walberla::lbm_generated::NonuniformGeneratedPdfPackInfo< PdfField_T > Class Template Reference

#include <NonuniformGeneratedPdfPackInfo.h>

+ Inheritance diagram for walberla::lbm_generated::NonuniformGeneratedPdfPackInfo< PdfField_T >:

Public Types

using LatticeStorageSpecification_T = typename PdfField_T::LatticeStorageSpecification
 
using PackingKernels_T = typename LatticeStorageSpecification_T::PackKernels
 
using Stencil = typename LatticeStorageSpecification_T::Stencil
 
using CommunicationStencil = typename LatticeStorageSpecification_T::CommunicationStencil
 
using CommData_T = NonuniformCommData< LatticeStorageSpecification_T >
 

Public Member Functions

 NonuniformGeneratedPdfPackInfo (const BlockDataID pdfFieldID, const BlockDataID commDataID)
 
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, Direction dir, mpi::RecvBuffer &buffer) override
 Equal Level. 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
 Coarse to Fine. More...
 
void communicateLocalCoarseToFine (const Block *coarseSender, Block *fineReceiver, stencil::Direction dir) override
 
void prepareCoalescence (Block *coarseReceiver)
 Fine to Coarse. More...
 
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...
 
virtual void unpackDataEqualLevel (Block *receiver, stencil::Direction dir, mpi::RecvBuffer &buffer)=0
 If NOT thread-safe, threadsafeReceiving must return false! 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 ()
 

Public Attributes

const BlockDataID commDataID_
 

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

Private Member Functions

Vector3< cell_idx_tgetNeighborShift (const BlockID &fineBlock, stencil::Direction dir) const
 Helper Functions As in PdfFieldPackInfo.h. More...
 
bool areNeighborsInDirection (const Block *block, const BlockID &neighborID, const Vector3< cell_idx_t > dirVec) const
 Checks whether or not the block with ID neighborID is a neighbor of block in direction dir. More...
 
CellInterval intervalHullInDirection (const CellInterval &ci, const Vector3< cell_idx_t > tangentialDir, cell_idx_t width) const
 Returns the part of a cell interval's hull of given width in direction dirVec. More...
 
bool skipsThroughCoarseBlock (const Block *block, const Direction dir) const
 For edge or corner directions, checks if a coarser block is part of the respective edge or corner intersection. More...
 
void getCoarseBlockCommIntervals (const BlockID &fineBlockID, const Direction dir, const PdfField_T *field, std::vector< std::pair< Direction, CellInterval > > &intervals) const
 For coarse-to-fine and fine-to-coarse communication, returns a list of pairs (Direction, CellInterval) mapping sub-directions of the communication direction to cell intervals on the coarse block interior whose data must be communicated as if communicating in those sub-directions. More...
 
void getFineBlockCommIntervals (const BlockID &fineBlockID, const Direction dir, const PdfField_T *field, std::vector< std::pair< Direction, CellInterval > > &intervals) const
 For coarse-to-fine and fine-to-coarse communication, returns a list of pairs (Direction, CellInterval) mapping sub-directions of the communication direction to cell intervals on the fine block whose data must be communicated as if communicating in those sub-directions. More...
 
CellInterval getCoarseBlockCoalescenceInterval (const Block *coarseBlock, const BlockID &fineBlockID, Direction dir, const PdfField_T *field) const
 

Private Attributes

const BlockDataID pdfFieldID_
 
internal::NonuniformPackingKernelsWrapper< PdfField_T, LatticeStorageSpecification_T::inplace > kernels_
 

Additional Inherited Members

- 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

◆ CommData_T

◆ CommunicationStencil

template<typename PdfField_T >
using walberla::lbm_generated::NonuniformGeneratedPdfPackInfo< PdfField_T >::CommunicationStencil = typename LatticeStorageSpecification_T::CommunicationStencil

◆ LatticeStorageSpecification_T

template<typename PdfField_T >
using walberla::lbm_generated::NonuniformGeneratedPdfPackInfo< PdfField_T >::LatticeStorageSpecification_T = typename PdfField_T::LatticeStorageSpecification

◆ PackingKernels_T

