diff --git a/AMDiS/compositeFEM/src/CFE_Integration.cc b/AMDiS/compositeFEM/src/CFE_Integration.cc index 9fe952d9b94c881047514eb9d8fbc445bf38f508..183f9af865f4160d68d56d3e47749d61e758a59e 100644 --- a/AMDiS/compositeFEM/src/CFE_Integration.cc +++ b/AMDiS/compositeFEM/src/CFE_Integration.cc @@ -288,7 +288,7 @@ namespace AMDiS { } // calculate determinant for surface - surfDet = ElInfo::calcDet(worldCoords); + surfDet = loc_elInfo->calcDet(worldCoords); return surfDet; } diff --git a/AMDiS/src/Assembler.cc b/AMDiS/src/Assembler.cc index 9ab13bee6f7ae0860d44caef85fa9c534cb83a47..c6578a9bf7e5c7e41c6627c4806c7d142291da57 100644 --- a/AMDiS/src/Assembler.cc +++ b/AMDiS/src/Assembler.cc @@ -11,12 +11,12 @@ namespace AMDiS { - Assembler::Assembler(Operator *op, - const FiniteElemSpace *rowFESpace_, - const FiniteElemSpace *colFESpace_) + Assembler::Assembler(Operator *op, + const FiniteElemSpace *row, + const FiniteElemSpace *col) : operat(op), - rowFESpace(rowFESpace_), - colFESpace(colFESpace_ ? colFESpace_ : rowFESpace_), + rowFESpace(row), + colFESpace(col ? col : row), nRow(rowFESpace->getBasisFcts()->getNumber()), nCol(colFESpace->getBasisFcts()->getNumber()), remember(true), @@ -28,7 +28,19 @@ namespace AMDiS { lastVecEl(NULL), lastTraverseId(-1) - {} + { + elementMatrix = NEW ElementMatrix(nRow, nCol); + elementVector = NEW ElementVector(nRow); + } + + Assembler::~Assembler() + { + if (elementMatrix) + DELETE elementMatrix; + + if (elementVector) + DELETE elementVector; + } void Assembler::calculateElementMatrix(const ElInfo *elInfo, ElementMatrix *userMat, @@ -40,11 +52,6 @@ namespace AMDiS { rememberElMat = true; } - if (rememberElMat && !elementMatrix) - elementMatrix = NEW ElementMatrix(nRow, nCol); - - checkQuadratures(); - Element *el = elInfo->getElement(); if ((el != lastMatEl && el != lastVecEl) || !operat->isOptimized()) { @@ -93,15 +100,9 @@ namespace AMDiS { rememberElMat = true; } - if (rememberElMat && !elementMatrix) - elementMatrix = NEW ElementMatrix(nRow, nCol); - - Element *el = smallElInfo->getElement(); - + Element *el = smallElInfo->getElement(); lastVecEl = lastMatEl = NULL; - - checkQuadratures(); - + if ((el != lastMatEl && el != lastVecEl) || !operat->isOptimized()) { initElement(smallElInfo, largeElInfo); } @@ -148,12 +149,7 @@ namespace AMDiS { rememberElVec = true; } - if (rememberElVec && !elementVector) { - elementVector = NEW ElementVector(nRow); - } - Element *el = elInfo->getElement(); - checkQuadratures(); if ((el != lastMatEl && el != lastVecEl) || !operat->isOptimized()) { initElement(elInfo); @@ -202,12 +198,7 @@ namespace AMDiS { rememberElVec = true; } - if (rememberElVec && !elementVector) { - elementVector = NEW ElementVector(nRow); - } - Element *el = mainElInfo->getElement(); - checkQuadratures(); if ((el != lastMatEl && el != lastVecEl) || !operat->isOptimized()) { initElement(auxElInfo); @@ -333,8 +324,6 @@ namespace AMDiS { const ElInfo *largeElInfo, Quadrature *quad) { - checkQuadratures(); - if (secondOrderAssembler) secondOrderAssembler->initElement(smallElInfo, largeElInfo, quad); if (firstOrderAssemblerGrdPsi) @@ -345,50 +334,6 @@ namespace AMDiS { zeroOrderAssembler->initElement(smallElInfo, largeElInfo, quad); } - OptimizedAssembler::OptimizedAssembler(Operator *op, - Quadrature *quad2, - Quadrature *quad1GrdPsi, - Quadrature *quad1GrdPhi, - Quadrature *quad0, - const FiniteElemSpace *rowFESpace_, - const FiniteElemSpace *colFESpace_) - : Assembler(op, rowFESpace_, colFESpace_) - { - bool opt = (rowFESpace_ == colFESpace_); - - // create sub assemblers - secondOrderAssembler = - SecondOrderAssembler::getSubAssembler(op, this, quad2, opt); - firstOrderAssemblerGrdPsi = - FirstOrderAssembler::getSubAssembler(op, this, quad1GrdPsi, GRD_PSI, opt); - firstOrderAssemblerGrdPhi = - FirstOrderAssembler::getSubAssembler(op, this, quad1GrdPhi, GRD_PHI, opt); - zeroOrderAssembler = - ZeroOrderAssembler::getSubAssembler(op, this, quad0, opt); - } - - StandardAssembler::StandardAssembler(Operator *op, - Quadrature *quad2, - Quadrature *quad1GrdPsi, - Quadrature *quad1GrdPhi, - Quadrature *quad0, - const FiniteElemSpace *rowFESpace_, - const FiniteElemSpace *colFESpace_) - : Assembler(op, rowFESpace_, colFESpace_) - { - remember = false; - - // create sub assemblers - secondOrderAssembler = - SecondOrderAssembler::getSubAssembler(op, this, quad2, false); - firstOrderAssemblerGrdPsi = - FirstOrderAssembler::getSubAssembler(op, this, quad1GrdPsi, GRD_PSI, false); - firstOrderAssemblerGrdPhi = - FirstOrderAssembler::getSubAssembler(op, this, quad1GrdPhi, GRD_PHI, false); - zeroOrderAssembler = - ZeroOrderAssembler::getSubAssembler(op, this, quad0, false); - } - void Assembler::initElementMatrix(ElementMatrix *elMat, const ElInfo *rowElInfo, const ElInfo *colElInfo) @@ -473,4 +418,53 @@ namespace AMDiS { lastVecEl = NULL; lastMatEl = NULL; } + + OptimizedAssembler::OptimizedAssembler(Operator *op, + Quadrature *quad2, + Quadrature *quad1GrdPsi, + Quadrature *quad1GrdPhi, + Quadrature *quad0, + const FiniteElemSpace *row, + const FiniteElemSpace *col) + : Assembler(op, row, col) + { + bool opt = (row == col); + + // create sub assemblers + secondOrderAssembler = + SecondOrderAssembler::getSubAssembler(op, this, quad2, opt); + firstOrderAssemblerGrdPsi = + FirstOrderAssembler::getSubAssembler(op, this, quad1GrdPsi, GRD_PSI, opt); + firstOrderAssemblerGrdPhi = + FirstOrderAssembler::getSubAssembler(op, this, quad1GrdPhi, GRD_PHI, opt); + zeroOrderAssembler = + ZeroOrderAssembler::getSubAssembler(op, this, quad0, opt); + + checkQuadratures(); + } + + StandardAssembler::StandardAssembler(Operator *op, + Quadrature *quad2, + Quadrature *quad1GrdPsi, + Quadrature *quad1GrdPhi, + Quadrature *quad0, + const FiniteElemSpace *row, + const FiniteElemSpace *col) + : Assembler(op, row, col) + { + remember = false; + + // create sub assemblers + secondOrderAssembler = + SecondOrderAssembler::getSubAssembler(op, this, quad2, false); + firstOrderAssemblerGrdPsi = + FirstOrderAssembler::getSubAssembler(op, this, quad1GrdPsi, GRD_PSI, false); + firstOrderAssemblerGrdPhi = + FirstOrderAssembler::getSubAssembler(op, this, quad1GrdPhi, GRD_PHI, false); + zeroOrderAssembler = + ZeroOrderAssembler::getSubAssembler(op, this, quad0, false); + + checkQuadratures(); + } + } diff --git a/AMDiS/src/Assembler.h b/AMDiS/src/Assembler.h index 38c9dcb05cf5711ea5da97efd122c5f07c724a20..649f38fa86c7d2b6d94286acfec52d689312be7a 100644 --- a/AMDiS/src/Assembler.h +++ b/AMDiS/src/Assembler.h @@ -60,12 +60,13 @@ namespace AMDiS { public: MEMORY_MANAGED(Assembler); - /// Constructor. + /// Constructor Assembler(Operator *op, const FiniteElemSpace *rowFESpace, const FiniteElemSpace *colFESpace = NULL); - virtual ~Assembler() {} + /// Destructor + ~Assembler(); void initElementMatrix(ElementMatrix *elMat, const ElInfo *rowElInfo, @@ -200,12 +201,13 @@ namespace AMDiS { void matVecAssemble(const ElInfo *elInfo, ElementVector *vec); + /// void matVecAssemble(const ElInfo *mainElInfo, const ElInfo *auxElInfo, const ElInfo *smallElInfo, const ElInfo *largeElInfo, ElementVector *vec); /** \brief - * Checks whether quadratures for sub assemblers are already set. + * Checks whether quadratures for subassemblers are already set. * If not they will be created. */ void checkQuadratures(); diff --git a/AMDiS/src/DOFMatrix.cc b/AMDiS/src/DOFMatrix.cc index a7f1b10ece2f362767f284367453473265ef0091..8138d34ab9ae0a21b07743bcc7de5af8b7aec4de 100644 --- a/AMDiS/src/DOFMatrix.cc +++ b/AMDiS/src/DOFMatrix.cc @@ -443,7 +443,7 @@ namespace AMDiS { std::vector<double*>::iterator factorIt = operatorFactor.begin(); for (; it != operators.end(); ++it, ++factorIt) { if ((*it)->getNeedDualTraverse() == false) { - (*it)->getElementMatrix(elInfo, + (*it)->getElementMatrix(elInfo, elementMatrix, *factorIt ? **factorIt : 1.0); } @@ -460,7 +460,7 @@ namespace AMDiS { TEST_EXIT_DBG(op)("No operator!\n"); op->getAssembler(omp_get_thread_num())->initElementMatrix(elementMatrix, elInfo); - op->getElementMatrix(elInfo, elementMatrix); + op->getElementMatrix(elInfo, elementMatrix, factor); addElementMatrix(factor, *elementMatrix, bound); } diff --git a/AMDiS/src/ElInfo.cc b/AMDiS/src/ElInfo.cc index d2a1ae2cb945cabe48a34d809d4fb2087ba3b8e9..84d14023a196582647d5fc26262cd640ebf6b4dd 100644 --- a/AMDiS/src/ElInfo.cc +++ b/AMDiS/src/ElInfo.cc @@ -78,7 +78,7 @@ namespace AMDiS { return calcDet(coord_); } - double ElInfo::calcDet(const FixVec<WorldVector<double>, VERTEX> &coords) + double ElInfo::calcDet(const FixVec<WorldVector<double>, VERTEX> &coords) const { FUNCNAME("ElInfo::calcDet()"); @@ -92,34 +92,38 @@ namespace AMDiS { if (dim == 0) return 1.0; - // dim = dim of world - WorldVector<double> e1, e2, e3, v0; - - v0 = coords[0]; - - for (int i = 0; i < dow; i++) { - e1[i] = coords[1][i] - v0[i]; - if (dim > 1) - e2[i] = coords[2][i] - v0[i]; - if (dim > 2) - e3[i] = coords[3][i] - v0[i]; - } - switch (dow) { case 1: det = coords[1][0] - coords[0][0]; break; case 2: if (dim == 1) { + + WorldVector<double> e1; + + e1[0] = coords[1][0] - coords[0][0]; + e1[1] = coords[1][1] - coords[0][1]; det = norm(&e1); + } else { - det = e1[0] * e2[1] - e1[1] * e2[0]; + + det = (coords[1][0] - coords[0][0]) * (coords[2][1] - coords[0][1]) - + (coords[1][1] - coords[0][1]) * (coords[2][0] - coords[0][0]); + } break; case 3: { - WorldVector<double> n; + WorldVector<double> e1, e2, e3, n; + for (int i = 0; i < dow; i++) { + e1[i] = coords[1][i] - coords[0][i]; + if (dim > 1) + e2[i] = coords[2][i] - coords[0][i]; + if (dim > 2) + e3[i] = coords[3][i] - coords[0][i]; + } + if (dim > 1) { n[0] = e1[1] * e2[2] - e1[2] * e2[1]; n[1] = e1[2] * e2[0] - e1[0] * e2[2]; diff --git a/AMDiS/src/ElInfo.h b/AMDiS/src/ElInfo.h index 7f21ad7352f27cd9596cca6baeeebcdc5d1c56bb..3782bce2ece64c64fcd196725b96b3a9f41513e2 100644 --- a/AMDiS/src/ElInfo.h +++ b/AMDiS/src/ElInfo.h @@ -383,7 +383,7 @@ namespace AMDiS { * Used by non static method \ref calcDet(). Calculates the determinant * for a given vector of vertex coordinates. */ - static double calcDet(const FixVec<WorldVector<double>, VERTEX> &coords); + double calcDet(const FixVec<WorldVector<double>, VERTEX> &coords) const; /** \brief * Checks whether flag is set in ElInfo's \ref fillFlag_. If not, the program diff --git a/AMDiS/src/Operator.cc b/AMDiS/src/Operator.cc index 70f457f6a3e3f5f1e89213cbc6749955bcf5d926..c4e6d759e37834b306f9968ccf983e60f75a8023 100644 --- a/AMDiS/src/Operator.cc +++ b/AMDiS/src/Operator.cc @@ -124,7 +124,7 @@ namespace AMDiS { { FUNCNAME("OperatorTerm::getGradientsAtQPs()"); - TEST_EXIT(elInfo->getMesh() == vec->getFESpace()->getMesh()) + TEST_EXIT_DBG(elInfo->getMesh() == vec->getFESpace()->getMesh()) ("There is something wrong!\n"); return subAssembler->getGradientsAtQPs(vec, elInfo, quad); diff --git a/AMDiS/src/ProblemVec.cc b/AMDiS/src/ProblemVec.cc index fe53ba1bc87c0e94e4b6ff78a5e1fe06a1026d12..f9fc78990938fd82096ee4a309d19db17e407b05 100644 --- a/AMDiS/src/ProblemVec.cc +++ b/AMDiS/src/ProblemVec.cc @@ -1193,9 +1193,6 @@ namespace AMDiS { &mainElInfo, &auxElInfo, &smallElInfo, &largeElInfo); while (cont) { - Element *mainElem = mainElInfo->getElement(); - Element *auxElem = auxElInfo->getElement(); - if (useGetBound) { basisFcts->getBound(mainElInfo, bound); } diff --git a/AMDiS/src/SubAssembler.h b/AMDiS/src/SubAssembler.h index 3c316034c6d8f87a6dd455b4de5823919bc06e53..a56dbd4444e2ca2cc3eb11720d7c90311e7d44fe 100644 --- a/AMDiS/src/SubAssembler.h +++ b/AMDiS/src/SubAssembler.h @@ -54,9 +54,7 @@ namespace AMDiS { bool optimized, FirstOrderType type = GRD_PHI); - /** \brief - * Destructor - */ + /// Destructor virtual ~SubAssembler() {} /** \brief @@ -79,23 +77,17 @@ namespace AMDiS { virtual void calculateElementVector(const ElInfo *elInfo, ElementVector *vec) = 0; - /** \brief - * Returns \ref terms - */ + /// Returns \ref terms inline std::vector<OperatorTerm*> *getTerms() { return &terms[omp_get_thread_num()]; } - /** \brief - * Returns \ref quadrature. - */ + /// Returns \ref quadrature. inline Quadrature *getQuadrature() { return quadrature; } - /** \brief - * Sets \ref quadrature to q. - */ + /// Sets \ref quadrature to q. inline void setQuadrature(Quadrature* q) { quadrature = q; } @@ -116,9 +108,7 @@ namespace AMDiS { const ElInfo* elInfo, Quadrature *quad = NULL); - /** \brief - * - */ + /// double* getVectorAtQPs(DOFVectorBase<double>* dv, const ElInfo* smallElInfo, const ElInfo* largeElInfo, @@ -132,9 +122,7 @@ namespace AMDiS { const ElInfo* elInfo, Quadrature *quad = NULL); - /** \brief - * - */ + /// WorldVector<double>* getGradientsAtQPs(DOFVectorBase<double>* dv, const ElInfo* smallElInfo, const ElInfo* largeElInfo, @@ -149,32 +137,24 @@ namespace AMDiS { const ElInfo *largeElInfo = NULL, Quadrature *quad = NULL); - /** \brief - * Returns \ref psiFast. - */ + /// Returns \ref psiFast. const FastQuadrature *getPsiFast() const { return psiFast; } - /** \brief - * Returns \ref phiFast. - */ + // Returns \ref phiFast. const FastQuadrature *getPhiFast() const { return phiFast; } protected: - /** \brief - * Updates \ref psiFast and \ref phiFast. - */ + /// Updates \ref psiFast and \ref phiFast. FastQuadrature *updateFastQuadrature(FastQuadrature *quadFast, const BasisFunction *psi, Flag updateFlag); protected: - /** \brief - * Problem dimension - */ + /// Problem dimension int dim; /** \brief @@ -189,32 +169,24 @@ namespace AMDiS { */ int nCol; - /** \brief - * Used for \ref getVectorAtQPs(). - */ + /// Used for \ref getVectorAtQPs(). class ValuesAtQPs { public: Vector<double> values; bool valid; }; - /** \brief - * Used for \ref getGradientsAtQPs(). - */ + /// Used for \ref getGradientsAtQPs(). class GradientsAtQPs { public: Vector<WorldVector<double> > values; bool valid; }; - /** \brief - * Used for \ref getVectorAtQPs(). - */ + /// Used for \ref getVectorAtQPs(). std::map<const DOFVectorBase<double>*, ValuesAtQPs*> valuesAtQPs; - /** \brief - * Used for \ref getGradientsAtQPs(). - */ + /// Used for \ref getGradientsAtQPs(). std::map<const DOFVectorBase<double>*, GradientsAtQPs*> gradientsAtQPs; /** \brief @@ -223,54 +195,34 @@ namespace AMDiS { */ WorldVector<double> *coordsAtQPs; - /** \brief - * Used for \ref getCoordsAtQPs(). - */ + /// Used for \ref getCoordsAtQPs(). bool coordsValid; - /** \brief - * Used for \ref getCoordsAtQP(). Stores the number of allocated WorldVectors. - */ + /// Used for \ref getCoordsAtQP(). Stores the number of allocated WorldVectors. int coordsNumAllocated; - /** \brief - * Needed Quadrature. Constructed in the constructor of SubAssembler - */ + /// Needed Quadrature. Constructed in the constructor of SubAssembler Quadrature *quadrature; - /** \brief - * FastQuadrature for row basis functions - */ + /// FastQuadrature for row basis functions FastQuadrature *psiFast; - /** \brief - * FastQuadrature for column basis functions - */ + /// FastQuadrature for column basis functions FastQuadrature *phiFast; - /** \brief - * Corresponding Assembler - */ + /// Corresponding Assembler Assembler* owner; - /** \brief - * Flag that specifies whether the element matrix is symmetric. - */ + /// Flag that specifies whether the element matrix is symmetric. bool symmetric; - /** \brief - * List of all terms with a contribution to this SubAssembler - */ + /// List of all terms with a contribution to this SubAssembler std::vector< std::vector<OperatorTerm*> > terms; - /** \brief - * - */ + /// bool opt; - /** \brief - * - */ + /// bool firstCall; friend class Assembler; diff --git a/AMDiS/src/SubElInfo.cc b/AMDiS/src/SubElInfo.cc index 9e7745f23eae5f6484c7eb5fae0e8e409dbc035f..5abe6d4b7870d6d665735e5656dead116d3b3ea5 100644 --- a/AMDiS/src/SubElInfo.cc +++ b/AMDiS/src/SubElInfo.cc @@ -32,7 +32,7 @@ namespace AMDiS { worldCoords[i]); } - det = ElInfo::calcDet(worldCoords); + det = elInfo->calcDet(worldCoords); } } diff --git a/AMDiS/src/SubElInfo.h b/AMDiS/src/SubElInfo.h index 22c7e7ffb0afa1a75bdcc7d85e9be21fdc5e5a4c..b44abf9b1d898802d8894eaac90cc8aea919bfb3 100644 --- a/AMDiS/src/SubElInfo.h +++ b/AMDiS/src/SubElInfo.h @@ -30,23 +30,15 @@ namespace AMDiS { public: MEMORY_MANAGED(SubElInfo); - /** - * Constructor - */ - SubElInfo(VectorOfFixVecs<DimVec<double> > *lambda, - const ElInfo *elInfo); + /// Constructor + SubElInfo(VectorOfFixVecs<DimVec<double> > *lambda, const ElInfo *elInfo); - /** - * Destructor. - */ + /// Destructor ~SubElInfo() { DELETE lambda; } - /** - * Get b-th coordinate of the a-th vertex of subelement (barycentric - * coordinates). - */ + /// Get b-th coordinate of the a-th vertex of subelement (barycentriccoordinates). inline const double getLambda(int a, int b) const { if (lambda) return (*lambda)[a][b]; @@ -54,42 +46,30 @@ namespace AMDiS { return 0.0; } - /** - * Get coordinates of a-th vertex of subelement (barycentric coordinates). - */ + /// Get coordinates of a-th vertex of subelement (barycentric coordinates). inline const DimVec<double>& getLambda(int a) const { return (*lambda)[a]; } - /** - * Get coordinates of all vertices of subelement (barycentric coordinates). - */ + /// Get coordinates of all vertices of subelement (barycentric coordinates). inline VectorOfFixVecs<DimVec<double> > *getLambda() const { return lambda; } - /** - * Get determinant corresponding to subelement. - */ + /// Get determinant corresponding to subelement. inline const double getDet() const { return det; } protected: - /** - * Contains elInfo of the element that contains subelement. - */ + /// Contains elInfo of the element that contains subelement. const ElInfo *elInfo; - /** - * Barycentrc coordinates of the vertices of subelement. - */ + /// Barycentrc coordinates of the vertices of subelement. VectorOfFixVecs<DimVec<double> > *lambda; - /** - * Determinant corresponding to the (World-)subelement. - */ + /// Determinant corresponding to the (World-)subelement. double det; }; diff --git a/AMDiS/src/SurfaceAssembler.h b/AMDiS/src/SurfaceAssembler.h index 1c1458d4a078d34bb92bb587cc3c3df75befba13..9c95a1f9ec4238aa77e324678a414480650de1b8 100644 --- a/AMDiS/src/SurfaceAssembler.h +++ b/AMDiS/src/SurfaceAssembler.h @@ -45,9 +45,7 @@ namespace AMDiS { public: MEMORY_MANAGED(SurfaceAssembler); - /** \brief - * Creates a SurfaceAssembler conforming to operat for the given \ref coords. - */ + /// Creates a SurfaceAssembler conforming to operat for the given \ref coords. SurfaceAssembler(Operator *operat, const FiniteElemSpace *rowFESpace, const FiniteElemSpace *colFESpace, @@ -85,81 +83,71 @@ namespace AMDiS { } }; - /** \brief - * Destructor - */ + /// Destructor ~SurfaceAssembler() { - if(rowQuad11_) DELETE rowQuad11_; - if(rowQuad10_) DELETE rowQuad10_; - if(rowQuad01_) DELETE rowQuad01_; - if(rowQuad00_) DELETE rowQuad00_; - }; + if (rowQuad11_) DELETE rowQuad11_; + if (rowQuad10_) DELETE rowQuad10_; + if (rowQuad01_) DELETE rowQuad01_; + if (rowQuad00_) DELETE rowQuad00_; + } - /** \brief - * Adapt surface quadratures to \ref coords. - */ + /// Adapt surface quadratures to \ref coords. void adaptSurfaceAssembler(VectorOfFixVecs<DimVec<double> > &coords) { coords_ = coords; - if(rowQuad11_) + if (rowQuad11_) dynamic_cast<SubQuadrature*>(rowQuad11_)->scaleQuadrature(coords_); - if(rowQuad10_) + if (rowQuad10_) dynamic_cast<SubQuadrature*>(rowQuad10_)->scaleQuadrature(coords_); - if(rowQuad01_) + if (rowQuad01_) dynamic_cast<SubQuadrature*>(rowQuad01_)->scaleQuadrature(coords_); - if(rowQuad00_) + if (rowQuad00_) dynamic_cast<SubQuadrature*>(rowQuad00_)->scaleQuadrature(coords_); - }; + } - /** \brief - * - */ + /// bool initElementMatrix(const ElInfo *elInfo1, const ElInfo *elInfo2, const ElInfo *smaller) { - if(Assembler::initElementMatrix(elInfo1, elInfo2, smaller)) { - int i; - FixVec<WorldVector<double>, VERTEX> worldCoords(rowDim_-1, NO_INIT); + if (Assembler::initElementMatrix(elInfo1, elInfo2, smaller)) { + FixVec<WorldVector<double>, VERTEX> worldCoords(rowDim_ - 1, NO_INIT); // transform barycentric coords to world coords - for(i = 0; i < rowDim_; i++) { + for (int i = 0; i < rowDim_; i++) { elInfo1->coordToWorld(coords_[i], &worldCoords[i]); } // set determinant for world coords of the side - det_ = ElInfo::calcDet(worldCoords); + det_ = elInfo1->calcDet(worldCoords); return true; } else { return false; } - }; + } - /** \brief - * - */ + /// bool initElementVector(const ElInfo *elInfo) { - if(Assembler::initElementVector(elInfo)) { - int i; - FixVec<WorldVector<double>, VERTEX> worldCoords(rowDim_-1, NO_INIT); + if (Assembler::initElementVector(elInfo)) { + FixVec<WorldVector<double>, VERTEX> worldCoords(rowDim_ - 1, NO_INIT); // transform barycentric coords to world coords - for(i = 0; i < rowDim_; i++) { + for (int i = 0; i < rowDim_; i++) { elInfo->coordToWorld(coords_[i], &worldCoords[i]); } // set determinant for world coords of the side - det_ = ElInfo::calcDet(worldCoords); + det_ = elInfo->calcDet(worldCoords); return true; } else { return false; } - }; + } protected: VectorOfFixVecs<DimVec<double> > coords_; diff --git a/AMDiS/src/SurfaceOperator.h b/AMDiS/src/SurfaceOperator.h index 349d5efc217cd04b9f807235ed8837b30b972de6..915537d3fdbd15b67e036e0d617a263faf905923 100644 --- a/AMDiS/src/SurfaceOperator.h +++ b/AMDiS/src/SurfaceOperator.h @@ -52,9 +52,7 @@ namespace AMDiS { public: MEMORY_MANAGED(SurfaceOperator); - /** \brief - * Creates a SurfaceOperator conforming to operat for the given \ref coords. - */ + /// Creates a SurfaceOperator conforming to operat for the given \ref coords. SurfaceOperator(Operator *operat, VectorOfFixVecs<DimVec<double> > &coords) : Operator(*operat), @@ -102,11 +100,9 @@ namespace AMDiS { // initialize assembler with surface quadratures optimized = false; initAssembler(myRank, quad2, quad1GrdPsi, quad1GrdPhi, quad0); - }; + } - /** \brief - * Adapt surface quadratures to \ref coords. - */ + /// Adapt surface quadratures to \ref coords. void adaptSurfaceOperator(VectorOfFixVecs<DimVec<double> > &coords) { coords_ = coords; @@ -126,7 +122,7 @@ namespace AMDiS { if (quad0) { quad0->scaleSurfaceQuadrature(coords); } - }; + } /** \brief * Implementation of \ref Operator::getElementMatrix(). Repalces the @@ -149,14 +145,14 @@ namespace AMDiS { } // set determinant for world coords of the side - const_cast<ElInfo*>(elInfo)->setDet(ElInfo::calcDet(worldCoords)); + const_cast<ElInfo*>(elInfo)->setDet(elInfo->calcDet(worldCoords)); // calc element matrix Operator::getElementMatrix(elInfo, userMat, factor); // set determinant for world coords of the side const_cast<ElInfo*>(elInfo)->setDet(origDet); - }; + } /** \brief * Implementation of \ref Operator::getElementVector(). Repalces the @@ -179,13 +175,13 @@ namespace AMDiS { } // set determinant for world coords of the side - const_cast<ElInfo*>(elInfo)->setDet(ElInfo::calcDet(worldCoords)); + const_cast<ElInfo*>(elInfo)->setDet(elInfo->calcDet(worldCoords)); // calc element vector Operator::getElementVector(elInfo, userVec, factor); const_cast<ElInfo*>(elInfo)->setDet(origDet); - }; + } protected: VectorOfFixVecs<DimVec<double> > coords_;