Reference documentation for deal.II version Git fe553f7db3 2020-12-03 08:11:48 +0100
\(\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 
76 template <int dim, int spacedim = dim>
77 class MappingCartesian : public Mapping<dim, spacedim>
78 {
79 public:
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 
96  // for documentation, see the Mapping base class
97  virtual Point<spacedim>
100  const Point<dim> &p) const override;
101 
102  // for documentation, see the Mapping base class
103  virtual Point<dim>
105  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
106  const Point<spacedim> &p) const override;
107 
117  // for documentation, see the Mapping base class
118  virtual void
119  transform(const ArrayView<const Tensor<1, dim>> & input,
120  const MappingKind kind,
121  const typename Mapping<dim, spacedim>::InternalDataBase &internal,
122  const ArrayView<Tensor<1, spacedim>> &output) const override;
123 
124  // for documentation, see the Mapping base class
125  virtual void
127  const MappingKind kind,
128  const typename Mapping<dim, spacedim>::InternalDataBase &internal,
129  const ArrayView<Tensor<2, spacedim>> &output) const override;
130 
131  // for documentation, see the Mapping base class
132  virtual void
133  transform(const ArrayView<const Tensor<2, dim>> & input,
134  const MappingKind kind,
135  const typename Mapping<dim, spacedim>::InternalDataBase &internal,
136  const ArrayView<Tensor<2, spacedim>> &output) const override;
137 
138  // for documentation, see the Mapping base class
139  virtual void
141  const MappingKind kind,
142  const typename Mapping<dim, spacedim>::InternalDataBase &internal,
143  const ArrayView<Tensor<3, spacedim>> &output) const override;
144 
145  // for documentation, see the Mapping base class
146  virtual void
147  transform(const ArrayView<const Tensor<3, dim>> & input,
148  const MappingKind kind,
149  const typename Mapping<dim, spacedim>::InternalDataBase &internal,
150  const ArrayView<Tensor<3, spacedim>> &output) const override;
151 
157 private:
174  class InternalData : public Mapping<dim, spacedim>::InternalDataBase
175  {
176  public:
180  InternalData(const Quadrature<dim> &quadrature);
181 
185  virtual std::size_t
186  memory_consumption() const override;
187 
193 
197  mutable double volume_element;
198 
202  std::vector<Point<dim>> quadrature_points;
203  };
204 
205  // documentation can be found in Mapping::requires_update_flags()
206  virtual UpdateFlags
207  requires_update_flags(const UpdateFlags update_flags) const override;
208 
209  // documentation can be found in Mapping::get_data()
210  virtual std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
211  get_data(const UpdateFlags, const Quadrature<dim> &quadrature) const override;
212 
213  // documentation can be found in Mapping::get_face_data()
214  virtual std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
215  get_face_data(const UpdateFlags flags,
216  const Quadrature<dim - 1> &quadrature) const override;
217 
218  // documentation can be found in Mapping::get_subface_data()
219  virtual std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
220  get_subface_data(const UpdateFlags flags,
221  const Quadrature<dim - 1> &quadrature) const override;
222 
223  // documentation can be found in Mapping::fill_fe_values()
226  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
227  const CellSimilarity::Similarity cell_similarity,
228  const Quadrature<dim> & quadrature,
229  const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
231  &output_data) const override;
232 
233  // documentation can be found in Mapping::fill_fe_face_values()
234  virtual void
236  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
237  const unsigned int face_no,
238  const Quadrature<dim - 1> & quadrature,
239  const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
241  &output_data) const override;
242 
243  // documentation can be found in Mapping::fill_fe_subface_values()
244  virtual void
246  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
247  const unsigned int face_no,
248  const unsigned int subface_no,
249  const Quadrature<dim - 1> & quadrature,
250  const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
252  &output_data) const override;
253 
262  void
264  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
265  const CellSimilarity::Similarity cell_similarity,
266  const InternalData & data) const;
267 
274  void
276  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
277  const InternalData & data,
278  std::vector<Point<dim>> &quadrature_points) const;
279 
286  void
288  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
289  const unsigned int face_no,
290  const InternalData & data,
291  std::vector<Point<dim>> &quadrature_points) const;
292 
299  void
301  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
302  const unsigned int face_no,
303  const unsigned int sub_no,
304  const InternalData & data,
305  std::vector<Point<dim>> &quadrature_points) const;
306 
313  void
315  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
316  const InternalData & data,
317  const typename QProjector<dim>::DataSetDescriptor & offset,
318  std::vector<Point<dim>> &quadrature_points) const;
319 
324  void
326  const unsigned int face_no,
327  const InternalData & data,
328  std::vector<Tensor<1, dim>> &normal_vectors) const;
329 
335  void
337  const InternalData & data,
338  const CellSimilarity::Similarity cell_similarity,
340  &output_data) const;
341 };
342 
346 
347 #endif
virtual Point< dim > transform_real_to_unit_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< spacedim > &p) const override
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 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 update_cell_extents(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const CellSimilarity::Similarity cell_similarity, const InternalData &data) const
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
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
std::vector< Point< dim > > 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
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_face_data(const UpdateFlags flags, const Quadrature< dim - 1 > &quadrature) const override
MappingKind
Definition: mapping.h:62
virtual std::size_t memory_consumption() const override
virtual std::unique_ptr< Mapping< dim, spacedim > > clone() const override
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
UpdateFlags
Abstract base class for mapping classes.
Definition: mapping.h:301
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_subface_data(const UpdateFlags flags, const Quadrature< dim - 1 > &quadrature) const override
void maybe_update_jacobian_derivatives(const InternalData &data, const CellSimilarity::Similarity cell_similarity, internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &output_data) const
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:372
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
void maybe_update_cell_quadrature_points(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const InternalData &data, std::vector< Point< dim >> &quadrature_points) const
InternalData(const Quadrature< dim > &quadrature)
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_data(const UpdateFlags, const Quadrature< dim > &quadrature) const override
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:371
virtual UpdateFlags requires_update_flags(const UpdateFlags update_flags) const override
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