walberla::field::refinement::PackInfo< Field_T, Stencil > Class Template Reference

#include <PackInfo.h>

+ Inheritance diagram for walberla::field::refinement::PackInfo< Field_T, Stencil >:

Public Member Functions

 PackInfo (const BlockDataID &fieldId)
 
 ~PackInfo () override=default
 
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
 
- 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 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 coarserNeighborExists (const Block *block, stencil::Direction dir)
 

Protected Attributes

const BlockDataID fieldId_
 
- Protected Attributes inherited from walberla::blockforest::communication::NonUniformPackInfo
std::map< const Block *, std::map< stencil::Direction, std::map< uint_t, size_t > > > bufferSize_
 

Constructor & Destructor Documentation

◆ PackInfo()

template<typename Field_T , typename Stencil >
walberla::field::refinement::PackInfo< Field_T, Stencil >::PackInfo ( const BlockDataID fieldId)
inline

◆ ~PackInfo()

template<typename Field_T , typename Stencil >
walberla::field::refinement::PackInfo< Field_T, Stencil >::~PackInfo ( )
overridedefault

Member Function Documentation

◆ blocksConnectedByEdges()

template<typename Field_T , typename Stencil >
bool walberla::field::refinement::PackInfo< Field_T, Stencil >::blocksConnectedByEdges ( const Block block,
const BlockID neighbor 
)
inlinestaticprotected

◆ blocksConnectedByFaces()

template<typename Field_T , typename Stencil >
bool walberla::field::refinement::PackInfo< Field_T, Stencil >::blocksConnectedByFaces ( const Block block,
const BlockID neighbor 
)
inlinestaticprotected

◆ coarserNeighborExists()

template<typename Field_T , typename Stencil >
bool walberla::field::refinement::PackInfo< Field_T, Stencil >::coarserNeighborExists ( const Block block,
stencil::Direction  dir 
)
staticprotected

◆ coarseToFinePackInterval()

template<typename Field_T , typename Stencil >
CellInterval walberla::field::refinement::PackInfo< Field_T, Stencil >::coarseToFinePackInterval ( stencil::Direction  dir,
const CellInterval cellBB,
const BlockID smallBlock 
)
staticprotected

◆ coarseToFineUnpackInterval()

template<typename Field_T , typename Stencil >
CellInterval walberla::field::refinement::PackInfo< Field_T, Stencil >::coarseToFineUnpackInterval ( stencil::Direction  dir,
const CellInterval cellBB,
const BlockID smallBlock 
)
staticprotected

◆ communicateLocalCoarseToFine()

template<typename Field_T , typename Stencil >
void walberla::field::refinement::PackInfo< Field_T, Stencil >::communicateLocalCoarseToFine ( const Block coarseSender,
Block fineReceiver,
stencil::Direction  dir 
)
overridevirtual

◆ communicateLocalEqualLevel()

template<typename Field_T , typename Stencil >
void walberla::field::refinement::PackInfo< Field_T, Stencil >::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 Field_T , typename Stencil >
void walberla::field::refinement::PackInfo< Field_T, Stencil >::communicateLocalFineToCoarse ( const Block fineSender,
Block coarseReceiver,
stencil::Direction  dir 
)
overridevirtual

◆ constantDataExchange()

template<typename Field_T , typename Stencil >
bool walberla::field::refinement::PackInfo< Field_T, Stencil >::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 Field_T , typename Stencil >
bool walberla::field::refinement::PackInfo< Field_T, Stencil >::divisibleByTwo ( const CellInterval cellBB)
inlinestaticprotected

◆ equalLevelPackInterval()

template<typename Field_T , typename Stencil >
CellInterval walberla::field::refinement::PackInfo< Field_T, Stencil >::equalLevelPackInterval ( stencil::Direction  dir,
const CellInterval cellBB,
const uint_t  numberOfLayers 
)
inlinestaticprotected

◆ equalLevelUnpackInterval()

template<typename Field_T , typename Stencil >
CellInterval walberla::field::refinement::PackInfo< Field_T, Stencil >::equalLevelUnpackInterval ( stencil::Direction  dir,
const CellInterval cellBB,
const uint_t  numberOfLayers 
)
staticprotected

◆ fineToCoarsePackInterval()

template<typename Field_T , typename Stencil >
CellInterval walberla::field::refinement::PackInfo< Field_T, Stencil >::fineToCoarsePackInterval ( stencil::Direction  dir,
const CellInterval cellBB 
)
inlinestaticprotected

◆ fineToCoarseUnpackInterval()

template<typename Field_T , typename Stencil >
CellInterval walberla::field::refinement::PackInfo< Field_T, Stencil >::fineToCoarseUnpackInterval ( stencil::Direction  dir,
const CellInterval cellBB,
const BlockID smallBlock 
)
staticprotected

◆ getNeighborShift()

template<typename Field_T , typename Stencil >
Vector3< cell_idx_t > walberla::field::refinement::PackInfo< Field_T, Stencil >::getNeighborShift ( const BlockID smallBlock,
stencil::Direction  dir 
)
inlinestaticprotected

◆ isCornerDirection()

template<typename Field_T , typename Stencil >
bool walberla::field::refinement::PackInfo< Field_T, Stencil >::isCornerDirection ( stencil::Direction  dir)
inlinestaticprotected

◆ isEdgeDirection()

template<typename Field_T , typename Stencil >
bool walberla::field::refinement::PackInfo< Field_T, Stencil >::isEdgeDirection ( stencil::Direction  dir)
inlinestaticprotected

◆ isFaceDirection()

template<typename Field_T , typename Stencil >
bool walberla::field::refinement::PackInfo< Field_T, Stencil >::isFaceDirection ( stencil::Direction  dir)
inlinestaticprotected

◆ packDataCoarseToFineImpl()

template<typename Field_T , typename Stencil >
void walberla::field::refinement::PackInfo< Field_T, Stencil >::packDataCoarseToFineImpl ( const Block coarseSender,
const BlockID fineReceiver,
stencil::Direction  dir,
mpi::SendBuffer buffer 
) const
overrideprotectedvirtual

◆ packDataEqualLevelImpl()

template<typename Field_T , typename Stencil >
void walberla::field::refinement::PackInfo< Field_T, Stencil >::packDataEqualLevelImpl ( const Block sender,
stencil::Direction  dir,
mpi::SendBuffer buffer 
) const
overrideprotectedvirtual

◆ packDataFineToCoarseImpl()

template<typename Field_T , typename Stencil >
void walberla::field::refinement::PackInfo< Field_T, Stencil >::packDataFineToCoarseImpl ( const Block fineSender,
const BlockID coarseReceiver,
stencil::Direction  dir,
mpi::SendBuffer buffer 
) const
overrideprotectedvirtual

◆ threadsafeReceiving()

template<typename Field_T , typename Stencil >
bool walberla::field::refinement::PackInfo< Field_T, Stencil >::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 Field_T , typename Stencil >
void walberla::field::refinement::PackInfo< Field_T, Stencil >::unpackDataCoarseToFine ( Block fineReceiver,
const BlockID coarseSender,
stencil::Direction  dir,
mpi::RecvBuffer buffer 
)
overridevirtual

◆ unpackDataEqualLevel()

template<typename Field_T , typename Stencil >
void walberla::field::refinement::PackInfo< Field_T, Stencil >::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 Field_T , typename Stencil >
void walberla::field::refinement::PackInfo< Field_T, Stencil >::unpackDataFineToCoarse ( Block coarseReceiver,
const BlockID fineSender,
stencil::Direction  dir,
mpi::RecvBuffer buffer 
)
overridevirtual

Member Data Documentation

◆ fieldId_

template<typename Field_T , typename Stencil >
const BlockDataID walberla::field::refinement::PackInfo< Field_T, Stencil >::fieldId_
protected

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