walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T > Class Template Reference

#include <PdfFieldPackInfo.h>

+ Inheritance diagram for walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >:

Public Types

using PdfField_T = PdfField< LatticeModel_T >
 
using Stencil = typename LatticeModel_T::Stencil
 

Public Member Functions

 PdfFieldPackInfo (const BlockDataID &pdfFieldId, const ConstBlockDataID &boundaryHandlingId, const bool _optimizedEqualLevelCommunication=true, const bool _optimizedForLinearExplosion=true)
 
 ~PdfFieldPackInfo () override=default
 
bool optimizedEqualLevelCommunication () const override
 
void optimizeEqualLevelCommunication (const bool value=true) override
 
bool optimizedForLinearExplosion () const override
 
void optimizeForLinearExplosion (const bool value=true) override
 
bool constantDataExchange () const override
 Should return true if the amount of data that is packed for a given block in direction "dir" is guaranteed to remain constant over time. More...
 
bool threadsafeReceiving () const override
 Must return false if calling unpackData and/or communicateLocal is not thread-safe. More...
 
void unpackDataEqualLevel (Block *receiver, stencil::Direction dir, mpi::RecvBuffer &buffer) override
 If NOT thread-safe, threadsafeReceiving must return false! More...
 
void communicateLocalEqualLevel (const Block *sender, Block *receiver, stencil::Direction dir) override
 If NOT thread-safe, threadsafeReceiving must return false! More...
 
void unpackDataCoarseToFine (Block *fineReceiver, const BlockID &coarseSender, stencil::Direction dir, mpi::RecvBuffer &buffer) override
 
void communicateLocalCoarseToFine (const Block *coarseSender, Block *fineReceiver, stencil::Direction dir) override
 
void unpackDataFineToCoarse (Block *coarseReceiver, const BlockID &fineSender, stencil::Direction dir, mpi::RecvBuffer &buffer) override
 
void communicateLocalFineToCoarse (const Block *fineSender, Block *coarseReceiver, stencil::Direction dir) override
 
- Public Member Functions inherited from walberla::blockforest::communication::NonUniformPackInfo
 NonUniformPackInfo ()=default
 
virtual ~NonUniformPackInfo ()=default
 
void packDataEqualLevel (const Block *sender, stencil::Direction dir, mpi::SendBuffer &buffer) const
 Must be thread-safe! Calls packDataImpl. More...
 
void packDataCoarseToFine (const Block *coarseSender, const BlockID &fineReceiver, stencil::Direction dir, mpi::SendBuffer &buffer) const
 
void packDataFineToCoarse (const Block *fineSender, const BlockID &coarseReceiver, stencil::Direction dir, mpi::SendBuffer &buffer) const
 
void clearBufferSizeCheckMap ()
 

Protected Member Functions

void packDataEqualLevelImpl (const Block *sender, stencil::Direction dir, mpi::SendBuffer &buffer) const override
 Must be thread-safe! More...
 
void packDataCoarseToFineImpl (const Block *coarseSender, const BlockID &fineReceiver, stencil::Direction dir, mpi::SendBuffer &buffer) const override
 
void packDataFineToCoarseImpl (const Block *fineSender, const BlockID &coarseReceiver, stencil::Direction dir, mpi::SendBuffer &buffer) const override
 
bool equalLevelFaceIntervalSplitable (const CellInterval &interval, stencil::Direction dir) const
 
std::vector< CellIntervalsplitEqualLevelFaceInterval (const CellInterval &interval, stencil::Direction dir) const
 
- Protected Member Functions inherited from walberla::blockforest::communication::NonUniformPackInfo

Static Protected Member Functions

static CellInterval equalLevelPackInterval (stencil::Direction dir, const CellInterval &cellBB, const uint_t numberOfLayers)
 
static CellInterval equalLevelUnpackInterval (stencil::Direction dir, const CellInterval &cellBB, const uint_t numberOfLayers)
 
static Vector3< cell_idx_tgetNeighborShift (const BlockID &smallBlock, stencil::Direction dir)
 