template<typename PdfField_T >
using walberla::lbm_generated::NonuniformGeneratedPdfPackInfo< PdfField_T >::PackingKernels_T = typename LatticeStorageSpecification_T::PackKernels

◆ Stencil

template<typename PdfField_T >
using walberla::lbm_generated::NonuniformGeneratedPdfPackInfo< PdfField_T >::Stencil = typename LatticeStorageSpecification_T::Stencil

Constructor & Destructor Documentation

◆ NonuniformGeneratedPdfPackInfo()

template<typename PdfField_T >
walberla::lbm_generated::NonuniformGeneratedPdfPackInfo< PdfField_T >::NonuniformGeneratedPdfPackInfo ( const BlockDataID  pdfFieldID,
const BlockDataID  commDataID 
)
inline

Member Function Documentation

◆ areNeighborsInDirection()

template<typename PdfField_T >
bool walberla::lbm_generated::NonuniformGeneratedPdfPackInfo< PdfField_T >::areNeighborsInDirection ( const Block block,
const BlockID neighborID,
const Vector3< cell_idx_t dirVec 
) const
private

Checks whether or not the block with ID neighborID is a neighbor of block in direction dir.

◆ communicateLocalCoarseToFine()

template<typename PdfField_T >
void walberla::lbm_generated::NonuniformGeneratedPdfPackInfo< PdfField_T >::communicateLocalCoarseToFine ( const Block coarseSender,
Block fineReceiver,
stencil::Direction  dir 
)
overridevirtual

◆ communicateLocalEqualLevel()

template<typename PdfField_T >
void walberla::lbm_generated::NonuniformGeneratedPdfPackInfo< PdfField_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 PdfField_T >
void walberla::lbm_generated::NonuniformGeneratedPdfPackInfo< PdfField_T >::communicateLocalFineToCoarse ( const Block fineSender,
walberla::Block coarseReceiver,
stencil::Direction  dir 
)
overridevirtual

◆ constantDataExchange()

template<typename PdfField_T >
bool walberla::lbm_generated::NonuniformGeneratedPdfPackInfo< PdfField_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.

◆ getCoarseBlockCoalescenceInterval()

template<typename PdfField_T >
CellInterval walberla::lbm_generated::NonuniformGeneratedPdfPackInfo< PdfField_T >::getCoarseBlockCoalescenceInterval ( const Block coarseBlock,
const BlockID fineBlockID,
Direction  dir,
const PdfField_T field 
) const
private

◆ getCoarseBlockCommIntervals()

template<typename PdfField_T >
void walberla::lbm_generated::NonuniformGeneratedPdfPackInfo< PdfField_T >::getCoarseBlockCommIntervals ( const BlockID fineBlockID,
const Direction  dir,
const PdfField_T field,
std::vector< std::pair< Direction, CellInterval > > &  intervals 
) const
inlineprivate

For coarse-to-fine and fine-to-coarse communication, returns a list of pairs (Direction, CellInterval) mapping sub-directions of the communication direction to cell intervals on the coarse block interior whose data must be communicated as if communicating in those sub-directions.

Parameters
fineBlockIDID of the fine block
dirDirection from the coarse to the fine block
fieldPointer to the PDF field on the coarse block
intervalsVector that will be filled with the computed intervals

◆ getFineBlockCommIntervals()

template<typename PdfField_T >
void walberla::lbm_generated::NonuniformGeneratedPdfPackInfo< PdfField_T >::getFineBlockCommIntervals ( const BlockID fineBlockID,
const Direction  dir,
const PdfField_T field,
std::vector< std::pair< Direction, CellInterval > > &  intervals 
) const
inlineprivate

For coarse-to-fine and fine-to-coarse communication, returns a list of pairs (Direction, CellInterval) mapping sub-directions of the communication direction to cell intervals on the fine block whose data must be communicated as if communicating in those sub-directions.

Parameters
fineBlockIDID of the fine block
dirDirection from the fine to the coarse block
fieldPointer to the PDF Field on the fine block
intervalsVector that will be filled with the computed intervals

◆ getNeighborShift()

template<typename PdfField_T >
Vector3< cell_idx_t > walberla::lbm_generated::NonuniformGeneratedPdfPackInfo< PdfField_T >::getNeighborShift ( const BlockID fineBlock,
stencil::Direction  dir 
) const
inlineprivate

