Reference documentation for deal.II version GIT relicensing-12-g89ba5bf9db 2024-02-24 00:00:03+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\}}\)
Loading...
Searching...
No Matches
manifold_lib.h
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 2014 - 2023 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Part of the source code is dual licensed under Apache-2.0 WITH
9// LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10// governing the source code and code contributions can be found in
11// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12//
13// ------------------------------------------------------------------------
14
15#ifndef dealii_manifold_lib_h
16#define dealii_manifold_lib_h
17
18
19#include <deal.II/base/config.h>
20
23
25
27
28// forward declaration
29namespace internal
30{
31 namespace MappingQImplementation
32 {
33 template <int, int>
34 class InverseQuadraticApproximation;
35 }
36} // namespace internal
37
38
82template <int dim, int spacedim = dim>
83class PolarManifold : public ChartManifold<dim, spacedim, spacedim>
84{
85public:
93
97 virtual std::unique_ptr<Manifold<dim, spacedim>>
98 clone() const override;
99
104 virtual Point<spacedim>
105 pull_back(const Point<spacedim> &space_point) const override;
106
111 virtual Point<spacedim>
112 push_forward(const Point<spacedim> &chart_point) const override;
113
127 push_forward_gradient(const Point<spacedim> &chart_point) const override;
128
132 virtual Tensor<1, spacedim>
135 const Point<spacedim> &p) const override;
136
141
142private:
149};
150
151
152
244template <int dim, int spacedim = dim>
245class SphericalManifold : public Manifold<dim, spacedim>
246{
247public:
255
259 virtual std::unique_ptr<Manifold<dim, spacedim>>
260 clone() const override;
261
269 virtual Point<spacedim>
271 const Point<spacedim> &p2,
272 const double w) const override;
273
278 virtual Tensor<1, spacedim>
280 const Point<spacedim> &x2) const override;
281
285 virtual Tensor<1, spacedim>
288 const Point<spacedim> &p) const override;
289
293 virtual void
296 typename Manifold<dim, spacedim>::FaceVertexNormals &face_vertex_normals)
297 const override;
298
313 virtual void
314 get_new_points(const ArrayView<const Point<spacedim>> &surrounding_points,
315 const Table<2, double> &weights,
316 ArrayView<Point<spacedim>> new_points) const override;
317
322 virtual Point<spacedim>
324 const ArrayView<const double> &weights) const override;
325
330
331private:
338 std::pair<double, Tensor<1, spacedim>>
339 guess_new_point(const ArrayView<const Tensor<1, spacedim>> &directions,
340 const ArrayView<const double> &distances,
341 const ArrayView<const double> &weights) const;
342
360 void
361 do_get_new_points(const ArrayView<const Point<spacedim>> &surrounding_points,
362 const ArrayView<const double> &weights,
363 ArrayView<Point<spacedim>> new_points) const;
364
369};
370
384template <int dim, int spacedim = dim>
385class CylindricalManifold : public ChartManifold<dim, spacedim, 3>
386{
387public:
394 CylindricalManifold(const unsigned int axis = 0,
395 const double tolerance = 1e-10);
396
406 const double tolerance = 1e-10);
407
411 virtual std::unique_ptr<Manifold<dim, spacedim>>
412 clone() const override;
413
420 virtual Point<3>
421 pull_back(const Point<spacedim> &space_point) const override;
422
429 virtual Point<spacedim>
430 push_forward(const Point<3> &chart_point) const override;
431
439 push_forward_gradient(const Point<3> &chart_point) const override;
440
445 virtual Point<spacedim>
446 get_new_point(const ArrayView<const Point<spacedim>> &surrounding_points,
447 const ArrayView<const double> &weights) const override;
448
449private:
454
459
464
468 const double tolerance;
469
474};
475
507template <int dim, int spacedim = dim>
508class EllipticalManifold : public ChartManifold<dim, spacedim, spacedim>
509{
510public:
523 const Tensor<1, spacedim> &major_axis_direction,
524 const double eccentricity);
525
526 virtual std::unique_ptr<Manifold<dim, spacedim>>
527 clone() const override;
528
532 virtual Point<spacedim>
533 pull_back(const Point<spacedim> &space_point) const override;
534
538 virtual Point<spacedim>
539 push_forward(const Point<spacedim> &chart_point) const override;
540
545 push_forward_gradient(const Point<spacedim> &chart_point) const override;
546
547
548private:
560 const double cosh_u;
561 const double sinh_u;
562
571};
572
573
588template <int dim, int spacedim = dim, int chartdim = dim>
589class FunctionManifold : public ChartManifold<dim, spacedim, chartdim>
590{
591public:
608 const Tensor<1, chartdim> &periodicity = Tensor<1, chartdim>(),
609 const double tolerance = 1e-10);
610
623 std::unique_ptr<Function<chartdim>> push_forward,
624 std::unique_ptr<Function<spacedim>> pull_back,
625 const Tensor<1, chartdim> &periodicity = Tensor<1, chartdim>(),
626 const double tolerance = 1e-10);
627
643 const std::string push_forward_expression,
644 const std::string pull_back_expression,
645 const Tensor<1, chartdim> &periodicity = Tensor<1, chartdim>(),
648 const std::string chart_vars =
650 const std::string space_vars =
652 const double tolerance = 1e-10,
653 const double h = 1e-8);
654
658 virtual ~FunctionManifold() override;
659
663 virtual std::unique_ptr<Manifold<dim, spacedim>>
664 clone() const override;
665
671 virtual Point<spacedim>
672 push_forward(const Point<chartdim> &chart_point) const override;
673
695 push_forward_gradient(const Point<chartdim> &chart_point) const override;
696
702 virtual Point<chartdim>
703 pull_back(const Point<spacedim> &space_point) const override;
704
705private:
710
717
724
730 const double tolerance;
731
740
744 const std::string push_forward_expression;
745
749 const std::string pull_back_expression;
750
754 const std::string chart_vars;
755
759 const std::string space_vars;
760
765};
766
767
768
781template <int dim>
782class TorusManifold : public ChartManifold<dim, 3, 3>
783{
784public:
785 static const int chartdim = 3;
786 static const int spacedim = 3;
787
793 TorusManifold(const double R, const double r);
794
798 virtual std::unique_ptr<Manifold<dim, 3>>
799 clone() const override;
800
804 virtual Point<3>
805 pull_back(const Point<3> &p) const override;
806
810 virtual Point<3>
811 push_forward(const Point<3> &chart_point) const override;
812
817 push_forward_gradient(const Point<3> &chart_point) const override;
818
819private:
820 double r, R;
821};
822
823
824
962template <int dim, int spacedim = dim>
963class TransfiniteInterpolationManifold : public Manifold<dim, spacedim>
964{
965public:
970
974 virtual ~TransfiniteInterpolationManifold() override;
975
979 virtual std::unique_ptr<Manifold<dim, spacedim>>
980 clone() const override;
981
994 void
996
1012 virtual Point<spacedim>
1013 get_new_point(const ArrayView<const Point<spacedim>> &surrounding_points,
1014 const ArrayView<const double> &weights) const override;
1015
1035 virtual void
1036 get_new_points(const ArrayView<const Point<spacedim>> &surrounding_points,
1037 const Table<2, double> &weights,
1038 ArrayView<Point<spacedim>> new_points) const override;
1039
1040private:
1052 std::array<unsigned int, 20>
1054 const ArrayView<const Point<spacedim>> &surrounding_points) const;
1055
1065 const ArrayView<const Point<spacedim>> &surrounding_points,
1066 ArrayView<Point<dim>> chart_points) const;
1067
1086 const Point<spacedim> &p,
1087 const Point<dim> &initial_guess) const;
1088
1102 const Point<dim> &chart_point) const;
1103
1118 const Point<dim> &chart_point,
1119 const Point<spacedim> &pushed_forward_chart_point) const;
1120
1125
1131
1137 std::vector<bool> coarse_cell_is_flat;
1138
1144
1149 std::vector<internal::MappingQImplementation::
1150 InverseQuadraticApproximation<dim, spacedim>>
1152
1157 boost::signals2::connection clear_signal;
1158};
1159
1161
1162#endif
virtual Point< spacedim > push_forward(const Point< 3 > &chart_point) const override
const Tensor< 1, spacedim > dxn
virtual DerivativeForm< 1, 3, spacedim > push_forward_gradient(const Point< 3 > &chart_point) const override
virtual Point< spacedim > get_new_point(const ArrayView< const Point< spacedim > > &surrounding_points, const ArrayView< const double > &weights) const override
virtual std::unique_ptr< Manifold< dim, spacedim > > clone() const override
const Tensor< 1, spacedim > normal_direction
const Point< spacedim > point_on_axis
const double tolerance
const Tensor< 1, spacedim > direction
virtual Point< 3 > pull_back(const Point< spacedim > &space_point) const override
Tensor< 1, spacedim > direction
virtual std::unique_ptr< Manifold< dim, spacedim > > clone() const override
const Point< spacedim > center
virtual Point< spacedim > push_forward(const Point< spacedim > &chart_point) const override
virtual DerivativeForm< 1, spacedim, spacedim > push_forward_gradient(const Point< spacedim > &chart_point) const override
virtual Point< spacedim > pull_back(const Point< spacedim > &space_point) const override
static Tensor< 1, spacedim > get_periodicity()
const double sinh_u
const double cosh_u
SmartPointer< const Function< spacedim >, FunctionManifold< dim, spacedim, chartdim > > pull_back_function
const double tolerance
const FunctionParser< spacedim >::ConstMap const_map
const std::string chart_vars
const std::string pull_back_expression
virtual DerivativeForm< 1, chartdim, spacedim > push_forward_gradient(const Point< chartdim > &chart_point) const override
SmartPointer< const Function< chartdim >, FunctionManifold< dim, spacedim, chartdim > > push_forward_function
const std::string space_vars
virtual Point< spacedim > push_forward(const Point< chartdim > &chart_point) const override
const double finite_difference_step
virtual std::unique_ptr< Manifold< dim, spacedim > > clone() const override
const std::string push_forward_expression
virtual Point< chartdim > pull_back(const Point< spacedim > &space_point) const override
virtual ~FunctionManifold() override
std::map< std::string, double > ConstMap
std::array< Tensor< 1, spacedim >, GeometryInfo< dim >::vertices_per_face > FaceVertexNormals
Definition manifold.h:306
Definition point.h:111
static Tensor< 1, spacedim > get_periodicity()
virtual std::unique_ptr< Manifold< dim, spacedim > > clone() const override
virtual DerivativeForm< 1, spacedim, spacedim > push_forward_gradient(const Point< spacedim > &chart_point) const override
const Point< spacedim > center
virtual Tensor< 1, spacedim > normal_vector(const typename Triangulation< dim, spacedim >::face_iterator &face, const Point< spacedim > &p) const override
virtual Point< spacedim > push_forward(const Point< spacedim > &chart_point) const override
virtual Point< spacedim > pull_back(const Point< spacedim > &space_point) const override
virtual Point< spacedim > get_new_point(const ArrayView< const Point< spacedim > > &vertices, const ArrayView< const double > &weights) const override
virtual std::unique_ptr< Manifold< dim, spacedim > > clone() const override
const Point< spacedim > center
virtual Point< spacedim > get_intermediate_point(const Point< spacedim > &p1, const Point< spacedim > &p2, const double w) const override
const PolarManifold< spacedim > polar_manifold
virtual void get_normals_at_vertices(const typename Triangulation< dim, spacedim >::face_iterator &face, typename Manifold< dim, spacedim >::FaceVertexNormals &face_vertex_normals) const override
std::pair< double, Tensor< 1, spacedim > > guess_new_point(const ArrayView< const Tensor< 1, spacedim > > &directions, const ArrayView< const double > &distances, const ArrayView< const double > &weights) const
virtual void get_new_points(const ArrayView< const Point< spacedim > > &surrounding_points, const Table< 2, double > &weights, ArrayView< Point< spacedim > > new_points) const override
virtual Tensor< 1, spacedim > get_tangent_vector(const Point< spacedim > &x1, const Point< spacedim > &x2) const override
virtual Tensor< 1, spacedim > normal_vector(const typename Triangulation< dim, spacedim >::face_iterator &face, const Point< spacedim > &p) const override
void do_get_new_points(const ArrayView< const Point< spacedim > > &surrounding_points, const ArrayView< const double > &weights, ArrayView< Point< spacedim > > new_points) const
virtual Point< 3 > pull_back(const Point< 3 > &p) const override
static const int spacedim
virtual DerivativeForm< 1, 3, 3 > push_forward_gradient(const Point< 3 > &chart_point) const override
virtual Point< 3 > push_forward(const Point< 3 > &chart_point) const override
static const int chartdim
virtual std::unique_ptr< Manifold< dim, 3 > > clone() const override
const Triangulation< dim, spacedim > * triangulation
boost::signals2::connection clear_signal
DerivativeForm< 1, dim, spacedim > push_forward_gradient(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< dim > &chart_point, const Point< spacedim > &pushed_forward_chart_point) const
std::vector< internal::MappingQImplementation::InverseQuadraticApproximation< dim, spacedim > > quadratic_approximation
void initialize(const Triangulation< dim, spacedim > &triangulation)
Triangulation< dim, spacedim >::cell_iterator compute_chart_points(const ArrayView< const Point< spacedim > > &surrounding_points, ArrayView< Point< dim > > chart_points) const
virtual ~TransfiniteInterpolationManifold() override
std::array< unsigned int, 20 > get_possible_cells_around_points(const ArrayView< const Point< spacedim > > &surrounding_points) const
FlatManifold< dim > chart_manifold
Point< dim > pull_back(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< spacedim > &p, const Point< dim > &initial_guess) const
virtual void get_new_points(const ArrayView< const Point< spacedim > > &surrounding_points, const Table< 2, double > &weights, ArrayView< Point< spacedim > > new_points) const override
virtual Point< spacedim > get_new_point(const ArrayView< const Point< spacedim > > &surrounding_points, const ArrayView< const double > &weights) const override
std::vector< bool > coarse_cell_is_flat
Point< spacedim > push_forward(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< dim > &chart_point) const
virtual std::unique_ptr< Manifold< dim, spacedim > > clone() const override
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:502
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:503
Point< 3 > vertices[4]
TriaIterator< TriaAccessor< dim - 1, dim, spacedim > > face_iterator
Definition tria.h:1609