static CellInterval coarseToFinePackInterval (stencil::Direction dir, const CellInterval &cellBB, const BlockID &smallBlock)
 
static CellInterval coarseToFineUnpackInterval (stencil::Direction dir, const CellInterval &cellBB, const BlockID &smallBlock)
 
static CellInterval fineToCoarsePackInterval (stencil::Direction dir, const CellInterval &cellBB)
 
static CellInterval fineToCoarseUnpackInterval (stencil::Direction dir, const CellInterval &cellBB, const BlockID &smallBlock)
 
static uint_t equalLevelCells ()
 
static bool isFaceDirection (stencil::Direction dir)
 
static bool isEdgeDirection (stencil::Direction dir)
 
static bool isCornerDirection (stencil::Direction dir)
 
static bool blocksConnectedByFaces (const Block *block, const BlockID &neighbor)
 
static bool blocksConnectedByEdges (const Block *block, const BlockID &neighbor)
 
static bool divisibleByTwo (const CellInterval &cellBB)
 
static bool coarserNeighborExistsInVicinity (const Block *block, stencil::Direction dir)
 

Protected Attributes

BlockDataID pdfFieldId_
 
ConstBlockDataID boundaryHandlingId_
 
bool optimizedEqualLevelCommunication_
 
bool optimizedForLinearExplosion_
 
uint_t equalLevelCells_
 
- Protected Attributes inherited from walberla::blockforest::communication::NonUniformPackInfo
std::map< const Block *, std::map< stencil::Direction, std::map< uint_t, size_t > > > bufferSize_
 

Member Typedef Documentation

◆ PdfField_T

template<typename LatticeModel_T , typename BoundaryHandling_T >
using walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::PdfField_T = PdfField<LatticeModel_T>

◆ Stencil

template<typename LatticeModel_T , typename BoundaryHandling_T >
using walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::Stencil = typename LatticeModel_T::Stencil

Constructor & Destructor Documentation

◆ PdfFieldPackInfo()

template<typename LatticeModel_T , typename BoundaryHandling_T >
walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::PdfFieldPackInfo ( const BlockDataID pdfFieldId,
const ConstBlockDataID boundaryHandlingId,
const bool  _optimizedEqualLevelCommunication = true,
const bool  _optimizedForLinearExplosion = true 
)
inline

◆ ~PdfFieldPackInfo()

template<typename LatticeModel_T , typename BoundaryHandling_T >
walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::~PdfFieldPackInfo ( )
overridedefault

Member Function Documentation

◆ blocksConnectedByEdges()

template<typename LatticeModel_T , typename BoundaryHandling_T >
bool walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::blocksConnectedByEdges ( const Block block,
const BlockID neighbor 
)
inlinestaticprotected

◆ blocksConnectedByFaces()

template<typename LatticeModel_T , typename BoundaryHandling_T >
bool walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::blocksConnectedByFaces ( const Block block,
const BlockID neighbor 
)
inlinestaticprotected

◆ coarserNeighborExistsInVicinity()

template<typename LatticeModel_T , typename BoundaryHandling_T >
bool walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::coarserNeighborExistsInVicinity ( const Block block,
stencil::Direction  dir 
)
staticprotected

◆ coarseToFinePackInterval()

template<typename LatticeModel_T , typename BoundaryHandling_T >
CellInterval walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::coarseToFinePackInterval ( stencil::Direction  dir,
const CellInterval cellBB,
const BlockID smallBlock 
)
staticprotected

◆ coarseToFineUnpackInterval()

template<typename LatticeModel_T , typename BoundaryHandling_T >
CellInterval walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::coarseToFineUnpackInterval ( stencil::Direction  dir,
const CellInterval cellBB,
const BlockID smallBlock 
)
staticprotected

◆ communicateLocalCoarseToFine()

template<typename LatticeModel_T , typename BoundaryHandling_T >
void walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::communicateLocalCoarseToFine ( const Block coarseSender,
Block fineReceiver,
stencil::Direction  dir 
)
overridevirtual

◆ communicateLocalEqualLevel()

