Reference documentation for deal.II version 9.1.1
\(\newcommand{\dealcoloneq}{\mathrel{\vcenter{:}}=}\)
mapping_cartesian.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2001 - 2018 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 
22 #include <deal.II/fe/mapping.h>
23 
24 #include <cmath>
25 
26 
27 DEAL_II_NAMESPACE_OPEN
28 
31 
60 template <int dim, int spacedim = dim>
61 class MappingCartesian : public Mapping<dim, spacedim>
62 {
63 public:
64  // for documentation, see the Mapping base class
65  virtual std::unique_ptr<Mapping<dim, spacedim>>
66  clone() const override;
67 
72  virtual bool
73  preserves_vertex_locations() const override;
74 
80  // for documentation, see the Mapping base class
81  virtual Point<spacedim>
84  const Point<dim> &p) const override;
85 
86  // for documentation, see the Mapping base class
87  virtual Point<dim>
90  const Point<spacedim> &p) const override;
91 
101  // for documentation, see the Mapping base class
102  virtual void
103  transform(const ArrayView<const Tensor<1, dim>> & input,
104  const MappingType type,
105  const typename Mapping<dim, spacedim>::InternalDataBase &internal,
106  const ArrayView<Tensor<1, spacedim>> &output) const override;
107 
108  // for documentation, see the Mapping base class
109  virtual void
111  const MappingType type,
112  const typename Mapping<dim, spacedim>::InternalDataBase &internal,
113  const ArrayView<Tensor<2, spacedim>> &output) const override;
114 
115  // for documentation, see the Mapping base class
116  virtual void
117  transform(const ArrayView<const Tensor<2, dim>> & input,
118  const MappingType type,
119  const typename Mapping<dim, spacedim>::InternalDataBase &internal,
120  const ArrayView<Tensor<2, spacedim>> &output) const override;
121 
122  // for documentation, see the Mapping base class
123  virtual void
125  const MappingType type,
126  const typename Mapping<dim, spacedim>::InternalDataBase &internal,
127  const ArrayView<Tensor<3, spacedim>> &output) const override;
128 
129  // for documentation, see the Mapping base class
130  virtual void
131  transform(const ArrayView<const Tensor<3, dim>> & input,
132  const MappingType type,
133  const typename Mapping<dim, spacedim>::InternalDataBase &internal,
134  const ArrayView<Tensor<3, spacedim>> &output) const override;
135 
141 private:
158  class InternalData : public Mapping<dim, spacedim>::InternalDataBase
159  {
160  public:
164  InternalData(const Quadrature<dim> &quadrature);
165 
169  virtual std::size_t
170  memory_consumption() const override;
171 
177 
181  mutable double volume_element;
182 
186  std::vector<Point<dim>> quadrature_points;
187  };
188 
189  // documentation can be found in Mapping::requires_update_flags()
190  virtual UpdateFlags
191  requires_update_flags(const UpdateFlags update_flags) const override;
192 
193  // documentation can be found in Mapping::get_data()
194  virtual std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
195  get_data(const UpdateFlags, const Quadrature<dim> &quadrature) const override;
196 
197  // documentation can be found in Mapping::get_face_data()
198  virtual std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
199  get_face_data(const UpdateFlags flags,
200  const Quadrature<dim - 1> &quadrature) const override;
201 
202  // documentation can be found in Mapping::get_subface_data()
203  virtual std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
204  get_subface_data(const UpdateFlags flags,
205  const Quadrature<dim - 1> &quadrature) const override;
206 
207  // documentation can be found in Mapping::fill_fe_values()
209  fill_fe_values(
210  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
211  const CellSimilarity::Similarity cell_similarity,
212  const Quadrature<dim> & quadrature,
213  const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
215  &output_data) const override;
216 
217  // documentation can be found in Mapping::fill_fe_face_values()
218  virtual void
219  fill_fe_face_values(
220  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
221  const unsigned int face_no,
222  const Quadrature<dim - 1> & quadrature,
223  const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
225  &output_data) const override;
226 
227  // documentation can be found in Mapping::fill_fe_subface_values()
228  virtual void
229  fill_fe_subface_values(
230  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
231  const unsigned int face_no,
232  const unsigned int subface_no,
233  const Quadrature<dim - 1> & quadrature,
234  const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
236  &output_data) const override;
237 
247  void
249  const unsigned int face_no,
250  const unsigned int sub_no,
251  const CellSimilarity::Similarity cell_similarity,
252  const InternalData & data,
253  std::vector<Point<dim>> & quadrature_points,
254  std::vector<Tensor<1, dim>> & normal_vectors) const;
255 
260 };
261 
264 DEAL_II_NAMESPACE_CLOSE
265 
266 #endif
virtual Point< dim > transform_real_to_unit_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< spacedim > &p) const override
static const unsigned int invalid_unsigned_int
Definition: types.h:173
MappingType
Definition: mapping.h:61
std::vector< Point< dim > > quadrature_points
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_face_data(const UpdateFlags flags, const Quadrature< dim - 1 > &quadrature) const override
virtual std::size_t memory_consumption() const override
virtual std::unique_ptr< Mapping< dim, spacedim > > clone() const override
UpdateFlags
virtual void transform(const ArrayView< const Tensor< 1, dim >> &input, const MappingType type, const typename Mapping< dim, spacedim >::InternalDataBase &internal, const ArrayView< Tensor< 1, spacedim >> &output) const override
Abstract base class for mapping classes.
Definition: dof_tools.h:57
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_subface_data(const UpdateFlags flags, const Quadrature< dim - 1 > &quadrature) const override
void compute_fill(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no, const unsigned int sub_no, const CellSimilarity::Similarity cell_similarity, const InternalData &data, std::vector< Point< dim >> &quadrature_points, std::vector< Tensor< 1, dim >> &normal_vectors) const
static const unsigned int invalid_face_number
InternalData(const Quadrature< dim > &quadrature)
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_data(const UpdateFlags, const Quadrature< dim > &quadrature) const override
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