Commit 831c4c20 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

some error corrections

parent 7287b5b1
...@@ -68,10 +68,9 @@ namespace AMDiS { ...@@ -68,10 +68,9 @@ namespace AMDiS {
template<> template<>
const double DOFVector<double>::evalAtPoint(WorldVector<double> &p, const double& DOFVector<double>::evalAtPoint(WorldVector<double> &p, ElInfo *oldElInfo, double* values) const
ElInfo *oldElInfo) const
{ {
FUNCNAME("DOFVector<double>::evalAtPoint()"); FUNCNAME("DOFVector<double>::evalAtCoords()");
Mesh *mesh = feSpace->getMesh(); Mesh *mesh = feSpace->getMesh();
const BasisFunction *basFcts = feSpace->getBasisFcts(); const BasisFunction *basFcts = feSpace->getBasisFcts();
...@@ -79,7 +78,7 @@ namespace AMDiS { ...@@ -79,7 +78,7 @@ namespace AMDiS {
int dim = mesh->getDim(); int dim = mesh->getDim();
int nBasFcts = basFcts->getNumber(); int nBasFcts = basFcts->getNumber();
std::vector<DegreeOfFreedom> localIndices(nBasFcts); DegreeOfFreedom *localIndices = new DegreeOfFreedom[nBasFcts];
DimVec<double> lambda(dim, NO_INIT); DimVec<double> lambda(dim, NO_INIT);
ElInfo *elInfo = mesh->createNewElInfo(); ElInfo *elInfo = mesh->createNewElInfo();
...@@ -87,8 +86,7 @@ namespace AMDiS { ...@@ -87,8 +86,7 @@ namespace AMDiS {
bool inside = false; bool inside = false;
if (oldElInfo && oldElInfo->getMacroElement()) { if (oldElInfo && oldElInfo->getMacroElement()) {
inside = mesh->findElInfoAtPoint(p, elInfo, lambda, inside = mesh->findElInfoAtPoint(p, elInfo, lambda, oldElInfo->getMacroElement(), NULL, NULL);
oldElInfo->getMacroElement(), NULL, NULL);
delete oldElInfo; delete oldElInfo;
} else } else
inside = mesh->findElInfoAtPoint(p, elInfo, lambda, NULL, NULL, NULL); inside = mesh->findElInfoAtPoint(p, elInfo, lambda, NULL, NULL, NULL);
...@@ -97,8 +95,7 @@ namespace AMDiS { ...@@ -97,8 +95,7 @@ namespace AMDiS {
oldElInfo = elInfo; oldElInfo = elInfo;
if (inside) { if (inside) {
basFcts->getLocalIndices(elInfo->getElement(), feSpace->getAdmin(), basFcts->getLocalIndices(elInfo->getElement(), feSpace->getAdmin(), localIndices);
localIndices);
ElementVector uh(lambda.size()); ElementVector uh(lambda.size());
for (int i = 0; i < lambda.size(); i++) for (int i = 0; i < lambda.size(); i++)
uh[i] = operator[](localIndices[i]); uh[i] = operator[](localIndices[i]);
...@@ -106,19 +103,20 @@ namespace AMDiS { ...@@ -106,19 +103,20 @@ namespace AMDiS {
} else } else
throw(std::runtime_error("Can not eval DOFVector at point p, because point is outside geometry.")); throw(std::runtime_error("Can not eval DOFVector at point p, because point is outside geometry."));
delete [] localIndices;
if (oldElInfo == NULL) if (oldElInfo == NULL)
delete elInfo; delete elInfo;
if (values != NULL)
*values = value;
return value; return value;
} };
template<> template<>
const WorldVector<double> const WorldVector<double>& DOFVector<WorldVector<double> >::evalAtPoint(WorldVector<double> &p, ElInfo *oldElInfo, WorldVector<double>* values) const
DOFVector<WorldVector<double> >::evalAtPoint(WorldVector<double> &p,
ElInfo *oldElInfo) const
{ {
FUNCNAME("DOFVector<double>::evalAtPoint()"); FUNCNAME("DOFVector<double>::evalAtCoords()");
Mesh *mesh = feSpace->getMesh(); Mesh *mesh = feSpace->getMesh();
const BasisFunction *basFcts = feSpace->getBasisFcts(); const BasisFunction *basFcts = feSpace->getBasisFcts();
...@@ -126,17 +124,18 @@ namespace AMDiS { ...@@ -126,17 +124,18 @@ namespace AMDiS {
int dim = mesh->getDim(); int dim = mesh->getDim();
int nBasFcts = basFcts->getNumber(); int nBasFcts = basFcts->getNumber();
vector<DegreeOfFreedom> localIndices(nBasFcts); DegreeOfFreedom *localIndices = new DegreeOfFreedom[nBasFcts];
DimVec<double> lambda(dim, NO_INIT); DimVec<double> lambda(dim, NO_INIT);
ElInfo *elInfo = mesh->createNewElInfo(); ElInfo *elInfo = mesh->createNewElInfo();
WorldVector<double> value(DEFAULT_VALUE, 0.0); static WorldVector<double> Values(DEFAULT_VALUE, 0.0);
WorldVector<double> *val = (NULL != values) ? values : &Values;
bool inside = false; bool inside = false;
if (oldElInfo && oldElInfo->getMacroElement()) { if (oldElInfo && oldElInfo->getMacroElement()) {
inside = mesh->findElInfoAtPoint(p, elInfo, lambda, inside = mesh->findElInfoAtPoint(p, elInfo, lambda, oldElInfo->getMacroElement(), NULL, NULL);
oldElInfo->getMacroElement(), NULL, NULL);
delete oldElInfo; delete oldElInfo;
} else } else
inside = mesh->findElInfoAtPoint(p, elInfo, lambda, NULL, NULL, NULL); inside = mesh->findElInfoAtPoint(p, elInfo, lambda, NULL, NULL, NULL);
...@@ -145,20 +144,20 @@ namespace AMDiS { ...@@ -145,20 +144,20 @@ namespace AMDiS {
oldElInfo = elInfo; oldElInfo = elInfo;
if (inside) { if (inside) {
basFcts->getLocalIndices(elInfo->getElement(), feSpace->getAdmin(), basFcts->getLocalIndices(elInfo->getElement(), feSpace->getAdmin(), localIndices);
localIndices);
mtl::dense_vector<WorldVector<double> > uh(lambda.size()); mtl::dense_vector<WorldVector<double> > uh(lambda.size());
for (int i = 0; i < lambda.size(); i++) for (int i = 0; i < lambda.size(); i++)
uh[i] = operator[](localIndices[i]); uh[i] = operator[](localIndices[i]);
value = basFcts->evalUh(lambda, uh); *val = basFcts->evalUh(lambda, uh);
} else } else
throw(std::runtime_error("Can not eval DOFVector at point p, because point is outside geometry.")); throw(std::runtime_error("Can not eval DOFVector at point p, because point is outside geometry."));
delete [] localIndices;
if (oldElInfo == NULL) if (oldElInfo == NULL)
delete elInfo; delete elInfo;
return value; return ((*val));
} };
template<> template<>
...@@ -911,11 +910,11 @@ namespace AMDiS { ...@@ -911,11 +910,11 @@ namespace AMDiS {
TEST_EXIT(vecs.size()>0)("No DOFVectors provided!\n"); TEST_EXIT(vecs.size()>0)("No DOFVectors provided!\n");
int deg = std::max(fct->getDegree(), int deg = std::max(fct->getDegree(),
2 * vecs[0].getFeSpace()->getBasisFcts()->getDegree()); 2 * vecs[0]->getFeSpace()->getBasisFcts()->getDegree());
Quadrature* quad = Quadrature* quad =
Quadrature::provideQuadrature(vecs[0].getFeSpace()->getMesh()->getDim(), deg); Quadrature::provideQuadrature(vecs[0]->getFeSpace()->getMesh()->getDim(), deg);
FastQuadrature *fastQuad = FastQuadrature *fastQuad =
FastQuadrature::provideFastQuadrature(vecs[0].getFeSpace()->getBasisFcts(), *quad, INIT_PHI); FastQuadrature::provideFastQuadrature(vecs[0]->getFeSpace()->getBasisFcts(), *quad, INIT_PHI);
std::vector<mtl::dense_vector<double> > qp(vecs.size()); std::vector<mtl::dense_vector<double> > qp(vecs.size());
std::vector<double> qp_local(vecs.size()); std::vector<double> qp_local(vecs.size());
...@@ -925,10 +924,10 @@ namespace AMDiS { ...@@ -925,10 +924,10 @@ namespace AMDiS {
double value = 0.0; double value = 0.0;
Flag traverseFlag = Mesh::CALL_LEAF_EL | Mesh::FILL_COORDS | Mesh::FILL_DET; Flag traverseFlag = Mesh::CALL_LEAF_EL | Mesh::FILL_COORDS | Mesh::FILL_DET;
TraverseStack stack; TraverseStack stack;
ElInfo *elInfo = stack.traverseFirst(vec1.getFeSpace()->getMesh(), -1, traverseFlag); ElInfo *elInfo = stack.traverseFirst(vecs[0]->getFeSpace()->getMesh(), -1, traverseFlag);
while (elInfo) { while (elInfo) {
for (size_t i = 0; i < vecs.size(); i++) for (size_t i = 0; i < vecs.size(); i++)
vecs[i].getVecAtQPs(elInfo, quad, fastQuad, qp[i]); vecs[i]->getVecAtQPs(elInfo, quad, fastQuad, qp[i]);
double tmp = 0.0; double tmp = 0.0;
for (int iq = 0; iq < fastQuad->getNumPoints(); iq++) { for (int iq = 0; iq < fastQuad->getNumPoints(); iq++) {
...@@ -951,7 +950,7 @@ namespace AMDiS { ...@@ -951,7 +950,7 @@ namespace AMDiS {
double integrateGeneralGradient(const std::vector<DOFVector<double>*> &vecs, double integrateGeneralGradient(const std::vector<DOFVector<double>*> &vecs,
const std::vector<DOFVector<double>*> &grds, const std::vector<DOFVector<double>*> &grds,
BinaryAbstractFunction<double, std::vector<double>, std::vector<WorldVector<double> > *fct) BinaryAbstractFunction<double, std::vector<double>, std::vector<WorldVector<double> > > *fct)
{ {
FUNCNAME("integrateGeneral()"); FUNCNAME("integrateGeneral()");
...@@ -960,11 +959,11 @@ namespace AMDiS { ...@@ -960,11 +959,11 @@ namespace AMDiS {
TEST_EXIT(grds.size()>0)("No DOFVectors for gradients provided!\n"); TEST_EXIT(grds.size()>0)("No DOFVectors for gradients provided!\n");
int deg = std::max(fct->getDegree(), int deg = std::max(fct->getDegree(),
2 * vecs[0].getFeSpace()->getBasisFcts()->getDegree()); 2 * vecs[0]->getFeSpace()->getBasisFcts()->getDegree());
Quadrature* quad = Quadrature* quad =
Quadrature::provideQuadrature(vecs[0].getFeSpace()->getMesh()->getDim(), deg); Quadrature::provideQuadrature(vecs[0]->getFeSpace()->getMesh()->getDim(), deg);
FastQuadrature *fastQuad = FastQuadrature *fastQuad =
FastQuadrature::provideFastQuadrature(vecs[0].getFeSpace()->getBasisFcts(), *quad, INIT_PHI); FastQuadrature::provideFastQuadrature(vecs[0]->getFeSpace()->getBasisFcts(), *quad, INIT_PHI);
std::vector<mtl::dense_vector<double> > qp(vecs.size()); std::vector<mtl::dense_vector<double> > qp(vecs.size());
std::vector<mtl::dense_vector<WorldVector<double> > > qpGrd(vecs.size()); std::vector<mtl::dense_vector<WorldVector<double> > > qpGrd(vecs.size());
...@@ -978,12 +977,12 @@ namespace AMDiS { ...@@ -978,12 +977,12 @@ namespace AMDiS {
double value = 0.0; double value = 0.0;
Flag traverseFlag = Mesh::CALL_LEAF_EL | Mesh::FILL_COORDS | Mesh::FILL_DET; Flag traverseFlag = Mesh::CALL_LEAF_EL | Mesh::FILL_COORDS | Mesh::FILL_DET;
TraverseStack stack; TraverseStack stack;
ElInfo *elInfo = stack.traverseFirst(vec1.getFeSpace()->getMesh(), -1, traverseFlag); ElInfo *elInfo = stack.traverseFirst(vecs[0]->getFeSpace()->getMesh(), -1, traverseFlag);
while (elInfo) { while (elInfo) {
for (size_t i = 0; i < vecs.size(); i++) for (size_t i = 0; i < vecs.size(); i++)
vecs[i].getVecAtQPs(elInfo, quad, fastQuad, qp[i]); vecs[i]->getVecAtQPs(elInfo, quad, fastQuad, qp[i]);
for (size_t i = 0; i < grds.size(); i++) for (size_t i = 0; i < grds.size(); i++)
grds[i].getGradientAtQPs(elInfo, quad, fastQuad, qpGrd[i]); grds[i]->getGrdAtQPs(elInfo, quad, fastQuad, qpGrd[i]);
double tmp = 0.0; double tmp = 0.0;
for (int iq = 0; iq < fastQuad->getNumPoints(); iq++) { for (int iq = 0; iq < fastQuad->getNumPoints(); iq++) {
......
...@@ -65,13 +65,17 @@ namespace AMDiS { ...@@ -65,13 +65,17 @@ namespace AMDiS {
virtual ~DOFVectorBase(); virtual ~DOFVectorBase();
/// For the given element, this function returns an array of all DOFs of this /** \brief
/// DOFVector that are defined on this element. * For the given element, this function returns an array of all DOFs of this
* DOFVector that are defined on this element.
*/
virtual void getLocalVector(const Element *el, virtual void getLocalVector(const Element *el,
mtl::dense_vector<T>& localVec) const; mtl::dense_vector<T>& localVec) const;
/// Evaluates the DOF vector at a set of quadrature points defined on the /** \brief
/// given element. * Evaluates the DOF vector at a set of quadrature points defined on the
* given element.
*/
void getVecAtQPs(const ElInfo *elInfo, void getVecAtQPs(const ElInfo *elInfo,
const Quadrature *quad, const Quadrature *quad,
const FastQuadrature *quadFast, const FastQuadrature *quadFast,
...@@ -83,8 +87,10 @@ namespace AMDiS { ...@@ -83,8 +87,10 @@ namespace AMDiS {
const FastQuadrature *quadFast, const FastQuadrature *quadFast,
mtl::dense_vector<T>& vecAtQPs) const; mtl::dense_vector<T>& vecAtQPs) const;
/// Evaluates the gradient of a DOF vector at a set of quadrature points /** \brief
/// defined on the given element. * Evaluates the gradient of a DOF vector at a set of quadrature points defined on the
* given element.
*/
void getGrdAtQPs( const ElInfo *elInfo, void getGrdAtQPs( const ElInfo *elInfo,
const Quadrature *quad, const Quadrature *quad,
const FastQuadrature *quadFast, const FastQuadrature *quadFast,
...@@ -96,8 +102,10 @@ namespace AMDiS { ...@@ -96,8 +102,10 @@ namespace AMDiS {
const FastQuadrature *quadFast, const FastQuadrature *quadFast,
mtl::dense_vector<typename GradientType<T>::type> &grdAtQPs) const; mtl::dense_vector<typename GradientType<T>::type> &grdAtQPs) const;
/// Evaluates the comp'th component of the derivative of a DOF vector at a /** \brief
/// set of quadrature points defined on the given element. * Evaluates the comp'th component of the derivative of a DOF vector at a set of quadrature points defined on the
* given element.
*/
void getDerivativeAtQPs( const ElInfo *elInfo, void getDerivativeAtQPs( const ElInfo *elInfo,
const Quadrature *quad, const Quadrature *quad,
const FastQuadrature *quadFast, const FastQuadrature *quadFast,
...@@ -111,8 +119,10 @@ namespace AMDiS { ...@@ -111,8 +119,10 @@ namespace AMDiS {
int comp, int comp,
mtl::dense_vector<T> &derivativeAtQPs) const; mtl::dense_vector<T> &derivativeAtQPs) const;
/// Evaluates the jacobian of a DOF vector at a set of quadrature points /** \brief
/// defined on the given element. * Evaluates the jacobian of a DOF vector at a set of quadrature points defined on the
* given element.
*/
void getD2AtQPs(const ElInfo *elInfo, void getD2AtQPs(const ElInfo *elInfo,
const Quadrature *quad, const Quadrature *quad,
const FastQuadrature *quadFast, const FastQuadrature *quadFast,
...@@ -124,8 +134,10 @@ namespace AMDiS { ...@@ -124,8 +134,10 @@ namespace AMDiS {
return feSpace; return feSpace;
} }
/// Assembles the element vector for the given ellement and adds the element /** \brief
/// matrix to the current DOF vector. * Assembles the element vector for the given ellement and adds the
* element matrix to the current DOF vector.
*/
void assemble(T factor, ElInfo *elInfo, void assemble(T factor, ElInfo *elInfo,
const BoundaryType *bound, const BoundaryType *bound,
Operator *op = NULL); Operator *op = NULL);
...@@ -142,9 +154,11 @@ namespace AMDiS { ...@@ -142,9 +154,11 @@ namespace AMDiS {
ElInfo *elInfo, ElInfo *elInfo,
bool add = true); bool add = true);
/// That function must be called after the matrix assembling has been /* \brief
/// finished. This makes it possible to start some cleanup or matrix data * That function must be called after the matrix assembling has been finished.
/// compressing procedures. * This makes it possible to start some cleanup or matrix data compressing
* procedures.
*/
void finishAssembling(); void finishAssembling();
inline void addOperator(Operator* op, inline void addOperator(Operator* op,
...@@ -377,8 +391,10 @@ namespace AMDiS { ...@@ -377,8 +391,10 @@ namespace AMDiS {
return vec.end(); return vec.end();
} }
/// Used by DOFAdmin to compress this DOFVector. Implementation of /** \brief
/// DOFIndexedBase::compress() * Used by DOFAdmin to compress this DOFVector. Implementation of
* DOFIndexedBase::compress()
*/
virtual void compressDOFIndexed(int first, int last, virtual void compressDOFIndexed(int first, int last,
std::vector<DegreeOfFreedom> &newDof); std::vector<DegreeOfFreedom> &newDof);
...@@ -457,8 +473,10 @@ namespace AMDiS { ...@@ -457,8 +473,10 @@ namespace AMDiS {
/// Calculates Integral of this DOFVector /// Calculates Integral of this DOFVector
double Int(Quadrature* q = NULL) const; double Int(Quadrature* q = NULL) const;
/// Calculates Integral of this DOFVector over parts of the domain /** \brief
/// boundary, indicated by boundaryType. Implemented for DOFVector<double> * Calculates Integral of this DOFVector over parts of the domain
* boundary, indicated by boundaryType. Implemented for DOFVector<double>
**/
T IntOnBoundary(BoundaryType boundary, Quadrature* q = NULL) const T IntOnBoundary(BoundaryType boundary, Quadrature* q = NULL) const
{ {
FUNCNAME("DOFVector::IntOnBoundary())"); FUNCNAME("DOFVector::IntOnBoundary())");
...@@ -466,9 +484,11 @@ namespace AMDiS { ...@@ -466,9 +484,11 @@ namespace AMDiS {
return 0.0; return 0.0;
} }
/// Calculates Integral of this DOFVector times normal vector over parts /** \brief
/// of the domain boundary, indicated by boundaryType. Implemented for * Calculates Integral of this DOFVector times normal vector over parts
/// DOFVector<WorldVector<double> > * of the domain boundary, indicated by boundaryType. Implemented for
* DOFVector<WorldVector<double> >
**/
double IntOnBoundaryNormal(BoundaryType boundary, Quadrature* q = NULL) const double IntOnBoundaryNormal(BoundaryType boundary, Quadrature* q = NULL) const
{ {
FUNCNAME("DOFVector::IntOnBoundaryNormal())"); FUNCNAME("DOFVector::IntOnBoundaryNormal())");
...@@ -561,25 +581,31 @@ namespace AMDiS { ...@@ -561,25 +581,31 @@ namespace AMDiS {
/// ///
int calcMemoryUsage() const; int calcMemoryUsage() const;
/// Computes the coefficients of the interpolant of the function fct and /** \brief
/// stores these in the DOFVector * Computes the coefficients of the interpolant of the function fct and
* stores these in the DOFVector
*/
void interpol(AbstractFunction<T, WorldVector<double> > *fct); void interpol(AbstractFunction<T, WorldVector<double> > *fct);
void interpol(DOFVector<T> *v, double factor = 1.0); void interpol(DOFVector<T> *v, double factor = 1.0);
/// Eval DOFVector at given point p. If oldElInfo != NULL the search for /** eval DOFVector at given point p. If oldElInfo != NULL the search for the element, where p is inside,
/// the element, where p is inside, starts from oldElInfo. implemented for: * starts from oldElInfo.
/// double, WorldVector<double> * implemented for: double, WorldVector< double >
inline const T evalAtPoint(WorldVector<double> &p, */
ElInfo *oldElInfo = NULL) const inline const T& evalAtPoint(
WorldVector<double> &p, ElInfo *oldElInfo = NULL, T* value = NULL) const
{ {
FUNCNAME("DOFVector::evalAtPoint())"); FUNCNAME("DOFVector::evalAtPoint())");
TEST_EXIT(false)("Please implement your evaluation\n"); TEST_EXIT(false)("Please implement your evaluation\n");
return *value;
} }
const bool getDOFidxAtPoint(WorldVector<double> &p, DegreeOfFreedom &idx, ElInfo *oldElInfo = NULL, bool useOldElInfo = false); /** determine the DegreeOfFreedom that has coords with minimal euclidean distance to WorldVector p
* return true if DOF is found, and false otherwise
*/
const bool getDOFidxAtPoint(WorldVector<double> &p, DegreeOfFreedom &idx, ElInfo *oldElInfo = NULL, bool useOldElInfo = false) const;
/// Writes the data of the DOFVector to an output stream. /// Writes the data of the DOFVector to an output stream.
void serialize(std::ostream &out) void serialize(std::ostream &out)
...@@ -598,11 +624,13 @@ namespace AMDiS { ...@@ -598,11 +624,13 @@ namespace AMDiS {
in.read(reinterpret_cast<char*>(&(vec[0])), size * sizeof(T)); in.read(reinterpret_cast<char*>(&(vec[0])), size * sizeof(T));
} }
// DOFVector<WorldVector<T> > *getGradient(DOFVector<WorldVector<T> >*) const;
DOFVector<typename GradientType<T>::type>* DOFVector<typename GradientType<T>::type>*
getGradient(DOFVector<typename GradientType<T>::type> *grad) const; getGradient(DOFVector<typename GradientType<T>::type> *grad) const;
WorldVector<DOFVector<T>*> *getGradient(WorldVector<DOFVector<T>*> *grad) const; WorldVector<DOFVector<T>*> *getGradient(WorldVector<DOFVector<T>*> *grad) const;
// DOFVector<WorldVector<T> >* getRecoveryGradient(DOFVector<WorldVector<T> >*) const;
DOFVector<typename GradientType<T>::type>* DOFVector<typename GradientType<T>::type>*
getRecoveryGradient(DOFVector<typename GradientType<T>::type> *grad) const; getRecoveryGradient(DOFVector<typename GradientType<T>::type> *grad) const;
...@@ -631,13 +659,12 @@ namespace AMDiS { ...@@ -631,13 +659,12 @@ namespace AMDiS {
BoundaryType boundaryType, Quadrature* q) const; BoundaryType boundaryType, Quadrature* q) const;
template<> template<>
const double DOFVector<double>::evalAtPoint(WorldVector<double> &p, const double& DOFVector<double>::evalAtPoint(
ElInfo *oldElInfo) const; WorldVector<double> &p, ElInfo *oldElInfo, double* value) const;
template<> template<>
const WorldVector<double> const WorldVector<double>& DOFVector<WorldVector<double> >::evalAtPoint(
DOFVector<WorldVector<double> >::evalAtPoint(WorldVector<double> &p, WorldVector<double> &p, ElInfo *oldElInfo, WorldVector<double>* value) const;
ElInfo *oldElInfo) const;
template<> template<>
void DOFVector<double>::refineInterpol(RCNeighbourList&, int); void DOFVector<double>::refineInterpol(RCNeighbourList&, int);
...@@ -664,8 +691,10 @@ namespace AMDiS { ...@@ -664,8 +691,10 @@ namespace AMDiS {
public DOFContainer public DOFContainer
{ {
public: public:
/// Calls constructor of DOFVector<DegreeOfFreedom> and registers itself /** \brief
/// as DOFContainer at DOFAdmin * Calls constructor of DOFVector<DegreeOfFreedom> and registers itself
* as DOFContainer at DOFAdmin
*/
DOFVectorDOF(const FiniteElemSpace* feSpace_, std::string name_) DOFVectorDOF(const FiniteElemSpace* feSpace_, std::string name_)
: DOFVector<DegreeOfFreedom>(feSpace_, name_) : DOFVector<DegreeOfFreedom>(feSpace_, name_)
{ {
...@@ -678,8 +707,10 @@ namespace AMDiS { ...@@ -678,8 +707,10 @@ namespace AMDiS {
feSpace->getAdmin()->removeDOFContainer(this); feSpace->getAdmin()->removeDOFContainer(this);
} }
/// Implements DOFContainer::operator[]() by calling /** \brief
/// DOFVector<DegreeOfFreedom>::operator[]() * Implements DOFContainer::operator[]() by calling
* DOFVector<DegreeOfFreedom>::operator[]()
*/
DegreeOfFreedom& operator[](DegreeOfFreedom i) DegreeOfFreedom& operator[](DegreeOfFreedom i)
{ {
return DOFVector<DegreeOfFreedom>::operator[](i); return DOFVector<DegreeOfFreedom>::operator[](i);
...@@ -843,22 +874,20 @@ namespace AMDiS { ...@@ -843,22 +874,20 @@ namespace AMDiS {
std::vector<DOFVector<double>*> *res); std::vector<DOFVector<double>*> *res);
/** \brief /** \brief
* Computes the integral of a function that includes two different DOFVectors. * Computes the integral of a function that includes two different DOFVectors. This
* This function works also for the case that the DOFVectors are defined on * function works also for the case that the DOFVectors are defined on two different
* two different meshes. * meshes.
*/ */
double integrate(const DOFVector<double> &vec1, double integrate(const DOFVector<double> &vec1,
const DOFVector<double> &vec2, const DOFVector<double> &vec2,
BinaryAbstractFunction<double, double, double> *fct); BinaryAbstractFunction<double, double, double> *fct);
/// Computes the integral of a function with two DOFVectors defined on the /// Computes the integral of a function with two DOFVectors defined on the same mesh.
/// same mesh.
double intSingleMesh(const DOFVector<double> &vec1, double intSingleMesh(const DOFVector<double> &vec1,
const DOFVector<double> &vec2, const DOFVector<double> &vec2,
BinaryAbstractFunction<double, double, double> *fct); BinaryAbstractFunction<double, double, double> *fct);
/// Computes the integral of a function with two DOFVectors defined on /// Computes the integral of a function with two DOFVectors defined on different meshes.
/// different meshes.
double intDualMesh(const DOFVector<double> &vec1, double intDualMesh(const DOFVector<double> &vec1,
const DOFVector<double> &vec2, const DOFVector<double> &vec2,
BinaryAbstractFunction<double, double, double> *fct); BinaryAbstractFunction<double, double, double> *fct);
...@@ -874,7 +903,7 @@ namespace AMDiS { ...@@ -874,7 +903,7 @@ namespace AMDiS {
double integrateGeneralGradient(const std::vector<DOFVector<double>*> &vecs, double integrateGeneralGradient(const std::vector<DOFVector<double>*> &vecs,
const std::vector<DOFVector<double>*> &grds, const std::vector<DOFVector<double>*> &grds,
BinaryAbstractFunction<double, std::vector<double>, std::vector<WorldVector<double> > *fct); BinaryAbstractFunction<double, std::vector<double>, std::vector<WorldVector<double>