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
mapping.h
Go to the documentation of this file.
1// ---------------------------------------------------------------------
2//
3// Copyright (C) 2000 - 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_mapping_h
17#define dealii_mapping_h
18
19
20#include <deal.II/base/config.h>
21
24
27
28#include <deal.II/grid/tria.h>
29
31
33
34#include <array>
35#include <cmath>
36#include <memory>
37
39
40template <typename ElementType, typename MemorySpaceType>
41class ArrayView;
42template <int dim>
43class Quadrature;
44template <int dim, int spacedim>
45class FEValues;
46template <int dim, int spacedim>
47class FEValuesBase;
48template <int dim, int spacedim>
49class FEValues;
50template <int dim, int spacedim>
51class FEFaceValues;
52template <int dim, int spacedim>
53class FESubfaceValues;
54namespace NonMatching
55{
56 template <int dim>
58 namespace internal
59 {
60 template <int dim, int spacedim>
62 }
63} // namespace NonMatching
64
65
78{
83 mapping_none = 0x0000,
84
89
94
100
106
114
120
129
134
139
150
156
163
164
315template <int dim, int spacedim = dim>
316class Mapping : public Subscriptor
317{
318public:
322 virtual ~Mapping() override = default;
323
333 virtual std::unique_ptr<Mapping<dim, spacedim>>
334 clone() const = 0;
335
350 virtual boost::container::small_vector<Point<spacedim>,
353 const typename Triangulation<dim, spacedim>::cell_iterator &cell) const;
354
363 boost::container::small_vector<Point<spacedim>,
366 const unsigned int face_no) const;
367
391 virtual Point<spacedim>
393 const bool map_barycenter_of_reference_cell = true) const;
394
414 const typename Triangulation<dim, spacedim>::cell_iterator &cell) const;
415
427 virtual bool
429
434 virtual bool
435 is_compatible_with(const ReferenceCell &reference_cell) const = 0;
436
453 virtual Point<spacedim>
456 const Point<dim> & p) const = 0;
457
486 virtual Point<dim>
489 const Point<spacedim> & p) const = 0;
490
502 virtual void
505 const ArrayView<const Point<spacedim>> & real_points,
506 const ArrayView<Point<dim>> &unit_points) const;
507
518 Point<dim - 1>
521 const unsigned int face_no,
522 const Point<spacedim> & p) const;
523
538
539
549 "Computing the mapping between a real space point and a point in reference "
550 "space failed, typically because the given point lies outside the cell "
551 "where the inverse mapping is not unique.");
552
562 double,
563 int,
564 << "The image of the mapping applied to cell with center ["
565 << arg1 << "] is distorted. The cell geometry or the "
566 << "mapping are invalid, giving a non-positive volume "
567 << "fraction of " << arg2 << " in quadrature point " << arg3
568 << '.');
569
579public:
646 {
647 public:
653
658
662 virtual ~InternalDataBase() = default;
663
679
683 virtual std::size_t
685 };
686
687
688protected:
712 virtual UpdateFlags
713 requires_update_flags(const UpdateFlags update_flags) const = 0;
714
763 virtual std::unique_ptr<InternalDataBase>
764 get_data(const UpdateFlags update_flags,
765 const Quadrature<dim> &quadrature) const = 0;
766
794 virtual std::unique_ptr<InternalDataBase>
795 get_face_data(const UpdateFlags update_flags,
796 const hp::QCollection<dim - 1> &quadrature) const;
797
801 virtual std::unique_ptr<InternalDataBase>
802 get_face_data(const UpdateFlags update_flags,
803 const Quadrature<dim - 1> &quadrature) const;
804
833 virtual std::unique_ptr<InternalDataBase>
834 get_subface_data(const UpdateFlags update_flags,
835 const Quadrature<dim - 1> &quadrature) const = 0;
836
923 const CellSimilarity::Similarity cell_similarity,
924 const Quadrature<dim> & quadrature,
925 const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
927 &output_data) const = 0;
928
953 virtual void
956 const unsigned int face_no,
957 const hp::QCollection<dim - 1> & quadrature,
958 const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
960 &output_data) const;
961
965 virtual void
968 const unsigned int face_no,
969 const Quadrature<dim - 1> & quadrature,
970 const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
972 &output_data) const;
973
1000 virtual void
1003 const unsigned int face_no,
1004 const unsigned int subface_no,
1005 const Quadrature<dim - 1> & quadrature,
1006 const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
1008 &output_data) const = 0;
1009
1016 virtual void
1020 const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
1022 &output_data) const;
1023
1028public:
1097 virtual void
1098 transform(const ArrayView<const Tensor<1, dim>> & input,
1099 const MappingKind kind,
1101 const ArrayView<Tensor<1, spacedim>> &output) const = 0;
1102
1150 virtual void
1152 const MappingKind kind,
1154 const ArrayView<Tensor<2, spacedim>> &output) const = 0;
1155
1208 virtual void
1209 transform(const ArrayView<const Tensor<2, dim>> & input,
1210 const MappingKind kind,
1212 const ArrayView<Tensor<2, spacedim>> &output) const = 0;
1213
1255 virtual void
1257 const MappingKind kind,
1259 const ArrayView<Tensor<3, spacedim>> &output) const = 0;
1260
1308 virtual void
1309 transform(const ArrayView<const Tensor<3, dim>> & input,
1310 const MappingKind kind,
1312 const ArrayView<Tensor<3, spacedim>> &output) const = 0;
1313
1319 // Give class @p FEValues access to the private <tt>get_...data</tt> and
1320 // <tt>fill_fe_...values</tt> functions.
1321 friend class FEValuesBase<dim, spacedim>;
1322 friend class FEValues<dim, spacedim>;
1323 friend class FEFaceValues<dim, spacedim>;
1324 friend class FESubfaceValues<dim, spacedim>;
1325 friend class NonMatching::FEImmersedSurfaceValues<dim>;
1326 friend class NonMatching::internal::ComputeMappingDataHelper<dim, spacedim>;
1327};
1328
1329
1337template <int dim, int spacedim>
1340
1341
1343
1344#endif
UpdateFlags update_each
Definition mapping.h:678
InternalDataBase(const InternalDataBase &)=delete
virtual ~InternalDataBase()=default
virtual std::size_t memory_consumption() const
Abstract base class for mapping classes.
Definition mapping.h:317
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:112
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:472
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:473
#define DeclException0(Exception0)
Definition exceptions.h:465
static ::ExceptionBase & ExcDistortedMappedCell(Point< spacedim > arg1, double arg2, int arg3)
static ::ExceptionBase & ExcTransformationFailed()
#define DeclExceptionMsg(Exception, defaulttext)
Definition exceptions.h:488
static ::ExceptionBase & ExcInvalidData()
#define DeclException3(Exception3, type1, type2, type3, outsequence)
Definition exceptions.h:556
UpdateFlags
MappingKind
Definition mapping.h:78
@ mapping_piola
Definition mapping.h:113
@ mapping_covariant_gradient
Definition mapping.h:99
@ mapping_covariant
Definition mapping.h:88
@ mapping_nedelec
Definition mapping.h:128
@ mapping_contravariant
Definition mapping.h:93
@ mapping_raviart_thomas
Definition mapping.h:133
@ mapping_contravariant_hessian
Definition mapping.h:155
@ mapping_covariant_hessian
Definition mapping.h:149
@ mapping_contravariant_gradient
Definition mapping.h:105
@ mapping_none
Definition mapping.h:83
@ mapping_bdm
Definition mapping.h:138
@ mapping_piola_gradient
Definition mapping.h:119
@ mapping_piola_hessian
Definition mapping.h:161
const Mapping< dim, spacedim > & get_default_linear_mapping(const Triangulation< dim, spacedim > &triangulation)
Definition mapping.cc:285
const ::parallel::distributed::Triangulation< dim, spacedim > * triangulation