Reference documentation for deal.II version 9.3.3
\(\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\}}\)
manifold_lib.h
Go to the documentation of this file.
1// ---------------------------------------------------------------------
2//
3// Copyright (C) 1999 - 2020 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_manifold_lib_h
17#define dealii_manifold_lib_h
18
19
20#include <deal.II/base/config.h>
21
24
26
28
29// forward declaration
30namespace internal
31{
32 namespace MappingQGenericImplementation
33 {
34 template <int, int>
35 class InverseQuadraticApproximation;
36 }
37} // namespace internal
38
39
69template <int dim, int spacedim = dim>
70class PolarManifold : public ChartManifold<dim, spacedim, spacedim>
71{
72public:
82
86 virtual std::unique_ptr<Manifold<dim, spacedim>>
87 clone() const override;
88
94 virtual Point<spacedim>
95 pull_back(const Point<spacedim> &space_point) const override;
96
102 virtual Point<spacedim>
103 push_forward(const Point<spacedim> &chart_point) const override;
104
118 push_forward_gradient(const Point<spacedim> &chart_point) const override;
119
123 virtual Tensor<1, spacedim>
126 const Point<spacedim> &p) const override;
127
132
133private:
140};
141
142
143
235template <int dim, int spacedim = dim>
236class SphericalManifold : public Manifold<dim, spacedim>
237{
238public:
243
247 virtual std::unique_ptr<Manifold<dim, spacedim>>
248 clone() const override;
249
257 virtual Point<spacedim>
259 const Point<spacedim> &p2,
260 const double w) const override;
261
266 virtual Tensor<1, spacedim>
268 const Point<spacedim> &x2) const override;
269
273 virtual Tensor<1, spacedim>
276 const Point<spacedim> &p) const override;
277
281 virtual void
284 typename Manifold<dim, spacedim>::FaceVertexNormals &face_vertex_normals)
285 const override;
286
301 virtual void
302 get_new_points(const ArrayView<const Point<spacedim>> &surrounding_points,
303 const Table<2, double> & weights,
304 ArrayView<Point<spacedim>> new_points) const override;
305
310 virtual Point<spacedim>
312 const ArrayView<const double> & weights) const override;
313
318
319private:
326 std::pair<double, Tensor<1, spacedim>>
327 guess_new_point(const ArrayView<const Tensor<1, spacedim>> &directions,
328 const ArrayView<const double> & distances,
329 const ArrayView<const double> & weights) const;
330
347 get_new_point(const ArrayView<const Tensor<1, spacedim>> &directions,
348 const ArrayView<const double> & distances,
349 const ArrayView<const double> & weights,
350 const Point<spacedim> &candidate_point) const;
351
365 virtual void
366 get_new_points(const ArrayView<const Point<spacedim>> &surrounding_points,
367 const ArrayView<const double> & weights,
368 ArrayView<Point<spacedim>> new_points) const;
369
374};
375
389template <int dim, int spacedim = dim>
390class CylindricalManifold : public ChartManifold<dim, spacedim, 3>
391{
392public:
399 CylindricalManifold(const unsigned int axis = 0,
400 const double tolerance = 1e-10);
401
411 const double tolerance = 1e-10);
412
416 virtual std::unique_ptr<Manifold<dim, spacedim>>
417 clone() const override;
418
425 virtual Point<3>
426 pull_back(const Point<spacedim> &space_point) const override;
427
434 virtual Point<spacedim>
435 push_forward(const Point<3> &chart_point) const override;
436
444 push_forward_gradient(const Point<3> &chart_point) const override;
445
450 virtual Point<spacedim>
451 get_new_point(const ArrayView<const Point<spacedim>> &surrounding_points,
452 const ArrayView<const double> & weights) const override;
453
454protected:
459
464
469
470private:
474 double tolerance;
475};
476
508template <int dim, int spacedim = dim>
509class EllipticalManifold : public ChartManifold<dim, spacedim, spacedim>
510{
511public:
524 const Tensor<1, spacedim> &major_axis_direction,
525 const double eccentricity);
526
527 virtual std::unique_ptr<Manifold<dim, spacedim>>
528 clone() const override;
529
533 virtual Point<spacedim>
534 pull_back(const Point<spacedim> &space_point) const override;
535
539 virtual Point<spacedim>
540 push_forward(const Point<spacedim> &chart_point) const override;
541
546 push_forward_gradient(const Point<spacedim> &chart_point) const override;
547
548
549protected:
561 const double cosh_u;
562 const double sinh_u;
563
564private:
573};
574
575
590template <int dim, int spacedim = dim, int chartdim = dim>
591class FunctionManifold : public ChartManifold<dim, spacedim, chartdim>
592{
593public:
610 const Tensor<1, chartdim> &periodicity = Tensor<1, chartdim>(),
611 const double tolerance = 1e-10);
612
625 std::unique_ptr<Function<chartdim>> push_forward,
626 std::unique_ptr<Function<spacedim>> pull_back,
627 const Tensor<1, chartdim> & periodicity = Tensor<1, chartdim>(),
628 const double tolerance = 1e-10);
629
645 const std::string push_forward_expression,
646 const std::string pull_back_expression,
647 const Tensor<1, chartdim> &periodicity = Tensor<1, chartdim>(),
650 const std::string chart_vars =
652 const std::string space_vars =
654 const double tolerance = 1e-10,
655 const double h = 1e-8);
656
660 virtual ~FunctionManifold() override;
661
665 virtual std::unique_ptr<Manifold<dim, spacedim>>
666 clone() const override;
667
673 virtual Point<spacedim>
674 push_forward(const Point<chartdim> &chart_point) const override;
675
697 push_forward_gradient(const Point<chartdim> &chart_point) const override;
698
704 virtual Point<chartdim>
705 pull_back(const Point<spacedim> &space_point) const override;
706
707private:
712
719
726
732 const double tolerance;
733
742
746 const std::string push_forward_expression;
747
751 const std::string pull_back_expression;
752
756 const std::string chart_vars;
757
761 const std::string space_vars;
762
767};
768
769
770
783template <int dim>
784class TorusManifold : public ChartManifold<dim, 3, 3>
785{
786public:
787 static const int chartdim = 3;
788 static const int spacedim = 3;
789
795 TorusManifold(const double R, const double r);
796
800 virtual std::unique_ptr<Manifold<dim, 3>>
801 clone() const override;
802
806 virtual Point<3>
807 pull_back(const Point<3> &p) const override;
808
812 virtual Point<3>
813 push_forward(const Point<3> &chart_point) const override;
814
819 push_forward_gradient(const Point<3> &chart_point) const override;
820
821private:
822 double r, R;
823};
824
825
826
964template <int dim, int spacedim = dim>
965class TransfiniteInterpolationManifold : public Manifold<dim, spacedim>
966{
967public:
972
976 virtual ~TransfiniteInterpolationManifold() override;
977
981 virtual std::unique_ptr<Manifold<dim, spacedim>>
982 clone() const override;
983
996 void
998
1014 virtual Point<spacedim>
1015 get_new_point(const ArrayView<const Point<spacedim>> &surrounding_points,
1016 const ArrayView<const double> & weights) const override;
1017
1037 virtual void
1038 get_new_points(const ArrayView<const Point<spacedim>> &surrounding_points,
1039 const Table<2, double> & weights,
1040 ArrayView<Point<spacedim>> new_points) const override;
1041
1042private:
1054 std::array<unsigned int, 20>
1056 const ArrayView<const Point<spacedim>> &surrounding_points) const;
1057
1067 const ArrayView<const Point<spacedim>> &surrounding_points,
1068 ArrayView<Point<dim>> chart_points) const;
1069
1088 const Point<spacedim> & p,
1089 const Point<dim> &initial_guess) const;
1090
1104 const Point<dim> &chart_point) const;
1105
1120 const Point<dim> & chart_point,
1121 const Point<spacedim> &pushed_forward_chart_point) const;
1122
1127
1133
1139 std::vector<bool> coarse_cell_is_flat;
1140
1146
1151 std::vector<internal::MappingQGenericImplementation::
1152 InverseQuadraticApproximation<dim, spacedim>>
1154
1159 boost::signals2::connection clear_signal;
1160};
1161
1163
1164#endif
virtual Point< spacedim > push_forward(const Point< 3 > &chart_point) const override
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
Definition: manifold_lib.h:458
CylindricalManifold(const unsigned int axis=0, const double tolerance=1e-10)
const Point< spacedim > point_on_axis
Definition: manifold_lib.h:468
const Tensor< 1, spacedim > direction
Definition: manifold_lib.h:463
virtual Point< 3 > pull_back(const Point< spacedim > &space_point) const override
Tensor< 1, spacedim > direction
Definition: manifold_lib.h:553
virtual std::unique_ptr< Manifold< dim, spacedim > > clone() const override
const Point< spacedim > center
Definition: manifold_lib.h:557
virtual Point< spacedim > push_forward(const Point< spacedim > &chart_point) const override
EllipticalManifold(const Point< spacedim > &center, const Tensor< 1, spacedim > &major_axis_direction, const double eccentricity)
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
Definition: manifold_lib.h:562
const double cosh_u
Definition: manifold_lib.h:561
SmartPointer< const Function< spacedim >, FunctionManifold< dim, spacedim, chartdim > > pull_back_function
Definition: manifold_lib.h:725
const double tolerance
Definition: manifold_lib.h:732
const FunctionParser< spacedim >::ConstMap const_map
Definition: manifold_lib.h:711
const std::string chart_vars
Definition: manifold_lib.h:756
const std::string pull_back_expression
Definition: manifold_lib.h:751
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
Definition: manifold_lib.h:718
const std::string space_vars
Definition: manifold_lib.h:761
virtual Point< spacedim > push_forward(const Point< chartdim > &chart_point) const override
const double finite_difference_step
Definition: manifold_lib.h:766
FunctionManifold(const Function< chartdim > &push_forward_function, const Function< spacedim > &pull_back_function, const Tensor< 1, chartdim > &periodicity=Tensor< 1, chartdim >(), const double tolerance=1e-10)
virtual std::unique_ptr< Manifold< dim, spacedim > > clone() const override
const std::string push_forward_expression
Definition: manifold_lib.h:746
virtual Point< chartdim > pull_back(const Point< spacedim > &space_point) const override
virtual ~FunctionManifold() override
std::map< std::string, double > ConstMap
PolarManifold(const Point< spacedim > center=Point< spacedim >())
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
Definition: manifold_lib.h:131
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
Definition: manifold_lib.h:317
virtual Point< spacedim > get_intermediate_point(const Point< spacedim > &p1, const Point< spacedim > &p2, const double w) const override
const PolarManifold< spacedim > polar_manifold
Definition: manifold_lib.h:373
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
SphericalManifold(const Point< spacedim > center=Point< spacedim >())
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
virtual Point< 3 > pull_back(const Point< 3 > &p) const override
static const int spacedim
Definition: manifold_lib.h:788
TorusManifold(const double R, const double r)
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
Definition: manifold_lib.h:787
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
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
std::vector< internal::MappingQGenericImplementation::InverseQuadraticApproximation< dim, spacedim > > quadratic_approximation
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:402
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:403
Point< 3 > vertices[4]
Tensor< 2, dim, Number > w(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)