SubElementAssembler.h 4.26 KB
 Peter Gottschling committed Feb 15, 2008 1 2 3 4 5 6 7 8 9 10 /** \file SubElementAssembler.h */ #ifndef AMDIS_SUBELEMENTASSEMBLER_H #define AMDIS_SUBELEMENTASSEMBLER_H #include "MemoryManager.h" #include "Assembler.h" #include "SubElInfo.h" #include "ScalableQuadrature.h"  Thomas Witkowski committed Sep 03, 2008 11 namespace AMDiS {  Peter Gottschling committed Feb 15, 2008 12   Thomas Witkowski committed Sep 03, 2008 13  class SubPolytope;  Peter Gottschling committed Feb 15, 2008 14   Thomas Witkowski committed Sep 03, 2008 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 57  // ============================================================================ // ===== 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: MEMORY_MANAGED(SubElementAssembler);  Peter Gottschling committed Feb 15, 2008 58   Thomas Witkowski committed Sep 03, 2008 59  SubElementAssembler(Operator *op,  Thomas Witkowski committed Sep 04, 2008 60 61  const FiniteElemSpace *rowFESpace, const FiniteElemSpace *colFESpace = NULL);  Peter Gottschling committed Feb 15, 2008 62   Thomas Witkowski committed Sep 03, 2008 63 64 65 66 67 68 69 70 71 72 73 74 75  virtual ~SubElementAssembler() { if (zeroOrderScalableQuadrature) DELETE zeroOrderScalableQuadrature; if (firstOrderGrdPsiScalableQuadrature) DELETE firstOrderGrdPsiScalableQuadrature; if (firstOrderGrdPhiScalableQuadrature) DELETE firstOrderGrdPhiScalableQuadrature; if (secondOrderScalableQuadrature) DELETE secondOrderScalableQuadrature; }; void scaleQuadratures(const SubElInfo& subElInfo);  Peter Gottschling committed Feb 15, 2008 76   Thomas Witkowski committed Sep 03, 2008 77 78 79  void getSubElementVector(SubElInfo *subElInfo, const ElInfo *elInfo, ElementVector *userVec);  Peter Gottschling committed Feb 15, 2008 80   Thomas Witkowski committed Sep 03, 2008 81 82 83  void getSubElementMatrix(SubElInfo *subElInfo, const ElInfo *elInfo, ElementMatrix *userMat);  Peter Gottschling committed Feb 15, 2008 84   Thomas Witkowski committed Sep 03, 2008 85 86 87 88  void getSubPolytopeVector(SubPolytope *subPolytope, SubElementAssembler *subElementAssembler, const ElInfo *elInfo, ElementVector *userVec);  Peter Gottschling committed Feb 15, 2008 89   Thomas Witkowski committed Sep 03, 2008 90 91 92 93  void getSubPolytopeMatrix(SubPolytope *subPolytope, SubElementAssembler *subElementAssembler, const ElInfo *elInfo, ElementMatrix *userMat);  Peter Gottschling committed Feb 15, 2008 94   Thomas Witkowski committed Sep 03, 2008 95 96 97 98 99 100  protected: ScalableQuadrature *zeroOrderScalableQuadrature; ScalableQuadrature *firstOrderGrdPsiScalableQuadrature; ScalableQuadrature *firstOrderGrdPhiScalableQuadrature; ScalableQuadrature *secondOrderScalableQuadrature; };  Peter Gottschling committed Feb 15, 2008 101   Thomas Witkowski committed Sep 03, 2008 102 }  Peter Gottschling committed Feb 15, 2008 103 104  #endif // AMDIS_SUBELEMENTASSEMBLER_H