deal.II version GIT relicensing-2289-g1e5549a87a 2024-12-21 21:30:00+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 - 2024 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 template <int dim, int spacedim, typename Number>
63 class MappingInfo;
64} // namespace NonMatching
65
66
164
165
316template <int dim, int spacedim = dim>
318{
319public:
323 virtual ~Mapping() override = default;
324
334 virtual std::unique_ptr<Mapping<dim, spacedim>>
335 clone() const = 0;
336
351 virtual boost::container::small_vector<Point<spacedim>,
354 const typename Triangulation<dim, spacedim>::cell_iterator &cell) const;
355
364 boost::container::small_vector<Point<spacedim>,
367 const unsigned int face_no) const;
368
392 virtual Point<spacedim>
394 const bool map_barycenter_of_reference_cell = true) const;
395
415 const typename Triangulation<dim, spacedim>::cell_iterator &cell) const;
416
428 virtual bool
430
435 virtual bool
436 is_compatible_with(const ReferenceCell &reference_cell) const = 0;
437
454 virtual Point<spacedim>
457 const Point<dim> &p) const = 0;
458
487 virtual Point<dim>
490 const Point<spacedim> &p) const = 0;
491
504 virtual void
507 const ArrayView<const Point<spacedim>> &real_points,
508 const ArrayView<Point<dim>> &unit_points) const;
509
520 Point<dim - 1>
523 const unsigned int face_no,
524 const Point<spacedim> &p) const;
525
540
541
551 "Computing the mapping between a real space point and a point in reference "
552 "space failed, typically because the given point lies outside the cell "
553 "where the inverse mapping is not unique.");
554
564 double,
565 int,
566 << "The image of the mapping applied to cell with center ["
567 << arg1 << "] is distorted. The cell geometry or the "
568 << "mapping are invalid, giving a non-positive volume "
569 << "fraction of " << arg2 << " in quadrature point " << arg3
570 << '.');
571
581public:
648 {
649 public:
655
660
670 virtual void
671 reinit(const UpdateFlags update_flags, const Quadrature<dim> &quadrature);
672
676 virtual ~InternalDataBase() = default;
677
693
697 virtual std::size_t
699 };
700
701protected:
725 virtual UpdateFlags
726 requires_update_flags(const UpdateFlags update_flags) const = 0;
727
776 virtual std::unique_ptr<InternalDataBase>
777 get_data(const UpdateFlags update_flags,
778 const Quadrature<dim> &quadrature) const = 0;
779
807 virtual std::unique_ptr<InternalDataBase>
808 get_face_data(const UpdateFlags update_flags,
809 const hp::QCollection<dim - 1> &quadrature) const;
810
814 virtual std::unique_ptr<InternalDataBase>
815 get_face_data(const UpdateFlags update_flags,
816 const Quadrature<dim - 1> &quadrature) const;
817
846 virtual std::unique_ptr<InternalDataBase>
847 get_subface_data(const UpdateFlags update_flags,
848 const Quadrature<dim - 1> &quadrature) const = 0;
849
936 const CellSimilarity::Similarity cell_similarity,
937 const Quadrature<dim> &quadrature,
938 const typename Mapping<dim, spacedim>::InternalDataBase &internal_data,
940 &output_data) const = 0;
941
966 virtual void
969 const unsigned int face_no,
970 const hp::QCollection<dim - 1> &quadrature,
971 const typename Mapping<dim, spacedim>::InternalDataBase &internal_data,
973 &output_data) const;
974
978 virtual void
981 const unsigned int face_no,
982 const Quadrature<dim - 1> &quadrature,
983 const typename Mapping<dim, spacedim>::InternalDataBase &internal_data,
985 &output_data) const;
986
1013 virtual void
1016 const unsigned int face_no,
1017 const unsigned int subface_no,
1018 const Quadrature<dim - 1> &quadrature,
1019 const typename Mapping<dim, spacedim>::InternalDataBase &internal_data,
1021 &output_data) const = 0;
1022
1029 virtual void
1033 const typename Mapping<dim, spacedim>::InternalDataBase &internal_data,
1035 &output_data) const;
1036
1041public:
1110 virtual void
1112 const MappingKind kind,
1114 const ArrayView<Tensor<1, spacedim>> &output) const = 0;
1115
1163 virtual void
1165 const MappingKind kind,
1167 const ArrayView<Tensor<2, spacedim>> &output) const = 0;
1168
1221 virtual void
1223 const MappingKind kind,
1225 const ArrayView<Tensor<2, spacedim>> &output) const = 0;
1226
1268 virtual void
1270 const MappingKind kind,
1272 const ArrayView<Tensor<3, spacedim>> &output) const = 0;
1273
1321 virtual void
1323 const MappingKind kind,
1325 const ArrayView<Tensor<3, spacedim>> &output) const = 0;
1326
1332 // Give class @p FEValues access to the private <tt>get_...data</tt> and
1333 // <tt>fill_fe_...values</tt> functions.
1334 friend class FEValuesBase<dim, spacedim>;
1335 friend class FEValues<dim, spacedim>;
1336 friend class FEFaceValues<dim, spacedim>;
1337 friend class FESubfaceValues<dim, spacedim>;
1338 friend class NonMatching::FEImmersedSurfaceValues<dim>;
1339 friend class NonMatching::internal::ComputeMappingDataHelper<dim, spacedim>;
1340 template <int, int, typename>
1342};
1343
1344
1352template <int dim, int spacedim>
1355
1356
1358
1359#endif
UpdateFlags update_each
Definition mapping.h:692
InternalDataBase(const InternalDataBase &)=delete
virtual ~InternalDataBase()=default
virtual std::size_t memory_consumption() const
virtual void reinit(const UpdateFlags update_flags, const Quadrature< dim > &quadrature)
Abstract base class for mapping classes.
Definition mapping.h:318
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:498
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:499
#define DeclException0(Exception0)
Definition exceptions.h:466
static ::ExceptionBase & ExcDistortedMappedCell(Point< spacedim > arg1, double arg2, int arg3)
static ::ExceptionBase & ExcTransformationFailed()
#define DeclExceptionMsg(Exception, defaulttext)
Definition exceptions.h:489
static ::ExceptionBase & ExcInvalidData()
#define DeclException3(Exception3, type1, type2, type3, outsequence)
Definition exceptions.h:557
UpdateFlags
MappingKind
Definition mapping.h:79
@ mapping_piola
Definition mapping.h:114
@ mapping_covariant_gradient
Definition mapping.h:100
@ mapping_covariant
Definition mapping.h:89
@ mapping_nedelec
Definition mapping.h:129
@ mapping_contravariant
Definition mapping.h:94
@ mapping_raviart_thomas
Definition mapping.h:134
@ mapping_contravariant_hessian
Definition mapping.h:156
@ mapping_covariant_hessian
Definition mapping.h:150
@ mapping_contravariant_gradient
Definition mapping.h:106
@ mapping_none
Definition mapping.h:84
@ mapping_bdm
Definition mapping.h:139
@ mapping_piola_gradient
Definition mapping.h:120
@ mapping_piola_hessian
Definition mapping.h:162
const Mapping< dim, spacedim > & get_default_linear_mapping(const Triangulation< dim, spacedim > &triangulation)
Definition mapping.cc:296
const ::parallel::distributed::Triangulation< dim, spacedim > * triangulation