Reference documentation for deal.II version 9.4.1
\(\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 - 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
22
23#include <array>
24
26
27namespace 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:
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
187 compute_closest_point_ellipse(const Point<dim> &point) const;
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
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
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
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
Definition: tensor.h:503
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:442
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:443