bilinearForm.hh

Go to the documentation of this file.
1 
6 #ifndef dgBilinearForms_hh
7 #define dgBilinearForms_hh
8 
9 #include "basics/typedefs.hh"
10 #include "elementPair.hh"
11 #include "operator/bilinearForm.hh"
12 #include "operator/matrix.hh"
13 
14 #define DEBUG_ASSEMBLY 0
15 #define DEBUG_IDENTITY 0
16 #define DEBUG_LAPLACE 0
17 
18 namespace linDG3D {
19 
20  using concepts::Real;
21  // ***************************************************** FvdgBilinearForm **
22 
27  public:
37  virtual void operator()(const FvdgElement& elmX, const FvdgElement& elmY,
39  const FvdgElementPair& ep) const = 0;
40  };
41 
42 
43  // ************************************************************** Assembly **
44 
48  class Assembly
49  {
50  public:
59  static void inner(concepts::Matrix<Real>& dest,
60  FvdgBilinearForm& bf,
62  bool transpose = false);
71  static void boundary(concepts::Matrix<Real>& dest,
72  FvdgBilinearForm& bf,
74  bool transpose = false);
75  private:
77  Assembly() {};
78  };
79 
80  // ************************************************************** Identity **
86  class Identity : public concepts::BilinearForm<Real> {
87  public:
88  Identity() {}
90  virtual void operator()(const concepts::Element<Real>& elmX,
91  const concepts::Element<Real>& elmY,
94  void operator()(const FvdgP0TetElem& eX,
95  const FvdgP0TetElem& eY,
98  void operator()(const FvdgP1TetElem& eX,
99  const FvdgP1TetElem& eY,
101  virtual Identity* clone() const { return new Identity(); }
102  };
103 
104  //*********************************************************** LaplaceVolBF **
110  class LaplaceVolBF : public concepts::BilinearForm<Real> {
111  public:
114  virtual void operator()(const concepts::Element<Real>& elmX,
115  const concepts::Element<Real>& elmY,
118  void operator()(const FvdgP1TetElem& eX,
119  const FvdgP1TetElem& eY,
121  virtual LaplaceVolBF* clone() const { return new LaplaceVolBF(); }
122  };
123 
124  //********************************************************* LaplaceInnerBF **
131  public:
136  LaplaceInnerBF(bool symm = false) { symm_ = symm ? -1 : 1; }
138  virtual void operator()(const FvdgElement& elmX, const FvdgElement& elmY,
140  const FvdgElementPair& ep) const;
141  virtual LaplaceInnerBF* clone() const { return new LaplaceInnerBF(symm_); }
142  private:
144  int symm_;
145  };
146 
147  //****************************************************** LaplaceBoundaryBF **
154  public:
159  LaplaceBoundaryBF(bool symm = false) {
160  symm_ = symm ? -1 : 1;
161  }
163  virtual void operator()(const FvdgElement& elmX, const FvdgElement& elmY,
165  const FvdgElementPair& ep) const;
166  virtual LaplaceBoundaryBF* clone() const {
167  return new LaplaceBoundaryBF(symm_); }
168  private:
170  int symm_;
171  };
172 
173  //************************************************************** PenaltyBF **
179  class PenaltyBF : public FvdgBilinearForm {
180  public:
184  virtual void operator()(const FvdgElement& elmX, const FvdgElement& elmY,
186  const FvdgElementPair& ep) const;
187  virtual PenaltyBF* clone() const { return new PenaltyBF(); }
188  };
189 
190 } // namespace linDG3D
191 
192 #endif // dgBilinearForms_hh
void operator()(const FvdgP1TetElem &eX, const FvdgP1TetElem &eY, concepts::ElementMatrix< Real > &em) const
Application operator for P1 elements.
void operator()(const FvdgP1TetElem &eX, const FvdgP1TetElem &eY, concepts::ElementMatrix< Real > &em) const
Application operator for P1 elements.
Laplace bilinear form.
Penalty bilinear form.
PenaltyBF()
Constructor.
virtual void operator()(const FvdgElement &elmX, const FvdgElement &elmY, concepts::ElementMatrix< Real > &em, const FvdgElementPair &ep) const
Application operator.
virtual PenaltyBF * clone() const
Tetrahedral element with linear shapefunctions.
Definition: element.hh:179
Laplace bilinear form.
Generic tetrahedral element for FV/DG method.
Definition: element.hh:31
virtual Identity * clone() const
Virtual constructor.
virtual void operator()(const FvdgElement &elmX, const FvdgElement &elmY, concepts::ElementMatrix< Real > &em, const FvdgElementPair &ep) const
Application operator.
Identity bilinear form.
Definition: bilinearForm.hh:86
void operator()(const FvdgP0TetElem &eX, const FvdgP0TetElem &eY, concepts::ElementMatrix< Real > &em) const
Application operator for P0 elements.
virtual void operator()(const concepts::Element< Real > &elmX, const concepts::Element< Real > &elmY, concepts::ElementMatrix< Real > &em) const
General application operator.
Abstract function class to evaluate a bilinear form.
Definition: bilinearForm.hh:33
virtual LaplaceVolBF * clone() const
Virtual constructor.
Stores additional information about two adjacent elements, namely the index, area,...
Definition: elementPair.hh:27
int symm_
symmetry sign
virtual LaplaceInnerBF * clone() const
static void inner(concepts::Matrix< Real > &dest, FvdgBilinearForm &bf, const concepts::ElementPairList< Real > &pairs, bool transpose=false)
Assembly operator scanning a list of inner element pairs.
Mapping< F, dim > & transpose(Mapping< F, dim > &m)
Definition: operations.hh:54
static void boundary(concepts::Matrix< Real > &dest, FvdgBilinearForm &bf, const concepts::ElementPairList< Real > &pairs, bool transpose=false)
Assembly operator scanning a list of boundary element pairs.
virtual void operator()(const FvdgElement &elmX, const FvdgElement &elmY, concepts::ElementMatrix< Real > &em, const FvdgElementPair &ep) const =0
Evaluates the bilinear form for all shape functions on elmX and elmY and stores the result in the mat...
virtual void operator()(const FvdgElement &elmX, const FvdgElement &elmY, concepts::ElementMatrix< Real > &em, const FvdgElementPair &ep) const
Application operator.
Bilinear Form for FV/DG purpose.
Definition: bilinearForm.hh:26
Tetrahedral element with constant shapefunction.
Definition: element.hh:111
DG-FEM methods to solve elliptic and hyperbolic PDE's.
Definition: bilinearForm.hh:18
Laplace bilinear form.
virtual void operator()(const concepts::Element< Real > &elmX, const concepts::Element< Real > &elmY, concepts::ElementMatrix< Real > &em) const
General application operator.
LaplaceInnerBF(bool symm=false)
Constructor.
LaplaceBoundaryBF(bool symm=false)
Constructor.
virtual LaplaceBoundaryBF * clone() const
Assembly()
Constructor. Is private in order to prevent creating an instance.
Definition: bilinearForm.hh:77
Provides methods to assemby matrices by lists of FvdgElementPairs.
Definition: bilinearForm.hh:49
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich