SubElementAssembler.h 4.19 KB
 Peter Gottschling committed Feb 15, 2008 1 2 3 4 5 6 7 8 9 /** \file SubElementAssembler.h */ #ifndef AMDIS_SUBELEMENTASSEMBLER_H #define AMDIS_SUBELEMENTASSEMBLER_H #include "Assembler.h" #include "SubElInfo.h" #include "ScalableQuadrature.h"  Thomas Witkowski committed Sep 03, 2008 10 namespace AMDiS {  Peter Gottschling committed Feb 15, 2008 11   Thomas Witkowski committed Sep 03, 2008 12  class SubPolytope;  Peter Gottschling committed Feb 15, 2008 13   Thomas Witkowski committed Sep 03, 2008 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56  // ============================================================================ // ===== class SubElementAssembler ============================================ // ============================================================================ // // Class Desription: // The class \ref SubElementAssembler holds the routines for the assemblage on // subpolytopes and subelements. // The integration on a subpolytope takes place by integrating on the // subelements and afterwards summing up the results. // If S' is a sublement and S the element containing S', the numerical integration // on S' is done by integration on the element S with a manipulated quadrature // formula and multiplication of the result with a correction term consisting of // the determinants corresponding to S and S'. That means, the quadrature points // are manipulated in the following way: // The original quadrature formula holds quadrature points which are given in // barycentric coordinates with respect to S'. Now we express these quadrature // points in barycentric coordinates with respect to S and obtain the manipulated // quadrature points we need. Obviously, the corresponding quadrature points // in world coordinates coincide. Thus the numerical integration on S with the // manipulated quadrature formula gives us the same result as the numerical // integration on S' with the original quadrature formula up to the determinant. // This method for integration on subelements allows the reuse of the routines for // the integration on elements. // // The manipulation of the quadrature formula takes place for the corresponding // assembler type (ZeroOrderAssembler, FirstOrderAssemblerGrdPsi, ...). // // Main routines: // SubElementAssembler() - Creates a scalable quadrature for the appropriate // assembler type and assigns this quadrature to the // assembler. // scaleQuadratures() - Manipulates the scalable quadrature of the // appropriate assembler type with respect to a // subelement. // getSubPolytopeVector() - Calculates the righthandside vector for a polytope. // getSubPolytopeMatrix() - Calculates the system matrix for a polytope. // getSubElementVector() - Calculates the righthandside vector for a subelement. // getSubElementMatrix() - Calculates the system matrix for a subelement. // ============================================================================ class SubElementAssembler : public StandardAssembler { public: SubElementAssembler(Operator *op,  Thomas Witkowski committed Sep 04, 2008 57 58  const FiniteElemSpace *rowFESpace, const FiniteElemSpace *colFESpace = NULL);  Peter Gottschling committed Feb 15, 2008 59   Thomas Witkowski committed Sep 03, 2008 60 61 62  virtual ~SubElementAssembler() { if (zeroOrderScalableQuadrature)  Thomas Witkowski committed May 11, 2009 63  delete zeroOrderScalableQuadrature;  Thomas Witkowski committed Sep 03, 2008 64  if (firstOrderGrdPsiScalableQuadrature)  Thomas Witkowski committed May 11, 2009 65  delete firstOrderGrdPsiScalableQuadrature;  Thomas Witkowski committed Sep 03, 2008 66  if (firstOrderGrdPhiScalableQuadrature)  Thomas Witkowski committed May 11, 2009 67  delete firstOrderGrdPhiScalableQuadrature;  Thomas Witkowski committed Sep 03, 2008 68  if (secondOrderScalableQuadrature)  Thomas Witkowski committed May 11, 2009 69 70  delete secondOrderScalableQuadrature; }  Thomas Witkowski committed Sep 03, 2008 71 72  void scaleQuadratures(const SubElInfo& subElInfo);  Peter Gottschling committed Feb 15, 2008 73   Thomas Witkowski committed Sep 03, 2008 74 75  void getSubElementVector(SubElInfo *subElInfo, const ElInfo *elInfo,  Thomas Witkowski committed May 11, 2009 76  ElementVector& userVec);  Peter Gottschling committed Feb 15, 2008 77   Thomas Witkowski committed Sep 03, 2008 78 79  void getSubElementMatrix(SubElInfo *subElInfo, const ElInfo *elInfo,  Thomas Witkowski committed May 11, 2009 80  ElementMatrix& userMat);  Peter Gottschling committed Feb 15, 2008 81   Thomas Witkowski committed Sep 03, 2008 82 83 84  void getSubPolytopeVector(SubPolytope *subPolytope, SubElementAssembler *subElementAssembler, const ElInfo *elInfo,  Thomas Witkowski committed May 11, 2009 85  ElementVector& userVec);  Peter Gottschling committed Feb 15, 2008 86   Thomas Witkowski committed Sep 03, 2008 87 88 89  void getSubPolytopeMatrix(SubPolytope *subPolytope, SubElementAssembler *subElementAssembler, const ElInfo *elInfo,  Thomas Witkowski committed May 11, 2009 90  ElementMatrix& userMat);  Peter Gottschling committed Feb 15, 2008 91   Thomas Witkowski committed Sep 03, 2008 92 93 94 95 96 97  protected: ScalableQuadrature *zeroOrderScalableQuadrature; ScalableQuadrature *firstOrderGrdPsiScalableQuadrature; ScalableQuadrature *firstOrderGrdPhiScalableQuadrature; ScalableQuadrature *secondOrderScalableQuadrature; };  Peter Gottschling committed Feb 15, 2008 98   Thomas Witkowski committed Sep 03, 2008 99 }  Peter Gottschling committed Feb 15, 2008 100 101  #endif // AMDIS_SUBELEMENTASSEMBLER_H