shortestDist.hh

Go to the documentation of this file.
1 
6 #ifndef shortestDist2D_hh
7 #define shortestDist2D_hh
8 
9 #include <cmath>
11 #include "hp2D/singularSet.hh"
12 
13 namespace hp2D {
14 
15  // forward declarations
16  template<class F>
17  class Quad;
18  using concepts::Real;
19 
20  // ********************************************************* TrivialWeight **
21 
26  class TrivialWeight {
27  public:
30  const Quad<Real>*) const { return 1.0; }
31  };
32 
33  std::ostream& operator<<(std::ostream& os, const TrivialWeight& p);
34 
35  // ********************************************************** ShortestDist **
36 
43  class ShortestDist {
44  public:
52  Real operator()(const SingularSet& singularities,
53  concepts::Real2d point, const Quad<Real>* elm) const;
54  };
55 
56  std::ostream& operator<<(std::ostream& os, const ShortestDist& p);
57 
58  // ********************************************************** DistancePost **
59 
69  template<typename DistClass, typename Function>
70  class DistancePost {
71  public:
75  Real operator()(const SingularSet& singularities,
76  concepts::Real2d point, const Quad<Real>* elm) const {
77  return Function::post(dist_(singularities, point, elm));
78  }
79  private:
80  DistClass dist_;
81  };
82 
83  template<typename DistClass, typename Function>
84  inline std::ostream& operator<<(std::ostream& os,
86  return os << Function() << '(' << DistClass() << ')';
87  }
88 
89 
90  // ********************************************************** Postprocess4 **
91 
96  class Postprocess4 {
97  public:
98  static Real post(Real x) { return std::pow(x, 0.4); }
99  };
100 
101  std::ostream& operator<<(std::ostream& os, const Postprocess4& p);
102 
103  // ********************************************************** Postprocess7 **
104 
109  class Postprocess7 {
110  public:
111  static Real post(Real x) { return std::pow(x, 0.7); }
112  };
113 
114  std::ostream& operator<<(std::ostream& os, const Postprocess7& p);
115 
116  // ********************************************************** Postprocess8 **
117 
122  class Postprocess8 {
123  public:
124  static Real post(Real x) { return std::pow(x, 0.8); }
125  };
126 
127  std::ostream& operator<<(std::ostream& os, const Postprocess8& p);
128 
129  // ********************************************************** Postprocess9 **
130 
135  class Postprocess9 {
136  public:
137  static Real post(Real x) { return std::pow(x, 0.9); }
138  };
139 
140  std::ostream& operator<<(std::ostream& os, const Postprocess9& p);
141 
142  // ******************************************************* PostprocessSqrt **
143 
149  public:
150  static Real post(Real x) { return std::sqrt(x); }
151  };
152 
153  std::ostream& operator<<(std::ostream& os, const PostprocessSqrt& p);
154 
155 } // namespace hp2D
156 
157 #endif // shortestDist2D_hh
static Real post(Real x)
Computes x to the power of 0.9.
Computes x to the power of 0.4.
Definition: shortestDist.hh:96
A function class for trivial (constant equal 1.0) weight function.
Definition: shortestDist.hh:26
Computes x to the power of 0.8.
Real operator()(const SingularSet &, concepts::Real2d, const Quad< Real > *) const
Returns 1.
Definition: shortestDist.hh:29
2D hp-FEM for H1-conforming elements.
Class for handling a set of singular vertices.
Definition: singularSet.hh:63
static Real post(Real x)
Computes to square root of x.
std::ostream & operator<<(std::ostream &os, const TrivialWeight &p)
Computes x to the power of 0.7.
A function class for weighted regularization.
Definition: shortestDist.hh:70
A function class for weighted regularization, which returns the square of the shortest distance of a ...
Definition: shortestDist.hh:43
Real operator()(const SingularSet &singularities, concepts::Real2d point, const Quad< Real > *elm) const
Uses DistClass to compute the weight function and Function to post process the weight.
Definition: shortestDist.hh:75
static Real post(Real x)
static Real post(Real x)
static Real post(Real x)
Definition: shortestDist.hh:98
Real operator()(const SingularSet &singularities, concepts::Real2d point, const Quad< Real > *elm) const
Returns the square of the shortest distance of a point to the singular vertices.
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich