bf_graduv.hh

Go to the documentation of this file.
1 
7 #ifndef HP2DEDGE_BF_GRADUV_HH_
8 #define HP2DEDGE_BF_GRADUV_HH_
9 
10 #include <memory>
11 #include "operator/bilinearForm.hh"
12 #include "basics/typedefs.hh"
16 #include "formula/boundary.hh"
18 #include "hp2D/quad.hh"
19 #include "hp2D/formula.hh"
22 #include "toolbox/sharedPointer.hh"
23 
24 namespace concepts
25 {
26 // forward declarations
27  template<class F>
28  class Element;
29 
30  template<class F>
31  class ElementMatrix;
32 
33  template<class F>
34  class Array;
35 
36  template<class F>
37  class RCP;
38 }
39 
40 namespace hp2Dedge
41 {
42  // forward declarations
43  template<class F>
44  class Quad;
45 
46  template<class F>
47  class Edge;
48 
49  using concepts::Real;
50  using concepts::Cmplx;
51 
52 // ************************************************************** GraduvBase **
53 
62  template<class F = Real, class G = typename concepts::Realtype<F>::type>
64  {
65  public:
67 
72  bool all = false);
73 
76  bool all = false);
77  protected:
79  bool all_;
80 
81  bool
82  assemble_(const hp2D::Quad<Real>* elmX, const Quad<Real>* elmY,
84 
85  private:
89  };
90 
91 // *************************************************************** Graduv **
92 
99  template<class F = Real>
100  class Graduv : public concepts::BilinearForm<F>,
101  public hp2Dedge::GraduvBase<F>
102  {
103  public:
106  virtual ~Graduv()
107  {
108  }
109  void
111  const concepts::Element<Real>& elmY,
112  concepts::ElementMatrix<F>& em) const;
113  void
114  operator()(const hp2D::Quad<Real>& elmX, const Quad<Real>& elmY,
115  concepts::ElementMatrix<F>& em) const;
116  virtual Graduv<F>*
117  clone() const
118  {
119  return new Graduv(this->frm_);
120  }
121  protected:
122  virtual std::ostream&
123  info(std::ostream& os) const;
124  };
125 
126 // *************************************************************** GraduvMatrix **
127 
133  template<class F = Real>
135  public hp2Dedge::GraduvBase<Real, F>
136  {
137  public:
138 
140 
142  virtual ~GraduvMatrix()
143  {
144  }
145  void
147  const concepts::Element<Real>& elmY,
148  concepts::ElementMatrix<F>& em) const;
149  void
150  operator()(const hp2D::Quad<Real>& elmX, const Quad<Real>& elmY,
151  concepts::ElementMatrix<F>& em) const;
152  virtual GraduvMatrix<F>*
153  clone() const
154  {
155  return new GraduvMatrix(this->frmM_);
156  }
157  protected:
158  virtual std::ostream&
159  info(std::ostream& os) const;
160  };
161 
162 } // namespace hp2Dedge
163 
164 #endif /* HP2DEDGE_BF_GRADUV_HH_ */
Basic class for a 2D or 3D map.
concepts::Array< concepts::Mapping< F, 2 > > jacobianInv_
Definition: bf_graduv.hh:88
concepts::ElementFormulaContainer< concepts::Mapping< Real, 2 > > frmM_
Matrix element formula.
concepts::ElementFormulaContainer< concepts::Mapping< F, 2 > > FrmE_Matrix
Definition: bf_graduv.hh:139
GraduvMatrix(const FrmE_Matrix frm=FrmE_Matrix())
Base class to calculate element matrices for the (grad u, v)-bilinearform, for both scalar and matrix...
Definition: bf_graduv.hh:64
concepts::ElementFormulaContainer< Real > frm_
Element formula.
void operator()(const concepts::Element< Real > &elmX, const concepts::Element< Real > &elmY, concepts::ElementMatrix< F > &em) const
An edge of a 2D FEM edge element quad.
Definition: bf_graduv.hh:47
bool assemble_(const hp2D::Quad< Real > *elmX, const Quad< Real > *elmY, concepts::ElementMatrix< value_type > &em) const
concepts::Combtype< F, G >::type value_type
Definition: bf_graduv.hh:66
GenericElement< KarniadakisMixin< F > > Element
template aliases for backwards compatibility
Definition: element.hh:270
Helper class for bilinearforms a(u,v), where u and v are 1-forms, which computes intermediate data fo...
GraduvBase(const concepts::ElementFormulaContainer< concepts::Mapping< G, 2 > > frm, bool all=false)
void operator()(const hp2D::Quad< Real > &elmX, const Quad< Real > &elmY, concepts::ElementMatrix< F > &em) const
Abstract function class to evaluate a bilinear form.
Definition: bilinearForm.hh:33
A function class to calculate element matrices for the bilinear form.
Definition: bf_graduv.hh:136
void operator()(const concepts::Element< Real > &elmX, const concepts::Element< Real > &elmY, concepts::ElementMatrix< F > &em) const
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
bool all_
Parameter for the sum factorisation.
Definition: bf_graduv.hh:79
Graduv(const concepts::ElementFormulaContainer< F > frm=concepts::ElementFormulaContainer< F >())
An array of objects.
Definition: bilinearForm.hh:23
virtual Graduv< F > * clone() const
Virtual constructor.
Definition: bf_graduv.hh:117
std::complex< Real > Cmplx
Type for a complex number. It also depends on the setting of Real.
Definition: typedefs.hh:39
virtual GraduvMatrix< F > * clone() const
Virtual constructor.
Definition: bf_graduv.hh:153
virtual ~Graduv()
Definition: bf_graduv.hh:106
concepts::Array< F > factor_
Intermediate data for element matrix computation.
Definition: bf_graduv.hh:87
Element matrix.
Definition: linearForm.hh:18
void operator()(const hp2D::Quad< Real > &elmX, const Quad< Real > &elmY, concepts::ElementMatrix< F > &em) const
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
A function class to calculate element matrices for the bilinear form.
Definition: bf_graduv.hh:102
GraduvBase(const concepts::ElementFormulaContainer< F > frm, bool all=false)
Constructor.
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
Basic namespace for Concepts-2.
Definition: pml_formula.h:16
hp 2D edge elements for electromagnetics.
Definition: bf_advection.hh:37
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich