FirstOrderAssembler.h 6.77 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
31
32
33
34
35
#ifndef AMDIS_FIRST_ORDER_ASSEMBLER_H
#define AMDIS_FIRST_ORDER_ASSEMBLER_H

#include "SubAssembler.h"

namespace AMDiS {

  class Q10PsiPhi;
  class Q01PsiPhi;
  class Q1Psi;

  /**
   * \ingroup Assembler
   * 
   * \brief
   * SubAssembler for first order terms.
   */
  class FirstOrderAssembler : public SubAssembler
  {
  public:
    MEMORY_MANAGED(FirstOrderAssembler);

    /** \brief
     * Creates and returns the FirstOrderAssembler 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 FirstOrderAssembler* getSubAssembler(Operator *op,
						Assembler *assembler,
						Quadrature *quadrat,
						FirstOrderType type,
						bool optimized);
  
Thomas Witkowski's avatar
Thomas Witkowski committed
36
37
    /// Destructor.
    virtual ~FirstOrderAssembler() {}
38
39

  protected:
Thomas Witkowski's avatar
Thomas Witkowski committed
40
    /// Constructor.
41
42
43
44
45
46
47
48
    FirstOrderAssembler(Operator *op,
			Assembler *assembler,
			Quadrature *quadrat,
			bool optimized,
			FirstOrderType type);


  protected:
Thomas Witkowski's avatar
Thomas Witkowski committed
49
    /// List of all yet created optimized zero order assemblers for grdPsi.
50
51
    static std::vector<SubAssembler*> optimizedSubAssemblersGrdPsi;

Thomas Witkowski's avatar
Thomas Witkowski committed
52
    /// List of all yet created standard zero order assemblers for grdPsi.
53
54
    static std::vector<SubAssembler*> standardSubAssemblersGrdPsi;

Thomas Witkowski's avatar
Thomas Witkowski committed
55
    /// List of all yet created optimized zero order assemblers for grdPhi.
56
57
    static std::vector<SubAssembler*> optimizedSubAssemblersGrdPhi;

Thomas Witkowski's avatar
Thomas Witkowski committed
58
    /// List of all yet created standard zero order assemblers for grdPhi.
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
    static std::vector<SubAssembler*> standardSubAssemblersGrdPhi;
  };


  /**
   * \ingroup Assembler
   * 
   * \brief
   * Standard first order assembler for grdPsi.
   */
  class Stand10 : public FirstOrderAssembler
  {
  public:
    MEMORY_MANAGED(Stand10);

Thomas Witkowski's avatar
Thomas Witkowski committed
74
    /// Constructor.
75
76
    Stand10(Operator *op, Assembler *assembler, Quadrature *quad);

Thomas Witkowski's avatar
Thomas Witkowski committed
77
    /// Implements SubAssembler::calculateElementMatrix().
78
79
    void calculateElementMatrix(const ElInfo *elInfo, ElementMatrix *mat);

Thomas Witkowski's avatar
Thomas Witkowski committed
80
    ///
81
82
    void calculateElementMatrix(const ElInfo *rowElInfo,
				const ElInfo *colElInfo,
83
84
				const ElInfo *smallElInfo,
				const ElInfo *largeElInfo,
Thomas Witkowski's avatar
Thomas Witkowski committed
85
				ElementMatrix *mat);
86

Thomas Witkowski's avatar
Thomas Witkowski committed
87
    /// Implements SubAssembler::calculateElementVector().
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
    void calculateElementVector(const ElInfo *, ElementVector */*vec*/);
  };


