Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
bitpit::VolumeMapper Class Referenceabstract

The VolumeMapper is the class to map two meshes. More...

Inheritance diagram for bitpit::VolumeMapper:
Inheritance graph
[legend]
Collaboration diagram for bitpit::VolumeMapper:
Collaboration graph
[legend]

Public Member Functions

virtual void adaptionAlter (const std::vector< adaption::Info > &infoAdapt, bool reference=true, bool fillInv=false)=0
 
virtual void adaptionCleanup ()=0
 
virtual void adaptionPrepare (const std::vector< adaption::Info > &infoAdapt, bool reference=true)=0
 
virtual bool checkPartition ()=0
 
void clear ()
 
void clearInverseMapping ()
 
void clearMapping ()
 
const bitpit::PiercedStorage< mapping::Info > & getInverseMapping () const
 
const VolumeKernelgetMappedPatch () const
 
const bitpit::PiercedStorage< mapping::Info > & getMapping () const
 
virtual std::unordered_map< int, std::vector< long > > getReceivedMappedIds () const =0
 
virtual std::unordered_map< int, std::vector< long > > getReceivedReferenceIds () const =0
 
const VolumeKernelgetReferencePatch () const
 
virtual std::unordered_map< int, std::vector< long > > getSentMappedIds () const =0
 
virtual std::unordered_map< int, std::vector< long > > getSentReferenceIds () const =0
 
void initialize (bool fillInv=false)
 

Protected Member Functions

 VolumeMapper (const VolumeKernel *referencePatch, const VolumeKernel *mappedPatch, MPI_Comm communicator)
 
virtual void _mapMeshes (bool fillInverse)=0
 
void freeCommunicator ()
 
MPI_Comm getCommunicator () const
 
void initializeCommunicator (MPI_Comm communicator)
 
bool isCommunicatorSet () const
 

Protected Attributes

MPI_Comm m_communicator
 
PiercedStorage< mapping::Infom_inverseMapping
 
const VolumeKernelm_mappedPatch
 
PiercedStorage< mapping::Infom_mapping
 
int m_nProcs
 
std::unordered_map< long, mapping::Infom_previousMapping
 
int m_rank
 
const VolumeKernelm_referencePatch
 

Detailed Description

The VolumeMapper is the class to map two meshes.

The VolumeMapper allows to map meshes of class VolumeKernel. The meshes are defined as a reference mesh and a mapped mesh.

The object can provide a direct mapper and a inverse mapper between only the cells of the meshes.

The information given by a mapper object is analogous to an adaptation info to adapt the mapped mesh to the reference one (or vice versa in case of inverse mapper).

The two meshes have to be imperatively linked at declaration of the mapper object.

To compute the mapper the first time call initialize method. Then, if the reference mesh OR the mapped mesh (one at a time) is adapted, the mapper can be adapted together by passing the adaptation information to the prepare and alter methods. A load-balancing procedure is not allowed, i.e. the mapper has to be entirely recomputed after a load-balance of a mesh.

Note that the VolumeMapper class is a pure virtual class, only objects of its complete derived classes can be instantiated.

The core method of the mapping procedure and the adapting mesh functions have to be implemented in a derived class.

Definition at line 102 of file volume_mapper.hpp.

Constructor & Destructor Documentation

◆ VolumeMapper()

bitpit::VolumeMapper::VolumeMapper ( const VolumeKernel * referencePatch,
const VolumeKernel * mappedPatch,
MPI_Comm communicator )
protected

Constructor.

Parameters
[in]referencePatchis the reference mesh
[in]mappedPatchis the mapped mesh
[in]communicatoris the MPI communicator

Definition at line 73 of file volume_mapper.cpp.

Member Function Documentation

◆ adaptionAlter()

virtual void bitpit::VolumeMapper::adaptionAlter ( const std::vector< adaption::Info > & infoAdapt,
bool reference = true,
bool fillInv = false )
pure virtual

Implemented in bitpit::VolOctreeMapper.

◆ adaptionCleanup()

virtual void bitpit::VolumeMapper::adaptionCleanup ( )
pure virtual

Implemented in bitpit::VolOctreeMapper.

◆ adaptionPrepare()

virtual void bitpit::VolumeMapper::adaptionPrepare ( const std::vector< adaption::Info > & infoAdapt,
bool reference = true )
pure virtual

Implemented in bitpit::VolOctreeMapper.

◆ checkPartition()

virtual bool bitpit::VolumeMapper::checkPartition ( )
pure virtual

Implemented in bitpit::VolOctreeMapper.

◆ clear()

void bitpit::VolumeMapper::clear ( )

Clear mapping members

Definition at line 90 of file volume_mapper.cpp.

◆ clearInverseMapping()

void bitpit::VolumeMapper::clearInverseMapping ( )

Clear inverse mapping

Definition at line 111 of file volume_mapper.cpp.

◆ clearMapping()

void bitpit::VolumeMapper::clearMapping ( )

Clear direct mapping

Definition at line 99 of file volume_mapper.cpp.

◆ freeCommunicator()

void bitpit::VolumeMapper::freeCommunicator ( )
protected

Frees the MPI communicator associated to the mapper.

Definition at line 226 of file volume_mapper.cpp.

◆ getCommunicator()

MPI_Comm bitpit::VolumeMapper::getCommunicator ( ) const
protected

Returns the MPI communicator stored within LevelSetKernel.

Returns
Return the MPI communicator.

Definition at line 207 of file volume_mapper.cpp.

◆ getInverseMapping()

const bitpit::PiercedStorage< mapping::Info > & bitpit::VolumeMapper::getInverseMapping ( ) const

Get inverse mapping

Definition at line 151 of file volume_mapper.cpp.

◆ getMappedPatch()

const bitpit::VolumeKernel * bitpit::VolumeMapper::getMappedPatch ( ) const

Get a constant point to the mapped patch

Returns
a constant pointer to the mapped patch

Definition at line 135 of file volume_mapper.cpp.

◆ getMapping()

const bitpit::PiercedStorage< mapping::Info > & bitpit::VolumeMapper::getMapping ( ) const

Get direct mapping

Definition at line 143 of file volume_mapper.cpp.

◆ getReceivedMappedIds()

virtual std::unordered_map< int, std::vector< long > > bitpit::VolumeMapper::getReceivedMappedIds ( ) const
pure virtual

Implemented in bitpit::VolOctreeMapper.

◆ getReceivedReferenceIds()

virtual std::unordered_map< int, std::vector< long > > bitpit::VolumeMapper::getReceivedReferenceIds ( ) const
pure virtual

Implemented in bitpit::VolOctreeMapper.

◆ getReferencePatch()

const bitpit::VolumeKernel * bitpit::VolumeMapper::getReferencePatch ( ) const

Get a constant point to the reference patch

Returns
a constant pointer to the reference patch

Definition at line 125 of file volume_mapper.cpp.

◆ getSentMappedIds()

virtual std::unordered_map< int, std::vector< long > > bitpit::VolumeMapper::getSentMappedIds ( ) const
pure virtual

Implemented in bitpit::VolOctreeMapper.

◆ getSentReferenceIds()

virtual std::unordered_map< int, std::vector< long > > bitpit::VolumeMapper::getSentReferenceIds ( ) const
pure virtual

Implemented in bitpit::VolOctreeMapper.

◆ initialize()

void bitpit::VolumeMapper::initialize ( bool fillInverse = false)

Initialize (compute for the first time) the mapper of the mapped mesh on the reference mesh.

The two meshes are set in the constructor of the derived object.

Parameters
[in]fillInverseif set to true the inverse mapped (reference mesh to input mesh) will be filled

Definition at line 165 of file volume_mapper.cpp.

◆ initializeCommunicator()

void bitpit::VolumeMapper::initializeCommunicator ( MPI_Comm communicator)
protected

Initialize the MPI communicator to be used for parallel communications.

Parameters
communicatoris the communicator.

Definition at line 178 of file volume_mapper.cpp.

◆ isCommunicatorSet()

bool bitpit::VolumeMapper::isCommunicatorSet ( ) const
protected

Checks if the communicator to be used for parallel communications has already been set.

Returns
Returns true if the communicator has been set, false otherwise.

Definition at line 218 of file volume_mapper.cpp.

Member Data Documentation

◆ m_communicator

MPI_Comm bitpit::VolumeMapper::m_communicator
protected

MPI communicator

Definition at line 144 of file volume_mapper.hpp.

◆ m_inverseMapping

PiercedStorage<mapping::Info> bitpit::VolumeMapper::m_inverseMapping
protected

Inverse mapping info for each cell of mapped mesh.

Definition at line 139 of file volume_mapper.hpp.

◆ m_mappedPatch

const VolumeKernel* bitpit::VolumeMapper::m_mappedPatch
protected

Pointer to mapped mesh.

Definition at line 133 of file volume_mapper.hpp.

◆ m_mapping

PiercedStorage<mapping::Info> bitpit::VolumeMapper::m_mapping
protected

Mapping info for each cell of reference mesh. The mapping info is treated as a set of adaption info related to an adaption of the mapped mesh toward the reference mesh.

Definition at line 135 of file volume_mapper.hpp.

◆ m_nProcs

int bitpit::VolumeMapper::m_nProcs
protected

Number of processes.

Definition at line 146 of file volume_mapper.hpp.

◆ m_previousMapping

std::unordered_map<long, mapping::Info> bitpit::VolumeMapper::m_previousMapping
protected

Temporary mapping used during a mesh adaptation.

Definition at line 141 of file volume_mapper.hpp.

◆ m_rank

int bitpit::VolumeMapper::m_rank
protected

Local rank of process.

Definition at line 145 of file volume_mapper.hpp.

◆ m_referencePatch

const VolumeKernel* bitpit::VolumeMapper::m_referencePatch
protected

Pointer to reference mesh.

Definition at line 132 of file volume_mapper.hpp.


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