Commit af1268e7 authored by Praetorius, Simon's avatar Praetorius, Simon

extensions extended by unit-vector/-matrix; FixVec,Vector and Matrix corrected...

extensions extended by unit-vector/-matrix; FixVec,Vector and Matrix corrected and extended; lots of other changes
parent 92775cf7
......@@ -122,6 +122,7 @@ SET(AMDIS_SRC ${SOURCE_DIR}/AdaptBase.cc
${SOURCE_DIR}/MacroElement.cc
${SOURCE_DIR}/Marker.cc
${SOURCE_DIR}/MatrixVector.cc
# ${SOURCE_DIR}/Test_MatrixVectorOperations.cc
${SOURCE_DIR}/Mesh.cc
${SOURCE_DIR}/MeshStructure.cc
${SOURCE_DIR}/Operator.cc
......@@ -175,6 +176,7 @@ SET(AMDIS_SRC ${SOURCE_DIR}/AdaptBase.cc
${SOURCE_DIR}/io/detail/Arh2Writer.cc
${SOURCE_DIR}/io/DofWriter.cc
${SOURCE_DIR}/io/ElementFileWriter.cc
${SOURCE_DIR}/io/FileWriterInterface.cc
${SOURCE_DIR}/io/FileWriter.cc
${SOURCE_DIR}/io/GNUPlotWriter.cc
${SOURCE_DIR}/io/MacroInfo.cc
......@@ -433,9 +435,7 @@ if(ENABLE_EXTENSIONS)
${EXTENSIONS_DIR}/POperators.cc
${EXTENSIONS_DIR}/SingularDirichletBC2.cc
${EXTENSIONS_DIR}/time/ExtendedRosenbrockStationary.cc
${EXTENSIONS_DIR}/pugixml/src/pugixml.cpp
${EXTENSIONS_DIR}/preconditioner/PhaseFieldCrystal_.cc
${EXTENSIONS_DIR}/preconditioner/CahnHilliard_.cc)
${EXTENSIONS_DIR}/pugixml/src/pugixml.cpp)
if(ENABLE_SEQ_PETSC)
list(APPEND EXTENSIONS_SRC
......@@ -510,11 +510,15 @@ if(ENABLE_EXTENSIONS)
${EXTENSIONS_DIR}/base_problems/CahnHilliard.cc
${EXTENSIONS_DIR}/base_problems/CahnHilliard_RB.cc
${EXTENSIONS_DIR}/base_problems/CahnHilliardNavierStokes.cc
# ${EXTENSIONS_DIR}/base_problems/DiffuseDomainFsi.cc
${EXTENSIONS_DIR}/base_problems/CahnHilliardNavierStokes_RB.cc
${EXTENSIONS_DIR}/base_problems/CahnHilliardNavierStokes_TwoPhase.cc
${EXTENSIONS_DIR}/base_problems/CahnHilliardNavierStokes_TwoPhase_RB.cc
${EXTENSIONS_DIR}/base_problems/DiffuseDomainFsi.cc
${EXTENSIONS_DIR}/base_problems/LinearElasticity.cc
${EXTENSIONS_DIR}/base_problems/LinearElasticityPhase.cc
# ${EXTENSIONS_DIR}/base_problems/NavierStokes_Chorin.cc
# ${EXTENSIONS_DIR}/base_problems/NavierStokes_Chorin.cc
${EXTENSIONS_DIR}/base_problems/NavierStokesCahnHilliard.cc
# ${EXTENSIONS_DIR}/base_problems/NavierStokesPhase_Chorin.cc
${EXTENSIONS_DIR}/base_problems/NavierStokesPhase_TaylorHood.cc
${EXTENSIONS_DIR}/base_problems/NavierStokes_TaylorHood.cc
${EXTENSIONS_DIR}/base_problems/NavierStokes_TaylorHood_RB.cc
......@@ -524,7 +528,10 @@ if(ENABLE_EXTENSIONS)
${EXTENSIONS_DIR}/base_problems/PhaseFieldCrystal_Phase.cc
${EXTENSIONS_DIR}/base_problems/PhaseFieldCrystal_RB.cc
${EXTENSIONS_DIR}/base_problems/PolarizationField.cc
${EXTENSIONS_DIR}/base_problems/QuasiCrystal.cc)
${EXTENSIONS_DIR}/base_problems/QuasiCrystal.cc
${EXTENSIONS_DIR}/base_problems/QuasiCrystal_RB.cc
# ${EXTENSIONS_DIR}/base_problems/VacancyPhaseFieldCrystal.cc
)
list(APPEND COMPILEFLAGS "-DHAVE_BASE_PROBLEMS=1")
list(APPEND AMDIS_INCLUDE_DIRS ${EXTENSIONS_DIR}/base_problems)
if(WIN32)
......@@ -635,6 +642,11 @@ INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/)
list(APPEND deb_add_dirs "include/amdis")
FILE(GLOB HEADERS "${SOURCE_DIR}/config/*.h*")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/config/)
list(APPEND deb_add_dirs "include/amdis/config")
FILE(GLOB HEADERS "${SOURCE_DIR}/*.hh")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/)
......
......@@ -76,6 +76,7 @@
#include "Marker.h"
// #include "MathFunctions.h"
#include "MatrixVector.h"
#include "MatrixVectorOperations.h"
#include "Mesh.h"
#include "MeshStructure.h"
#include "ComponentTraverseInfo.h"
......
......@@ -64,7 +64,7 @@ namespace AMDiS {
Element *el = elInfo->getElement();
if (el != lastMatEl || !operat->isOptimized()) {
initElement(elInfo);
initElement(elInfo, elInfo);
if (rememberElMat)
set_to_zero(elementMatrix);
......@@ -123,12 +123,14 @@ namespace AMDiS {
}
ElementMatrix& mat = rememberElMat ? elementMatrix : userMat;
if (secondOrderAssembler) {
// calculate element matrices always on smallest element
secondOrderAssembler->calculateElementMatrix(smallElInfo, mat);
// smallElInfo stores refinement-relation to largeElInfo
ElementMatrix &m =
smallElInfo->getSubElemGradCoordsMat(rowFeSpace->getBasisFcts()->getDegree());
smallElInfo->getSubElemGradCoordsMat(rowFeSpace->getBasisFcts()->getDegree()); // muste be moved to next if-else block when generalized for multiple polynomial degrees
if (!rowColFeSpaceEqual) {
if (smallElInfo == colElInfo)
......@@ -321,14 +323,7 @@ namespace AMDiS {
calculateElementMatrix(elInfo, elementMatrix);
}
// vec += elementMatrix*uhOldLoc;
for (int i = 0; i < nRow; i++) {
double val = 0.0;
for (int j = 0; j < nCol; j++)
val += elementMatrix[i][j] * uhOldLoc[j];
vec[i] += val;
}
vec += elementMatrix*uhOldLoc;
}
......@@ -358,15 +353,10 @@ namespace AMDiS {
if (mainElInfo->getElement() != lastMatEl) {
set_to_zero(elementMatrix);
calculateElementMatrix(mainElInfo, auxElInfo, smallElInfo, largeElInfo,
false, elementMatrix);
rowFeSpace == operat->uhOld->getFeSpace(), elementMatrix);
}
for (int i = 0; i < nBasFcts; i++) {
double val = 0.0;
for (int j = 0; j < nBasFcts; j++)
val += elementMatrix[i][j] * uhOldLoc[j];
vec[i] += val;
}
vec += elementMatrix * uhOldLoc;
}
......
......@@ -25,6 +25,8 @@
#ifndef AMDIS_BALLPROJECT_H
#define AMDIS_BALLPROJECT_H
#include "MatrixVectorOperations.h"
namespace AMDiS {
/** \brief
......
......@@ -20,6 +20,7 @@
#include "Cholesky.h"
#include "MatrixVectorOperations.h"
namespace AMDiS {
......
#pragma once
/** \brief current AMDiS version */
#ifndef AMDIS_VERSION
#define AMDIS_VERSION "AMDiS: Version 0.9.1"
#endif
#include <boost/config.hpp>
#define CACHE_LINE 16
#if defined(__clang__) // Clang/LLVM.
#include "config/Config_clang.h"
#elif defined(__ICC) || defined(__INTEL_COMPILER) // Intel ICC/ICPC.
#include "config/Config_intel.h"
#elif defined(__GNUC__) || defined(__GNUG__) // GNU GCC/G++.
#include "config/Config_gcc.h"
#elif defined(__HP_cc) || defined(__HP_aCC)
error: not supported compiler
#elif defined(__IBMC__) || defined(__IBMCPP__)
error: not supported compiler
#elif defined(_MSC_VER) // Microsoft Visual Studio.
#include "config/Config_msc.h"
#elif defined(__PGI) // Portland Group PGCC/PGCPP.
error: not supported compiler
// #include "Config_pgi.h"
#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
error: not supported compiler
#endif
#include "config/Config_defaults.h"
\ No newline at end of file
......@@ -25,6 +25,8 @@
#ifndef AMDIS_CYLINDERPROJECT_H
#define AMDIS_CYLINDERPROJECT_H
#include "MatrixVectorOperations.h"
namespace AMDiS {
/** \brief
......
......@@ -350,10 +350,10 @@ namespace AMDiS {
{}
/// Constructs a DOFVector with name n belonging to FiniteElemSpace f
DOFVector(const FiniteElemSpace* f, std::string n, bool addToSynch = true);
DOFVector(const FiniteElemSpace* f, std::string n, bool addToSynch = false);
/// Initialization.
void init(const FiniteElemSpace* f, std::string n, bool addToSynch = true);
void init(const FiniteElemSpace* f, std::string n, bool addToSynch = false);
/// Copy Constructor
DOFVector(const DOFVector& rhs) : DOFVectorBase<T>()
......
......@@ -130,7 +130,7 @@ namespace AMDiS {
(this->feSpace->getAdmin())->addDOFIndexed(this);
this->boundaryManager = new BoundaryManager(f);
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
if ( Parallel::MeshDistributor::globalMeshDistributor != NULL)
if (addToSynch && Parallel::MeshDistributor::globalMeshDistributor != NULL)
Parallel::MeshDistributor::globalMeshDistributor->addInterchangeVector(this);
#endif
}
......
......@@ -37,10 +37,10 @@ namespace AMDiS {
*/
struct DualElInfo
{
ElInfo *rowElInfo;
ElInfo *colElInfo;
ElInfo *smallElInfo;
ElInfo *largeElInfo;
ElInfo *rowElInfo; ///< elInfo related to testfunction
ElInfo *colElInfo; ///< elInfo related to trialfunction
ElInfo *smallElInfo; ///< the smaller element of (rowElInfo, colElInfo) with refinementPath relative to largeElInfo
ElInfo *largeElInfo; ///< the larger element of (rowElInfo, colElInfo)
};
/// Parallel traversal of two meshes.
......
......@@ -252,7 +252,7 @@ namespace AMDiS {
virtual mtl::dense2D<double>& getSubElemGradCoordsMat(int degree) const
{
return subElemGradMatrices[degree][std::make_pair(refinementPathLength, refinementPath)];
return getSubElemCoordsMat(degree);
}
/** \} */
......
......@@ -367,22 +367,7 @@ namespace AMDiS {
mtl::dense2D<double>& ElInfo1d::getSubElemGradCoordsMat(int degree) const
{
FUNCNAME("ElInfo1d::getSubElemGradCoordsMat()");
TEST_EXIT(degree == 1)("Not supported for basis functions with degree > 1!\n");
using namespace mtl;
if (subElemGradMatrices[degree].count(std::make_pair(refinementPathLength, refinementPath)) == 0) {
dense2D<double> mat(mat_d1);
for (int i = 0; i < refinementPathLength; i++)
mat *= 0.5;
subElemGradMatrices[1][std::make_pair(refinementPathLength, refinementPath)] = mat;
}
return subElemGradMatrices[degree][std::make_pair(refinementPathLength, refinementPath)];
return getSubElemCoordsMat(degree);
}
......
This diff is collapsed.
......@@ -824,11 +824,7 @@ namespace AMDiS {
mtl::dense2D<double>& ElInfo3d::getSubElemGradCoordsMat(int degree) const
{
FUNCNAME("ElInfo3d::getSubElemGradCoordsMat()");
ERROR_EXIT("Not yet implemented!\n");
return subElemGradMatrices[degree][std::make_pair(refinementPathLength, refinementPath)];
return getSubElemCoordsMat(degree);
}
}
......@@ -28,6 +28,7 @@
#include "AMDiS_fwd.h"
#include "OperatorTerm.h"
#include "Functors.h"
#include "MatrixVectorOperations.h"
#include <boost/static_assert.hpp>
#include <boost/type_traits.hpp>
......@@ -94,6 +95,7 @@
namespace AMDiS {
/// helper class to adopt the correct OperatorTerm based on the term order
template<int Order>
struct GetTerm {
typedef typename boost::mpl::if_c<Order == 0, ZeroOrderTerm,
......@@ -103,19 +105,27 @@ struct GetTerm {
>::type >::type >::type type;
};
/// basic interface for OperatorTerms based on expressions
template<typename Term, int Order = -1>
struct GenericOperatorTerm : public GetTerm<Order>::type
{
typedef typename GetTerm<Order>::type super;
/// Expression term stored as copy
Term term;
/// constructor
/// adds all feSpaces provided by the expression term to auxFeSpaces liste
GenericOperatorTerm(const Term& term_)
: super(term_.getDegree()), term(term_)
{
term.insertFeSpaces(this->auxFeSpaces);
#ifndef NDEBUG
test_auxFeSpaces(this->auxFeSpaces);
#endif
}
/// calls initElement() for \ref term
void initElement(const ElInfo* elInfo,
SubAssembler* subAssembler,
Quadrature *quad)
......@@ -123,6 +133,7 @@ struct GenericOperatorTerm : public GetTerm<Order>::type
term.initElement(this, elInfo, subAssembler, quad, NULL);
}
/// calls initElement() for \ref term
void initElement(const ElInfo* smallElInfo,
const ElInfo* largeElInfo,
SubAssembler* subAssembler,
......@@ -130,9 +141,22 @@ struct GenericOperatorTerm : public GetTerm<Order>::type
{
term.initElement(this, smallElInfo, largeElInfo, subAssembler, quad, NULL);
}
};
/// test for only one mesh allowed in expressions
template<typename FeSpaceList>
void test_auxFeSpaces(FeSpaceList const& auxFeSpaces)
{
typedef typename FeSpaceList::const_iterator fe_iter;
if (auxFeSpaces.size() > 0) {
Mesh* mesh0 = (*auxFeSpaces.begin())->getMesh();
for (fe_iter it = auxFeSpaces.begin(); it != auxFeSpaces.end(); it++) {
if ((*it)->getMesh() != mesh0) {
ERROR_EXIT("Only one mesh allowed in expression.\n");
}
}
}
}
};
template<typename Term>
struct GenericOperatorTerm<Term, -1> : public GenericOperatorTerm<Term, -2>
......@@ -687,7 +711,7 @@ template<typename Term>
inline typename boost::enable_if<typename traits::is_expr<Term>::type, typename Term::value_type>::type
max(Term term)
{
typename Term::value_type value0 = -1.e25;
typename Term::value_type value0 = std::numeric_limits<typename Term::value_type>::min();
value0 = accumulate(term, functors::max<typename Term::value_type>(), value0);
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
......@@ -701,7 +725,7 @@ template<typename Term>
inline typename boost::enable_if<typename traits::is_expr<Term>::type, typename Term::value_type>::type
min(Term term)
{
typename Term::value_type value0 = 1.e25;
typename Term::value_type value0 = std::numeric_limits<typename Term::value_type>::max();
value0 = accumulate(term, functors::min<typename Term::value_type>(), value0);
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
......@@ -715,7 +739,7 @@ template<typename Term>
inline typename boost::enable_if<typename traits::is_expr<Term>::type, typename Term::value_type>::type
abs_max(Term term)
{
typename Term::value_type value0 = 0.0;
typename Term::value_type value0 = 0;
value0 = accumulate(term, functors::abs_max<typename Term::value_type>(), value0);
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
......@@ -729,7 +753,7 @@ template<typename Term>
inline typename boost::enable_if<typename traits::is_expr<Term>::type, typename Term::value_type>::type
abs_min(Term term)
{
typename Term::value_type value0 = 1.e25;
typename Term::value_type value0 = std::numeric_limits<typename Term::value_type>::max();
value0 = accumulate(term, functors::abs_min<typename Term::value_type>(), value0);
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
......@@ -744,19 +768,61 @@ abs_min(Term term)
template<typename T, typename Term>
inline typename boost::enable_if<
typename boost::mpl::and_<typename traits::is_expr<Term>::type,
typename boost::is_convertible<typename Term::value_type, T>::type
typename traits::is_convertible<typename Term::value_type, T>::type
>::type
>::type
transformDOF(Term term, DOFVector<T>* result);
/// Assign an expression to a DOFVector (using multi-mesh if term and result vector are on different meshes)
template<typename T, typename Term>
inline typename boost::enable_if<
typename boost::mpl::and_<typename traits::is_expr<Term>::type,
typename traits::is_convertible<typename Term::value_type, T>::type
>::type
>::type
transformDOF_mm(Term term, DOFVector<T>* result);
/// Assign an expression to a DOFVector
template<typename T, typename Term>
typename boost::enable_if<
typename boost::mpl::and_<typename traits::is_expr<Term>::type,
typename boost::is_convertible<typename Term::value_type, T>::type
typename traits::is_convertible<typename Term::value_type, T>::type
>::type,
DOFVector<T>& >::type
operator<<(DOFVector<T>& result, const Term& term);
operator<<(DOFVector<T>& result, const Term& term)
{
transformDOF(term, &result);
return result;
}
/// Assign a constant value to a DOFVector
// template<typename T, typename S>
// typename boost::enable_if<
// typename boost::mpl::or_<
// typename boost::mpl::and_<
// typename traits::is_scalar<T>::type,
// typename traits::is_scalar<S>::type,
// typename boost::is_convertible<S, T>::type
// >::type,
// typename boost::mpl::and_<
// typename traits::is_vector<T>::type,
// typename traits::is_vector<S>::type,
// typename boost::is_convertible<typename S::value_type, typename T::value_type>::type
// >::type,
// typename boost::mpl::and_<
// typename traits::is_matrix<T>::type,
// typename traits::is_matrix<S>::type,
// typename boost::is_convertible<typename S::value_type, typename T::value_type>::type
// >::type
// >::type,
// DOFVector<T>& // return type
// >::type
// operator<<(DOFVector<T>& result, const S& value)
// {
// result.set(value);
// return result;
// }
// -----------------------------------------------------------------------------
......@@ -764,7 +830,11 @@ operator<<(DOFVector<T>& result, const Term& term);
template<typename Term>
typename boost::enable_if<typename traits::is_expr<Term>::type,
std::ostream& >::type
operator<<(std::ostream& result, const Term& term);
operator<<(std::ostream& result, const Term& term)
{
result << term.str();
return result;
}
} // end namespace AMDiS
......
......@@ -23,36 +23,6 @@
/** \file Expressions.hh */
namespace AMDiS {
#if 0
namespace detail {
template<typename Term, typename T, typename Enable = void>
struct GenericOperatorTerm { };
template<typename Term, typename T>
struct GenericOperatorTerm<Term, T, typename boost::enable_if<traits::is_scalar<T> >::type> {
typedef GenericZeroOrderTerm<Term> type;
};
template<typename Term, typename T>
struct GenericOperatorTerm<Term, T, typename boost::enable_if<traits::is_vector<T> >::type> {
typedef GenericFirstOrderTerm_b<Term> type;
};
template<typename Term, typename T >
struct GenericOperatorTerm<Term, T, typename boost::enable_if<traits::is_matrix<T> >::type> {
typedef GenericSecondOrderTerm_A<Term, true> type;
};
} // end namespace detail
template<typename Term>
struct GenericOperatorTerm {
typedef typename detail::GenericOperatorTerm<Term, typename Term::value_type>::type type;
};
#endif
template<typename Term>
inline typename boost::enable_if<typename traits::is_expr<Term>::type, typename Term::value_type>::type
......@@ -139,32 +109,38 @@ accumulate(Term term, Functor f, typename Term::value_type value0)
template<typename T, typename Term>
inline typename boost::enable_if<
typename boost::mpl::and_<typename traits::is_expr<Term>::type,
typename boost::is_convertible<typename Term::value_type, T>::type
typename traits::is_convertible<typename Term::value_type, T>::type
>::type
>::type
transformDOF(Term term, DOFVector<T>* result)
{
typedef typename Term::value_type TOut;
TOut tmp; nullify(tmp);
GenericOperatorTerm<Term> ot(term);
std::set<const FiniteElemSpace*> feSpaces = ot.getAuxFeSpaces();
Mesh* mesh = result->getFeSpace()->getMesh();
if (feSpaces.size() > 0 && mesh != (*feSpaces.begin())->getMesh())
return transformDOF_mm(term, result);
typedef typename Term::value_type TOut;
DOFVector<TOut> temp(result->getFeSpace(), "temp");
DOFVector<int> assigned(result->getFeSpace(), "assigned");
GenericOperatorTerm<Term> ot(term);
Mesh* mesh = result->getFeSpace()->getMesh();
const FiniteElemSpace* resultFeSpace = temp.getFeSpace();
const BasisFunction *basisFcts = resultFeSpace->getBasisFcts();
int nBasisFcts = basisFcts->getNumber();
assigned.set(0);
temp.set(tmp);
std::vector<DegreeOfFreedom> localIndices(nBasisFcts);
TraverseStack stack;
ElInfo *elInfo = stack.traverseFirst(mesh, -1,
Mesh::CALL_LEAF_EL |
Mesh::FILL_COORDS | Mesh::FILL_GRD_LAMBDA);
term.initElement(&ot, elInfo, NULL, NULL, basisFcts);
TOut tmp(term(0)); nullify(tmp);
assigned.set(0);
temp.set(tmp);
while (elInfo) {
term.initElement(&ot, elInfo, NULL, NULL, basisFcts);
......@@ -187,31 +163,88 @@ transformDOF(Term term, DOFVector<T>* result)
DOFIterator<T> resultIter(result, USED_DOFS);
DOFIterator<int> assignedIter(&assigned, USED_DOFS);
for (tempIter.reset(), resultIter.reset(), assignedIter.reset(); !resultIter.end(); ++tempIter, ++resultIter, ++assignedIter) {
*resultIter = (*tempIter) * (1.0/static_cast<double>(*assignedIter));
*resultIter = (*tempIter);
*resultIter/= (*assignedIter);
}
}
// works only for nodal basis functions!
template<typename T, typename Term>
typename boost::enable_if<
inline typename boost::enable_if<
typename boost::mpl::and_<typename traits::is_expr<Term>::type,
typename boost::is_convertible<typename Term::value_type, T>::type
>::type,
DOFVector<T>& >::type
operator<<(DOFVector<T>& result, const Term& term)
typename traits::is_convertible<typename Term::value_type, T>::type
>::type
>::type
transformDOF_mm(Term term, DOFVector<T>* result)
{
transformDOF(term, &result);
return result;
}
typedef typename Term::value_type TOut;
GenericOperatorTerm<Term> ot(term);
std::set<const FiniteElemSpace*> feSpaces = ot.getAuxFeSpaces();
Mesh* mesh1 = result->getFeSpace()->getMesh();
Mesh* mesh2 = (*feSpaces.begin())->getMesh();
DOFVector<TOut> temp(result->getFeSpace(), "temp");
DOFVector<int> assigned(result->getFeSpace(), "assigned");
const FiniteElemSpace* resultFeSpace = temp.getFeSpace();
const BasisFunction *basisFcts = resultFeSpace->getBasisFcts();
int nBasisFcts = basisFcts->getNumber();
std::vector<DegreeOfFreedom> localIndices(nBasisFcts);
mtl::dense_vector<TOut> vecLocalCoeffs(nBasisFcts);
DimVec<double> *lambda = NULL;
DimVec<double> *lambda_1 = new DimVec<double>;
WorldVector<double> coords;
DualTraverse dualTraverse;
DualElInfo dualElInfo;
Flag assembleFlag = Mesh::CALL_LEAF_EL | Mesh::FILL_COORDS | Mesh::FILL_GRD_LAMBDA;
bool cont = dualTraverse.traverseFirst(mesh1, mesh2, -1, -1,
assembleFlag, assembleFlag, dualElInfo);
term.initElement(&ot, dualElInfo.colElInfo, NULL, NULL, basisFcts);
TOut tmp(term(0)); nullify(tmp);
assigned.set(0);
temp.set(tmp);
while (cont) {
term.initElement(&ot, dualElInfo.colElInfo, NULL, NULL, basisFcts);
basisFcts->getLocalIndices(dualElInfo.rowElInfo->getElement(), resultFeSpace->getAdmin(), localIndices);
for (int i = 0; i < nBasisFcts; i++)
vecLocalCoeffs[i] = term(i);
for (int i = 0; i < nBasisFcts; i++) {
lambda = basisFcts->getCoords(i);
dualElInfo.rowElInfo->coordToWorld(*lambda, coords);
int inside = dualElInfo.colElInfo->worldToCoord(coords, lambda_1);
if (inside < 0) {
temp[localIndices[i]] += basisFcts->evalUh(*lambda_1, vecLocalCoeffs);
assigned[localIndices[i]]++;
}
}
cont = dualTraverse.traverseNext(dualElInfo);
}
template<typename Term>
typename boost::enable_if<typename traits::is_expr<Term>::type,
std::ostream& >::type
operator<<(std::ostream& result, const Term& term)
{
result << term.str();
return result;
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
Parallel::MeshDistributor::globalMeshDistributor->synchAddVector(temp);
Parallel::MeshDistributor::globalMeshDistributor->synchAddVector(assigned);
#endif
DOFIterator<TOut> tempIter(&temp, USED_DOFS);
DOFIterator<T> resultIter(result, USED_DOFS);
DOFIterator<int> assignedIter(&assigned, USED_DOFS);
for (tempIter.reset(), resultIter.reset(), assignedIter.reset(); !resultIter.end(); ++tempIter, ++resultIter, ++assignedIter) {
*resultIter = (*tempIter);
*resultIter/= (*assignedIter);
}
}
} // end namespace AMDiS
......@@ -31,6 +31,7 @@
#include "AbstractFunction.h"
#include "ElInfo.h"
#include "traits/size.hpp"
#include "MatrixVectorOperations.h"
namespace AMDiS {
......
This diff is collapsed.
......@@ -34,17 +34,6 @@ namespace AMDiS {
}
}
template<typename T, GeoIndex d>
double absteukl(const FixVec<T,d>& a,const FixVec<T,d>& b)
{