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\}}\)
mapping_cartesian.h
Go to the documentation of this file.
1// ---------------------------------------------------------------------
2//
3// Copyright (C) 2001 - 2021 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_cartesian_h
17#define dealii_mapping_cartesian_h
18
19
20#include <deal.II/base/config.h>
21
23
24#include <deal.II/fe/mapping.h>
25
26#include <cmath>
27
28
30
33
76template <int dim, int spacedim = dim>
77class MappingCartesian : public Mapping<dim, spacedim>
78{
79public:
80 // for documentation, see the Mapping base class
81 virtual std::unique_ptr<Mapping<dim, spacedim>>
82 clone() const override;
83
88 virtual bool
89 preserves_vertex_locations() const override;
90
91 virtual bool
92 is_compatible_with(const ReferenceCell &reference_cell) const override;
93
99 // for documentation, see the Mapping base class
100 virtual Point<spacedim>
103 const Point<dim> &p) const override;
104
105 // for documentation, see the Mapping base class
106 virtual Point<dim>
109 const Point<spacedim> &p) const override;
110
120 // for documentation, see the Mapping base class
121 virtual void
122 transform(const ArrayView<const Tensor<1, dim>> & input,
123 const MappingKind kind,
125 const ArrayView<Tensor<1, spacedim>> &output) const override;
126
127 // for documentation, see the Mapping base class
128 virtual void
130 const MappingKind kind,
132 const ArrayView<Tensor<2, spacedim>> &output) const override;
133
134 // for documentation, see the Mapping base class
135 virtual void
136 transform(const ArrayView<const Tensor<2, dim>> & input,
137 const MappingKind kind,
139 const ArrayView<Tensor<2, spacedim>> &output) const override;
140
141 // for documentation, see the Mapping base class
142 virtual void
144 const MappingKind kind,
146 const ArrayView<Tensor<3, spacedim>> &output) const override;
147
148 // for documentation, see the Mapping base class
149 virtual void
150 transform(const ArrayView<const Tensor<3, dim>> & input,
151 const MappingKind kind,
153 const ArrayView<Tensor<3, spacedim>> &output) const override;
154
160private:
177 class InternalData : public Mapping<dim, spacedim>::InternalDataBase
178 {
179 public:
183 InternalData(const Quadrature<dim> &quadrature);
184
188 virtual std::size_t
189 memory_consumption() const override;
190
196
200 mutable double volume_element;
201
205 std::vector<Point<dim>> quadrature_points;
206 };
207
208 // documentation can be found in Mapping::requires_update_flags()
209 virtual UpdateFlags
210 requires_update_flags(const UpdateFlags update_flags) const override;
211
212 // documentation can be found in Mapping::get_data()
213 virtual std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
214 get_data(const UpdateFlags, const Quadrature<dim> &quadrature) const override;
215
216 using Mapping<dim, spacedim>::get_face_data;
217
218 // documentation can be found in Mapping::get_face_data()
219 virtual std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
220 get_face_data(const UpdateFlags flags,
221 const hp::QCollection<dim - 1> &quadrature) const override;
222
223 // documentation can be found in Mapping::get_subface_data()
224 virtual std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
225 get_subface_data(const UpdateFlags flags,
226 const Quadrature<dim - 1> &quadrature) const override;
227
228 // documentation can be found in Mapping::fill_fe_values()
232 const CellSimilarity::Similarity cell_similarity,
233 const Quadrature<dim> & quadrature,
234 const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
236 &output_data) const override;
237
238 using Mapping<dim, spacedim>::fill_fe_face_values;
239
240 // documentation can be found in Mapping::fill_fe_face_values()
241 virtual void
244 const unsigned int face_no,
245 const hp::QCollection<dim - 1> & quadrature,
246 const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
248 &output_data) const override;
249
250 // documentation can be found in Mapping::fill_fe_subface_values()
251 virtual void
254 const unsigned int face_no,
255 const unsigned int subface_no,
256 const Quadrature<dim - 1> & quadrature,
257 const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
259 &output_data) const override;
260
269 void
272 const CellSimilarity::Similarity cell_similarity,
273 const InternalData & data) const;
274
281 void
284 const InternalData & data,
285 std::vector<Point<dim>> &quadrature_points) const;
286
293 void
296 const unsigned int face_no,
297 const InternalData & data,
298 std::vector<Point<dim>> &quadrature_points) const;
299
306 void
309 const unsigned int face_no,
310 const unsigned int sub_no,
311 const InternalData & data,
312 std::vector<Point<dim>> &quadrature_points) const;
313
320 void
323 const InternalData & data,
324 const typename QProjector<dim>::DataSetDescriptor & offset,
325 std::vector<Point<dim>> &quadrature_points) const;
326
331 void
333 const unsigned int face_no,
334 const InternalData & data,
335 std::vector<Tensor<1, dim>> &normal_vectors) const;
336
342 void
344 const InternalData & data,
345 const CellSimilarity::Similarity cell_similarity,
347 &output_data) const;
348};
349
353
354#endif
std::vector< Point< dim > > quadrature_points
InternalData(const Quadrature< dim > &quadrature)
virtual std::size_t memory_consumption() const override
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 override
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_face_data(const UpdateFlags flags, const hp::QCollection< dim - 1 > &quadrature) const override
virtual UpdateFlags requires_update_flags(const UpdateFlags update_flags) const override
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_subface_data(const UpdateFlags flags, const Quadrature< dim - 1 > &quadrature) const override
void update_cell_extents(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const CellSimilarity::Similarity cell_similarity, const InternalData &data) const
void maybe_update_subface_quadrature_points(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no, const unsigned int sub_no, const InternalData &data, std::vector< Point< dim > > &quadrature_points) 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 override
void maybe_update_face_quadrature_points(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no, const InternalData &data, std::vector< Point< dim > > &quadrature_points) const
virtual bool is_compatible_with(const ReferenceCell &reference_cell) const override
void maybe_update_cell_quadrature_points(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const InternalData &data, std::vector< Point< dim > > &quadrature_points) const
virtual bool preserves_vertex_locations() const override
virtual Point< spacedim > transform_unit_to_real_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< dim > &p) const override
virtual std::unique_ptr< Mapping< dim, spacedim > > clone() const override
virtual Point< dim > transform_real_to_unit_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< spacedim > &p) const override
void transform_quadrature_points(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const InternalData &data, const typename QProjector< dim >::DataSetDescriptor &offset, std::vector< Point< dim > > &quadrature_points) const
void maybe_update_jacobian_derivatives(const InternalData &data, const CellSimilarity::Similarity cell_similarity, internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &output_data) const
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 override
void maybe_update_normal_vectors(const unsigned int face_no, const InternalData &data, std::vector< Tensor< 1, dim > > &normal_vectors) const
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_data(const UpdateFlags, const Quadrature< dim > &quadrature) const override
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 override
Abstract base class for mapping classes.
Definition: mapping.h:304
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:402
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:403
UpdateFlags
MappingKind
Definition: mapping.h:65
void reference_cell(Triangulation< dim, spacedim > &tria, const ReferenceCell &reference_cell)
void quadrature_points(const Triangulation< dim, spacedim > &triangulation, const Quadrature< dim > &quadrature, const std::vector< std::vector< BoundingBox< spacedim > > > &global_bounding_boxes, ParticleHandler< dim, spacedim > &particle_handler, const Mapping< dim, spacedim > &mapping=(ReferenceCells::get_hypercube< dim >() .template get_default_linear_mapping< dim, spacedim >()), const std::vector< std::vector< double > > &properties={})
Definition: generators.cc:451