SecondOrderAssembler.h 3.5 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef AMDIS_SECOND_ORDER_ASSEMBLER_H
#define AMDIS_SECOND_ORDER_ASSEMBLER_H

#include "SubAssembler.h"

namespace AMDiS {

  class Q11PsiPhi;

  /**
   * \ingroup Assembler
   * 
   * \brief
   * SubAssembler for second order terms.
   */
  class SecondOrderAssembler : public SubAssembler
  {
  public:
    /** \brief
     * Creates and returns the SecondOrderAssembler 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.
     */
    static SecondOrderAssembler* getSubAssembler(Operator *op,
						 Assembler *assembler,
						 Quadrature *quadrat,
						 bool optimized);

Thomas Witkowski's avatar
Thomas Witkowski committed
31
32
    /// Destructor.
    virtual ~SecondOrderAssembler() {}
33
34

  protected:
Thomas Witkowski's avatar
Thomas Witkowski committed
35
    /// Constructor.
36
37
38
39
40
41
    SecondOrderAssembler(Operator *op,
			 Assembler *assembler,
			 Quadrature *quadrat,
			 bool optimized);

  protected:
Thomas Witkowski's avatar
Thomas Witkowski committed
42
    /// List of all yet created optimized second order assemblers.
43
44
    static std::vector<SubAssembler*> optimizedSubAssemblers;

Thomas Witkowski's avatar
Thomas Witkowski committed
45
    /// List of all yet created standard second order assemblers.
46
47
48
49
50
51
52
53
54
55
56
57
58
    static std::vector<SubAssembler*> standardSubAssemblers;
  };


  /**
   * \ingroup Assembler
   * 
   * \brief
   * Standard second order assembler
   */
  class Stand2 : public SecondOrderAssembler 
  {
  public:
Thomas Witkowski's avatar
Thomas Witkowski committed
59
    /// Constructor.
60
61
    Stand2(Operator *op, Assembler *assembler, Quadrature *quad);

Thomas Witkowski's avatar
Thomas Witkowski committed
62
    /// Implements SubAssembler::calculateElementMatrix().
63
    void calculateElementMatrix(const ElInfo *elInfo, ElementMatrix& mat);
64

Thomas Witkowski's avatar
Thomas Witkowski committed
65
    /// Implements SubAssembler::calculateElementVector().
66
    void calculateElementVector(const ElInfo *, ElementVector&) {
67
      ERROR_EXIT("should not be called\n");
Thomas Witkowski's avatar
Thomas Witkowski committed
68
    }
69
70
  };

Thomas Witkowski's avatar
Thomas Witkowski committed
71
72
73
74
  /**
   * \ingroup Assembler
   * 
   * \brief
75
76
77
78
79
   * Second order assembler using fast quadratures.
   */
  class Quad2 : public SecondOrderAssembler 
  {
  public:
Thomas Witkowski's avatar
Thomas Witkowski committed
80
    /// Constructor.
81
82
83
84
    Quad2(Operator *op, Assembler *assembler, Quadrature *quad);

    ~Quad2();

Thomas Witkowski's avatar
Thomas Witkowski committed
85
    /// Implements SubAssembler::calculateElementMatrix().
86
    void calculateElementMatrix(const ElInfo *elInfo, ElementMatrix& mat);
87

Thomas Witkowski's avatar
Thomas Witkowski committed
88
    /// Implements SubAssembler::calculateElementVector().
89
    void calculateElementVector(const ElInfo *, ElementVector&) {
90
      ERROR_EXIT("should not be called\n");
Thomas Witkowski's avatar
Thomas Witkowski committed
91
    }
92
93
94

  protected:
    /** \brief
Thomas Witkowski's avatar
Thomas Witkowski committed
95
96
     * Thread safe temporary vector of DimMats for calculation in
     * function calculateElementMatrix().
97
98
99
100
     */
    std::vector< DimMat<double>** > tmpLALt;
  };

Thomas Witkowski's avatar
Thomas Witkowski committed
101
102
103
104
  /**
   * \ingroup Assembler
   * 
   * \brief
105
106
107
108
109
   * Second order assembler using predefined integrals.
   */
  class Pre2 : public SecondOrderAssembler 
  {
  public:
Thomas Witkowski's avatar
Thomas Witkowski committed
110
    /// Constructor.
111
112
    Pre2(Operator *op, Assembler *assembler, Quadrature *quad);

Thomas Witkowski's avatar
Thomas Witkowski committed
113
    /// Destructor.
114
115
    ~Pre2();

Thomas Witkowski's avatar
Thomas Witkowski committed
116
    /// Implements SubAssembler::calculateElementMatrix().
117
    void calculateElementMatrix(const ElInfo *elInfo, ElementMatrix& mat);
118

Thomas Witkowski's avatar
Thomas Witkowski committed
119
    /// Implements SubAssembler::calculateElementVector().
120
    void calculateElementVector(const ElInfo *, ElementVector&) {
121
      ERROR_EXIT("should not be called\n");
Thomas Witkowski's avatar
Thomas Witkowski committed
122
    }
123
124

  protected:
125
    /// Integral of the product of the derivative of psi and the derivative of phi.
126
127
128
    const Q11PsiPhi *q11;

    /** \brief
Thomas Witkowski's avatar
Thomas Witkowski committed
129
130
     * Thread safe temporary vector of DimMats for calculation in 
     * function calculateElementMatrix().
131
132
133
134
135
136
137
138
139
     */
    std::vector< DimMat<double>** > tmpLALt;

    friend class SecondOrderAssembler;
  };

}

#endif // AMDIS_SECOND_ORDER_ASSEMBLER_H