Reference documentation for deal.II version 9.2.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\}}\)
mapping.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2000 - 2019 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 
26 
27 #include <deal.II/grid/tria.h>
28 
29 #include <array>
30 #include <cmath>
31 #include <memory>
32 
34 
35 template <typename ElementType, typename MemorySpaceType>
36 class ArrayView;
37 template <int dim>
38 class Quadrature;
39 template <int dim, int spacedim>
40 class FEValues;
41 template <int dim, int spacedim>
42 class FEValuesBase;
43 template <int dim, int spacedim>
44 class FEValues;
45 template <int dim, int spacedim>
46 class FEFaceValues;
47 template <int dim, int spacedim>
48 class FESubfaceValues;
49 
50 
63 {
68  mapping_none = 0x0000,
69 
74 
79 
85 
91 
98  mapping_piola = 0x0100,
99 
105 
113  mapping_nedelec = 0x0200,
114 
119 
124 
135 
141 
147 };
148 
149 
301 template <int dim, int spacedim = dim>
302 class Mapping : public Subscriptor
303 {
304 public:
308  virtual ~Mapping() override = default;
309 
319  virtual std::unique_ptr<Mapping<dim, spacedim>>
320  clone() const = 0;
321 
336  virtual std::array<Point<spacedim>, GeometryInfo<dim>::vertices_per_cell>
337  get_vertices(
338  const typename Triangulation<dim, spacedim>::cell_iterator &cell) const;
339 
365  virtual Point<spacedim>
367  const bool map_center_of_reference_cell = true) const;
368 
388  virtual BoundingBox<spacedim>
390  const typename Triangulation<dim, spacedim>::cell_iterator &cell) const;
391 
403  virtual bool
404  preserves_vertex_locations() const = 0;
405 
422  virtual Point<spacedim>
424  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
425  const Point<dim> & p) const = 0;
426 
455  virtual Point<dim>
457  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
458  const Point<spacedim> & p) const = 0;
459 
470  Point<dim - 1>
472  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
473  const unsigned int face_no,
474  const Point<spacedim> & p) const;
475 
490 
491 
501  "Computing the mapping between a real space point and a point in reference "
502  "space failed, typically because the given point lies outside the cell "
503  "where the inverse mapping is not unique.");
504 
514  double,
515  int,
516  << "The image of the mapping applied to cell with center ["
517  << arg1 << "] is distorted. The cell geometry or the "
518  << "mapping are invalid, giving a non-positive volume "
519  << "fraction of " << arg2 << " in quadrature point " << arg3
520  << ".");
521 
531 public:
598  {
599  public:
605 
609  InternalDataBase(const InternalDataBase &) = delete;
610 
614  virtual ~InternalDataBase() = default;
615 
631 
635  virtual std::size_t
636  memory_consumption() const;
637  };
638 
639 
640 protected:
664  virtual UpdateFlags
665  requires_update_flags(const UpdateFlags update_flags) const = 0;
666 
715  virtual std::unique_ptr<InternalDataBase>
716  get_data(const UpdateFlags update_flags,
717  const Quadrature<dim> &quadrature) const = 0;
718 
746  virtual std::unique_ptr<InternalDataBase>
747  get_face_data(const UpdateFlags update_flags,
748  const Quadrature<dim - 1> &quadrature) const = 0;
749 
778  virtual std::unique_ptr<InternalDataBase>
779  get_subface_data(const UpdateFlags update_flags,
780  const Quadrature<dim - 1> &quadrature) const = 0;
781 
867  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
868  const CellSimilarity::Similarity cell_similarity,
869  const Quadrature<dim> & quadrature,
870  const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
872  &output_data) const = 0;
873 
898  virtual void
900  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
901  const unsigned int face_no,
902  const Quadrature<dim - 1> & quadrature,
903  const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
905  &output_data) const = 0;
906 
933  virtual void
935  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
936  const unsigned int face_no,
937  const unsigned int subface_no,
938  const Quadrature<dim - 1> & quadrature,
939  const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
941  &output_data) const = 0;
942 
947 public:
1016  virtual void
1017  transform(const ArrayView<const Tensor<1, dim>> & input,
1018  const MappingKind kind,
1019  const typename Mapping<dim, spacedim>::InternalDataBase &internal,
1020  const ArrayView<Tensor<1, spacedim>> &output) const = 0;
1021 
1069  virtual void
1071  const MappingKind kind,
1072  const typename Mapping<dim, spacedim>::InternalDataBase &internal,
1073  const ArrayView<Tensor<2, spacedim>> &output) const = 0;
1074 
1127  virtual void
1128  transform(const ArrayView<const Tensor<2, dim>> & input,
1129  const MappingKind kind,
1130  const typename Mapping<dim, spacedim>::InternalDataBase &internal,
1131  const ArrayView<Tensor<2, spacedim>> &output) const = 0;
1132 
1174  virtual void
1176  const MappingKind kind,
1177  const typename Mapping<dim, spacedim>::InternalDataBase &internal,
1178  const ArrayView<Tensor<3, spacedim>> &output) const = 0;
1179 
1227  virtual void
1228  transform(const ArrayView<const Tensor<3, dim>> & input,
1229  const MappingKind kind,
1230  const typename Mapping<dim, spacedim>::InternalDataBase &internal,
1231  const ArrayView<Tensor<3, spacedim>> &output) const = 0;
1232 
1238  // Give class @p FEValues access to the private <tt>get_...data</tt> and
1239  // <tt>fill_fe_...values</tt> functions.
1240  friend class FEValuesBase<dim, spacedim>;
1241  friend class FEValues<dim, spacedim>;
1242  friend class FEFaceValues<dim, spacedim>;
1243  friend class FESubfaceValues<dim, spacedim>;
1244 };
1245 
1246 
1248 
1249 #endif
array_view.h
DeclExceptionMsg
#define DeclExceptionMsg(Exception, defaulttext)
Definition: exceptions.h:496
derivative_form.h
Mapping::transform
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
fe_update_flags.h
mapping_piola
@ mapping_piola
Definition: mapping.h:98
MappingKind
MappingKind
Definition: mapping.h:62
mapping_covariant_gradient
@ mapping_covariant_gradient
Definition: mapping.h:84
Mapping::get_subface_data
virtual std::unique_ptr< InternalDataBase > get_subface_data(const UpdateFlags update_flags, const Quadrature< dim - 1 > &quadrature) const =0
internal::FEValuesImplementation::MappingRelatedData
Definition: fe_update_flags.h:418
mapping_piola_gradient
@ mapping_piola_gradient
Definition: mapping.h:104
tria.h
Mapping::InternalDataBase::~InternalDataBase
virtual ~InternalDataBase()=default
ArrayView
Definition: array_view.h:77
Mapping::ExcTransformationFailed
static ::ExceptionBase & ExcTransformationFailed()
mapping_contravariant_gradient
@ mapping_contravariant_gradient
Definition: mapping.h:90
GeometryInfo
Definition: geometry_info.h:1224
CellSimilarity::Similarity
Similarity
Definition: fe_update_flags.h:378
mapping_piola_hessian
@ mapping_piola_hessian
Definition: mapping.h:146
FEValues
Definition: fe.h:38
Mapping::ExcInvalidData
static ::ExceptionBase & ExcInvalidData()
BoundingBox
Definition: bounding_box.h:128
Subscriptor
Definition: subscriptor.h:62
mapping_raviart_thomas
@ mapping_raviart_thomas
Definition: mapping.h:118
DerivativeForm< 1, dim, spacedim >
Mapping
Abstract base class for mapping classes.
Definition: mapping.h:302
mapping_covariant_hessian
@ mapping_covariant_hessian
Definition: mapping.h:134
mapping_contravariant
@ mapping_contravariant
Definition: mapping.h:78
Mapping::requires_update_flags
virtual UpdateFlags requires_update_flags(const UpdateFlags update_flags) const =0
Mapping::clone
virtual std::unique_ptr< Mapping< dim, spacedim > > clone() const =0
Tensor< 1, dim >
Mapping::project_real_point_to_unit_point_on_face
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
Definition: mapping.cc:81
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
mapping_bdm
@ mapping_bdm
Definition: mapping.h:123
Mapping::get_data
virtual std::unique_ptr< InternalDataBase > get_data(const UpdateFlags update_flags, const Quadrature< dim > &quadrature) const =0
Mapping::InternalDataBase::memory_consumption
virtual std::size_t memory_consumption() const
Definition: mapping.cc:130
DeclException3
#define DeclException3(Exception3, type1, type2, type3, outsequence)
Definition: exceptions.h:564
Mapping::transform_unit_to_real_cell
virtual Point< spacedim > transform_unit_to_real_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< dim > &p) const =0
Mapping::ExcDistortedMappedCell
static ::ExceptionBase & ExcDistortedMappedCell(Point< spacedim > arg1, double arg2, int arg3)
Mapping::get_center
virtual Point< spacedim > get_center(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const bool map_center_of_reference_cell=true) const
Definition: mapping.cc:43
FEValuesBase
Definition: fe.h:36
UpdateFlags
UpdateFlags
Definition: fe_update_flags.h:66
mapping_nedelec
@ mapping_nedelec
Definition: mapping.h:113
FESubfaceValues
Definition: fe.h:42
Mapping::get_bounding_box
virtual BoundingBox< spacedim > get_bounding_box(const typename Triangulation< dim, spacedim >::cell_iterator &cell) const
Definition: mapping.cc:68
Mapping::get_vertices
virtual std::array< Point< spacedim >, GeometryInfo< dim >::vertices_per_cell > get_vertices(const typename Triangulation< dim, spacedim >::cell_iterator &cell) const
Definition: mapping.cc:28
Mapping::get_face_data
virtual std::unique_ptr< InternalDataBase > get_face_data(const UpdateFlags update_flags, const Quadrature< dim - 1 > &quadrature) const =0
Mapping::InternalDataBase
Definition: mapping.h:597
Mapping::~Mapping
virtual ~Mapping() override=default
DeclException0
#define DeclException0(Exception0)
Definition: exceptions.h:473
Mapping::InternalDataBase::update_each
UpdateFlags update_each
Definition: mapping.h:630
Mapping::fill_fe_values
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
Point< spacedim >
Mapping::fill_fe_subface_values
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
config.h
FEFaceValues
Definition: fe.h:40
mapping_covariant
@ mapping_covariant
Definition: mapping.h:73
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359
Mapping::preserves_vertex_locations
virtual bool preserves_vertex_locations() const =0
Mapping::fill_fe_face_values
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 =0
Quadrature
Definition: quadrature.h:85
TriaIterator
Definition: tria_iterator.h:578
Mapping::InternalDataBase::InternalDataBase
InternalDataBase()
Definition: mapping.cc:122
mapping_none
@ mapping_none
Definition: mapping.h:68
mapping_contravariant_hessian
@ mapping_contravariant_hessian
Definition: mapping.h:140
Mapping::transform_real_to_unit_cell
virtual Point< dim > transform_real_to_unit_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< spacedim > &p) const =0