Helper Functions As in PdfFieldPackInfo.h.

◆ intervalHullInDirection()

template<typename PdfField_T >
CellInterval walberla::lbm_generated::NonuniformGeneratedPdfPackInfo< PdfField_T >::intervalHullInDirection ( const CellInterval ci,
const Vector3< cell_idx_t dirVec,
cell_idx_t  width 
) const
inlineprivate

Returns the part of a cell interval's hull of given width in direction dirVec.

Parameters
ciThe original cell interval
dirVecDirection Vector
widthWidth of the hull
Returns
Interval forming the part of the hull

◆ packDataCoarseToFineImpl()

template<typename PdfField_T >
void walberla::lbm_generated::NonuniformGeneratedPdfPackInfo< PdfField_T >::packDataCoarseToFineImpl ( const Block coarseSender,
const BlockID fineReceiver,
stencil::Direction  dir,
mpi::SendBuffer buffer 
) const
overrideprotectedvirtual

◆ packDataEqualLevelImpl()

template<typename PdfField_T >
void walberla::lbm_generated::NonuniformGeneratedPdfPackInfo< PdfField_T >::packDataEqualLevelImpl ( const Block sender,
stencil::Direction  dir,
mpi::SendBuffer buffer 
) const
overrideprotectedvirtual

◆ packDataFineToCoarseImpl()

template<typename PdfField_T >
void walberla::lbm_generated::NonuniformGeneratedPdfPackInfo< PdfField_T >::packDataFineToCoarseImpl ( const Block fineSender,
const BlockID coarseReceiver,
stencil::Direction  dir,
mpi::SendBuffer buffer 
) const
overrideprotectedvirtual

◆ prepareCoalescence()

template<typename PdfField_T >
void walberla::lbm_generated::NonuniformGeneratedPdfPackInfo< PdfField_T >::prepareCoalescence ( Block coarseReceiver)

Fine to Coarse.

◆ skipsThroughCoarseBlock()

template<typename PdfField_T >
bool walberla::lbm_generated::NonuniformGeneratedPdfPackInfo< PdfField_T >::skipsThroughCoarseBlock ( const Block block,
const Direction  dir 
) const
inlineprivate

For edge or corner directions, checks if a coarser block is part of the respective edge or corner intersection.

Parameters
blockThe local block
dirThe direction to check
Returns
true if dir is an edge or corner direction skipping through a coarser block.

◆ threadsafeReceiving()

template<typename PdfField_T >
bool walberla::lbm_generated::NonuniformGeneratedPdfPackInfo< PdfField_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 PdfField_T >
void walberla::lbm_generated::NonuniformGeneratedPdfPackInfo< PdfField_T >::unpackDataCoarseToFine ( Block fineReceiver,
const BlockID coarseSender,
stencil::Direction  dir,
mpi::RecvBuffer buffer 
)
overridevirtual

◆ unpackDataEqualLevel()

template<typename PdfField_T >
void walberla::lbm_generated::NonuniformGeneratedPdfPackInfo< PdfField_T >::unpackDataEqualLevel ( Block receiver,
Direction  dir,
mpi::RecvBuffer buffer 
)
override

Equal Level.

◆ unpackDataFineToCoarse()

template<typename PdfField_T >
void walberla::lbm_generated::NonuniformGeneratedPdfPackInfo< PdfField_T >::unpackDataFineToCoarse ( walberla::Block coarseReceiver,
const BlockID fineSender,
stencil::Direction  dir,
mpi::RecvBuffer buffer 
)
overridevirtual

Member Data Documentation

◆ commDataID_

template<typename PdfField_T >
const BlockDataID walberla::lbm_generated::NonuniformGeneratedPdfPackInfo< PdfField_T >::commDataID_

◆ kernels_

template<typename PdfField_T >
internal::NonuniformPackingKernelsWrapper< PdfField_T, LatticeStorageSpecification_T::inplace > walberla::lbm_generated::NonuniformGeneratedPdfPackInfo< PdfField_T >::kernels_
private

◆ pdfFieldID_

template<typename PdfField_T >
const BlockDataID walberla::lbm_generated::NonuniformGeneratedPdfPackInfo< PdfField_T >::pdfFieldID_
private

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