Class documentation of Concepts

Loading...
Searching...
No Matches
matrixElementFormula.hh
Go to the documentation of this file.
1
6#ifndef matrixelementformula_hh
7#define matrixelementformula_hh
8
9#include <vector>
11#include "elementFormula.hh"
13
14namespace concepts {
15
16
17 // ************************************************** MatrixElementFormula **
18
24 class MatrixElementFormula : public ElementFormula< Mapping<F, dim>, G >
25 {
26 public:
28
29 MatrixElementFormula<F,dim,G>() : formulas_()
30 {
31 for(int i=0; i < dim*dim; ++i)
32 formulas_.push_back(ElementFormulaContainer<F>());
33 }
34
35
43 : formulas_(formulas)
44 {
45 conceptsAssert(formulas_.size() == dim * dim, concepts::Assertion());
46 }
47
54 const Real t = 0.0) const
55 {
57 for (int i=0; i < dim; ++i) {
58 for (int j=0; j < dim; ++j)
59 ret(i,j) =
60 !formulas_[i*dim + j].empty() ? formulas_[i*dim + j](elm, p, t) : F(0);
61 }
62 return ret;
63 }
64
66 const Real t = 0.0) const
67 {
69 for (int i=0; i < dim; ++i) {
70 for (int j=0; j < dim; ++j)
71 ret(i,j) =
72 !formulas_[i*dim + j].empty() ? formulas_[i*dim + j](elm, p, t) : F(0);
73 }
74 return ret;
75 }
76
78 const Real t = 0.0) const
79 {
81 for (int i=0; i < dim; ++i) {
82 for (int j=0; j < dim; ++j)
83 ret(i,j) =
84 !formulas_[i*dim + j].empty() ? formulas_[i*dim + j](elm, p, t) : F(0);
85 }
86 return ret;
87 }
88
91 {
92 return new MatrixElementFormula<F, dim, G>(*this);
93 }
94
95#if 0
97 : formulas_(other.formulas_)
98 { }
99#endif
100
101 virtual ~MatrixElementFormula() { }
102
103 const std::vector< ElementFormulaContainer<F> >& getFormulas()
104 {
105 return formulas_;
106 }
107
109 {
110 conceptsAssert(i < dim*dim, concepts::Assertion());
111
112 return formulas_[i*dim +j];
113 }
114 protected:
115 std::vector< ElementFormulaContainer<F> > formulas_;
116 };
117
118
119} // namespace concepts
120
121
122#endif // matrixelementformula_hh
Mapping< F, dim > operator()(const ElementWithCell< G > &elm, const Real p, const Real t=0.0) const
virtual MatrixElementFormula< F, dim, G > * clone() const
Virtual copy constructor.
#define conceptsAssert(cond, exc)
double Real
Definition typedefs.hh:39
Set< F > makeSet(uint n, const F &first,...)
Definition set.hh:320