Reference documentation for deal.II version Git 2449c74b32 2021-01-19 22:49:31 +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_q.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_q_h
17 #define dealii_mapping_q_h
18 
19 
20 #include <deal.II/base/config.h>
21 
23 
25 
28 
79 template <int dim, int spacedim = dim>
80 class MappingQ : public Mapping<dim, spacedim>
81 {
82 public:
100  MappingQ(const unsigned int polynomial_degree,
101  const bool use_mapping_q_on_all_cells = false);
102 
106  MappingQ(const MappingQ<dim, spacedim> &mapping);
107 
112  unsigned int
113  get_degree() const;
114 
119  virtual bool
120  preserves_vertex_locations() const override;
121 
122  // for documentation, see the Mapping base class
123  virtual BoundingBox<spacedim>
125  &cell) const override;
126 
131  virtual Point<spacedim>
133  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
134  const Point<dim> &p) const override;
135 
157  virtual Point<dim>
159  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
160  const Point<spacedim> &p) const override;
161 
162  // for documentation, see the Mapping base class
163  virtual void
164  transform(const ArrayView<const Tensor<1, dim>> & input,
165  const MappingKind kind,
166  const typename Mapping<dim, spacedim>::InternalDataBase &internal,
167  const ArrayView<Tensor<1, spacedim>> &output) const override;
168 
169  // for documentation, see the Mapping base class
170  virtual void
172  const MappingKind kind,
173  const typename Mapping<dim, spacedim>::InternalDataBase &internal,
174  const ArrayView<Tensor<2, spacedim>> &output) const override;
175 
176  // for documentation, see the Mapping base class
177  virtual void
178  transform(const ArrayView<const Tensor<2, dim>> & input,
179  const MappingKind kind,
180  const typename Mapping<dim, spacedim>::InternalDataBase &internal,
181  const ArrayView<Tensor<2, spacedim>> &output) const override;
182 
183  // for documentation, see the Mapping base class
184  virtual void
186  const MappingKind kind,
187  const typename Mapping<dim, spacedim>::InternalDataBase &internal,
188  const ArrayView<Tensor<3, spacedim>> &output) const override;
189 
190  // for documentation, see the Mapping base class
191  virtual void
192  transform(const ArrayView<const Tensor<3, dim>> & input,
193  const MappingKind kind,
194  const typename Mapping<dim, spacedim>::InternalDataBase &internal,
195  const ArrayView<Tensor<3, spacedim>> &output) const override;
196 
202  virtual std::unique_ptr<Mapping<dim, spacedim>>
203  clone() const override;
204 
205 
211 protected:
232  class InternalData : public Mapping<dim, spacedim>::InternalDataBase
233  {
234  public:
238  InternalData();
239 
240 
244  virtual std::size_t
245  memory_consumption() const override;
246 
254 
259  std::unique_ptr<typename MappingQGeneric<dim, spacedim>::InternalData>
261 
266  std::unique_ptr<typename MappingQGeneric<dim, spacedim>::InternalData>
268  };
269 
270 protected:
271  // documentation can be found in Mapping::requires_update_flags()
272  virtual UpdateFlags
273  requires_update_flags(const UpdateFlags update_flags) const override;
274 
275  // documentation can be found in Mapping::get_data()
276  virtual std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
277  get_data(const UpdateFlags, const Quadrature<dim> &quadrature) const override;
278 
280 
281  // documentation can be found in Mapping::get_face_data()
282  virtual std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
283  get_face_data(const UpdateFlags flags,
284  const hp::QCollection<dim - 1> &quadrature) const override;
285 
286  // documentation can be found in Mapping::get_subface_data()
287  virtual std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
288  get_subface_data(const UpdateFlags flags,
289  const Quadrature<dim - 1> &quadrature) const override;
290 
291  // documentation can be found in Mapping::fill_fe_values()
294  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
295  const CellSimilarity::Similarity cell_similarity,
296  const Quadrature<dim> & quadrature,
297  const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
299  &output_data) const override;
300 
302 
303  // documentation can be found in Mapping::fill_fe_face_values()
304  virtual void
306  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
307  const unsigned int face_no,
308  const hp::QCollection<dim - 1> & quadrature,
309  const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
311  &output_data) const override;
312 
313  // documentation can be found in Mapping::fill_fe_subface_values()
314  virtual void
316  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
317  const unsigned int face_no,
318  const unsigned int subface_no,
319  const Quadrature<dim - 1> & quadrature,
320  const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
322  &output_data) const override;
323 
328 protected:
333  const unsigned int polynomial_degree;
334 
340 
358  std::shared_ptr<const MappingQGeneric<dim, spacedim>> q1_mapping;
359 
374  std::shared_ptr<const MappingQGeneric<dim, spacedim>> qp_mapping;
375 };
376 
380 
381 #endif
unsigned int get_degree() const
Definition: mapping_q.cc:122
virtual std::size_t memory_consumption() const override
Definition: mapping_q.cc:49
std::shared_ptr< const MappingQGeneric< dim, spacedim > > qp_mapping
Definition: mapping_q.h:374
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_data(const UpdateFlags, const Quadrature< dim > &quadrature) const override
Definition: mapping_q.cc:150
bool use_mapping_q1_on_current_cell
Definition: mapping_q.h:253
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_q.cc:388
const bool use_mapping_q_on_all_cells
Definition: mapping_q.h:339
MappingKind
Definition: mapping.h:64
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_face_data(const UpdateFlags flags, const hp::QCollection< dim - 1 > &quadrature) const override
Definition: mapping_q.cc:181
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_q.cc:342
UpdateFlags
Abstract base class for mapping classes.
Definition: mapping.h:303
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:380
const unsigned int polynomial_degree
Definition: mapping_q.h:333
virtual BoundingBox< spacedim > get_bounding_box(const typename Triangulation< dim, spacedim >::cell_iterator &cell) const override
Definition: mapping_q.cc:549
std::unique_ptr< typename MappingQGeneric< dim, spacedim >::InternalData > mapping_qp_data
Definition: mapping_q.h:267
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_subface_data(const UpdateFlags flags, const Quadrature< dim - 1 > &quadrature) const override
Definition: mapping_q.cc:218
virtual Point< spacedim > transform_unit_to_real_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< dim > &p) const override
Definition: mapping_q.cc:507
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
Definition: mapping_q.cc:306
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:379
virtual bool preserves_vertex_locations() const override
Definition: mapping_q.cc:131
virtual std::unique_ptr< Mapping< dim, spacedim > > clone() const override
Definition: mapping_q.cc:539
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_q.cc:252
std::unique_ptr< typename MappingQGeneric< dim, spacedim >::InternalData > mapping_q1_data
Definition: mapping_q.h:260
virtual UpdateFlags requires_update_flags(const UpdateFlags update_flags) const override
Definition: mapping_q.cc:140
MappingQ(const unsigned int polynomial_degree, const bool use_mapping_q_on_all_cells=false)
Definition: mapping_q.cc:61
virtual Point< dim > transform_real_to_unit_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< spacedim > &p) const override
Definition: mapping_q.cc:524
std::shared_ptr< const MappingQGeneric< dim, spacedim > > q1_mapping
Definition: mapping_q.h:358