PolyDEAL
 
Loading...
Searching...
No Matches
MappingBox< dim, spacedim > Class Template Reference

#include <mapping_box.h>

Inheritance diagram for MappingBox< dim, spacedim >:
Mapping< dim, dim > EnableObserverPointer

Classes

class  InternalData
 

Public Member Functions

 MappingBox (const std::vector< BoundingBox< dim > > &local_boxes, const std::map< types::global_cell_index, types::global_cell_index > &polytope_translator)
 
virtual std::unique_ptr< Mapping< dim, spacedim > > clone () const override
 
virtual bool preserves_vertex_locations () const override
 
virtual bool is_compatible_with (const ReferenceCell &reference_cell) const override
 
Mapping points between reference and real cells
virtual Point< spacedim > transform_unit_to_real_cell (const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< dim > &p) 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
 
Functions to transform tensors from reference to real coordinates
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 transform (const ArrayView< const DerivativeForm< 1, dim, spacedim > > &input, const MappingKind kind, const typename Mapping< dim, spacedim >::InternalDataBase &internal, const ArrayView< Tensor< 2, spacedim > > &output) const override
 
virtual void transform (const ArrayView< const Tensor< 2, dim > > &input, const MappingKind kind, const typename Mapping< dim, spacedim >::InternalDataBase &internal, const ArrayView< Tensor< 2, spacedim > > &output) const override
 
virtual void transform (const ArrayView< const DerivativeForm< 2, dim, spacedim > > &input, const MappingKind kind, const typename Mapping< dim, spacedim >::InternalDataBase &internal, const ArrayView< Tensor< 3, spacedim > > &output) const override
 
virtual void transform (const ArrayView< const Tensor< 3, dim > > &input, const MappingKind kind, const typename Mapping< dim, spacedim >::InternalDataBase &internal, const ArrayView< Tensor< 3, spacedim > > &output) const override
 
- Public Member Functions inherited from Mapping< dim, dim >
virtual ~Mapping () override=default
 
virtual boost::container::small_vector< Point< spacedim >, ReferenceCells::max_n_vertices< dim >() > get_vertices (const typename Triangulation< dim, spacedim >::cell_iterator &cell) const
 
boost::container::small_vector< Point< spacedim >, ReferenceCells::max_n_vertices< dim - 1 >() > get_vertices (const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no) const
 
virtual Point< spacedim > get_center (const typename Triangulation< dim, spacedim >::cell_iterator &cell, const bool map_barycenter_of_reference_cell=true) const
 
virtual BoundingBox< spacedim > get_bounding_box (const typename Triangulation< dim, spacedim >::cell_iterator &cell) const
 
void serialize (Archive &ar, const unsigned int version)
 
Point< dim - 1 > project_real_point_to_unit_point_on_face (const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no, const Point< spacedim > &p) const
 
Point< dim - 1 > project_real_point_to_unit_point_on_face (const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no, const Point< spacedim > &p) const
 
unsigned int n_subscriptions () const
 
unsigned int n_subscriptions () const
 
void list_subscribers (StreamType &stream) const
 
void list_subscribers () const
 
void list_subscribers (StreamType &stream) const
 
void list_subscribers () const
 
- Public Member Functions inherited from EnableObserverPointer
 EnableObserverPointer ()
 
 EnableObserverPointer (const EnableObserverPointer &)
 
 EnableObserverPointer (EnableObserverPointer &&) noexcept
 
virtual ~EnableObserverPointer ()
 
EnableObserverPointeroperator= (const EnableObserverPointer &)
 
EnableObserverPointeroperator= (EnableObserverPointer &&) noexcept
 
void serialize (Archive &ar, const unsigned int version)
 
unsigned int n_subscriptions () const
 
void list_subscribers (StreamType &stream) const
 
void list_subscribers () const
 
unsigned int n_subscriptions () const
 
void list_subscribers (StreamType &stream) const
 
void list_subscribers () const
 

Private Member Functions

void update_cell_extents (const typename Triangulation< dim, spacedim >::cell_iterator &cell, const CellSimilarity::Similarity cell_similarity, const InternalData &data) const
 
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_normal_vectors (const unsigned int face_no, const InternalData &data, std::vector< Tensor< 1, dim > > &normal_vectors) const
 
void maybe_update_jacobian_derivatives (const InternalData &data, const CellSimilarity::Similarity cell_similarity, internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &output_data) const
 
void maybe_update_volume_elements (const InternalData &data) const
 
void maybe_update_jacobians (const InternalData &data, const CellSimilarity::Similarity cell_similarity, internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &output_data) const
 
void maybe_update_inverse_jacobians (const InternalData &data, const CellSimilarity::Similarity cell_similarity, internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &output_data) const
 
Interface with FEValues
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< 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
 
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_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
 

Private Attributes

std::vector< BoundingBox< dim > > boxes
 
std::map< types::global_cell_index, types::global_cell_indexpolytope_translator
 

Additional Inherited Members

- Static Public Member Functions inherited from Mapping< dim, dim >
static ::ExceptionBaseExcInUse (int arg1, std::string arg2, std::string arg3)
 
static ::ExceptionBaseExcNoSubscriber (std::string arg1, std::string arg2)
 
static ::ExceptionBaseExcInvalidData ()
 
static ::ExceptionBaseExcInvalidData ()
 
static ::ExceptionBaseExcTransformationFailed ()
 
static ::ExceptionBaseExcTransformationFailed ()
 
static ::ExceptionBaseExcDistortedMappedCell (Point< spacedim > arg1, double arg2, int arg3)
 
static ::ExceptionBaseExcDistortedMappedCell (Point< spacedim > arg1, double arg2, int arg3)
 
- Static Public Member Functions inherited from EnableObserverPointer
static ::ExceptionBaseExcInUse (int arg1, std::string arg2, std::string arg3)
 
static ::ExceptionBaseExcNoSubscriber (std::string arg1, std::string arg2)
 
- Protected Member Functions inherited from Mapping< dim, dim >
virtual std::unique_ptr< InternalDataBase > get_face_data (const UpdateFlags update_flags, const hp::QCollection< dim - 1 > &quadrature) const
 
virtual std::unique_ptr< InternalDataBase > get_face_data (const UpdateFlags update_flags, const Quadrature< dim - 1 > &quadrature) const
 
virtual std::unique_ptr< InternalDataBase > get_face_data (const UpdateFlags update_flags, const hp::QCollection< dim - 1 > &quadrature) const
 
virtual std::unique_ptr< InternalDataBase > get_face_data (const UpdateFlags update_flags, const Quadrature< dim - 1 > &quadrature) const
 
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
 
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
 
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
 
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
 

Detailed Description

template<int dim, int spacedim = dim>
class MappingBox< dim, spacedim >

A class providing a mapping from the reference cell to cells that are axiparallel, i.e., that have the shape of rectangles (in 2d) or boxes (in 3d) with edges parallel to the coordinate directions. The class therefore provides functionality that is equivalent to what, for example, MappingQ would provide for such cells. However, knowledge of the shape of cells allows this class to be substantially more efficient.

Specifically, the mapping is meant for cells for which the mapping from the reference to the real cell is a scaling along the coordinate directions: The transformation from reference coordinates $\hat {\mathbf x}$ to real coordinates $\mathbf x$ on each cell is of the form

\begin{align*} {\mathbf x}(\hat {\mathbf x}) = \begin{pmatrix} h_x & 0 \\ 0 & h_y \end{pmatrix} \hat{\mathbf x} + {\mathbf v}_0 \end{align*}

in 2d, and

\begin{align*} {\mathbf x}(\hat {\mathbf x}) = \begin{pmatrix} h_x & 0 & 0 \\ 0 & h_y & 0 \\ 0 & 0 & h_z \end{pmatrix} \hat{\mathbf x} + {\mathbf v}_0 \end{align*}

in 3d, where ${\mathbf v}_0$ is the bottom left vertex and $h_x,h_y,h_z$ are the extents of the cell along the axes.

The class is intended for efficiency, and it does not do a whole lot of error checking. If you apply this mapping to a cell that does not conform to the requirements above, you will get strange results.

Definition at line 79 of file mapping_box.h.

Constructor & Destructor Documentation

◆ MappingBox()

template<int dim, int spacedim>
MappingBox< dim, spacedim >::MappingBox ( const std::vector< BoundingBox< dim > > & local_boxes,
const std::map< types::global_cell_index, types::global_cell_index > & polytope_translator )

Definition at line 68 of file mapping_box.cc.

References boxes, and polytope_translator.

Member Function Documentation

◆ clone()

template<int dim, int spacedim>
std::unique_ptr< Mapping< dim, spacedim > > MappingBox< dim, spacedim >::clone ( ) const
overridevirtual

