00001 /* makes a function (formula) from a weight (can then be plotted) 00002 */ 00003 00004 #ifndef formulaFromWeight_hh 00005 #define formulaFromWeight_hh 00006 00007 #include "space/formula.hh" 00008 #include "shortestDist.hh" 00009 00010 namespace hp3D { 00011 00012 // ***************************************************** FormulaFromWeight ** 00013 00018 template<typename Weight = TrivialWeight> 00019 class FormulaFromWeight : public concepts::ElementFormula<concepts::Real> { 00020 public: 00024 FormulaFromWeight(const SingularSet& singularities) : 00025 weight_(), singularities_(singularities) {} 00026 00027 virtual Real operator()(const concepts::ElementWithCell<Real>& elm, 00028 const Real p, const Real t = 0.0) const; 00029 virtual Real operator()(const concepts::ElementWithCell<Real>& elm, 00030 const concepts::Real2d& p, 00031 const Real t = 0.0) const; 00032 virtual Real operator()(const concepts::ElementWithCell<Real>& elm, 00033 const concepts::Real3d& p, 00034 const Real t = 0.0) const; 00035 virtual FormulaFromWeight<Weight>* clone() const { 00036 return new FormulaFromWeight(singularities_); } 00037 private: 00038 Weight weight_; 00039 const SingularSet& singularities_; 00040 }; 00041 00042 } // namespace concepts 00043 00044 #endif // formulaFromWeight_hh