Class documentation of Concepts

Loading...
Searching...
No Matches
vectorElementFormula.hh
Go to the documentation of this file.
8#ifndef vectorelementformula_hh
9#define vectorelementformula_hh
10
11#include <vector>
13#include "elementFormula.hh"
15
16namespace concepts {
17
18
19 // *********************************************** VectorElementFormulaBase **
20
26 class VectorElementFormulaBase : public ElementFormula< Point<F, dim>, G >
27 {
28 public:
30 {
31 for(int i=0; i < dim; ++i)
32 formulas_.push_back(ElementFormulaContainer<F,G>());
33 }
34
40 (const std::vector<ElementFormulaContainer<F,G> >& formulas)
41 : formulas_(formulas)
42 {
43 conceptsAssert(formulas_.size() == dim, concepts::Assertion());
44 }
45
52 const Real t = 0.0) const
53 {
55 for (int i=0; i < dim; ++i)
56 ret[i] = !formulas_[i].empty() ? formulas_[i](elm, p, t) : F(0);
57 return ret;
58 }
59
61 const Real t = 0.0) const
62 {
64 for (int i=0; i < dim; ++i)
65 ret[i] = !formulas_[i].empty() ? formulas_[i](elm, p, t) : F(0);
66
67 return ret;
68 }
69
71 const Real t = 0.0) const
72 {
74 for (int i=0; i < dim; ++i)
75 ret[i] = !formulas_[i].empty() ? formulas_[i](elm, p, t) : F(0);
76
77 return ret;
78 }
79
82 {
84 }
85
86#if 0
88 : formulas_(other.formulas_)
89 { }
90#endif
91
92 virtual ~VectorElementFormulaBase() { }
93
94 const std::vector<ElementFormulaContainer<F, G> >& getFormulas()
95 {
96 return formulas_;
97 }
98
99 ElementFormulaContainer<F, G>& operator[](int i)
100 {
102
103 return formulas_[i];
104 }
105
106 protected:
107 std::vector<ElementFormulaContainer<F, G> > formulas_;
108
109 virtual std::ostream& info(std::ostream& os) const {
110 os << concepts::typeOf(*this) << "([";
111 for (int i=0; i < dim; ++i) {
112 if (!formulas_[i].empty())
113 os << formulas_[i].frm();
114 else
115 os << "0";
116 if (i < dim - 1)
117 os << ", ";
118 }
119 return os << "])";
120 }
121 };
122
123 // ************************************************ VectorElementFormula *****
124
127
128
129 // ************************************************ VectorElementFormula<2> **
130
131 template<typename F, typename G>
148
149
150 // ************************************************ VectorElementFormula<3> **
151
152 template<typename F, typename G>
171
172
173} // namespace concepts
174
175
176#endif // vectorelementformula_hh
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual VectorElementFormulaBase< F, dim, G > * clone() const
Virtual copy constructor.
Point< F, dim > operator()(const ElementWithCell< G > &elm, const Real p, const Real t=0.0) const
#define conceptsAssert(cond, exc)
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