Implements Mapping< dim, dim >.

Definition at line 975 of file mapping_box.cc.

◆ fill_fe_immersed_surface_values()

◆ fill_fe_subface_values()

template<int dim, int spacedim>
void MappingBox< dim, spacedim >::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
overrideprivatevirtual

Implements Mapping< dim, dim >.

Definition at line 445 of file mapping_box.cc.

◆ fill_fe_values()

◆ get_data()

template<int dim, int spacedim>
std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > MappingBox< dim, spacedim >::get_data ( const UpdateFlags update_flags,
const Quadrature< dim > & quadrature ) const
overrideprivatevirtual

Implements Mapping< dim, dim >.

Definition at line 168 of file mapping_box.cc.

References requires_update_flags().

◆ get_subface_data()

template<int dim, int spacedim>
std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > MappingBox< dim, spacedim >::get_subface_data ( const UpdateFlags flags,
const Quadrature< dim - 1 > & quadrature ) const
overrideprivatevirtual

Implements Mapping< dim, dim >.

Definition at line 182 of file mapping_box.cc.

◆ is_compatible_with()

template<int dim, int spacedim>
bool MappingBox< dim, spacedim >::is_compatible_with ( const ReferenceCell & reference_cell) const
overridevirtual

Implements Mapping< dim, dim >.

Definition at line 133 of file mapping_box.cc.

References Utilities::to_string().

◆ maybe_update_cell_quadrature_points()

template<int dim, int spacedim>
void MappingBox< dim, spacedim >::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
private

Compute the quadrature points if the UpdateFlags of the incoming InternalData object say that they should be updated.

Called from fill_fe_values.

Definition at line 246 of file mapping_box.cc.

References boxes, and polytope_translator.

Referenced by fill_fe_immersed_surface_values(), and fill_fe_values().

◆ maybe_update_inverse_jacobians()

template<int dim, int spacedim>
void MappingBox< dim, spacedim >::maybe_update_inverse_jacobians ( const InternalData & data,
const CellSimilarity::Similarity cell_similarity,
internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > & output_data ) const
private

Compute the inverse Jacobians if the UpdateFlags of the incoming InternalData object say that they should be updated.

Definition at line 372 of file mapping_box.cc.

References internal::FEValuesImplementation::MappingRelatedData< int dim, int spacedim >::inverse_jacobians, and CellSimilarity::translation.

Referenced by fill_fe_immersed_surface_values(), and fill_fe_values().

◆ maybe_update_jacobian_derivatives()

◆ maybe_update_jacobians()

template<int dim, int spacedim>
void MappingBox< dim, spacedim >::maybe_update_jacobians ( const InternalData & data,
const CellSimilarity::Similarity cell_similarity,
internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > & output_data ) const
private

Compute the Jacobians if the UpdateFlags of the incoming InternalData object say that they should be updated.

Definition at line 350 of file mapping_box.cc.

References internal::FEValuesImplementation::MappingRelatedData< int dim, int spacedim >::jacobians, and CellSimilarity::translation.

Referenced by fill_fe_immersed_surface_values(), and fill_fe_values().

◆ maybe_update_normal_vectors()

template<int dim, int spacedim>
void MappingBox< dim, spacedim >::maybe_update_normal_vectors ( const unsigned int face_no,
const InternalData & data,
std::vector< Tensor< 1, dim > > & normal_vectors ) const
private

Compute the normal vectors if the UpdateFlags of the incoming InternalData object say that they should be updated.

Definition at line 263 of file mapping_box.cc.

References GeometryInfo< int dim >::faces_per_cell, and GeometryInfo< int dim >::unit_normal_vector.

◆ maybe_update_volume_elements()

template<int dim, int spacedim>
void MappingBox< dim, spacedim >::maybe_update_volume_elements ( const InternalData & data) const
private

Compute the volume elements if the UpdateFlags of the incoming InternalData object say that they should be updated.

Definition at line 334 of file mapping_box.cc.

Referenced by fill_fe_immersed_surface_values().

◆ preserves_vertex_locations()

template<int dim, int spacedim>
bool MappingBox< dim, spacedim >::preserves_vertex_locations ( ) const
overridevirtual

Return true because MappingBox preserves vertex locations.

Implements Mapping< dim, dim >.

Definition at line 124 of file mapping_box.cc.

◆ requires_update_flags()

