bf_identity.hh

Go to the documentation of this file.
1 
7 #ifndef hp2Dedge_bf_identity_hh
8 #define hp2Dedge_bf_identity_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 
51  // ************************************************************** IdentityBase **
52 
61  template<class F = Real, class G = typename concepts::Realtype<F>::type>
63  {
64  public:
66 
71  false);
72 
75  bool all = false);
76  protected:
78  bool all_;
79 
80  bool
81  assemble_(const Quad<Real>* elmX, const Quad<Real>* elmY,
83  };
84 
85  // ************************************************************** Identity **
86 
92  template<typename F = Real>
93  class Identity : public concepts::BilinearForm<F>, public IdentityBase<F>
94  {
95  public:
99  virtual ~Identity()
100  {
101  }
102  virtual Identity<F>*
103  clone() const
104  {
105  return new Identity<F>(this->frm_);
106  }
107  void
109  const concepts::Element<Real>& elmY,
110  concepts::ElementMatrix<F>& em) const;
111  void
112  operator()(const Quad<Real>& elmX, const Quad<Real>& elmY,
113  concepts::ElementMatrix<F>& em) const;
114  protected:
115  virtual std::ostream& info(std::ostream& os) const;
116  };
117 
118  // ************************************************************** IdentityMatrix **
119 
124  template<typename F = Real>
126  public IdentityBase<Real, F>
127  {
128  public:
129 
131 
134  virtual ~IdentityMatrix()
135  {
136  }
137  virtual IdentityMatrix<F>*
138  clone() const
139  {
140  return new IdentityMatrix<F>(this->frmM_);
141  }
142  virtual void
144  const concepts::Element<Real>& elmY,
145  concepts::ElementMatrix<F>& em) const;
146  virtual void
147  operator()(const Quad<Real>& elmX, const Quad<Real>& elmY,
148  concepts::ElementMatrix<F>& em) const;
149  protected:
150  virtual std::ostream&
151  info(std::ostream& os) const;
152  };
153 
154 } // namespace hp2Dedge
155 
156 #endif // hp2Dedge_bf_identity
Basic class for a 2D or 3D map.
void operator()(const Quad< Real > &elmX, const Quad< Real > &elmY, concepts::ElementMatrix< F > &em) const
concepts::ElementFormulaContainer< concepts::Mapping< Real, 2 > > frmM_
Matrix element formula.
virtual Identity< F > * clone() const
Virtual constructor.
Definition: bf_identity.hh:103
concepts::ElementFormulaContainer< Real > frm_
Element formula.
IdentityMatrix(const FrmE_Matrix frm=FrmE_Matrix())
Constructor.
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...
concepts::Combtype< F, G >::type value_type
Definition: bf_identity.hh:65
Abstract function class to evaluate a bilinear form.
Definition: bilinearForm.hh:33
bool assemble_(const Quad< Real > *elmX, const Quad< Real > *elmY, concepts::ElementMatrix< value_type > &em) const
A function class to calculate element matrices for the mass matrix.
Definition: bf_identity.hh:94
virtual ~Identity()
Definition: bf_identity.hh:99
IdentityBase(const concepts::ElementFormulaContainer< F > frm, bool all=false)
Constructor.
Identity(const concepts::ElementFormulaContainer< F > frm=concepts::ElementFormulaContainer< F >())
Constructor.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
bool all_
Parameter for the sum factorisation.
Definition: bf_identity.hh:78
Base class to calculate element matrices for the Identity, for both scalar and matrix formulas.
Definition: bf_identity.hh:63
IdentityBase(const concepts::ElementFormulaContainer< concepts::Mapping< G, 2 > > frm, bool all=false)
Element matrix.
Definition: linearForm.hh:18
virtual void operator()(const concepts::Element< Real > &elmX, const concepts::Element< Real > &elmY, concepts::ElementMatrix< F > &em) const
virtual void operator()(const Quad< Real > &elmX, const Quad< Real > &elmY, concepts::ElementMatrix< F > &em) const
void operator()(const concepts::Element< Real > &elmX, const concepts::Element< Real > &elmY, concepts::ElementMatrix< F > &em) const
concepts::ElementFormulaContainer< concepts::Mapping< F, 2 > > FrmE_Matrix
Definition: bf_identity.hh:130
virtual IdentityMatrix< F > * clone() const
Virtual constructor.
Definition: bf_identity.hh:138
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
A function class to calculate element matrices for the mass matrix with a matrix function in between.
Definition: bf_identity.hh:127
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