FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
FEAT::Trafo::HierarchicalInverseMapping< InverseMappingType_, CFMappingType_ > Class Template Reference

Accelerated inverse mapping for multigrid hierarchies. More...

#include <inverse_mapping.hpp>

Public Types

using CFMappingType = CFMappingType_
 the type of mapping between mesh levels More...
 
using DataType = typename InverseMappingType::DataType
 the datatype to be used More...
 
using DomainPointType = typename InvMapDataType::DomainPointType
 the domain point type More...
 
using ImagePointType = typename InvMapDataType::ImagePointType
 the image point type More...
 
using InverseMappingType = InverseMappingType_
 the type of the inverse mapping on each level More...
 
using InvMapDataType = typename InverseMappingType::InvMapDataType
 the inverse mapping data type More...
 
using ShapeType = typename InverseMappingType::ShapeType
 the shape type More...
 
using TrafoType = typename InverseMappingType::TrafoType
 the underlying trafo type More...
 

Public Member Functions

 HierarchicalInverseMapping ()=default
 Constructor.
 
 HierarchicalInverseMapping (const HierarchicalInverseMapping &other)=delete
 Copy constructor.
 
 HierarchicalInverseMapping (HierarchicalInverseMapping &&other)=default
 Move constructor.
 
virtual ~HierarchicalInverseMapping ()=default
 virtual destructor
 
const TrafoType & get_trafo () const
 Return a reference to the underlying trafo on the finest level. More...
 
HierarchicalInverseMapping & operator= (const HierarchicalInverseMapping &other)=delete
 Copy-assignment operator.
 
HierarchicalInverseMapping & operator= (HierarchicalInverseMapping &&other)=default
 Move-assignment operator.
 
void push_level (const InverseMappingType &imapping)
 Push the coarse level into the hierarchy. More...
 
void push_level (const InverseMappingType &imapping, const CFMappingType_ &cf_mapping)
 Push a fine level into the hierarchy. More...
 
InvMapDataType unmap_point (const ImagePointType &img_point, bool ignore_failures=false) const
 Unmaps a given image point. More...
 

Static Public Attributes

static constexpr int shape_dim = ShapeType::dimension
 the shape dimension More...
 
static constexpr int world_dim = TrafoType::world_dim
 the world dimension More...
 

Protected Attributes

std::deque< CFMappingType_ > _coarse_fine_mappings
 deque of mapping between levels More...
 
std::deque< std::reference_wrapper< const InverseMappingType > > _mappings
 deque of inverse mapping for each level More...
 

Static Private Member Functions

static bool try_unmap (const InverseMappingType &mapping, DomainPointType &domain_point, const ImagePointType &img_point, const Index cell, const bool ignore_failures=false)
 Try to unmap a point. More...
 

Detailed Description

template<typename InverseMappingType_, typename CFMappingType_>
class FEAT::Trafo::HierarchicalInverseMapping< InverseMappingType_, CFMappingType_ >

Accelerated inverse mapping for multigrid hierarchies.

This class provides an accelerated inverse mapping for situations in which a multigrid hierarchy is available. This accelerated mapping works by first unmapping the given point on the coarse mesh and then successively checking child-cells to determine all cells on the finest mesh that contain the given point.

Definition at line 607 of file inverse_mapping.hpp.

Member Typedef Documentation

◆ CFMappingType

template<typename InverseMappingType_ , typename CFMappingType_ >
using FEAT::Trafo::HierarchicalInverseMapping< InverseMappingType_, CFMappingType_ >::CFMappingType = CFMappingType_

the type of mapping between mesh levels

Definition at line 630 of file inverse_mapping.hpp.

◆ DataType

template<typename InverseMappingType_ , typename CFMappingType_ >
using FEAT::Trafo::HierarchicalInverseMapping< InverseMappingType_, CFMappingType_ >::DataType = typename InverseMappingType::DataType

the datatype to be used

Definition at line 615 of file inverse_mapping.hpp.

◆ DomainPointType

template<typename InverseMappingType_ , typename CFMappingType_ >
using FEAT::Trafo::HierarchicalInverseMapping< InverseMappingType_, CFMappingType_ >::DomainPointType = typename InvMapDataType::DomainPointType

