elementFormulaContainer.hh

Go to the documentation of this file.
1 
8 #ifndef elementformulaContainer_hh
9 #define elementformulaContainer_hh
10 
11 #include "toolbox/sharedPointer.hh"
12 #include "elementFormula.hh"
13 #include "constFormula.hh"
14 
15 
16 namespace concepts {
17 
18 
19  // ************************************************* ElementFormulaContainer **
20 
21  template<class F, typename G = typename Realtype<F>::type>
23  public:
32 
36 
49 
55  virtual F operator() (const ElementWithCell<G>& elm, const Real p,
56  const Real t = 0.0) const;
57  virtual F operator() (const ElementWithCell<G>& elm, const Real1d& p,
58  const Real t = 0.0) const
59  {return (*this)(elm, p[0],t);};
60  virtual F operator() (const ElementWithCell<G>& elm, const Real2d& p,
61  const Real t = 0.0) const;
62  virtual F operator() (const ElementWithCell<G>& elm, const Real3d& p,
63  const Real t = 0.0) const;
67  }
68 
69  const ElementFormula<F,G>& frm() const { return *frm_; }
70 
72  bool empty() const { return frm_.get() == 0; }
73 
75  protected:
76  virtual std::ostream& info(std::ostream& os) const;
77  private:
80  };
81 
82 
83 } // namespace concepts
84 
85 
86 #endif // elementformulaContainer_hh
virtual F operator()(const ElementWithCell< G > &elm, const Real p, const Real t=0.0) const
Evaluates the formula.
ElementFormulaContainer(const ElementFormula< F, G > &frm)
Constructor for an element formula, takes a clone.
ElementFormulaContainer(const F x)
Special constructor for a constant.
Basic class for a Point or a vector.
ElementFormulaContainer(const ElementFormula< F, G > *frm)
Constructor for a pointer to an element formula in dynamic memory which will be deleted by this class...
const ElementFormula< F, G > & frm() const
ElementFormulaContainer()
Constructor with no argument.
ElementFormulaContainer(const ElementFormulaContainer< F, G > &frm)
Copy constructor.
Element with cell.
bool empty() const
Returns true if no formula is stored.
virtual ElementFormulaContainer< F, G > * clone() const
Virtual copy constructor.
Interface for a formula defined element by element.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Reference-counting pointer.
Definition: bf_iddiv.hh:15
ElementFormulaContainer(const RCP< const ElementFormula< F, G > > frm)
Constructor for an RCP to an element formula, replaces the own RCP.
RCP< const ElementFormula< F, G > > frm_
Element formula is stored as a RCP.
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
Basic namespace for Concepts-2.
Definition: pml_formula.h:16
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich