Class documentation of Concepts

Loading...
Searching...
No Matches
piecewiseFormula.hh
Go to the documentation of this file.
1
8#ifndef piecewiseformula_hh
9#define piecewiseformula_hh
10
11#include "space/element.hh"
12#include "elementFormula.hh"
13#include "basics/output.hh"
14
15
16namespace concepts {
17
18 // ************************************************** PiecewiseFormulaBase **
19
41 template<typename F>
43 public ElementFormula<F, typename concepts::Realtype<F>::type> {
44 public:
45 typedef typename concepts::Realtype<F>::type G;
46
49 virtual ~PiecewiseFormulaBase();
50 virtual PiecewiseFormulaBase<F>* clone() const = 0;
51
52 virtual F operator()(const ElementWithCell<G>& elm, const Real p,
53 const Real t = 0.0) const
54 {
55 return operator()(elm.cell().connector(), elm.elemMap(p), t);
56 }
57 virtual F operator()(const ElementWithCell<G>& elm, const Real2d& p,
58 const Real t = 0.0) const
59 {
60 return operator()(elm.cell().connector(), elm.elemMap(p), t);
61 }
62
63 virtual F operator()(const ElementWithCell<G>& elm, const Real3d& p,
64 const Real t = 0.0) const
65 {
66 return operator()(elm.cell().connector(), elm.elemMap(p), t);
67 }
68
74 virtual F operator()(const Connector& cntr, const Real p,
75 const Real t = 0.0) const = 0;
76 virtual F operator()(const Connector& cntr, const Real2d& p,
77 const Real t = 0.0) const = 0;
78 virtual F operator()(const Connector& cntr, const Real3d& p,
79 const Real t = 0.0) const = 0;
81 inline virtual const F& dflt_value() const { return dflt_value_;}
83 inline virtual F& dflt_value() { return dflt_value_;}
84 protected:
85 virtual std::ostream& info(std::ostream& os) const;
86 private:
88 F dflt_value_;
89 };
90
91 template<typename F>
93 dflt_value_(dflt_value) {
94 }
95
96 template<typename F>
98
99 template<typename F>
100 std::ostream& PiecewiseFormulaBase<F>::info(std::ostream& os) const {
101 os << concepts::typeOf(*this) << "(default value = " << dflt_value() << ")";
102 return os;
103 }
104
105} // namespace concepts
106
107#endif // piecewiseformula_hh
virtual Connector & connector() const =0
Returns the connector.
virtual const Cell & cell() const =0
Returns the cell on which the element is built.
virtual F operator()(const Connector &cntr, const Real p, const Real t=0.0) const =0
virtual F & dflt_value()
Gives default value.
PiecewiseFormulaBase(const F dflt_value=(F) 0)
Constructor with default value.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual const F & dflt_value() const
Gives default value.
virtual PiecewiseFormulaBase< F > * clone() const =0
Virtual copy constructor.
std::string typeOf(const T &t)
Definition output.hh:43
double Real
Definition typedefs.hh:39
Set< F > makeSet(uint n, const F &first,...)
Definition set.hh:320