diff --git a/AMDiS/src/Assembler.cc b/AMDiS/src/Assembler.cc index db81e6fd06578611bb0bc3508bb7b136d1394a2a..a9e695f74272e34dfef84dcbde37cf71a21653d7 100644 --- a/AMDiS/src/Assembler.cc +++ b/AMDiS/src/Assembler.cc @@ -123,13 +123,13 @@ namespace AMDiS { ElementMatrix *mat = rememberElMat ? elementMatrix : userMat; if (secondOrderAssembler) - secondOrderAssembler->calculateElementMatrix(rowElInfo, mat); + secondOrderAssembler->calculateElementMatrix(rowElInfo, colElInfo, mat); if (firstOrderAssemblerGrdPsi) - firstOrderAssemblerGrdPsi->calculateElementMatrix(rowElInfo, mat); + firstOrderAssemblerGrdPsi->calculateElementMatrix(rowElInfo, colElInfo, mat); if (firstOrderAssemblerGrdPhi) - firstOrderAssemblerGrdPhi->calculateElementMatrix(rowElInfo, mat); + firstOrderAssemblerGrdPhi->calculateElementMatrix(rowElInfo, colElInfo, mat); if (zeroOrderAssembler) { - zeroOrderAssembler->calculateElementMatrix(rowElInfo, mat); + zeroOrderAssembler->calculateElementMatrix(rowElInfo, colElInfo, mat); } if (rememberElMat && userMat) { diff --git a/AMDiS/src/ElInfo.cc b/AMDiS/src/ElInfo.cc index 8b46c346f65a41888aa854e9a49ba7580f5df392..3d194ced5d7055e1965812dd20a3737db29e382f 100644 --- a/AMDiS/src/ElInfo.cc +++ b/AMDiS/src/ElInfo.cc @@ -22,7 +22,8 @@ namespace AMDiS { element_(NULL), parent_(NULL), macroElement_(NULL), - subElemCoords(NULL), + level_(0), + iChild(0), coord_(mesh_->getDim(), NO_INIT), boundary_(mesh_->getDim(), DEFAULT_VALUE, INTERIOR), projection_(mesh_->getDim(), NO_INIT), @@ -31,8 +32,7 @@ namespace AMDiS { neighbourCoord_(mesh_->getDim(), NO_INIT), oppVertex_(mesh_->getDim(), NO_INIT), grdLambda_(mesh_->getDim(), NO_INIT), - level_(0), - iChild(0) + subElemCoords(NULL) { projection_.set(NULL); diff --git a/AMDiS/src/ElInfo.h b/AMDiS/src/ElInfo.h index 40e1e283ee6e728ecbb5dd9793ea770872dc09c1..aeaea4af7e524408c9f1129060d407a3f4443216 100644 --- a/AMDiS/src/ElInfo.h +++ b/AMDiS/src/ElInfo.h @@ -260,7 +260,7 @@ namespace AMDiS { return parametric_; } - inline VectorOfFixVecs<DimVec<double> > *getSubElemCoords() { + inline VectorOfFixVecs<DimVec<double> > *getSubElemCoords() const { return subElemCoords; } diff --git a/AMDiS/src/Quadrature.cc b/AMDiS/src/Quadrature.cc index de3e250a6724e8fadc5d3bb70766fa7a99411751..25288401e2c08a86f9a99ac1cb715731ff140b30 100644 --- a/AMDiS/src/Quadrature.cc +++ b/AMDiS/src/Quadrature.cc @@ -1409,7 +1409,8 @@ namespace AMDiS { Quadrature* Quadrature::provideQuadrature(int dim_, int degree_) { FUNCNAME("Quadrature::provideQuadrature()"); - switch(dim_) { + + switch (dim_) { case 0: degree_ = 0; break; diff --git a/AMDiS/src/Quadrature.h b/AMDiS/src/Quadrature.h index b2403a536a8235af5047ba0a7fabb27acf005f24..b44f5eaf7910ddc560370dd23f07e08617ea41c4 100644 --- a/AMDiS/src/Quadrature.h +++ b/AMDiS/src/Quadrature.h @@ -83,17 +83,17 @@ namespace AMDiS { w(w_) {}; - /** \brief - * Destructor - */ - ~Quadrature(); - public: /** \brief * Copy constructor */ Quadrature(const Quadrature&); + /** \brief + * Destructor + */ + ~Quadrature(); + /** \brief * Returns a Quadrature for dimension dim exact for degree degree. */ diff --git a/AMDiS/src/ZeroOrderAssembler.cc b/AMDiS/src/ZeroOrderAssembler.cc index e1b98f30c9f683a12a4d179fb217876174b21232..7ffe128bfe208fdd705f922675d9db292d86f85b 100644 --- a/AMDiS/src/ZeroOrderAssembler.cc +++ b/AMDiS/src/ZeroOrderAssembler.cc @@ -156,6 +156,7 @@ namespace AMDiS { const BasisFunction *psi = owner->getRowFESpace()->getBasisFcts(); const BasisFunction *phi = owner->getColFESpace()->getBasisFcts(); + double *phival = GET_MEMORY(double, nCol); int nPoints = quadrature->getNumPoints(); double *c = GET_MEMORY(double, nPoints); @@ -165,21 +166,32 @@ namespace AMDiS { (static_cast<ZeroOrderTerm*>((*termIt)))->getC(rowElInfo, nPoints, c); } - ScalableQuadrature *scalQuadrature = NEW ScalableQuadrature(quadrature); - // SubElInfo *subElInfo = NEW ScalElInfo(rowElInfo); + SubElInfo *subElInfo = NEW SubElInfo(colElInfo->getSubElemCoords(), rowElInfo); + Quadrature psiQuadrature(*quadrature); + ScalableQuadrature *scaledQuadrature = NEW ScalableQuadrature(&psiQuadrature); + scaledQuadrature->scaleQuadrature(*subElInfo); for (int iq = 0; iq < nPoints; iq++) { c[iq] *= rowElInfo->getDet(); - // calculate phi at QPs only once! - for (int i = 0; i < nCol; i++) { - // phival[i] = (*(phi->getPhi(i)))(quadrature->getLambda(iq)); - } + // calculate phi at QPs only once! + for (int i = 0; i < nCol; i++) { + phival[i] = (*(phi->getPhi(i)))(quadrature->getLambda(iq)); + } + for (int i = 0; i < nRow; i++) { + double psival = (*(psi->getPhi(i)))(psiQuadrature.getLambda(iq)); + for (int j = 0; j < nCol; j++) { + (*mat)[i][j] += quadrature->getWeight(iq) * c[iq] * psival * phival[j]; + } + } } - DELETE scalQuadrature; - // DELETE subElInfo; + DELETE scaledQuadrature; + DELETE subElInfo; + + FREE_MEMORY(phival, double, nCol); + FREE_MEMORY(c, double, nPoints); ERROR_EXIT("SO, HIER GEHTS WEITER\n"); } diff --git a/AMDiS/src/ZeroOrderAssembler.h b/AMDiS/src/ZeroOrderAssembler.h index 9e9d293064cdecf94c83fea098ed3211a2bd9dc1..4f9c65efa322de6bb4cba7f40a406d02e6e61da3 100644 --- a/AMDiS/src/ZeroOrderAssembler.h +++ b/AMDiS/src/ZeroOrderAssembler.h @@ -24,8 +24,8 @@ namespace AMDiS { * Creates and returns the ZeroOrderAssembler for Operator op and * the given assembler. If all terms are piecewise constant precalculated * integrals can be used while assembling and the returned - * ZeroOrderAssembler is of type Pre0. Otherwise a Quad0 object will - * be returned. + * ZeroOrderAssembler is of type PrecalcZOA. Otherwise a FastQuadZOA + * object will be returned. */ static ZeroOrderAssembler* getSubAssembler(Operator *op, Assembler *assembler,