the domain point type

Definition at line 628 of file inverse_mapping.hpp.

◆ ImagePointType

template<typename InverseMappingType_ , typename CFMappingType_ >
using FEAT::Trafo::HierarchicalInverseMapping< InverseMappingType_, CFMappingType_ >::ImagePointType = typename InvMapDataType::ImagePointType

the image point type

Definition at line 626 of file inverse_mapping.hpp.

◆ InverseMappingType

template<typename InverseMappingType_ , typename CFMappingType_ >
using FEAT::Trafo::HierarchicalInverseMapping< InverseMappingType_, CFMappingType_ >::InverseMappingType = InverseMappingType_

the type of the inverse mapping on each level

Definition at line 611 of file inverse_mapping.hpp.

◆ InvMapDataType

template<typename InverseMappingType_ , typename CFMappingType_ >
using FEAT::Trafo::HierarchicalInverseMapping< InverseMappingType_, CFMappingType_ >::InvMapDataType = typename InverseMappingType::InvMapDataType

the inverse mapping data type

Definition at line 624 of file inverse_mapping.hpp.

◆ ShapeType

template<typename InverseMappingType_ , typename CFMappingType_ >
using FEAT::Trafo::HierarchicalInverseMapping< InverseMappingType_, CFMappingType_ >::ShapeType = typename InverseMappingType::ShapeType

the shape type

Definition at line 617 of file inverse_mapping.hpp.

◆ TrafoType

template<typename InverseMappingType_ , typename CFMappingType_ >
using FEAT::Trafo::HierarchicalInverseMapping< InverseMappingType_, CFMappingType_ >::TrafoType = typename InverseMappingType::TrafoType

the underlying trafo type

Definition at line 613 of file inverse_mapping.hpp.

Member Function Documentation

◆ get_trafo()

template<typename InverseMappingType_ , typename CFMappingType_ >
const TrafoType & FEAT::Trafo::HierarchicalInverseMapping< InverseMappingType_, CFMappingType_ >::get_trafo ( ) const
inline

Return a reference to the underlying trafo on the finest level.

Definition at line 699 of file inverse_mapping.hpp.

References FEAT::Trafo::HierarchicalInverseMapping< InverseMappingType_, CFMappingType_ >::_mappings.

◆ push_level() [1/2]

template<typename InverseMappingType_ , typename CFMappingType_ >
void FEAT::Trafo::HierarchicalInverseMapping< InverseMappingType_, CFMappingType_ >::push_level ( const InverseMappingType &  imapping)
inline

Push the coarse level into the hierarchy.

Parameters
[in]imappingInverse mapping on coarse level

Must be called before any other levels are pushed into the hierarchy.

Warning
The references to the inverse mapping and the coarse-fine mapping are stored and must outlive the HierarchicalInverseMapping

Definition at line 668 of file inverse_mapping.hpp.

References FEAT::Trafo::HierarchicalInverseMapping< InverseMappingType_, CFMappingType_ >::_mappings, and XASSERT.

◆ push_level() [2/2]

template<typename InverseMappingType_ , typename CFMappingType_ >
void FEAT::Trafo::HierarchicalInverseMapping< InverseMappingType_, CFMappingType_ >::push_level ( const InverseMappingType &  imapping,
const CFMappingType_ &  cf_mapping 
)
inline

Push a fine level into the hierarchy.

Must be called after the coarse level was pushed into the hierarchy.

Parameters
[in]imappingInverse mapping for new level
[in]cf_mappingMapping from previously finest level to this new level
Warning
The references to the inverse mapping and the coarse-fine mapping are stored and must outlive the HierarchicalInverseMapping

Definition at line 687 of file inverse_mapping.hpp.

References FEAT::Trafo::HierarchicalInverseMapping< InverseMappingType_, CFMappingType_ >::_coarse_fine_mappings, FEAT::Trafo::HierarchicalInverseMapping< InverseMappingType_, CFMappingType_ >::_mappings, and XASSERT.

◆ try_unmap()

