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_cartesian.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2001 - 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_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 
78 template <int dim, int spacedim = dim>
79 class MappingCartesian : public Mapping<dim, spacedim>
80 {
81 public:
82  // for documentation, see the Mapping base class
83  virtual std::unique_ptr<Mapping<dim, spacedim>>
84  clone() const override;
85 
90  virtual bool
91  preserves_vertex_locations() const override;
92 
98  // for documentation, see the Mapping base class
99  virtual Point<spacedim>
101  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
102  const Point<dim> &p) const override;
103 
104  // for documentation, see the Mapping base class
105  virtual Point<dim>
107  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
108  const Point<spacedim> &p) const override;
109 
119  // for documentation, see the Mapping base class
120  virtual void
121  transform(const ArrayView<const Tensor<1, dim>> & input,
122  const MappingKind kind,
123  const typename Mapping<dim, spacedim>::InternalDataBase &internal,
124  const ArrayView<Tensor<1, spacedim>> &output) const override;
125 
126  // for documentation, see the Mapping base class
127  virtual void
129  const MappingKind kind,
130  const typename Mapping<dim, spacedim>::InternalDataBase &internal,
131  const ArrayView<Tensor<2, spacedim>> &output) const override;
132 
133  // for documentation, see the Mapping base class
134  virtual void
135  transform(const ArrayView<const Tensor<2, dim>> & input,
136  const MappingKind kind,
137  const typename Mapping<dim, spacedim>::InternalDataBase &internal,
138  const ArrayView<Tensor<2, spacedim>> &output) const override;
139 
140  // for documentation, see the Mapping base class
141  virtual void
143  const MappingKind kind,
144  const typename Mapping<dim, spacedim>::InternalDataBase &internal,
145  const ArrayView<Tensor<3, spacedim>> &output) const override;
146 
147  // for documentation, see the Mapping base class
148  virtual void
149  transform(const ArrayView<const Tensor<3, dim>> & input,
150  const MappingKind kind,
151  const typename Mapping<dim, spacedim>::InternalDataBase &internal,
152  const ArrayView<Tensor<3, spacedim>> &output) const override;
153 
159 private:
176  class InternalData : public Mapping<dim, spacedim>::InternalDataBase
177  {
178  public:
182  InternalData(const Quadrature<dim> &quadrature);
183 
187  virtual std::size_t
188  memory_consumption() const override;
189 
195 
199  mutable double volume_element;
200 
204  std::vector<Point<dim>> quadrature_points;
205  };
206 
207  // documentation can be found in Mapping::requires_update_flags()
208  virtual UpdateFlags
209  requires_update_flags(const UpdateFlags update_flags) const override;
210 
211  // documentation can be found in Mapping::get_data()
212  virtual std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
213  get_data(const UpdateFlags, const Quadrature<dim> &quadrature) const override;
214 
215  // documentation can be found in Mapping::get_face_data()
216  virtual std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
217  get_face_data(const UpdateFlags flags,
218  const Quadrature<dim - 1> &quadrature) const override;
219 
220  // documentation can be found in Mapping::get_subface_data()
221  virtual std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
222  get_subface_data(const UpdateFlags flags,
223  const Quadrature<dim - 1> &quadrature) const override;
224 
225  // documentation can be found in Mapping::fill_fe_values()
228  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
229  const CellSimilarity::Similarity cell_similarity,
230  const Quadrature<dim> & quadrature,
231  const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
233  &output_data) const override;
234 
235  // documentation can be found in Mapping::fill_fe_face_values()
236  virtual void
238  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
239  const unsigned int face_no,
240  const Quadrature<dim - 1> & quadrature,
241  const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
243  &output_data) const override;
244 
245  // documentation can be found in Mapping::fill_fe_subface_values()
246  virtual void
248  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
249  const unsigned int face_no,
250  const unsigned int subface_no,
251  const Quadrature<dim - 1> & quadrature,
252  const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
254  &output_data) const override;
255 
264  void
266  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
267  const CellSimilarity::Similarity cell_similarity,
268  const InternalData & data) const;
269 
276  void
278  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
279  const InternalData & data,
280  std::vector<Point<dim>> &quadrature_points) const;
281 
288  void
290  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
291  const unsigned int face_no,
292  const InternalData & data,
293  std::vector<Point<dim>> &quadrature_points) const;
294 
301  void
303  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
304  const unsigned int face_no,
305  const unsigned int sub_no,
306  const InternalData & data,
307  std::vector<Point<dim>> &quadrature_points) const;
308 
315  void
317  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
318  const InternalData & data,
319  const typename QProjector<dim>::DataSetDescriptor & offset,
320  std::vector<Point<dim>> &quadrature_points) const;
321 
326  void
328  const unsigned int face_no,
329  const InternalData & data,
330  std::vector<Tensor<1, dim>> &normal_vectors) const;
331 
337  void
339  const InternalData & data,
340  const CellSimilarity::Similarity cell_similarity,
342  &output_data) const;
343 };
344 
348 
349 #endif
MappingCartesian::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 override
Definition: mapping_cartesian.cc:437
MappingCartesian::InternalData::quadrature_points
std::vector< Point< dim > > quadrature_points
Definition: mapping_cartesian.h:204
MappingKind
MappingKind
Definition: mapping.h:62
MappingCartesian::maybe_update_cell_quadrature_points
void maybe_update_cell_quadrature_points(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const InternalData &data, std::vector< Point< dim >> &quadrature_points) const
Definition: mapping_cartesian.cc:199
MappingCartesian::requires_update_flags
virtual UpdateFlags requires_update_flags(const UpdateFlags update_flags) const override
Definition: mapping_cartesian.cc:75
MappingCartesian::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 override
Definition: mapping_cartesian.cc:993
MappingCartesian::InternalData::InternalData
InternalData(const Quadrature< dim > &quadrature)
Definition: mapping_cartesian.cc:43
internal::FEValuesImplementation::MappingRelatedData
Definition: fe_update_flags.h:418
ArrayView
Definition: array_view.h:77
MappingCartesian::get_data
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_data(const UpdateFlags, const Quadrature< dim > &quadrature) const override
Definition: mapping_cartesian.cc:94
CellSimilarity::Similarity
Similarity
Definition: fe_update_flags.h:378
MappingCartesian
Definition: mapping_cartesian.h:79
MappingCartesian::maybe_update_subface_quadrature_points
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
Definition: mapping_cartesian.cc:244
MappingCartesian::InternalData::volume_element
double volume_element
Definition: mapping_cartesian.h:199
MappingCartesian::preserves_vertex_locations
virtual bool preserves_vertex_locations() const override
Definition: mapping_cartesian.cc:66
DerivativeForm< 1, dim, spacedim >
MappingCartesian::maybe_update_normal_vectors
void maybe_update_normal_vectors(const unsigned int face_no, const InternalData &data, std::vector< Tensor< 1, dim >> &normal_vectors) const
Definition: mapping_cartesian.cc:301
Mapping
Abstract base class for mapping classes.
Definition: mapping.h:302
MappingCartesian::InternalData::cell_extents
Tensor< 1, dim > cell_extents
Definition: mapping_cartesian.h:194
MappingCartesian::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 override
Definition: mapping_cartesian.cc:1028
Tensor< 1, dim >
MappingCartesian::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 override
Definition: mapping_cartesian.cc:586
QProjector::DataSetDescriptor
Definition: qprojector.h:220
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
MappingCartesian::InternalData
Definition: mapping_cartesian.h:176
MappingCartesian::update_cell_extents
void update_cell_extents(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const CellSimilarity::Similarity cell_similarity, const InternalData &data) const
Definition: mapping_cartesian.cc:163
MappingCartesian::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 override
Definition: mapping_cartesian.cc:372
UpdateFlags
UpdateFlags
Definition: fe_update_flags.h:66
MappingCartesian::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 override
Definition: mapping_cartesian.cc:508
mapping.h
Particles::Generators::quadrature_points
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=StaticMappingQ1< dim, spacedim >::mapping)
Definition: generators.cc:442
Mapping::InternalDataBase
Definition: mapping.h:597
MappingCartesian::get_face_data
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_face_data(const UpdateFlags flags, const Quadrature< dim - 1 > &quadrature) const override
Definition: mapping_cartesian.cc:113
MappingCartesian::transform_quadrature_points
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
Definition: mapping_cartesian.cc:278
Point< spacedim >
MappingCartesian::maybe_update_face_quadrature_points
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
Definition: mapping_cartesian.cc:217
config.h
MappingCartesian::clone
virtual std::unique_ptr< Mapping< dim, spacedim > > clone() const override
Definition: mapping_cartesian.cc:1062
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359
MappingCartesian::maybe_update_jacobian_derivatives
void maybe_update_jacobian_derivatives(const InternalData &data, const CellSimilarity::Similarity cell_similarity, internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &output_data) const
Definition: mapping_cartesian.cc:320
Quadrature
Definition: quadrature.h:85
TriaIterator
Definition: tria_iterator.h:578
MappingCartesian::InternalData::memory_consumption
virtual std::size_t memory_consumption() const override
Definition: mapping_cartesian.cc:54
qprojector.h
MappingCartesian::get_subface_data
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_subface_data(const UpdateFlags flags, const Quadrature< dim - 1 > &quadrature) const override
Definition: mapping_cartesian.cc:138