Reference documentation for deal.II version 9.5.0
\(\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\}}\)
Loading...
Searching...
No Matches
function_signed_distance.h
Go to the documentation of this file.
1// ---------------------------------------------------------------------
2//
3// Copyright (C) 2019 - 2023 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
23
24#include <array>
25
27
28namespace Functions
29{
30 namespace SignedDistance
31 {
48 template <int dim>
49 class Sphere : public Function<dim>
50 {
51 public:
55 Sphere(const Point<dim> &center = Point<dim>(), const double radius = 1);
56
57 double
58 value(const Point<dim> & point,
59 const unsigned int component = 0) const override;
60
71 gradient(const Point<dim> & point,
72 const unsigned int component = 0) const override;
73
84 hessian(const Point<dim> & point,
85 const unsigned int component = 0) const override;
86
87 private:
89 const double radius;
90 };
91
92
104 template <int dim>
105 class Plane : public Function<dim>
106 {
107 public:
111 Plane(const Point<dim> &point, const Tensor<1, dim> &normal);
112
113 double
114 value(const Point<dim> & point,
115 const unsigned int component = 0) const override;
116
118 gradient(const Point<dim> &,
119 const unsigned int component = 0) const override;
120
122 hessian(const Point<dim> &,
123 const unsigned int component = 0) const override;
124
125 private:
128 };
129
130
144 template <int dim>
145 class Ellipsoid : public Function<dim>
146 {
147 public:
157 const std::array<double, dim> &radii,
158 const double tolerance = 1e-14,
159 const unsigned int max_iter = 10);
160
161 double
162 value(const Point<dim> & point,
163 const unsigned int component = 0) const override;
164
170 gradient(const Point<dim> &,
171 const unsigned int component = 0) const override;
172
173 private:
181 double
182 evaluate_ellipsoid(const Point<dim> &point) const;
183
188 compute_closest_point_ellipse(const Point<dim> &point) const;
189
204
208 double
210
212 const std::array<double, dim> radii;
213 const double tolerance;
214 const unsigned int max_iter;
215 };
216
217
231 template <int dim>
232 class Rectangle : public Function<dim>
233 {
234 public:
242 Rectangle(const Point<dim> &bottom_left, const Point<dim> &top_right);
249
256 double
257 value(const Point<dim> & p,
258 const unsigned int component = 0) const override;
259
260 private:
262 };
263
264
281 template <int dim>
282 class ZalesakDisk : public Function<dim>
283 {
284 public:
295 const double radius,
296 const double notch_width,
297 const double notch_height);
298
305 double
306 value(const Point<dim> & p,
307 const unsigned int component = 0) const override;
308
309 private:
314
319 };
320 } // namespace SignedDistance
321} // namespace Functions
322
324
325#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
double evaluate_ellipsoid(const Point< dim > &point) const
Tensor< 1, dim, double > compute_analyical_normal_vector_on_ellipse(const Point< dim > &point) const
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
double value(const Point< dim > &p, const unsigned int component=0) const override
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
const Functions::SignedDistance::Sphere< dim > sphere
double value(const Point< dim > &p, const unsigned int component=0) const override
const Functions::SignedDistance::Rectangle< dim > notch
Definition point.h:112
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:472
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:473
Point< 3 > center