formula.hh

Go to the documentation of this file.
1 
6 #ifndef formulahp1d_hh
7 #define formulahp1d_hh
8 
9 #include "basics/operations.hh"
10 #include "formula/formula.hh"
11 #include "geometry/formula.hh"
12 #include "geometry/arrays.hh"
13 #include "function/vector.hh"
14 #include "element.hh"
15 
16 namespace hp1D {
17 
18  // *********************************************** ElementFormulaInterpGrad **
19 
20  template<typename F>
22  public:
24 
26  const Real p, const Real t = 0.0) const;
28  const concepts::Real2d& p, const Real t = 0.0) const {
29  return 0.0;
30  }
32  const concepts::Real3d& p, const Real t = 0.0) const {
33  return 0.0;
34  }
35 
39  }
40  protected:
41  virtual std::ostream& info(std::ostream& os) const;
42  private:
51  };
52 
53  // *************************************************** ArrayElementFormula **
54 
56 
57  template<class F = Real>
59  public:
71  void compute(const BaseElement<Real>& elm,
73  };
74 
75  template<class F>
77  concepts::Array<F>() {
78  }
79 
80  template<class F>
83  concepts::Array<F>(0) {
84  compute(elm, frm);
85  }
86 
87  // ****************************************************** LinearFormHelper **
88 
93  template<uint i, class F = Real>
95  };
96 
97  // *************************************************** LinearFormHelper<0> **
98 
113  template<class F>
114  class LinearFormHelper<0, F> {
115  public:
117  virtual ~LinearFormHelper();
118 
119  protected:
124  void computeIntermediate_(const BaseElement<Real>& elm) const;
125 
131 
134  };
135 
136  // *************************************************** LinearFormHelper<1> **
137 
154  template<class F>
155  class LinearFormHelper<1, F> {
156  public:
158  virtual ~LinearFormHelper();
159 
160  protected:
165  void computeIntermediate_(const Element<Real>& elm) const;
166 
172 
175  };
176 
177  // **************************************************** BilinearFormHelper **
178 
183  template<uint i, uint j, class F = Real>
185  };
186 
187  // *********************************************** BilinearFormHelper<0,0> **
188 
189  template<class F>
190  class BilinearFormHelper<0, 0, F> : public LinearFormHelper<0, F> {
191  public:
193  LinearFormHelper<0, F>(frm) {
194  }
195 
197  return &this->frm_.frm();
198  }
199  };
200 
201  // *********************************************** BilinearFormHelper<1,1> **
202 
211  template<class F>
212  class BilinearFormHelper<1, 1, F> {
213  public:
217  protected:
219  void computeIntermediate_(const Element<Real>& elm) const;
227  };
228 
232  template<class F>
233  class BilinearFormHelper<2, 2, F> {
234  public:
238 
239  protected:
240 
243 
246 
249 
251  void computeIntermediate_(const Element<Real>& elm) const;
252 
255 
256  };
257 
258  /*********************************** BilinearFormVtxHelper **************************/
263  template<class F = Real>
265  public:
268  frm_(frm) {
269  }
270 
273  return &this->frm_.frm();
274  }
275 
282  const hp1D::Element<Real>& elm) const;
283 
290  const hp1D::Element<Real>& elm) const;
291 
297  const hp1D::Element<Real>& elm) const;
298 
304 
305  protected:
306 
309  };
310 
311 
312 } // namespace hp1D
313 
314 #endif //formulahp1d_hh
Helper class for Linearforms l(v), where v is i-form.
Definition: formula.hh:94
const concepts::ElementFormula< F > * formula() const
Definition: formula.hh:196
ArrayElementFormula()
Constructor.
Definition: formula.hh:76
concepts::Array< F > intermediateValueHess_
calculated second tangential derivatives of the parametrisation
Definition: formula.hh:242
Helper class for bilinearforms a(u,v), where u is i-form and v is j-form.
Definition: formula.hh:184
BilinearFormVtxHelper(const concepts::ElementFormulaContainer< F > frm)
Constructor.
Definition: formula.hh:267
const concepts::ElementFormulaContainer< F > frm_
ElementFormula.
Definition: formula.hh:254
const concepts::ElementFormulaContainer< F > frm_
ElementFormula.
Definition: formula.hh:226
void compute(const BaseElement< Real > &elm, const concepts::ElementFormulaContainer< F > frm)
Evaluates the formula frm on all quadrature points of element elm.
BilinearFormHelper(const concepts::ElementFormulaContainer< F > frm)
Definition: formula.hh:192
const concepts::ElementFormulaContainer< F > frm_
ElementFormula.
Definition: formula.hh:308
virtual F operator()(const concepts::ElementWithCell< Real > &elm, const concepts::Real2d &p, const Real t=0.0) const
Definition: formula.hh:27
const ElementFormula< F, G > & frm() const
void computeIntermediate_(const BaseElement< Real > &elm) const
Compute the intermediate data for element matrix computation.
void computeIntermediate_(const Element< Real > &elm) const
Compute the intermediate data for element matrix computation.
BilinearFormHelper(const concepts::ElementFormulaContainer< F > frm=concepts::ElementFormulaContainer< F >())
concepts::Array< F > intermediateValue_
Intermediate value.
Definition: formula.hh:224
const concepts::ElementFormulaContainer< F > frm_
Element formula.
Definition: formula.hh:44
virtual F operator()(const concepts::ElementWithCell< Real > &elm, const concepts::Real3d &p, const Real t=0.0) const
Definition: formula.hh:31
const concepts::Array< F > getFrmVal(const hp1D::Element< Real > &elm) const
Returns the values of frm on {0,1}.
const concepts::ElementFormula< F > * formula() const
Getter for formula.
Definition: formula.hh:272
const concepts::ElementFormulaContainer< F > frm_
ElementFormula.
Definition: formula.hh:133
LinearFormHelper(const concepts::ElementFormulaContainer< F > frm)
Array of formula values on quadrature points.
Definition: formula.hh:58
ElementFormulaInterpGrad(const concepts::ElementFormulaContainer< F > frm)
const concepts::ElementWithCell< Real > * edge_
Last element.
Definition: formula.hh:48
Interface for a formula defined element by element.
const concepts::ElementFormulaContainer< F > frm_
ElementFormula.
Definition: formula.hh:174
const concepts::Array< Real > getTangentialSecondDerivative(const hp1D::Element< Real > &elm) const
Returns the second tangential derivative (s.t.d.) of the inverse Parametrisation on {0,...
1D generic element.
Definition: element.hh:225
BilinearFormHelper(const concepts::ElementFormulaContainer< F > frm=concepts::ElementFormulaContainer< F >())
void computeIntermediate_(const Element< Real > &elm) const
Compute the intermediate data for element matrix computation.
Helper class for bilinearforms a(u,v), where a is a i-j Form that just works on the Vertices,...
Definition: formula.hh:264
concepts::Array< F > intermediateValueJac_
calculated inverse Jacobian determinant on the integration points
Definition: formula.hh:245
concepts::Array< F > intermediateValue_
Intermediate value (on each quadrature point)
Definition: formula.hh:130
concepts::Array< F > intermediateValue_
Intermediate value (on each quadrature point)
Definition: formula.hh:171
concepts::Array< Real > x_
Chebychev points.
Definition: formula.hh:46
const concepts::Array< Real > getInvJacobeanDet(const hp1D::Element< Real > &elm) const
Returns the inverse of the jacobean determinant (i.J.d.)
concepts::Array< F > values_
Values of the element formula in the current quadrilateral.
Definition: formula.hh:50
concepts::Array< F > intermediateValueFrm_
calculated values of the elementFormula on the integration poitnts
Definition: formula.hh:248
void computeIntermediate_(const Element< Real > &elm) const
Compute the intermediate data for element matrix computation.
LinearFormHelper(const concepts::ElementFormulaContainer< F > frm)
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
const concepts::Array< Real > getInvJacobeanDetSq(const hp1D::Element< Real > &elm) const
Returns the inverse of the jacobean determinant squared (i.J.d.s.)
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
virtual F operator()(const concepts::ElementWithCell< Real > &elm, const Real p, const Real t=0.0) const
virtual ElementFormulaInterpGrad< F > * clone() const
Virtual copy constructor.
Definition: formula.hh:37
Basic namespace for Concepts-2.
Definition: pml_formula.h:16
1D hp-FEM
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich