shortestDist.hh

Go to the documentation of this file.
1 
7 #ifndef shortestDist_hh
8 #define shortestDist_hh
9 
10 #include <cmath>
12 #include "singularSet.hh"
13 
14 namespace hp3D {
15 
16  // forward declarations
17  class Hexahedron;
18  using concepts::Real;
19 
20  // ********************************************************* TrivialWeight **
21 
26  class TrivialWeight {
27  public:
29  const Hexahedron*) const { return 1.0; }
30  };
31 
32  std::ostream& operator<<(std::ostream& os, const TrivialWeight& p);
33 
34  // ********************************************************** ShortestDist **
35 
42  class ShortestDist {
43  public:
52  Real operator()(const SingularSet& singularities,
53  concepts::Real3d point, const Hexahedron* elm) const;
54  };
55 
56  std::ostream& operator<<(std::ostream& os, const ShortestDist& p);
57 
58  // ***************************************************** PostprocessSquare **
59 
65  public:
66  static Real post(Real x) { return x*x; }
67  };
68 
69  std::ostream& operator<<(std::ostream& os, const PostprocessSquare& p);
70 
71  // ******************************************************* PostprocessRoot **
72 
78  public:
79  static Real post(Real x) { return std::sqrt(x); }
80  };
81 
82  std::ostream& operator<<(std::ostream& os, const PostprocessRoot& p);
83 
84  // ****************************************************** PostprocessRoot4 **
85 
91  public:
92  static Real post(Real x) { return std::sqrt(std::sqrt(x)); }
93  };
94 
95  std::ostream& operator<<(std::ostream& os, const PostprocessRoot4& p);
96 
97  // ********************************************************* Postprocess34 **
98 
104  public:
105  static Real post(Real x) { return std::pow(x, 0.75); }
106  };
107 
108  std::ostream& operator<<(std::ostream& os, const Postprocess34& p);
109 
110  // ********************************************************* Postprocess14 **
111 
117  public:
118  static Real post(Real x) { return std::pow(x, 0.25); }
119  };
120 
121  std::ostream& operator<<(std::ostream& os, const Postprocess14& p);
122 
123  // ********************************************************** Postprocess4 **
124 
129  class Postprocess4 {
130  public:
131  static Real post(Real x) { return x*x*x*x; }
132  };
133 
134  std::ostream& operator<<(std::ostream& os, const Postprocess4& p);
135 
136  // ********************************************************** Postprocess3 **
137 
142  class Postprocess3 {
143  public:
144  static Real post(Real x) { return x*x*x; }
145  };
146 
147  std::ostream& operator<<(std::ostream& os, const Postprocess3& p);
148 
149  // ********************************************************** DistancePost **
150 
160  template<typename DistClass, typename Function>
161  class DistancePost {
162  public:
166  Real operator()(const SingularSet& singularities,
167  concepts::Real3d point, const Hexahedron* elm) const {
168  return Function::post(dist_(singularities, point, elm));
169  }
170  private:
171  DistClass dist_;
172  };
173 
174  template<typename DistClass, typename Function>
175  inline std::ostream& operator<<(std::ostream& os,
177  return os << Function() << '(' << DistClass() << ')';
178  }
179 
180  // ********************************************************** ProductOfAll **
181 
192  class ProductOfAll {
193  public:
194  Real operator()(const SingularSet& singularities,
195  concepts::Real3d point, const Hexahedron* elm) const;
196  };
197 
198  std::ostream& operator<<(std::ostream& os, const ProductOfAll& p);
199 
200  // *********************************************************** DaugeWeight **
201 
229  class DaugeWeight {
230  public:
231  Real operator()(const SingularSet& singularities,
232  concepts::Real3d point, const Hexahedron* elm) const;
233  };
234 
235  std::ostream& operator<<(std::ostream& os, const DaugeWeight& p);
236 
237  // *************************************************** ShortestDistLimited **
238 
247  public:
257  Real operator()(const SingularSet& singularities,
258  concepts::Real3d point, const Hexahedron* elm) const {
259  return shortestdist_(singularities, point, elm);
260  }
261  private:
263  };
264 
265  std::ostream& operator<<(std::ostream& os, const ShortestDistLimited& p);
266 
267 } // namespace hp3D
268 
269 #endif // shortestDist_hh
Real operator()(const SingularSet &singularities, concepts::Real3d point, const Hexahedron *elm) const
returns the square of the shortest distance of a point to the singular edges and vertices
A function class for weighted regularization, which returns the minimum of a value and the square of ...
A 3D FEM element: a hexahedron.
Definition: hexahedron.hh:37
A function class for weighted regularization, which returns the square of the shortest distance of a ...
Definition: shortestDist.hh:42
const ShortestDist shortestdist_
Weight implemented by Monique Dauge in Melina.
Returns the square root of x.
Definition: shortestDist.hh:77
static Real post(Real x)
Definition: shortestDist.hh:66
Returns the forth root of x.
Definition: shortestDist.hh:90
A function class for trivial (constant equal 1.0) weight function.
Definition: shortestDist.hh:26
static Real post(Real x)
Definition: shortestDist.hh:92
Real operator()(const SingularSet &, concepts::Real3d, const Hexahedron *) const
Definition: shortestDist.hh:28
Computes x to the power of 1/4.
static Real post(Real x)
Definition: shortestDist.hh:79
Real operator()(const SingularSet &singularities, concepts::Real3d point, const Hexahedron *elm) const
Computes the product of all distances in the singular set singularities.
std::ostream & operator<<(std::ostream &os, const TrivialWeight &p)
static Real post(Real x)
Computes x to the power of 3/4.
Real operator()(const SingularSet &singularities, concepts::Real3d point, const Hexahedron *elm) const
Real operator()(const SingularSet &singularities, concepts::Real3d point, const Hexahedron *elm) const
Uses DistClass to compute the weight function and Function to post process the weight.
Computes x to the power of 4.
Class for handling a set of singular edges and vertices.
Definition: singularSet.hh:136
Squares the given x.
Definition: shortestDist.hh:64
static Real post(Real x)
static Real post(Real x)
A function class for weighted regularization.
Real operator()(const SingularSet &singularities, concepts::Real3d point, const Hexahedron *elm) const
returns the minimum of a value and the square of the shortest distance of a point to the singular edg...
3D hp-FEM for H1-conforming elements.
Definition: meshDX.hh:23
static Real post(Real x)
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
Computes x to the power of 3.
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich