Reference documentation for deal.II version 9.6.0
\(\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\}}\)
Loading...
Searching...
No Matches
mapping_manifold.h
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 2016 - 2024 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Part of the source code is dual licensed under Apache-2.0 WITH
9// LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10// governing the source code and code contributions can be found in
11// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12//
13// ------------------------------------------------------------------------
14
15#ifndef dealii_mapping_manifold_h
16#define dealii_mapping_manifold_h
17
18
19#include <deal.II/base/config.h>
20
24
25#include <deal.II/fe/mapping.h>
26
27#include <cmath>
28
30
53template <int dim, int spacedim = dim>
54class MappingManifold : public Mapping<dim, spacedim>
55{
56public:
60 MappingManifold() = default;
61
66
67 // for documentation, see the Mapping base class
68 virtual std::unique_ptr<Mapping<dim, spacedim>>
69 clone() const override;
70
75 virtual bool
77
78 virtual bool
79 is_compatible_with(const ReferenceCell &cell_type) const override;
80
86 // for documentation, see the Mapping base class
87 virtual Point<spacedim>
90 const Point<dim> &p) const override;
91
92 // for documentation, see the Mapping base class
93 virtual Point<dim>
96 const Point<spacedim> &p) const override;
97
107 // for documentation, see the Mapping base class
108 virtual void
109 transform(const ArrayView<const Tensor<1, dim>> &input,
110 const MappingKind kind,
112 const ArrayView<Tensor<1, spacedim>> &output) const override;
113
114 // for documentation, see the Mapping base class
115 virtual void
117 const MappingKind kind,
119 const ArrayView<Tensor<2, spacedim>> &output) const override;
120
121 // for documentation, see the Mapping base class
122 virtual void
123 transform(const ArrayView<const Tensor<2, dim>> &input,
124 const MappingKind kind,
126 const ArrayView<Tensor<2, spacedim>> &output) const override;
127
128 // for documentation, see the Mapping base class
129 virtual void
131 const MappingKind kind,
133 const ArrayView<Tensor<3, spacedim>> &output) const override;
134
135 // for documentation, see the Mapping base class
136 virtual void
137 transform(const ArrayView<const Tensor<3, dim>> &input,
138 const MappingKind kind,
140 const ArrayView<Tensor<3, spacedim>> &output) const override;
141
162 class InternalData : public Mapping<dim, spacedim>::InternalDataBase
163 {
164 public:
168 InternalData() = default;
169
170 // Documentation see Mapping::InternalDataBase.
171 virtual void
172 reinit(const UpdateFlags update_flags,
173 const Quadrature<dim> &quadrature) override;
174
180 void
181 initialize_face(const UpdateFlags update_flags,
182 const Quadrature<dim> &quadrature,
183 const unsigned int n_original_q_points);
184
190 void
192
196 void
199
203 virtual std::size_t
204 memory_consumption() const override;
205
211 mutable std::vector<Point<spacedim>> vertices;
212
219
226
245 std::vector<std::vector<double>> cell_manifold_quadrature_weights;
246
261 mutable std::vector<double> vertex_weights;
262
276 std::array<std::vector<Tensor<1, dim>>,
279
289 mutable std::vector<DerivativeForm<1, dim, spacedim>> covariant;
290
298 mutable std::vector<DerivativeForm<1, dim, spacedim>> contravariant;
299
303 mutable std::vector<std::vector<Tensor<1, spacedim>>> aux;
304
309 mutable std::vector<double> volume_elements;
310
317 };
318
319private:
320 // documentation can be found in Mapping::requires_update_flags()
321 virtual UpdateFlags
322 requires_update_flags(const UpdateFlags update_flags) const override;
323
324 // documentation can be found in Mapping::get_data()
325 virtual std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
326 get_data(const UpdateFlags, const Quadrature<dim> &quadrature) const override;
327
328 using Mapping<dim, spacedim>::get_face_data;
329
330 // documentation can be found in Mapping::get_face_data()
331 virtual std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
332 get_face_data(const UpdateFlags flags,
333 const hp::QCollection<dim - 1> &quadrature) const override;
334
335 // documentation can be found in Mapping::get_subface_data()
336 virtual std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
337 get_subface_data(const UpdateFlags flags,
338 const Quadrature<dim - 1> &quadrature) const override;
339
340 // documentation can be found in Mapping::fill_fe_values()
344 const CellSimilarity::Similarity cell_similarity,
345 const Quadrature<dim> &quadrature,
346 const typename Mapping<dim, spacedim>::InternalDataBase &internal_data,
348 &output_data) const override;
349
350 using Mapping<dim, spacedim>::fill_fe_face_values;
351
352 // documentation can be found in Mapping::fill_fe_face_values()
353 virtual void
356 const unsigned int face_no,
357 const hp::QCollection<dim - 1> &quadrature,
358 const typename Mapping<dim, spacedim>::InternalDataBase &internal_data,
360 &output_data) const override;
361
362 // documentation can be found in Mapping::fill_fe_subface_values()
363 virtual void
366 const unsigned int face_no,
367 const unsigned int subface_no,
368 const Quadrature<dim - 1> &quadrature,
369 const typename Mapping<dim, spacedim>::InternalDataBase &internal_data,
371 &output_data) const override;
372
376};
377
378
379
382/*----------------------------------------------------------------------*/
383
384#ifndef DOXYGEN
385
386template <int dim, int spacedim>
387inline bool
389{
390 return true;
391}
392
393
394template <int dim, int spacedim>
395bool
397 const ReferenceCell &cell_type) const
398{
399 if (cell_type.get_dimension() != dim)
400 return false; // TODO: or is this an error?
401
402 if (cell_type.is_hyper_cube())
403 return true;
404
405 return false;
406}
407
408
409
410#endif // DOXYGEN
411
412/* -------------- declaration of explicit specializations ------------- */
413
414
416
417#endif
void store_vertices(const typename Triangulation< dim, spacedim >::cell_iterator &cell) const
std::vector< double > volume_elements
std::array< std::vector< Tensor< 1, dim > >, GeometryInfo< dim >::faces_per_cell *(dim - 1)> unit_tangentials
std::vector< DerivativeForm< 1, dim, spacedim > > contravariant
SmartPointer< const Manifold< dim, spacedim > > manifold
std::vector< std::vector< Tensor< 1, spacedim > > > aux
virtual std::size_t memory_consumption() const override
std::vector< std::vector< double > > cell_manifold_quadrature_weights
void initialize_face(const UpdateFlags update_flags, const Quadrature< dim > &quadrature, const unsigned int n_original_q_points)
virtual void reinit(const UpdateFlags update_flags, const Quadrature< dim > &quadrature) override
std::vector< Point< spacedim > > vertices
std::vector< double > vertex_weights
void compute_manifold_quadrature_weights(const Quadrature< dim > &quadrature)
std::vector< DerivativeForm< 1, dim, spacedim > > covariant
Triangulation< dim, spacedim >::cell_iterator cell
virtual Point< spacedim > transform_unit_to_real_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< dim > &p) const override
MappingManifold()=default
virtual Point< dim > transform_real_to_unit_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< spacedim > &p) const override
virtual bool is_compatible_with(const ReferenceCell &cell_type) 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
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
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
virtual bool preserves_vertex_locations() const override
virtual UpdateFlags requires_update_flags(const UpdateFlags update_flags) const override
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_data(const UpdateFlags, const Quadrature< dim > &quadrature) const override
virtual std::unique_ptr< Mapping< dim, spacedim > > clone() const override
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_face_data(const UpdateFlags flags, const hp::QCollection< dim - 1 > &quadrature) const override
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_subface_data(const UpdateFlags flags, const Quadrature< dim - 1 > &quadrature) const override
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
Abstract base class for mapping classes.
Definition mapping.h:318
Definition point.h:111
bool is_hyper_cube() const
unsigned int get_dimension() const
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:503
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:504
UpdateFlags
MappingKind
Definition mapping.h:79