Class documentation of Concepts

Loading...
Searching...
No Matches
formulaFromWeight.hh
Go to the documentation of this file.
1
6#ifndef formulaFromWeight2D_hh
7#define formulaFromWeight2D_hh
8
9#include <typeinfo>
11#include "space/element.hh"
12#include "shortestDist.hh"
13#include "quad.hh"
14#include "basics/exceptions.hh"
15
16// debugging
17#include "basics/debug.hh"
18
19#define FormulaFromWeightConstr_D 0
20#define FormulaFromWeightAppl_D 0
21
22
23namespace hp2D {
24
25 // ***************************************************** FormulaFromWeight **
26
31 template<typename Weight = TrivialWeight>
33 public:
37 FormulaFromWeight(const SingularSet& singularities);
38
39 virtual Real operator()(const concepts::Element<Real>& elm, const Real p,
40 const Real t = 0.0) const;
41 virtual Real operator()(const concepts::Element<Real>& elm,
42 const concepts::Real2d& p,
43 const Real t = 0.0) const;
44 virtual Real operator()(const concepts::Element<Real>& elm,
45 const concepts::Real3d& p,
46 const Real t = 0.0) const;
48 return new FormulaFromWeight(singularities_); }
49 private:
50 Weight weight_;
51 const SingularSet& singularities_;
52 };
53
54 template<typename Weight>
56 (const SingularSet& singularities) :
57 weight_(), singularities_(singularities) {
58 DEBUGL(FormulaFromWeightConstr_D, "weight is " << typeid(weight_).name());
59 DEBUGL(FormulaFromWeightConstr_D, "singularities: " << singularities_);
60 }
61
62 template<typename Weight>
64 (const concepts::Element<Real>& elm, const Real p, const Real t) const {
65 const Quad<Real>* quad = dynamic_cast<const Quad<Real>*>(&elm);
67 return weight_(singularities_, concepts::Real2d(p, 0), quad);
68 }
69
70 template<typename Weight>
71 Real FormulaFromWeight<Weight>::operator()
72 (const concepts::Element<Real>& elm, const concepts::Real2d& p,
73 const Real t) const {
74 const Quad<Real>* quad = dynamic_cast<const Quad<Real>*>(&elm);
76 DEBUGL(FormulaFromWeightAppl_D, "p = " << p << ", singularities = "
77 << singularities_);
78 return weight_(singularities_, p, quad);
79 }
80
81 template<typename Weight>
82 Real FormulaFromWeight<Weight>::operator()
83 (const concepts::Element<Real>& elm, const concepts::Real3d& p,
84 const Real t) const {
85 const Quad<Real>* quad = dynamic_cast<const Quad<Real>*>(&elm);
87 return weight_(singularities_, concepts::Real2d(p[0], p[1]), quad);
88 }
89
90} // namespace hp2D
91
92#endif // formulaFromWeight2D_hh
virtual FormulaFromWeight< Weight > * clone() const
Virtual copy constructor.
FormulaFromWeight(const SingularSet &singularities)
#define conceptsAssert(cond, exc)
#define DEBUGL(doit, msg)
Definition debug.hh:40
double Real
Definition typedefs.hh:39