walberla::free_surface::bubble_model::BubbleIDFieldPackInfo< Stencil_T > Class Template Reference

#include <BubbleIDFieldPackInfo.h>

+ Inheritance diagram for walberla::free_surface::bubble_model::BubbleIDFieldPackInfo< Stencil_T >:

Public Types

using CommunicationStencil_T = typename std::conditional< Stencil_T::D==uint_t(2), stencil::D2Q9, stencil::D3Q27 >::type
 
using field_t = GhostLayerField< BubbleID, 1 >
 
- Public Types inherited from walberla::field::communication::PackInfo< GhostLayerField< BubbleID, 1 > >
using T = typename GhostLayerField< BubbleID, 1 > ::value_type
 

Public Member Functions

 BubbleIDFieldPackInfo (const BlockDataID &bdId, MergeInformation *mergeInfo)
 
bool threadsafeReceiving () const override
 Must return false if calling unpackData and/or communicateLocal is not thread-safe. More...
 
void unpackData (IBlock *receiver, stencil::Direction dir, mpi::RecvBuffer &buffer) override
 Unpacks received Data. More...
 
void communicateLocal (const IBlock *sender, IBlock *receiver, stencil::Direction dir) override
 Function to copy data from one local block to another local block. More...
 
- Public Member Functions inherited from walberla::field::communication::PackInfo< GhostLayerField< BubbleID, 1 > >
 PackInfo (const BlockDataID &bdId)
 
 PackInfo (const BlockDataID &bdId, const uint_t numberOfGhostLayers)
 
 ~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 unpackData (IBlock *receiver, stencil::Direction dir, mpi::RecvBuffer &buffer) override
 Unpacks received Data. More...
 
void communicateLocal (const IBlock *sender, IBlock *receiver, stencil::Direction dir) override
 Function to copy data from one local block to another local block. More...
 
- Public Member Functions inherited from walberla::communication::UniformPackInfo
 UniformPackInfo ()=default
 
virtual ~UniformPackInfo ()=default
 
virtual bool constantDataExchange () const =0
 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...
 
void packData (const IBlock *sender, stencil::Direction dir, mpi::SendBuffer &buffer) const
 Packs data from a block into a send buffer. More...
 
virtual void beforeStartCommunication ()
 This function is called once before the communication is started by the UniformBufferedScheme. More...
 
virtual void afterStartCommunication ()
 This function is called once after the communication has been started by the UniformBufferedScheme. More...
 
virtual void beforeWait ()
 This function is called once before the UniformBufferedScheme waits for the communication to finish. More...
 
virtual void afterWait ()
 This function is called once after the communication has been finished by the UniformBufferedScheme. More...
 

Protected Member Functions

void lookForMerges (const field_t::iterator &i, stencil::Direction dir, const field_t *field)
 
- Protected Member Functions inherited from walberla::field::communication::PackInfo< GhostLayerField< BubbleID, 1 > >
void packDataImpl (const IBlock *sender, stencil::Direction dir, mpi::SendBuffer &outBuffer) const override
 Packs data from a block into a send buffer. More...
 
uint_t numberOfGhostLayersToCommunicate (const GhostLayerField< BubbleID, 1 > *const field) const
 
- Protected Member Functions inherited from walberla::communication::UniformPackInfo

Protected Attributes

MergeInformationmergeInfo_
 
- Protected Attributes inherited from walberla::field::communication::PackInfo< GhostLayerField< BubbleID, 1 > >
const BlockDataID bdId_
 
bool communicateAllGhostLayers_
 
uint_t numberOfGhostLayers_
 
- Protected Attributes inherited from walberla::communication::UniformPackInfo
std::map< const IBlock *, std::map< stencil::Direction, size_t > > bufferSize_
 

Member Typedef Documentation

◆ CommunicationStencil_T

template<typename Stencil_T >
using walberla::free_surface::bubble_model::BubbleIDFieldPackInfo< Stencil_T >::CommunicationStencil_T = typename std::conditional< Stencil_T::D == uint_t(2), stencil::D2Q9, stencil::D3Q27 >::type

◆ field_t

Constructor & Destructor Documentation

◆ BubbleIDFieldPackInfo()

template<typename Stencil_T >
walberla::free_surface::bubble_model::BubbleIDFieldPackInfo< Stencil_T >::BubbleIDFieldPackInfo ( const BlockDataID bdId,
MergeInformation mergeInfo 
)
inline

Member Function Documentation

◆ communicateLocal()

template<typename Stencil_T >
void walberla::free_surface::bubble_model::BubbleIDFieldPackInfo< Stencil_T >::communicateLocal ( const IBlock sender,
IBlock receiver,
stencil::Direction  dir 
)
inlineoverridevirtual

Function to copy data from one local block to another local block.

Both blocks are allocated on the current process. If NOT thread-safe, threadsafeReceiving must return false!

Parameters
senderid of block where the data should be copied from
receiverid of block where the data should be copied to
dirthe direction of the communication ( from sender to receiver )

Implements walberla::communication::UniformPackInfo.

◆ lookForMerges()

template<typename Stencil_T >
void walberla::free_surface::bubble_model::BubbleIDFieldPackInfo< Stencil_T >::lookForMerges ( const field_t::iterator i,
stencil::Direction  dir,
const field_t field 
)
inlineprotected

◆ threadsafeReceiving()

template<typename Stencil_T >
bool walberla::free_surface::bubble_model::BubbleIDFieldPackInfo< Stencil_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::communication::UniformPackInfo.

◆ unpackData()

template<typename Stencil_T >
void walberla::free_surface::bubble_model::BubbleIDFieldPackInfo< Stencil_T >::unpackData ( IBlock receiver,
stencil::Direction  dir,
mpi::RecvBuffer buffer 
)
inlineoverridevirtual

Unpacks received Data.

If NOT thread-safe, threadsafeReceiving must return false!

Parameters
receiverthe block where the unpacked data should be stored into
dirreceive data from neighbor in this direction
buffer

Implements walberla::communication::UniformPackInfo.

Member Data Documentation

◆ mergeInfo_

template<typename Stencil_T >
MergeInformation* walberla::free_surface::bubble_model::BubbleIDFieldPackInfo< Stencil_T >::mergeInfo_
protected

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