The VolumeMapper is the class to map two meshes. More...
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 VolumeKernel * | getMappedPatch () 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 VolumeKernel * | getReferencePatch () 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::Info > | m_inverseMapping |
const VolumeKernel * | m_mappedPatch |
PiercedStorage< mapping::Info > | m_mapping |
int | m_nProcs |
std::unordered_map< long, mapping::Info > | m_previousMapping |
int | m_rank |
const VolumeKernel * | m_referencePatch |
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.
|
protected |
Constructor.
[in] | referencePatch | is the reference mesh |
[in] | mappedPatch | is the mapped mesh |
[in] | communicator | is the MPI communicator |
Definition at line 73 of file volume_mapper.cpp.
|
pure virtual |
Implemented in bitpit::VolOctreeMapper.
|
pure virtual |
Implemented in bitpit::VolOctreeMapper.
|
pure virtual |
Implemented in bitpit::VolOctreeMapper.
|
pure virtual |
Implemented in bitpit::VolOctreeMapper.
void bitpit::VolumeMapper::clear | ( | ) |
Clear mapping members
Definition at line 90 of file volume_mapper.cpp.
void bitpit::VolumeMapper::clearInverseMapping | ( | ) |
Clear inverse mapping
Definition at line 111 of file volume_mapper.cpp.
void bitpit::VolumeMapper::clearMapping | ( | ) |
Clear direct mapping
Definition at line 99 of file volume_mapper.cpp.
|
protected |
Frees the MPI communicator associated to the mapper.
Definition at line 226 of file volume_mapper.cpp.
|
protected |
Returns the MPI communicator stored within LevelSetKernel.
Definition at line 207 of file volume_mapper.cpp.
const bitpit::PiercedStorage< mapping::Info > & bitpit::VolumeMapper::getInverseMapping | ( | ) | const |
Get inverse mapping
Definition at line 151 of file volume_mapper.cpp.
const bitpit::VolumeKernel * bitpit::VolumeMapper::getMappedPatch | ( | ) | const |
Get a constant point to the mapped patch
Definition at line 135 of file volume_mapper.cpp.
const bitpit::PiercedStorage< mapping::Info > & bitpit::VolumeMapper::getMapping | ( | ) | const |
Get direct mapping
Definition at line 143 of file volume_mapper.cpp.
|
pure virtual |
Implemented in bitpit::VolOctreeMapper.
|
pure virtual |
Implemented in bitpit::VolOctreeMapper.
const bitpit::VolumeKernel * bitpit::VolumeMapper::getReferencePatch | ( | ) | const |
Get a constant point to the reference patch
Definition at line 125 of file volume_mapper.cpp.
|
pure virtual |
Implemented in bitpit::VolOctreeMapper.
|
pure virtual |
Implemented in bitpit::VolOctreeMapper.
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.
[in] | fillInverse | if set to true the inverse mapped (reference mesh to input mesh) will be filled |
Definition at line 165 of file volume_mapper.cpp.
|
protected |
Initialize the MPI communicator to be used for parallel communications.
communicator | is the communicator. |
Definition at line 178 of file volume_mapper.cpp.
|
protected |
Checks if the communicator to be used for parallel communications has already been set.
Definition at line 218 of file volume_mapper.cpp.
|
protected |
MPI communicator
Definition at line 144 of file volume_mapper.hpp.
|
protected |
Inverse mapping info for each cell of mapped mesh.
Definition at line 139 of file volume_mapper.hpp.
|
protected |
Pointer to mapped mesh.
Definition at line 133 of file volume_mapper.hpp.
|
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.
|
protected |
Number of processes.
Definition at line 146 of file volume_mapper.hpp.
|
protected |
Temporary mapping used during a mesh adaptation.
Definition at line 141 of file volume_mapper.hpp.
|
protected |
Local rank of process.
Definition at line 145 of file volume_mapper.hpp.
|
protected |
Pointer to reference mesh.
Definition at line 132 of file volume_mapper.hpp.