Reference documentation for deal.II version 9.0.0
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 at
12 // the top level of the deal.II distribution.
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 #include <deal.II/base/table.h>
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 
65  // for documentation, see the Mapping base class
66  virtual
67  std::unique_ptr<Mapping<dim, spacedim>> clone () const override;
68 
73  virtual
74  bool preserves_vertex_locations () const override;
75 
81  // for documentation, see the Mapping base class
82  virtual
85  const Point<dim> &p) const override;
86 
87  // for documentation, see the Mapping base class
88  virtual
91  const Point<spacedim> &p) const override;
92 
102  // for documentation, see the Mapping base class
103  virtual
104  void
105  transform (const ArrayView<const Tensor<1,dim> > &input,
106  const MappingType type,
107  const typename Mapping<dim,spacedim>::InternalDataBase &internal,
108  const ArrayView<Tensor<1,spacedim> > &output) const override;
109 
110  // for documentation, see the Mapping base class
111  virtual
112  void
114  const MappingType type,
115  const typename Mapping<dim,spacedim>::InternalDataBase &internal,
116  const ArrayView<Tensor<2,spacedim> > &output) const override;
117 
118  // for documentation, see the Mapping base class
119  virtual
120  void
121  transform (const ArrayView<const Tensor<2, dim> > &input,
122  const MappingType type,
123  const typename Mapping<dim,spacedim>::InternalDataBase &internal,
124  const ArrayView<Tensor<2,spacedim> > &output) const override;
125 
126  // for documentation, see the Mapping base class
127  virtual
128  void
130  const MappingType type,
131  const typename Mapping<dim,spacedim>::InternalDataBase &internal,
132  const ArrayView<Tensor<3,spacedim> > &output) const override;
133 
134  // for documentation, see the Mapping base class
135  virtual
136  void
137  transform (const ArrayView<const Tensor<3, dim> > &input,
138  const MappingType type,
139  const typename Mapping<dim,spacedim>::InternalDataBase &internal,
140  const ArrayView<Tensor<3,spacedim> > &output) const override;
141 
147 private:
148 
165  class InternalData : public Mapping<dim, spacedim>::InternalDataBase
166  {
167  public:
171  InternalData (const Quadrature<dim> &quadrature);
172 
176  virtual
177  std::size_t memory_consumption () const override;
178 
184 
188  mutable double volume_element;
189 
193  std::vector<Point<dim> > quadrature_points;
194  };
195 
196  // documentation can be found in Mapping::requires_update_flags()
197  virtual
199  requires_update_flags (const UpdateFlags update_flags) const override;
200 
201  // documentation can be found in Mapping::get_data()
202  virtual
203  std::unique_ptr<typename Mapping<dim,spacedim>::InternalDataBase>
204  get_data (const UpdateFlags,
205  const Quadrature<dim> &quadrature) const override;
206 
207  // documentation can be found in Mapping::get_face_data()
208  virtual
209  std::unique_ptr<typename Mapping<dim,spacedim>::InternalDataBase>
210  get_face_data (const UpdateFlags flags,
211  const Quadrature<dim-1>& quadrature) const override;
212 
213  // documentation can be found in Mapping::get_subface_data()
214  virtual
215  std::unique_ptr<typename Mapping<dim,spacedim>::InternalDataBase>
216  get_subface_data (const UpdateFlags flags,
217  const Quadrature<dim-1>& quadrature) const override;
218 
219  // documentation can be found in Mapping::fill_fe_values()
220  virtual
222  fill_fe_values (const typename Triangulation<dim,spacedim>::cell_iterator &cell,
223  const CellSimilarity::Similarity cell_similarity,
224  const Quadrature<dim> &quadrature,
225  const typename Mapping<dim,spacedim>::InternalDataBase &internal_data,
227 
228  // documentation can be found in Mapping::fill_fe_face_values()
229  virtual
230  void
231  fill_fe_face_values (const typename Triangulation<dim,spacedim>::cell_iterator &cell,
232  const unsigned int face_no,
233  const Quadrature<dim-1> &quadrature,
234  const typename Mapping<dim,spacedim>::InternalDataBase &internal_data,
236 
237  // documentation can be found in Mapping::fill_fe_subface_values()
238  virtual
239  void
240  fill_fe_subface_values (const typename Triangulation<dim,spacedim>::cell_iterator &cell,
241  const unsigned int face_no,
242  const unsigned int subface_no,
243  const Quadrature<dim-1> &quadrature,
244  const typename Mapping<dim,spacedim>::InternalDataBase &internal_data,
246 
256  void compute_fill (const typename Triangulation<dim,spacedim>::cell_iterator &cell,
257  const unsigned int face_no,
258  const unsigned int sub_no,
259  const CellSimilarity::Similarity cell_similarity,
260  const InternalData &data,
261  std::vector<Point<dim> > &quadrature_points,
262  std::vector<Tensor<1,dim> > &normal_vectors) const;
263 
268 };
269 
272 DEAL_II_NAMESPACE_CLOSE
273 
274 #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
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
MappingType
Definition: mapping.h:51
std::vector< Point< dim > > quadrature_points
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_subface_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
Abstract base class for mapping classes.
Definition: dof_tools.h:46
static const unsigned int invalid_face_number
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_face_data(const UpdateFlags flags, const Quadrature< dim-1 > &quadrature) const override
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
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