template<int dim, int spacedim>
UpdateFlags MappingBox< dim, spacedim >::requires_update_flags ( const UpdateFlags update_flags) const
overrideprivatevirtual

Implements Mapping< dim, dim >.

Definition at line 150 of file mapping_box.cc.

Referenced by get_data().

◆ transform() [1/5]

template<int dim, int spacedim>
void MappingBox< dim, spacedim >::transform ( const ArrayView< const DerivativeForm< 1, dim, spacedim > > & input,
const MappingKind kind,
const typename Mapping< dim, spacedim >::InternalDataBase & internal,
const ArrayView< Tensor< 2, spacedim > > & output ) const
overridevirtual

Implements Mapping< dim, dim >.

Definition at line 569 of file mapping_box.cc.

References FEValuesBase::ExcAccessToUninitializedField().

◆ transform() [2/5]

template<int dim, int spacedim>
void MappingBox< dim, spacedim >::transform ( const ArrayView< const DerivativeForm< 2, dim, spacedim > > & input,
const MappingKind kind,
const typename Mapping< dim, spacedim >::InternalDataBase & internal,
const ArrayView< Tensor< 3, spacedim > > & output ) const
overridevirtual

Implements Mapping< dim, dim >.

Definition at line 795 of file mapping_box.cc.

References FEValuesBase::ExcAccessToUninitializedField().

◆ transform() [3/5]

template<int dim, int spacedim>
void MappingBox< dim, spacedim >::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
overridevirtual

Implements Mapping< dim, dim >.

Definition at line 509 of file mapping_box.cc.

References FEValuesBase::ExcAccessToUninitializedField().

◆ transform() [4/5]

template<int dim, int spacedim>
void MappingBox< dim, spacedim >::transform ( const ArrayView< const Tensor< 2, dim > > & input,
const MappingKind kind,
const typename Mapping< dim, spacedim >::InternalDataBase & internal,
const ArrayView< Tensor< 2, spacedim > > & output ) const
overridevirtual

Implements Mapping< dim, dim >.

Definition at line 682 of file mapping_box.cc.

References FEValuesBase::ExcAccessToUninitializedField().

◆ transform() [5/5]

template<int dim, int spacedim>
void MappingBox< dim, spacedim >::transform ( const ArrayView< const Tensor< 3, dim > > & input,
const MappingKind kind,
const typename Mapping< dim, spacedim >::InternalDataBase & internal,
const ArrayView< Tensor< 3, spacedim > > & output ) const
overridevirtual

Implements Mapping< dim, dim >.

Definition at line 834 of file mapping_box.cc.

References FEValuesBase::ExcAccessToUninitializedField().

◆ transform_points_real_to_unit_cell()

template<int dim, int spacedim>
void MappingBox< dim, spacedim >::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
overridevirtual

Reimplemented from Mapping< dim, dim >.

Definition at line 955 of file mapping_box.cc.

References boxes, has_box(), and polytope_translator.

◆ transform_real_to_unit_cell()

template<int dim, int spacedim>
Point< dim > MappingBox< dim, spacedim >::transform_real_to_unit_cell ( const typename Triangulation< dim, spacedim >::cell_iterator & cell,
const Point< spacedim > & p ) const
overridevirtual

Implements Mapping< dim, dim >.

Definition at line 940 of file mapping_box.cc.

References boxes, has_box(), and polytope_translator.

◆ transform_unit_to_real_cell()

template<int dim, int spacedim>
Point< spacedim > MappingBox< dim, spacedim >::transform_unit_to_real_cell ( const typename Triangulation< dim, spacedim >::cell_iterator & cell,
const Point< dim > & p ) const
overridevirtual

Implements Mapping< dim, dim >.

Definition at line 925 of file mapping_box.cc.

References boxes, has_box(), and polytope_translator.

◆ update_cell_extents()

template<int dim, int spacedim>
void MappingBox< dim, spacedim >::update_cell_extents ( const typename Triangulation< dim, spacedim >::cell_iterator & cell,
const CellSimilarity::Similarity cell_similarity,
const InternalData & data ) const
private

Member Data Documentation

◆ boxes

template<int dim, int spacedim = dim>
std::vector<BoundingBox<dim> > MappingBox< dim, spacedim >::boxes
private

◆ polytope_translator

template<int dim, int spacedim = dim>
std::map<types::global_cell_index, types::global_cell_index> MappingBox< dim, spacedim >::polytope_translator
private

The documentation for this class was generated from the following files: