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

The PODKernel class provides an interface to manage the mesh dependent members and functions of a POD object. More...

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

Public Member Functions

 PODKernel (MPI_Comm comm=MPI_COMM_WORLD)
 
 PODKernel (PODKernel &&other)=default
 
virtual ~PODKernel ()
 
void adaptionAlter (const std::vector< adaption::Info > &info, bool fillInv=true)
 
void adaptionCleanUp (const std::vector< adaption::Info > &info)
 
void adaptionPrepare (const std::vector< adaption::Info > &info)
 
void computeMapper (const VolumeKernel *mesh, bool fillInv=true)
 
void evalCellsVolume ()
 
double getCellVolume (long id)
 
MPI_Comm getCommunicator () const
 
VolumeMappergetMapper ()
 
VolumeKernelgetMesh ()
 
double getRawCellVolume (long rawIndex)
 
bool isCommunicatorSet () const
 
bool isMapperDirty ()
 
- Public Member Functions inherited from bitpit::VTKBaseStreamer
virtual void absorbData (std::fstream &, const std::string &, VTKFormat, uint64_t, uint8_t, VTKDataType)
 
virtual void flushData (std::fstream &, const std::string &, VTKFormat)
 
template<typename T >
void flushValue (std::fstream &, VTKFormat, const T &value) const
 
template<typename T >
void flushValue (std::fstream &, VTKFormat, const T *values, int nValues) const
 

Protected Member Functions

virtual std::unique_ptr< VolumeMapper_computeMapper (const VolumeKernel *mesh, bool fillInv)=0
 
virtual void adaptMeshToMesh (const VolumeKernel *meshToAdapt, const VolumeKernel *meshReference)=0
 
void clear ()
 
void clearMapper ()
 
virtual std::unique_ptr< VolumeKernelcreateMesh ()=0
 
void freeCommunicator ()
 
void initializeCommunicator (MPI_Comm communicator)
 
virtual PiercedStorage< bool > mapBoolFieldToPOD (const PiercedStorage< bool > &field, const VolumeKernel *mesh, const std::unordered_set< long > *targetCells)=0
 
virtual void mapBoolFieldToPOD (const PiercedStorage< bool > &field, const VolumeKernel *mesh, const std::unordered_set< long > *targetCells, PiercedStorage< bool > &mappedField)=0
 
virtual std::unordered_set< long > mapCellsToPOD (const std::unordered_set< long > *cells)=0
 
virtual void mapFieldsFromPOD (PiercedStorage< double > &fields, const VolumeKernel *mesh, const std::unordered_set< long > *targetCells, const PiercedStorage< double > &mappedFields, const std::vector< std::size_t > &scalarIds, const std::vector< std::array< std::size_t, 3 > > &vectorIds)=0
 
virtual PiercedStorage< double > mapFieldsToPOD (const PiercedStorage< double > &fields, const VolumeKernel *mesh, const std::unordered_set< long > *targetCells, const std::vector< std::size_t > &scalarIds, const std::vector< std::array< std::size_t, 3 > > &vectorIds)=0
 
virtual void mapPODFieldFromPOD (pod::PODField &field, const std::unordered_set< long > *targetCells, const pod::PODField &mappedField)=0
 
virtual pod::PODField mapPODFieldToPOD (const pod::PODField &field, const std::unordered_set< long > *targetCells)=0
 
std::unique_ptr< VolumeKernelreadMesh (const pod::SnapshotFile &snap)
 
void restoreMesh (const pod::SnapshotFile &snap)
 
void setMapperDirty (bool dirty=true)
 
void setMesh (std::unique_ptr< VolumeKernel > &&mesh)
 

Protected Attributes

PiercedStorage< double > m_cellsVolume
 
MPI_Comm m_communicator
 
bool m_dirtymap
 
std::unique_ptr< VolumeMapperm_meshmap
 
std::unique_ptr< VolumeKernelm_meshPOD
 
int m_nProcs
 
int m_rank
 

Friends

class POD
 

Detailed Description

The PODKernel class provides an interface to manage the mesh dependent members and functions of a POD object.

PODKernel is the base class to manage the mesh dependent members and functions of a POD object.

Definition at line 41 of file pod_kernel.hpp.

Constructor & Destructor Documentation

◆ PODKernel() [1/2]

bitpit::PODKernel::PODKernel ( MPI_Comm comm = MPI_COMM_WORLD)

Creates a new PODKernel object.

Parameters
[in]commThe MPI communicator used by the pod object. MPI_COMM_WORLD is the default value.

Definition at line 58 of file pod_kernel.cpp.

◆ ~PODKernel()

bitpit::PODKernel::~PODKernel ( )
virtual

Destructor of PODKernel

Definition at line 88 of file pod_kernel.cpp.

◆ PODKernel() [2/2]

bitpit::PODKernel::PODKernel ( PODKernel && other)
default

Default copy constructor.

Parameters
[in]otherInput PODKernel object

Member Function Documentation

◆ adaptionAlter()

void bitpit::PODKernel::adaptionAlter ( const std::vector< adaption::Info > & info,
bool fillInv = true )

Update the mapping pre-computed of an input mesh to the POD mesh by the info given after an adaptation of the input mesh (internal method).

Parameters
[in]infoInfo vector result of adaptation of the input mesh
[in]fillInvIf true even the inverse mapping is computed.

Definition at line 226 of file pod_kernel.cpp.

◆ adaptionCleanUp()

void bitpit::PODKernel::adaptionCleanUp ( const std::vector< adaption::Info > & info)

Clean up the mapping internal structures.

Parameters
[in]infoInfo vector result of adaptation of the input mesh

Definition at line 236 of file pod_kernel.cpp.