  /**
   * \ingroup Assembler
   * 
   * \brief
   * Standard first order assembler for grdPhi.
   */
  class Stand01 : public FirstOrderAssembler
  {
  public:
    MEMORY_MANAGED(Stand01);

Thomas Witkowski's avatar
Thomas Witkowski committed
103
    /// Constructor.
104
105
    Stand01(Operator *op, Assembler *assembler, Quadrature *quad);

Thomas Witkowski's avatar
Thomas Witkowski committed
106
    /// Implements SubAssembler::calculateElementMatrix().
107
108
    void calculateElementMatrix(const ElInfo *elInfo, ElementMatrix *mat);

Thomas Witkowski's avatar
Thomas Witkowski committed
109
    /// 
110
111
    void calculateElementMatrix(const ElInfo *rowElInfo,
				const ElInfo *colElInfo,
112
113
				const ElInfo *smallElInfo,
				const ElInfo *largeElInfo,
Thomas Witkowski's avatar
Thomas Witkowski committed
114
				ElementMatrix *mat);
115

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


Thomas Witkowski's avatar
Thomas Witkowski committed
123
124
125
126
  /**
   * \ingroup Assembler
   * 
   * \brief
127
128
129
130
131
132
133
   * First order assembler for grdPsi using fast quadratures.
   */
  class Quad10 : public FirstOrderAssembler
  {
  public:
    MEMORY_MANAGED(Quad10);

Thomas Witkowski's avatar
Thomas Witkowski committed
134
    /// Constructor.
135
136
    Quad10(Operator *op, Assembler *assembler, Quadrature *quad);

Thomas Witkowski's avatar
Thomas Witkowski committed
137
    /// Implements SubAssembler::calculateElementMatrix().
138
139
    void calculateElementMatrix(const ElInfo *elInfo, ElementMatrix *mat);

Thomas Witkowski's avatar
Thomas Witkowski committed
140
    ///
141
142
    void calculateElementMatrix(const ElInfo *rowElInfo,
				const ElInfo *colElInfo,
143
144
				const ElInfo *smallElInfo,
				const ElInfo *largeElInfo,
145
146
147
148
149
				ElementMatrix *mat) 
    {
      ERROR_EXIT("CEM not yet\n");
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
150
151
    /// Implements SubAssembler::calculateElementVector().
    void calculateElementVector(const ElInfo *, ElementVector *);
152
153
  };

Thomas Witkowski's avatar
Thomas Witkowski committed
154
155
156
157
  /**
   * \ingroup Assembler
   * 
   * \brief
158
159
160
161
162
163
164
   * First order assembler for grdPhi using fast quadratures.
   */
  class Quad01 : public FirstOrderAssembler 
  {
  public:
    MEMORY_MANAGED(Quad01);

Thomas Witkowski's avatar
Thomas Witkowski committed
165
    /// Constructor.
166
167
    Quad01(Operator *op, Assembler *assembler, Quadrature *quad);

Thomas Witkowski's avatar
Thomas Witkowski committed
168
    /// Implements SubAssembler::calculateElementMatrix().
169
170
    void calculateElementMatrix(const ElInfo *elInfo, ElementMatrix *mat);

Thomas Witkowski's avatar
Thomas Witkowski committed
171
    ///
172
173
    void calculateElementMatrix(const ElInfo *rowElInfo,
				const ElInfo *colElInfo,
174
175
				const ElInfo *smallElInfo,
				const ElInfo *largeElInfo,
176
177
178
179
180
				ElementMatrix *mat) 
    {
      ERROR_EXIT("CEM not yet\n");
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
181
182
    /// Implements SubAssembler::calculateElementVector().
    void calculateElementVector(const ElInfo *, ElementVector *) {
183
      ERROR_EXIT("should not be called\n");
Thomas Witkowski's avatar
Thomas Witkowski committed
184
    }
185
186
187
  };


Thomas Witkowski's avatar
Thomas Witkowski committed
188
189
190
191
  /**
   * \ingroup Assembler
   *
   * \brief
192
193
194
195
196
197
198
   * First order assembler for grdPsi using precalculated integrals
   */
  class Pre10 : public FirstOrderAssembler 
  {
  public:
    MEMORY_MANAGED(Pre10);

Thomas Witkowski's avatar
Thomas Witkowski committed
199
    /// Constructor.
200
201
    Pre10(Operator *op, Assembler *assembler, Quadrature *quad);

Thomas Witkowski's avatar
Thomas Witkowski committed
202
    /// Implements SubAssembler::calculateElementMatrix().
203
204
    void calculateElementMatrix(const ElInfo *elInfo, ElementMatrix *mat);

Thomas Witkowski's avatar
Thomas Witkowski committed
205
    ///
206
207
    void calculateElementMatrix(const ElInfo *rowElInfo,
				const ElInfo *colElInfo,
208
209
				const ElInfo *smallElInfo,
				const ElInfo *largeElInfo,
210
211
212
213
214
				ElementMatrix *mat) 
    {
      ERROR_EXIT("CEM not yet\n");
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
215
216
    /// Implements SubAssembler::calculateElementVector().
    void calculateElementVector(const ElInfo *, ElementVector *);
217
218

  protected:
Thomas Witkowski's avatar
Thomas Witkowski committed
219
    /// Integral of the product of the derivative of psi and phi.
220
221
    const Q10PsiPhi *q10;

Thomas Witkowski's avatar
Thomas Witkowski committed
222
    /// Integral of the derivative of psi.
223
224
225
226
227
228
    const Q1Psi *q1;

    friend class FirstOrderAssembler;
  };


Thomas Witkowski's avatar
Thomas Witkowski committed
229
230
231
232
  /**
   * \ingroup Assembler
   *
   * \brief
233
234
235
236
237
238
239
   *  First order assembler for grdPhi using precalculated integrals
   */
  class Pre01 : public FirstOrderAssembler 
  {
  public:
    MEMORY_MANAGED(Pre01);

Thomas Witkowski's avatar
Thomas Witkowski committed
240
    /// Constructor.
241
242
    Pre01(Operator *op, Assembler *assembler, Quadrature *quad);

Thomas Witkowski's avatar
Thomas Witkowski committed
243
    /// Implements SubAssembler::calculateElementMatrix().
244
245
    void calculateElementMatrix(const ElInfo *elInfo, ElementMatrix *mat);

Thomas Witkowski's avatar
Thomas Witkowski committed
246
    ///
247
248
    void calculateElementMatrix(const ElInfo *rowElInfo,
				const ElInfo *colElInfo,
249
250
				const ElInfo *smallElInfo,
				const ElInfo *largeElInfo,
251
252
253
254
255
				ElementMatrix *mat) 
    {
      ERROR_EXIT("CEM not yet\n");
    }

Thomas Witkowski's avatar
Thomas Witkowski committed
256
257
    /// Implements SubAssembler::calculateElementVector().
    void calculateElementVector(const ElInfo *, ElementVector *) {
258
      ERROR_EXIT("should not be called\n");
Thomas Witkowski's avatar
Thomas Witkowski committed
259
    }
260
261

  protected:
Thomas Witkowski's avatar
Thomas Witkowski committed
262
    /// Integral of the product of psi and the derivative of phi.
263
264
    const Q01PsiPhi *q01;

Thomas Witkowski's avatar
Thomas Witkowski committed
265
    /// Integral of the derivative of phi.
266
267
268
269
270
271
272
273
274
    const Q1Psi *q1;

    friend class FirstOrderAssembler;
  };


}

#endif // AMDIS_FIRST_ORDER_ASSEMBLER_H