template<typename LatticeModel_T , typename BoundaryHandling_T >
void walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::communicateLocalEqualLevel ( const Block sender,
Block receiver,
stencil::Direction  dir 
)
overridevirtual

If NOT thread-safe, threadsafeReceiving must return false!

Implements walberla::blockforest::communication::NonUniformPackInfo.

◆ communicateLocalFineToCoarse()

template<typename LatticeModel_T , typename BoundaryHandling_T >
void walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::communicateLocalFineToCoarse ( const Block fineSender,
Block coarseReceiver,
stencil::Direction  dir 
)
overridevirtual

◆ constantDataExchange()

template<typename LatticeModel_T , typename BoundaryHandling_T >
bool walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::constantDataExchange ( ) const
inlineoverridevirtual

Should return true if the amount of data that is packed for a given block in direction "dir" is guaranteed to remain constant over time.

False otherwise. If you are not sure what to return, return false! Returning false is always save. Falsely return true will lead to errors! However, if the data can be guaranteed to remain constant over time, returning true enables performance optimizations during the communication.

Implements walberla::blockforest::communication::NonUniformPackInfo.

◆ divisibleByTwo()

template<typename LatticeModel_T , typename BoundaryHandling_T >
bool walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::divisibleByTwo ( const CellInterval cellBB)
inlinestaticprotected

◆ equalLevelCells()

template<typename LatticeModel_T , typename BoundaryHandling_T >
uint_t walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::equalLevelCells
inlinestaticprotected

◆ equalLevelFaceIntervalSplitable()

template<typename LatticeModel_T , typename BoundaryHandling_T >
bool walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::equalLevelFaceIntervalSplitable ( const CellInterval interval,
stencil::Direction  dir 
) const
inlineprotected

◆ equalLevelPackInterval()

template<typename LatticeModel_T , typename BoundaryHandling_T >
CellInterval walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::equalLevelPackInterval ( stencil::Direction  dir,
const CellInterval cellBB,
const uint_t  numberOfLayers 
)
inlinestaticprotected

◆ equalLevelUnpackInterval()

template<typename LatticeModel_T , typename BoundaryHandling_T >
CellInterval walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::equalLevelUnpackInterval ( stencil::Direction  dir,
const CellInterval cellBB,
const uint_t  numberOfLayers 
)
staticprotected

◆ fineToCoarsePackInterval()

template<typename LatticeModel_T , typename BoundaryHandling_T >
CellInterval walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::fineToCoarsePackInterval ( stencil::Direction  dir,
const CellInterval cellBB 
)
inlinestaticprotected

◆ fineToCoarseUnpackInterval()

template<typename LatticeModel_T , typename BoundaryHandling_T >
CellInterval walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::fineToCoarseUnpackInterval ( stencil::Direction  dir,
const CellInterval cellBB,
const BlockID smallBlock 
)
staticprotected

◆ getNeighborShift()

template<typename LatticeModel_T , typename BoundaryHandling_T >
Vector3< cell_idx_t > walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::getNeighborShift ( const BlockID smallBlock,
stencil::Direction  dir 
)
inlinestaticprotected

◆ isCornerDirection()

template<typename LatticeModel_T , typename BoundaryHandling_T >
bool walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::isCornerDirection ( stencil::Direction  dir)
inlinestaticprotected

◆ isEdgeDirection()

template<typename LatticeModel_T , typename BoundaryHandling_T >
bool walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::isEdgeDirection ( stencil::Direction  dir)
inlinestaticprotected

◆ isFaceDirection()

template<typename LatticeModel_T , typename BoundaryHandling_T >
bool walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::isFaceDirection ( stencil::Direction  dir)
inlinestaticprotected

◆ optimizedEqualLevelCommunication()

template<typename LatticeModel_T , typename BoundaryHandling_T >
bool walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::optimizedEqualLevelCommunication ( ) const
inlineoverridevirtual

◆ optimizedForLinearExplosion()

template<typename LatticeModel_T , typename BoundaryHandling_T >
bool walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::optimizedForLinearExplosion ( ) const
inlineoverridevirtual

◆ optimizeEqualLevelCommunication()

template<typename LatticeModel_T , typename BoundaryHandling_T >
void walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::optimizeEqualLevelCommunication ( const bool  value = true)
inlineoverridevirtual

◆ optimizeForLinearExplosion()

template<typename LatticeModel_T , typename BoundaryHandling_T >
void walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::optimizeForLinearExplosion ( const bool  value = true)
inlineoverridevirtual

◆ packDataCoarseToFineImpl()

template<typename LatticeModel_T , typename BoundaryHandling_T >
void walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::packDataCoarseToFineImpl ( const Block coarseSender,
const BlockID fineReceiver,
stencil::Direction  dir,
mpi::SendBuffer buffer 
) const
overrideprotectedvirtual

◆ packDataEqualLevelImpl()

template<typename LatticeModel_T , typename BoundaryHandling_T >
void walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::packDataEqualLevelImpl ( const Block sender,
stencil::Direction  dir,
mpi::SendBuffer buffer 
) const
overrideprotectedvirtual

◆ packDataFineToCoarseImpl()

template<typename LatticeModel_T , typename BoundaryHandling_T >
void walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::packDataFineToCoarseImpl ( const Block fineSender,
const BlockID coarseReceiver,
stencil::Direction  dir,
mpi::SendBuffer buffer 
) const
overrideprotectedvirtual

◆ splitEqualLevelFaceInterval()

template<typename LatticeModel_T , typename BoundaryHandling_T >
std::vector< CellInterval > walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::splitEqualLevelFaceInterval ( const CellInterval interval,
stencil::Direction  dir 
) const
inlineprotected

◆ threadsafeReceiving()

template<typename LatticeModel_T , typename BoundaryHandling_T >
bool walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::threadsafeReceiving ( ) const
inlineoverridevirtual

Must return false if calling unpackData and/or communicateLocal is not thread-safe.

True otherwise. If you are not sure what to return, return false! Returning false is always save. Falsely return true will most likely lead to errors! However, if both unpackData AND communicateLocal are thread-safe, returning true can lead to performance improvements.

Implements walberla::blockforest::communication::NonUniformPackInfo.

◆ unpackDataCoarseToFine()

template<typename LatticeModel_T , typename BoundaryHandling_T >
void walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::unpackDataCoarseToFine ( Block fineReceiver,
const BlockID coarseSender,
stencil::Direction  dir,
mpi::RecvBuffer buffer 
)
overridevirtual

◆ unpackDataEqualLevel()

template<typename LatticeModel_T , typename BoundaryHandling_T >
void walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::unpackDataEqualLevel ( Block receiver,
stencil::Direction  dir,
mpi::RecvBuffer buffer 
)
overridevirtual

If NOT thread-safe, threadsafeReceiving must return false!

Implements walberla::blockforest::communication::NonUniformPackInfo.

◆ unpackDataFineToCoarse()

template<typename LatticeModel_T , typename BoundaryHandling_T >
void walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::unpackDataFineToCoarse ( Block coarseReceiver,
const BlockID fineSender,
stencil::Direction  dir,
mpi::RecvBuffer buffer 
)
overridevirtual

Member Data Documentation

◆ boundaryHandlingId_

template<typename LatticeModel_T , typename BoundaryHandling_T >
ConstBlockDataID walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::boundaryHandlingId_
protected

◆ equalLevelCells_

template<typename LatticeModel_T , typename BoundaryHandling_T >
uint_t walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::equalLevelCells_
protected

◆ optimizedEqualLevelCommunication_

template<typename LatticeModel_T , typename BoundaryHandling_T >
bool walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::optimizedEqualLevelCommunication_
protected

◆ optimizedForLinearExplosion_

template<typename LatticeModel_T , typename BoundaryHandling_T >
bool walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::optimizedForLinearExplosion_
protected

◆ pdfFieldId_

template<typename LatticeModel_T , typename BoundaryHandling_T >
BlockDataID walberla::lbm::refinement::PdfFieldPackInfo< LatticeModel_T, BoundaryHandling_T >::pdfFieldId_
protected

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