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

#include <mapping_box.h>

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

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 >, GeometryInfo< dim >::vertices_per_cell > get_vertices (const typename Triangulation< dim, spacedim >::cell_iterator &cell) const
 
boost::container::small_vector< Point< spacedim >, GeometryInfo< dim >::vertices_per_face > 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
 
void subscribe (std::atomic< bool > *const validity, const std::string &identifier="") const
 
void subscribe (std::atomic< bool > *const validity, const std::string &identifier="") const
 
void unsubscribe (std::atomic< bool > *const validity, const std::string &identifier="") const
 
void unsubscribe (std::atomic< bool > *const validity, const std::string &identifier="") 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 Subscriptor
 Subscriptor ()
 
 Subscriptor (const Subscriptor &)
 
 Subscriptor (Subscriptor &&) noexcept
 
virtual ~Subscriptor ()
 
Subscriptoroperator= (const Subscriptor &)
 
Subscriptoroperator= (Subscriptor &&) noexcept
 
void serialize (Archive &ar, const unsigned int version)
 
void subscribe (std::atomic< bool > *const validity, const std::string &identifier="") const
 
void unsubscribe (std::atomic< bool > *const validity, const std::string &identifier="") const
 
unsigned int n_subscriptions () const
 
void list_subscribers (StreamType &stream) const
 
void list_subscribers () const
 
void subscribe (std::atomic< bool > *const validity, const std::string &identifier="") const
 
void unsubscribe (std::atomic< bool > *const validity, const std::string &identifier="") 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 Subscriptor
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 Assert.

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()

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

◆ 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.

References DEAL_II_NOT_IMPLEMENTED.

◆ 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

◆ 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.

References DEAL_II_NOT_IMPLEMENTED.

◆ 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 Assert, reference_cell(), and 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 MappingBox< dim, spacedim >::boxes, MappingBox< dim, spacedim >::polytope_translator, Mapping::InternalDataBase::update_each, and update_quadrature_points.

Referenced by MappingBox< dim, spacedim >::fill_fe_immersed_surface_values(), and MappingBox< dim, spacedim >::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

◆ maybe_update_jacobian_derivatives()

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

◆ 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

◆ 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 Assert, Mapping::InternalDataBase::update_each, and update_normal_vectors.

◆ maybe_update_volume_elements()

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

◆ 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.

References update_boundary_forms, and update_normal_vectors.

Referenced by MappingBox< dim, spacedim >::get_data().

◆ transform() [1/5]

◆ 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

◆ transform() [3/5]

◆ transform() [4/5]

◆ transform() [5/5]

◆ 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

◆ 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

◆ 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

◆ update_cell_extents()

Member Data Documentation

◆ boxes

◆ polytope_translator


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