Reference documentation for deal.II version GIT c9976103bc 2022-12-09 17:30:02+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
function_signed_distance.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2019 - 2022 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii_function_signed_distance_h
17 #define dealii_function_signed_distance_h
18 
19 #include <deal.II/base/config.h>
20 
21 #include <deal.II/base/function.h>
22 
23 #include <array>
24 
26 
27 namespace Functions
28 {
29  namespace SignedDistance
30  {
47  template <int dim>
48  class Sphere : public Function<dim>
49  {
50  public:
54  Sphere(const Point<dim> &center = Point<dim>(), const double radius = 1);
55 
56  double
57  value(const Point<dim> & point,
58  const unsigned int component = 0) const override;
59 
70  gradient(const Point<dim> & point,
71  const unsigned int component = 0) const override;
72 
83  hessian(const Point<dim> & point,
84  const unsigned int component = 0) const override;
85 
86  private:
88  const double radius;
89  };
90 
91 
103  template <int dim>
104  class Plane : public Function<dim>
105  {
106  public:
110  Plane(const Point<dim> &point, const Tensor<1, dim> &normal);
111 
112  double
113  value(const Point<dim> & point,
114  const unsigned int component = 0) const override;
115 
117  gradient(const Point<dim> &,
118  const unsigned int component = 0) const override;
119 
121  hessian(const Point<dim> &,
122  const unsigned int component = 0) const override;
123 
124  private:
127  };
128 
129 
143  template <int dim>
144  class Ellipsoid : public Function<dim>
145  {
146  public:
155  Ellipsoid(const Point<dim> & center,
156  const std::array<double, dim> &radii,
157  const double tolerance = 1e-14,
158  const unsigned int max_iter = 10);
159 
160  double
161  value(const Point<dim> & point,
162  const unsigned int component = 0) const override;
163 
169  gradient(const Point<dim> &,
170  const unsigned int component = 0) const override;
171 
172  private:
180  double
181  evaluate_ellipsoid(const Point<dim> &point) const;
182 
186  Point<dim>
188 
203 
207  double
209 
211  const std::array<double, dim> radii;
212  const double tolerance;
213  const unsigned int max_iter;
214  };
215  } // namespace SignedDistance
216 } // namespace Functions
217 
219 
220 #endif
double value(const Point< dim > &point, const unsigned int component=0) const override
Tensor< 1, dim > gradient(const Point< dim > &, const unsigned int component=0) const override
double compute_signed_distance_ellipse(const Point< dim > &point) const
Point< dim > compute_closest_point_ellipse(const Point< dim > &point) const
Ellipsoid(const Point< dim > &center, const std::array< double, dim > &radii, const double tolerance=1e-14, const unsigned int max_iter=10)
double evaluate_ellipsoid(const Point< dim > &point) const
const std::array< double, dim > radii
Tensor< 1, dim, double > compute_analyical_normal_vector_on_ellipse(const Point< dim > &point) const
Plane(const Point< dim > &point, const Tensor< 1, dim > &normal)
double value(const Point< dim > &point, const unsigned int component=0) const override
SymmetricTensor< 2, dim > hessian(const Point< dim > &, const unsigned int component=0) const override
Tensor< 1, dim > gradient(const Point< dim > &, const unsigned int component=0) const override
Sphere(const Point< dim > &center=Point< dim >(), const double radius=1)
SymmetricTensor< 2, dim > hessian(const Point< dim > &point, const unsigned int component=0) const override
double value(const Point< dim > &point, const unsigned int component=0) const override
Tensor< 1, dim > gradient(const Point< dim > &point, const unsigned int component=0) const override
Definition: point.h:111
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:458
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:459
Point< spacedim > point(const gp_Pnt &p, const double tolerance=1e-10)
Definition: utilities.cc:189
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)