template<typename InverseMappingType_ , typename CFMappingType_ >
static bool FEAT::Trafo::HierarchicalInverseMapping< InverseMappingType_, CFMappingType_ >::try_unmap ( const InverseMappingType &  mapping,
DomainPointType &  domain_point,
const ImagePointType &  img_point,
const Index  cell,
const bool  ignore_failures = false 
)
inlinestaticprivate

Try to unmap a point.

Parameters
[in]mappingInverse mapping to unmap with
[out]domain_pointUnmapped point
[in]img_pointPoint on mesh to unmap
[in]cellCell to try to unmap on
[in]ignore_failuresSpecifies whether to ignore cells on which the Newton iteration broke down. If set to false, an InverseMappingError will be thrown if Newton fails to converge, otherwise the corresponding cell will be skipped.
Returns
False if the point could not be unmapped, true otherwise

Definition at line 804 of file inverse_mapping.hpp.

References FEAT::img_point.

Referenced by FEAT::Trafo::HierarchicalInverseMapping< InverseMappingType_, CFMappingType_ >::unmap_point().

◆ unmap_point()

template<typename InverseMappingType_ , typename CFMappingType_ >
InvMapDataType FEAT::Trafo::HierarchicalInverseMapping< InverseMappingType_, CFMappingType_ >::unmap_point ( const ImagePointType &  img_point,
bool  ignore_failures = false 
) const
inline

Unmaps a given image point.

This function "unmaps" a point given in real world coordinates, i.e. this function determines the set of cells that intersect with the given point and also computes the corresponding domain points for each of these cells.

Attention
This function may throw an InverseMappingError if the given input point img_point could not be unmapped for a candidate cell, unless ignore_failures was set to true. This usually indicates that the mesh has quite ill-formed cell shapes, which cause the Newton iteration to diverge – especially, if the point to be tested is not on the candidate cell, but outside of it.

\Note You should be sure that at least on cell in the given Cell array does indeed contain the inquired point. Else you the more costly overload function above

Parameters
[in]img_pointThe image point that is to be unmapped.
[in]ignore_failuresSpecifies whether to ignore cells on which the Newton iteration broke down. If set to false, an InverseMappingError will be thrown if Newton fails to converge, otherwise the corresponding cell will be skipped.
Returns
An InvMapDataType object that contains the set of cells and domain points, which are mapped onto the given img_point.

Definition at line 734 of file inverse_mapping.hpp.

References FEAT::Trafo::HierarchicalInverseMapping< InverseMappingType_, CFMappingType_ >::_coarse_fine_mappings, FEAT::Trafo::HierarchicalInverseMapping< InverseMappingType_, CFMappingType_ >::_mappings, FEAT::img_point, FEAT::Trafo::HierarchicalInverseMapping< InverseMappingType_, CFMappingType_ >::try_unmap(), and XASSERT.

Member Data Documentation

◆ _coarse_fine_mappings

template<typename InverseMappingType_ , typename CFMappingType_ >
std::deque<CFMappingType_> FEAT::Trafo::HierarchicalInverseMapping< InverseMappingType_, CFMappingType_ >::_coarse_fine_mappings
protected

◆ _mappings

template<typename InverseMappingType_ , typename CFMappingType_ >
std::deque<std::reference_wrapper<const InverseMappingType> > FEAT::Trafo::HierarchicalInverseMapping< InverseMappingType_, CFMappingType_ >::_mappings
protected

◆ shape_dim

template<typename InverseMappingType_ , typename CFMappingType_ >
constexpr int FEAT::Trafo::HierarchicalInverseMapping< InverseMappingType_, CFMappingType_ >::shape_dim = ShapeType::dimension
staticconstexpr

the shape dimension

Definition at line 619 of file inverse_mapping.hpp.

◆ world_dim

template<typename InverseMappingType_ , typename CFMappingType_ >
constexpr int FEAT::Trafo::HierarchicalInverseMapping< InverseMappingType_, CFMappingType_ >::world_dim = TrafoType::world_dim
staticconstexpr

the world dimension

Definition at line 621 of file inverse_mapping.hpp.


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