◆ adaptionPrepare()

void bitpit::PODKernel::adaptionPrepare ( const std::vector< adaption::Info > & info)

Prepare the pre-computed mapping of an input mesh to the POD mesh by the info given before an adaptation of the input mesh (internal method).

Parameters
[in]infoInfo vector result of adaptation prepare of the input mesh

Definition at line 214 of file pod_kernel.cpp.

◆ clear()

void bitpit::PODKernel::clear ( )
protected

Cleaning PODKernel

Definition at line 96 of file pod_kernel.cpp.

◆ clearMapper()

void bitpit::PODKernel::clearMapper ( )
protected

Clear the mapping info.

Definition at line 255 of file pod_kernel.cpp.

◆ computeMapper()

void bitpit::PODKernel::computeMapper ( const VolumeKernel * mesh,
bool fillInv = true )

Compute the mapping of an input mesh on the pod mesh.

Parameters
[in]meshPointer to input mesh.
[in]fillInvIf true even the inverse mapping is computed.

Definition at line 194 of file pod_kernel.cpp.

◆ evalCellsVolume()

void bitpit::PODKernel::evalCellsVolume ( )

Compute the volume of the cells of the mesh and store them in a member.

Definition at line 159 of file pod_kernel.cpp.

◆ freeCommunicator()

void bitpit::PODKernel::freeCommunicator ( )
protected

Frees the MPI communicator associated to the patch

Definition at line 327 of file pod_kernel.cpp.

◆ getCellVolume()

double bitpit::PODKernel::getCellVolume ( long id)

Get the volume of a cell of the mesh.

Parameters
[in]idCell id

Definition at line 174 of file pod_kernel.cpp.

◆ getCommunicator()

MPI_Comm bitpit::PODKernel::getCommunicator ( ) const

Returns the MPI communicator stored within LevelSetKernel.

Returns
MPI communicator.

Definition at line 307 of file pod_kernel.cpp.

◆ getMapper()

VolumeMapper * bitpit::PODKernel::getMapper ( )

Get the stored pre-computed mapping.

Returns
mesh mapper.

Definition at line 246 of file pod_kernel.cpp.

◆ getMesh()

bitpit::VolumeKernel * bitpit::PODKernel::getMesh ( )

Get a pointer to the POD mesh.

Returns
The const pointer to the POD mesh.

Definition at line 120 of file pod_kernel.cpp.

◆ getRawCellVolume()

double bitpit::PODKernel::getRawCellVolume ( long rawIndex)

Get the volume of a cell of the mesh.

Parameters
[in]rawIndexCell raw index

Definition at line 184 of file pod_kernel.cpp.

◆ initializeCommunicator()

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

Initializes the MPI communicator to be used for parallel communications.

Parameters
communicatoris the communicator.

Definition at line 285 of file pod_kernel.cpp.

◆ isCommunicatorSet()

bool bitpit::PODKernel::isCommunicatorSet ( ) const

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 318 of file pod_kernel.cpp.

◆ isMapperDirty()

bool bitpit::PODKernel::isMapperDirty ( )

Get if the mapper has to be recomputed. return Is the mapping dirty?

Definition at line 274 of file pod_kernel.cpp.

◆ readMesh()

std::unique_ptr< VolumeKernel > bitpit::PODKernel::readMesh ( const pod::SnapshotFile & snap)
protected

Read the mesh from file.

Parameters
[in]snapSnapshot filename.

Definition at line 130 of file pod_kernel.cpp.

◆ restoreMesh()

void bitpit::PODKernel::restoreMesh ( const pod::SnapshotFile & snap)
protected

Restore the mesh from file.

Parameters
[in]snapSnapshot filename.

Definition at line 150 of file pod_kernel.cpp.

◆ setMapperDirty()

void bitpit::PODKernel::setMapperDirty ( bool dirty = true)
protected

Set if the mapper has to be recomputed. param[in] Dirty mapping flag

Definition at line 265 of file pod_kernel.cpp.

◆ setMesh()

void bitpit::PODKernel::setMesh ( std::unique_ptr< VolumeKernel > && mesh)
protected

Set the pointer to the POD mesh.

param[in] The pointer to the POD mesh.

Definition at line 110 of file pod_kernel.cpp.

Friends And Related Symbol Documentation

◆ POD

friend class POD
friend

Definition at line 43 of file pod_kernel.hpp.

Member Data Documentation

◆ m_cellsVolume

PiercedStorage<double> bitpit::PODKernel::m_cellsVolume
protected

Cells volume of POD mesh

Definition at line 80 of file pod_kernel.hpp.

◆ m_communicator

MPI_Comm bitpit::PODKernel::m_communicator
protected

MPI communicator

Definition at line 83 of file pod_kernel.hpp.

◆ m_dirtymap

bool bitpit::PODKernel::m_dirtymap
protected

True if mapping has to be recomputed/updated [to be set by set method].

Definition at line 90 of file pod_kernel.hpp.

◆ m_meshmap

std::unique_ptr<VolumeMapper> bitpit::PODKernel::m_meshmap
protected

Mapping object TO pod mesh.

Definition at line 88 of file pod_kernel.hpp.

◆ m_meshPOD

std::unique_ptr<VolumeKernel> bitpit::PODKernel::m_meshPOD
protected

POD mesh

Definition at line 79 of file pod_kernel.hpp.

◆ m_nProcs

int bitpit::PODKernel::m_nProcs
protected

Number of processes.

Definition at line 86 of file pod_kernel.hpp.

◆ m_rank

int bitpit::PODKernel::m_rank
protected

Local rank of process.

Definition at line 85 of file pod_kernel.hpp.


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