Class documentation of Concepts

Loading...
Searching...
No Matches
frmE_inverse.hh
Go to the documentation of this file.
1
8#ifndef inverseelementformula_hh
9#define inverseelementformula_hh
10
11#include "basics/debug.hh"
12//#include "elementFormulaContainer.hh"
13#include "exceptions.hh"
14
15#define InvElemFormConstr_D 0
16#define InvElemFormDestr_D 0
17#define InvElemFormClone_D 0
18
19namespace concepts {
20
21 // forward declaration
22 template<class F, class G>
23 class ElementFormulaContainer;
24
25
26 // *********************************************************** FrmE_Inverse **
27
36 class FrmE_Inverse : public ElementFormula<F,G> {
37 public:
39 : frm_(frm)
40 {
41 if (frm.empty()) throw(PointerToEmptyElementFormula());
42 }
45 : frm_(frm.frm_) {}
46
47 virtual ~FrmE_Inverse() {
48 DEBUGL(InvElemFormDestr_D, "Delete " << *this)
49 }
50
51 virtual F operator() (const ElementWithCell<G>& elm,
52 const Real p, const Real t = 0.0) const {
53 F v = frm_(elm, p,t);
54
55 return 1.0 / v;
56 }
57 virtual F operator() (const ElementWithCell<G>& elm,
58 const Real2d& p, const Real t = 0.0) const {
59 F v = frm_(elm, p,t);
60
61 return 1.0 / v;
62 }
63 virtual F operator() (const ElementWithCell<G>& elm,
64 const Real3d& p, const Real t = 0.0) const {
65 F v = frm_(elm, p,t);
66
67 return 1.0 / v;
68 }
69 virtual FrmE_Inverse<F,G>* clone() const {
70 return new FrmE_Inverse<F,G>(frm_);
71 }
72 protected:
73 virtual std::ostream& info(std::ostream& os) const {
74 return os << concepts::typeOf(*this) << "(1 / " << frm_ << ')';
75 }
76 private:
79 };
80
81} // namespace concepts
82
83
84#endif // inverseelementformula_hh
bool empty() const
Returns true if no formula is stored.
FrmE_Inverse(const FrmE_Inverse< F, G > &frm)
Copy constructor.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual FrmE_Inverse< F, G > * clone() const
Virtual copy constructor.
virtual F operator()(const ElementWithCell< G > &elm, const Real p, const Real t=0.0) const
#define DEBUGL(doit, msg)
Definition debug.hh:40
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