Reference documentation for deal.II version Git 53084d8c6a 2020-10-21 00:34:33 -0400
\(\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 
126  virtual Point<spacedim>
128  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
129  const Point<dim> &p) const override;
130 
152  virtual Point<dim>
154  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
155  const Point<spacedim> &p) const override;
156 
157  // for documentation, see the Mapping base class
158  virtual void
159  transform(const ArrayView<const Tensor<1, dim>> & input,
160  const MappingKind kind,
161  const typename Mapping<dim, spacedim>::InternalDataBase &internal,
162  const ArrayView<Tensor<1, spacedim>> &output) const override;
163 
164  // for documentation, see the Mapping base class
165  virtual void
167  const MappingKind kind,
168  const typename Mapping<dim, spacedim>::InternalDataBase &internal,
169  const ArrayView<Tensor<2, spacedim>> &output) const override;
170 
171  // for documentation, see the Mapping base class
172  virtual void
173  transform(const ArrayView<const Tensor<2, dim>> & input,
174  const MappingKind kind,
175  const typename Mapping<dim, spacedim>::InternalDataBase &internal,
176  const ArrayView<Tensor<2, spacedim>> &output) const override;
177 
178  // for documentation, see the Mapping base class
179  virtual void
181  const MappingKind kind,
182  const typename Mapping<dim, spacedim>::InternalDataBase &internal,
183  const ArrayView<Tensor<3, spacedim>> &output) const override;
184 
185  // for documentation, see the Mapping base class
186  virtual void
187  transform(const ArrayView<const Tensor<3, dim>> & input,
188  const MappingKind kind,
189  const typename Mapping<dim, spacedim>::InternalDataBase &internal,
190  const ArrayView<Tensor<3, spacedim>> &output) const override;
191 
197  virtual std::unique_ptr<Mapping<dim, spacedim>>
198  clone() const override;
199 
200 
206 protected:
227  class InternalData : public Mapping<dim, spacedim>::InternalDataBase
228  {
229  public:
233  InternalData();
234 
235 
239  virtual std::size_t
240  memory_consumption() const override;
241 
249 
254  std::unique_ptr<typename MappingQGeneric<dim, spacedim>::InternalData>
256 
261  std::unique_ptr<typename MappingQGeneric<dim, spacedim>::InternalData>
263  };
264 
265 protected:
266  // documentation can be found in Mapping::requires_update_flags()
267  virtual UpdateFlags
268  requires_update_flags(const UpdateFlags update_flags) const override;
269 
270  // documentation can be found in Mapping::get_data()
271  virtual std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
272  get_data(const UpdateFlags, const Quadrature<dim> &quadrature) const override;
273 
274  // documentation can be found in Mapping::get_face_data()
275  virtual std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
276  get_face_data(const UpdateFlags flags,
277  const Quadrature<dim - 1> &quadrature) const override;
278 
279  // documentation can be found in Mapping::get_subface_data()
280  virtual std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
281  get_subface_data(const UpdateFlags flags,
282  const Quadrature<dim - 1> &quadrature) const override;
283 
284  // documentation can be found in Mapping::fill_fe_values()
287  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
288  const CellSimilarity::Similarity cell_similarity,
289  const Quadrature<dim> & quadrature,
290  const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
292  &output_data) const override;
293 
294  // documentation can be found in Mapping::fill_fe_face_values()
295  virtual void
297  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
298  const unsigned int face_no,
299  const Quadrature<dim - 1> & quadrature,
300  const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
302  &output_data) const override;
303 
304  // documentation can be found in Mapping::fill_fe_subface_values()
305  virtual void
307  const typename Triangulation<dim, spacedim>::cell_iterator &cell,
308  const unsigned int face_no,
309  const unsigned int subface_no,
310  const Quadrature<dim - 1> & quadrature,
311  const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
313  &output_data) const override;
314 
319 protected:
324  const unsigned int polynomial_degree;
325 
331 
349  std::shared_ptr<const MappingQGeneric<dim, spacedim>> q1_mapping;
350 
365  std::shared_ptr<const MappingQGeneric<dim, spacedim>> qp_mapping;
366 };
367 
371 
372 #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:365
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:248
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_face_data(const UpdateFlags flags, const Quadrature< dim - 1 > &quadrature) const override
Definition: mapping_q.cc:181
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:384
const bool use_mapping_q_on_all_cells
Definition: mapping_q.h:330
MappingKind
Definition: mapping.h:62
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:338
UpdateFlags
Abstract base class for mapping classes.
Definition: mapping.h:301
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:369
const unsigned int polynomial_degree
Definition: mapping_q.h:324
std::unique_ptr< typename MappingQGeneric< dim, spacedim >::InternalData > mapping_qp_data
Definition: mapping_q.h:262
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:214
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:503
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:368
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:535
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:248
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_q.cc:302
std::unique_ptr< typename MappingQGeneric< dim, spacedim >::InternalData > mapping_q1_data
Definition: mapping_q.h:255
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:520
std::shared_ptr< const MappingQGeneric< dim, spacedim > > q1_mapping
Definition: mapping_q.h:349