Reference documentation for deal.II version GIT relicensing-43-g3fc2fae7c3 2024-03-03 21:10: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\}}\)
Loading...
Searching...
No Matches
mapping.h
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 2001 - 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_mapping_h
16#define dealii_mapping_h
17
18
19#include <deal.II/base/config.h>
20
23
26
27#include <deal.II/grid/tria.h>
28
30
32
33#include <array>
34#include <cmath>
35#include <memory>
36
38
39template <typename ElementType, typename MemorySpaceType>
40class ArrayView;
41template <int dim>
42class Quadrature;
43template <int dim, int spacedim>
44class FEValues;
45template <int dim, int spacedim>
46class FEValuesBase;
47template <int dim, int spacedim>
48class FEValues;
49template <int dim, int spacedim>
50class FEFaceValues;
51template <int dim, int spacedim>
52class FESubfaceValues;
53namespace NonMatching
54{
55 template <int dim>
57 namespace internal
58 {
59 template <int dim, int spacedim>
61 }
62} // namespace NonMatching
63
64
162
163
314template <int dim, int spacedim = dim>
315class Mapping : public Subscriptor
316{
317public:
321 virtual ~Mapping() override = default;
322
332 virtual std::unique_ptr<Mapping<dim, spacedim>>
333 clone() const = 0;
334
349 virtual boost::container::small_vector<Point<spacedim>,
352 const typename Triangulation<dim, spacedim>::cell_iterator &cell) const;
353
362 boost::container::small_vector<Point<spacedim>,
365 const unsigned int face_no) const;
366
390 virtual Point<spacedim>
392 const bool map_barycenter_of_reference_cell = true) const;
393
413 const typename Triangulation<dim, spacedim>::cell_iterator &cell) const;
414
426 virtual bool
428
433 virtual bool
434 is_compatible_with(const ReferenceCell &reference_cell) const = 0;
435
452 virtual Point<spacedim>
455 const Point<dim> &p) const = 0;
456
485 virtual Point<dim>
488 const Point<spacedim> &p) const = 0;
489
501 virtual void
504 const ArrayView<const Point<spacedim>> &real_points,
505 const ArrayView<Point<dim>> &unit_points) const;
506
517 Point<dim - 1>
520 const unsigned int face_no,
521 const Point<spacedim> &p) const;
522
537
538
548 "Computing the mapping between a real space point and a point in reference "
549 "space failed, typically because the given point lies outside the cell "
550 "where the inverse mapping is not unique.");
551
561 double,
562 int,
563 << "The image of the mapping applied to cell with center ["
564 << arg1 << "] is distorted. The cell geometry or the "
565 << "mapping are invalid, giving a non-positive volume "
566 << "fraction of " << arg2 << " in quadrature point " << arg3
567 << '.');
568
578public:
645 {
646 public:
652
657
661 virtual ~InternalDataBase() = default;
662
678
682 virtual std::size_t
684 };
685
686
687protected:
711 virtual UpdateFlags
712 requires_update_flags(const UpdateFlags update_flags) const = 0;
713
762 virtual std::unique_ptr<InternalDataBase>
763 get_data(const UpdateFlags update_flags,
764 const Quadrature<dim> &quadrature) const = 0;
765
793 virtual std::unique_ptr<InternalDataBase>
794 get_face_data(const UpdateFlags update_flags,
795 const hp::QCollection<dim - 1> &quadrature) const;
796
800 virtual std::unique_ptr<InternalDataBase>
801 get_face_data(const UpdateFlags update_flags,
802 const Quadrature<dim - 1> &quadrature) const;
803
832 virtual std::unique_ptr<InternalDataBase>
833 get_subface_data(const UpdateFlags update_flags,
834 const Quadrature<dim - 1> &quadrature) const = 0;
835
922 const CellSimilarity::Similarity cell_similarity,
923 const Quadrature<dim> &quadrature,
924 const typename Mapping<dim, spacedim>::InternalDataBase &internal_data,
926 &output_data) const = 0;
927
952 virtual void
955 const unsigned int face_no,
956 const hp::QCollection<dim - 1> &quadrature,
957 const typename Mapping<dim, spacedim>::InternalDataBase &internal_data,
959 &output_data) const;
960
964 virtual void
967 const unsigned int face_no,
968 const Quadrature<dim - 1> &quadrature,
969 const typename Mapping<dim, spacedim>::InternalDataBase &internal_data,
971 &output_data) const;
972
999 virtual void
1002 const unsigned int face_no,
1003 const unsigned int subface_no,
1004 const Quadrature<dim - 1> &quadrature,
1005 const typename Mapping<dim, spacedim>::InternalDataBase &internal_data,
1007 &output_data) const = 0;
1008
1015 virtual void
1019 const typename Mapping<dim, spacedim>::InternalDataBase &internal_data,
1021 &output_data) const;
1022
1027public:
1096 virtual void
1098 const MappingKind kind,
1100 const ArrayView<Tensor<1, spacedim>> &output) const = 0;
1101
1149 virtual void
1151 const MappingKind kind,
1153 const ArrayView<Tensor<2, spacedim>> &output) const = 0;
1154
1207 virtual void
1209 const MappingKind kind,
1211 const ArrayView<Tensor<2, spacedim>> &output) const = 0;
1212
1254 virtual void
1256 const MappingKind kind,
1258 const ArrayView<Tensor<3, spacedim>> &output) const = 0;
1259
1307 virtual void
1309 const MappingKind kind,
1311 const ArrayView<Tensor<3, spacedim>> &output) const = 0;
1312
1318 // Give class @p FEValues access to the private <tt>get_...data</tt> and
1319 // <tt>fill_fe_...values</tt> functions.
1320 friend class FEValuesBase<dim, spacedim>;
1321 friend class FEValues<dim, spacedim>;
1322 friend class FEFaceValues<dim, spacedim>;
1323 friend class FESubfaceValues<dim, spacedim>;
1324 friend class NonMatching::FEImmersedSurfaceValues<dim>;
1325 friend class NonMatching::internal::ComputeMappingDataHelper<dim, spacedim>;
1326};
1327
1328
1336template <int dim, int spacedim>
1339
1340
1342
1343#endif
UpdateFlags update_each
Definition mapping.h:677
InternalDataBase(const InternalDataBase &)=delete
virtual ~InternalDataBase()=default
virtual std::size_t memory_consumption() const
Abstract base class for mapping classes.
Definition mapping.h:316
virtual ~Mapping() override=default
Point< dim - 1 > project_real_point_to_unit_point_on_face(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no, const Point< spacedim > &p) const
virtual bool is_compatible_with(const ReferenceCell &reference_cell) const =0
virtual void transform(const ArrayView< const Tensor< 1, dim > > &input, const MappingKind kind, const typename Mapping< dim, spacedim >::InternalDataBase &internal, const ArrayView< Tensor< 1, spacedim > > &output) const =0
virtual void fill_fe_subface_values(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no, const unsigned int subface_no, const Quadrature< dim - 1 > &quadrature, const typename Mapping< dim, spacedim >::InternalDataBase &internal_data, internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &output_data) const =0
virtual std::unique_ptr< InternalDataBase > get_data(const UpdateFlags update_flags, const Quadrature< dim > &quadrature) const =0
virtual UpdateFlags requires_update_flags(const UpdateFlags update_flags) const =0
virtual BoundingBox< spacedim > get_bounding_box(const typename Triangulation< dim, spacedim >::cell_iterator &cell) const
virtual void fill_fe_immersed_surface_values(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const NonMatching::ImmersedSurfaceQuadrature< dim > &quadrature, const typename Mapping< dim, spacedim >::InternalDataBase &internal_data, internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &output_data) const
virtual void fill_fe_face_values(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no, const hp::QCollection< dim - 1 > &quadrature, const typename Mapping< dim, spacedim >::InternalDataBase &internal_data, internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &output_data) const
virtual std::unique_ptr< Mapping< dim, spacedim > > clone() const =0
virtual Point< spacedim > transform_unit_to_real_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< dim > &p) const =0
virtual void transform_points_real_to_unit_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const ArrayView< const Point< spacedim > > &real_points, const ArrayView< Point< dim > > &unit_points) const
virtual Point< dim > transform_real_to_unit_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< spacedim > &p) const =0
virtual void transform(const ArrayView< const DerivativeForm< 1, dim, spacedim > > &input, const MappingKind kind, const typename Mapping< dim, spacedim >::InternalDataBase &internal, const ArrayView< Tensor< 2, spacedim > > &output) const =0
virtual void transform(const ArrayView< const DerivativeForm< 2, dim, spacedim > > &input, const MappingKind kind, const typename Mapping< dim, spacedim >::InternalDataBase &internal, const ArrayView< Tensor< 3, spacedim > > &output) const =0
virtual void fill_fe_face_values(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no, const Quadrature< dim - 1 > &quadrature, const typename Mapping< dim, spacedim >::InternalDataBase &internal_data, internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &output_data) const
virtual std::unique_ptr< InternalDataBase > get_face_data(const UpdateFlags update_flags, const Quadrature< dim - 1 > &quadrature) const
virtual bool preserves_vertex_locations() const =0
boost::container::small_vector< Point< spacedim >, GeometryInfo< dim >::vertices_per_face > get_vertices(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no) const
virtual CellSimilarity::Similarity fill_fe_values(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const CellSimilarity::Similarity cell_similarity, const Quadrature< dim > &quadrature, const typename Mapping< dim, spacedim >::InternalDataBase &internal_data, internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &output_data) const =0
virtual void transform(const ArrayView< const Tensor< 2, dim > > &input, const MappingKind kind, const typename Mapping< dim, spacedim >::InternalDataBase &internal, const ArrayView< Tensor< 2, spacedim > > &output) const =0
virtual boost::container::small_vector< Point< spacedim >, GeometryInfo< dim >::vertices_per_cell > get_vertices(const typename Triangulation< dim, spacedim >::cell_iterator &cell) const
virtual Point< spacedim > get_center(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const bool map_barycenter_of_reference_cell=true) const
virtual std::unique_ptr< InternalDataBase > get_face_data(const UpdateFlags update_flags, const hp::QCollection< dim - 1 > &quadrature) const
virtual std::unique_ptr< InternalDataBase > get_subface_data(const UpdateFlags update_flags, const Quadrature< dim - 1 > &quadrature) const =0
Definition point.h:111
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:502
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:503
#define DeclException0(Exception0)
Definition exceptions.h:471
static ::ExceptionBase & ExcDistortedMappedCell(Point< spacedim > arg1, double arg2, int arg3)
static ::ExceptionBase & ExcTransformationFailed()
#define DeclExceptionMsg(Exception, defaulttext)
Definition exceptions.h:494
static ::ExceptionBase & ExcInvalidData()
#define DeclException3(Exception3, type1, type2, type3, outsequence)
Definition exceptions.h:562
UpdateFlags
MappingKind
Definition mapping.h:77
@ mapping_piola
Definition mapping.h:112
@ mapping_covariant_gradient
Definition mapping.h:98
@ mapping_covariant
Definition mapping.h:87
@ mapping_nedelec
Definition mapping.h:127
@ mapping_contravariant
Definition mapping.h:92
@ mapping_raviart_thomas
Definition mapping.h:132
@ mapping_contravariant_hessian
Definition mapping.h:154
@ mapping_covariant_hessian
Definition mapping.h:148
@ mapping_contravariant_gradient
Definition mapping.h:104
@ mapping_none
Definition mapping.h:82
@ mapping_bdm
Definition mapping.h:137
@ mapping_piola_gradient
Definition mapping.h:118
@ mapping_piola_hessian
Definition mapping.h:160
const Mapping< dim, spacedim > & get_default_linear_mapping(const Triangulation< dim, spacedim > &triangulation)
Definition mapping.cc:284
const ::parallel::distributed::Triangulation< dim, spacedim > * triangulation