deal.II version GIT relicensing-2287-g6548a49e0a 2024-12-20 18:30:00+00:00
\(\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_cartesian.h
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 2001 - 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_cartesian_h
16#define dealii_mapping_cartesian_h
17
18
19#include <deal.II/base/config.h>
20
22
23#include <deal.II/fe/mapping.h>
24
25#include <cmath>
26
27
29
77template <int dim, int spacedim = dim>
78class MappingCartesian : public Mapping<dim, spacedim>
79{
80public:
81 // for documentation, see the Mapping base class
82 virtual std::unique_ptr<Mapping<dim, spacedim>>
83 clone() const override;
84
89 virtual bool
90 preserves_vertex_locations() const override;
91
92 virtual bool
93 is_compatible_with(const ReferenceCell &reference_cell) const override;
94
100 // for documentation, see the Mapping base class
101 virtual Point<spacedim>
104 const Point<dim> &p) const override;
105
106 // for documentation, see the Mapping base class
107 virtual Point<dim>
110 const Point<spacedim> &p) const override;
111
112 // for documentation, see the Mapping base class
113 virtual void
116 const ArrayView<const Point<spacedim>> &real_points,
117 const ArrayView<Point<dim>> &unit_points) const override;
118
128 // for documentation, see the Mapping base class
129 virtual void
130 transform(const ArrayView<const Tensor<1, dim>> &input,
131 const MappingKind kind,
133 const ArrayView<Tensor<1, spacedim>> &output) const override;
134
135 // for documentation, see the Mapping base class
136 virtual void
138 const MappingKind kind,
140 const ArrayView<Tensor<2, spacedim>> &output) const override;
141
142 // for documentation, see the Mapping base class
143 virtual void
144 transform(const ArrayView<const Tensor<2, dim>> &input,
145 const MappingKind kind,
147 const ArrayView<Tensor<2, spacedim>> &output) const override;
148
149 // for documentation, see the Mapping base class
150 virtual void
152 const MappingKind kind,
154 const ArrayView<Tensor<3, spacedim>> &output) const override;
155
156 // for documentation, see the Mapping base class
157 virtual void
158 transform(const ArrayView<const Tensor<3, dim>> &input,
159 const MappingKind kind,
161 const ArrayView<Tensor<3, spacedim>> &output) const override;
162
184 void
187 const ArrayView<const Point<dim>> &unit_points,
188 const UpdateFlags update_flags,
190 &output_data) const;
191
208 class InternalData : public Mapping<dim, spacedim>::InternalDataBase
209 {
210 public:
214 InternalData() = default;
215
219 InternalData(const Quadrature<dim> &quadrature);
220
221 // Documentation see Mapping::InternalDataBase.
222 virtual void
223 reinit(const UpdateFlags update_flags,
224 const Quadrature<dim> &quadrature) override;
225
229 virtual std::size_t
230 memory_consumption() const override;
231
237
244
248 mutable double volume_element;
249
255 std::vector<Point<dim>> quadrature_points;
256 };
257
258private:
259 // documentation can be found in Mapping::requires_update_flags()
260 virtual UpdateFlags
261 requires_update_flags(const UpdateFlags update_flags) const override;
262
263 // documentation can be found in Mapping::get_data()
264 virtual std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
265 get_data(const UpdateFlags, const Quadrature<dim> &quadrature) const override;
266
267 using Mapping<dim, spacedim>::get_face_data;
268
269 // documentation can be found in Mapping::get_face_data()
270 virtual std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
271 get_face_data(const UpdateFlags flags,
272 const hp::QCollection<dim - 1> &quadrature) const override;
273
274 // documentation can be found in Mapping::get_subface_data()
275 virtual std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
276 get_subface_data(const UpdateFlags flags,
277 const Quadrature<dim - 1> &quadrature) const override;
278
279 // documentation can be found in Mapping::fill_fe_values()
283 const CellSimilarity::Similarity cell_similarity,
284 const Quadrature<dim> &quadrature,
285 const typename Mapping<dim, spacedim>::InternalDataBase &internal_data,
287 &output_data) const override;
288
289 using Mapping<dim, spacedim>::fill_fe_face_values;
290
291 // documentation can be found in Mapping::fill_fe_face_values()
292 virtual void
295 const unsigned int face_no,
296 const hp::QCollection<dim - 1> &quadrature,
297 const typename Mapping<dim, spacedim>::InternalDataBase &internal_data,
299 &output_data) const override;
300
301 // documentation can be found in Mapping::fill_fe_subface_values()
302 virtual void
305 const unsigned int face_no,
306 const unsigned int subface_no,
307 const Quadrature<dim - 1> &quadrature,
308 const typename Mapping<dim, spacedim>::InternalDataBase &internal_data,
310 &output_data) const override;
311
312 // documentation can be found in Mapping::fill_fe_immersed_surface_values()
313 virtual void
317 const typename Mapping<dim, spacedim>::InternalDataBase &internal_data,
319 &output_data) const override;
320
329 void
332 const CellSimilarity::Similarity cell_similarity,
333 const InternalData &data) const;
334
341 void
344 const InternalData &data,
345 const ArrayView<const Point<dim>> &unit_quadrature_points,
346 std::vector<Point<dim>> &quadrature_points) const;
347
354 void
357 const unsigned int face_no,
358 const InternalData &data,
359 std::vector<Point<dim>> &quadrature_points) const;
360
367 void
370 const unsigned int face_no,
371 const unsigned int sub_no,
372 const InternalData &data,
373 std::vector<Point<dim>> &quadrature_points) const;
374
379 void
381 const unsigned int face_no,
382 const InternalData &data,
383 std::vector<Tensor<1, dim>> &normal_vectors) const;
384
390 void
392 const InternalData &data,
393 const CellSimilarity::Similarity cell_similarity,
395 &output_data) const;
396
397
402 void
404
409 void
411 const InternalData &data,
412 const CellSimilarity::Similarity cell_similarity,
414 &output_data) const;
415
420 void
422 const InternalData &data,
423 const CellSimilarity::Similarity cell_similarity,
425 &output_data) const;
426};
427
431
432#endif
std::vector< Point< dim > > quadrature_points
virtual void reinit(const UpdateFlags update_flags, const Quadrature< dim > &quadrature) override
virtual std::size_t memory_consumption() 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
void maybe_update_cell_quadrature_points(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const InternalData &data, const ArrayView< const Point< dim > > &unit_quadrature_points, std::vector< Point< dim > > &quadrature_points) const
void maybe_update_volume_elements(const InternalData &data) const
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_face_data(const UpdateFlags flags, const hp::QCollection< dim - 1 > &quadrature) const override
virtual UpdateFlags requires_update_flags(const UpdateFlags update_flags) const override
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_subface_data(const UpdateFlags flags, const Quadrature< dim - 1 > &quadrature) const override
void update_cell_extents(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const CellSimilarity::Similarity cell_similarity, const InternalData &data) const
virtual void fill_fe_immersed_surface_values(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const NonMatching::ImmersedSurfaceQuadrature< dim > &quadrature, const typename Mapping< dim, spacedim >::InternalDataBase &internal_data, internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &output_data) const override
void maybe_update_jacobians(const InternalData &data, const CellSimilarity::Similarity cell_similarity, internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &output_data) const
void maybe_update_subface_quadrature_points(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no, const unsigned int sub_no, const InternalData &data, std::vector< Point< dim > > &quadrature_points) const
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
void maybe_update_face_quadrature_points(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no, const InternalData &data, std::vector< Point< dim > > &quadrature_points) const
virtual bool is_compatible_with(const ReferenceCell &reference_cell) 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 std::unique_ptr< Mapping< dim, spacedim > > clone() const override
virtual Point< dim > transform_real_to_unit_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< spacedim > &p) const override
virtual void transform_points_real_to_unit_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const ArrayView< const Point< spacedim > > &real_points, const ArrayView< Point< dim > > &unit_points) const override
void fill_mapping_data_for_generic_points(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const ArrayView< const Point< dim > > &unit_points, const UpdateFlags update_flags, internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &output_data) const
void maybe_update_jacobian_derivatives(const InternalData &data, const CellSimilarity::Similarity cell_similarity, internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &output_data) const
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
void maybe_update_normal_vectors(const unsigned int face_no, const InternalData &data, std::vector< Tensor< 1, dim > > &normal_vectors) const
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_data(const UpdateFlags, const Quadrature< dim > &quadrature) const override
void maybe_update_inverse_jacobians(const InternalData &data, const CellSimilarity::Similarity cell_similarity, internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &output_data) const
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
Abstract base class for mapping classes.
Definition mapping.h:318
Definition point.h:111
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:498
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:499
UpdateFlags
MappingKind
Definition mapping.h:79
std::vector< index_type > data
Definition mpi.cc:735