SubElementAssembler.h 4.19 KB
Newer Older
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"

10
namespace AMDiS {
11

12
  class SubPolytope;
13

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's avatar
Thomas Witkowski committed
57
58
			const FiniteElemSpace *rowFESpace,
			const FiniteElemSpace *colFESpace = NULL);
59

60
61
62
    virtual ~SubElementAssembler()
    {
      if (zeroOrderScalableQuadrature)
63
	delete zeroOrderScalableQuadrature;
64
      if (firstOrderGrdPsiScalableQuadrature)
65
	delete firstOrderGrdPsiScalableQuadrature;
66
      if (firstOrderGrdPhiScalableQuadrature)
67
	delete firstOrderGrdPhiScalableQuadrature;
68
      if (secondOrderScalableQuadrature) 
69
70
	delete secondOrderScalableQuadrature;
    }
71
72

    void scaleQuadratures(const SubElInfo& subElInfo);
73

74
75
    void getSubElementVector(SubElInfo *subElInfo, 
			     const ElInfo *elInfo, 
76
			     ElementVector& userVec);
77

78
79
    void getSubElementMatrix(SubElInfo *subElInfo, 
			     const ElInfo *elInfo, 
80
			     ElementMatrix& userMat);
81

82
83
84
    void getSubPolytopeVector(SubPolytope *subPolytope,
			      SubElementAssembler *subElementAssembler,
			      const ElInfo *elInfo,
85
			      ElementVector& userVec);
86

87
88
89
    void getSubPolytopeMatrix(SubPolytope *subPolytope,
			      SubElementAssembler *subElementAssembler,
			      const ElInfo *elInfo,
90
			      ElementMatrix& userMat);
91

92
93
94
95
96
97
  protected:
    ScalableQuadrature *zeroOrderScalableQuadrature;
    ScalableQuadrature *firstOrderGrdPsiScalableQuadrature;
    ScalableQuadrature *firstOrderGrdPhiScalableQuadrature;
    ScalableQuadrature *secondOrderScalableQuadrature;
  };
98

99
}
100
101

#endif  // AMDIS_SUBELEMENTASSEMBLER_H