walberla::free_surface::LoadBalancer< FlagField_T, CommunicationStencil_T, LatticeModelStencil_T > Class Template Reference

#include <LoadBalancing.h>

Classes

class  PhantomWeight
 

Public Member Functions

 LoadBalancer (const std::shared_ptr< StructuredBlockForest > &blockForestPtr, const blockforest::SimpleCommunication< CommunicationStencil_T > &communication, const blockforest::SimpleCommunication< LatticeModelStencil_T > &pdfCommunication, const std::shared_ptr< bubble_model::BubbleModelBase > &bubbleModel, uint_t blockWeightFullFreeSurface, uint_t blockWeightOnlyLBM, uint_t blockWeightOnlyGasAndBoundary, uint_t frequency, bool printStatistics=false)
 
void operator() ()
 

Private Attributes

std::shared_ptr< StructuredBlockForestblockForest_
 
blockforest::SimpleCommunication< CommunicationStencil_Tcommunication_
 
blockforest::SimpleCommunication< LatticeModelStencil_T > pdfCommunication_
 
std::shared_ptr< bubble_model::BubbleModelBasebubbleModel_
 
uint_t blockWeightFullFreeSurface_
 
uint_t blockWeightOnlyLBM_
 
uint_t blockWeightOnlyGasAndBoundary_
 
uint_t frequency_
 
bool printStatistics_
 
uint_t executionCounter_
 
ProcessLoadEvaluator< FlagField_Tevaluator_
 
std::function< void(mpi::SendBuffer &buffer, const PhantomBlock &block) > phantomWeightsPack
 
std::function< void(mpi::RecvBuffer &buffer, const PhantomBlock &, walberla::any &data) > phantomWeightsUnpack
 
std::function< void(std::vector< std::pair< const PhantomBlock *, walberla::any > > &blockData, const PhantomBlockForest &) > blockWeightAssignment
 

Constructor & Destructor Documentation

◆ LoadBalancer()

template<typename FlagField_T , typename CommunicationStencil_T , typename LatticeModelStencil_T >
walberla::free_surface::LoadBalancer< FlagField_T, CommunicationStencil_T, LatticeModelStencil_T >::LoadBalancer ( const std::shared_ptr< StructuredBlockForest > &  blockForestPtr,
const blockforest::SimpleCommunication< CommunicationStencil_T > &  communication,
const blockforest::SimpleCommunication< LatticeModelStencil_T > &  pdfCommunication,
const std::shared_ptr< bubble_model::BubbleModelBase > &  bubbleModel,
uint_t  blockWeightFullFreeSurface,
uint_t  blockWeightOnlyLBM,
uint_t  blockWeightOnlyGasAndBoundary,
uint_t  frequency,
bool  printStatistics = false 
)
inline

Member Function Documentation

◆ operator()()

template<typename FlagField_T , typename CommunicationStencil_T , typename LatticeModelStencil_T >
void walberla::free_surface::LoadBalancer< FlagField_T, CommunicationStencil_T, LatticeModelStencil_T >::operator() ( )
inline

Member Data Documentation

◆ blockForest_

template<typename FlagField_T , typename CommunicationStencil_T , typename LatticeModelStencil_T >
std::shared_ptr< StructuredBlockForest > walberla::free_surface::LoadBalancer< FlagField_T, CommunicationStencil_T, LatticeModelStencil_T >::blockForest_
private

◆ blockWeightAssignment

template<typename FlagField_T , typename CommunicationStencil_T , typename LatticeModelStencil_T >
std::function< void(std::vector< std::pair< const PhantomBlock*, walberla::any > >& blockData, const PhantomBlockForest&) > walberla::free_surface::LoadBalancer< FlagField_T, CommunicationStencil_T, LatticeModelStencil_T >::blockWeightAssignment
private
Initial value:
=
[this](std::vector< std::pair< const PhantomBlock*, walberla::any > >& blockData, const PhantomBlockForest&) {
for (auto it = blockData.begin(); it != blockData.end(); ++it)
{
if (it->first->getState().contains(BlockStateDetectorSweep< FlagField_T >::fullFreeSurface))
{
it->second = PhantomWeight(blockWeightFullFreeSurface_);
}
else
{
if (it->first->getState().contains(BlockStateDetectorSweep< FlagField_T >::onlyLBM))
{
it->second = PhantomWeight(blockWeightOnlyLBM_);
}
else
{
{
it->second = PhantomWeight(blockWeightOnlyGasAndBoundary_);
}
else { WALBERLA_ABORT("Unknown block state"); }
}
}
}
}

◆ blockWeightFullFreeSurface_

template<typename FlagField_T , typename CommunicationStencil_T , typename LatticeModelStencil_T >
uint_t walberla::free_surface::LoadBalancer< FlagField_T, CommunicationStencil_T, LatticeModelStencil_T >::blockWeightFullFreeSurface_
private

◆ blockWeightOnlyGasAndBoundary_

template<typename FlagField_T , typename CommunicationStencil_T , typename LatticeModelStencil_T >
uint_t walberla::free_surface::LoadBalancer< FlagField_T, CommunicationStencil_T, LatticeModelStencil_T >::blockWeightOnlyGasAndBoundary_
private

◆ blockWeightOnlyLBM_

template<typename FlagField_T , typename CommunicationStencil_T , typename LatticeModelStencil_T >
uint_t walberla::free_surface::LoadBalancer< FlagField_T, CommunicationStencil_T, LatticeModelStencil_T >::blockWeightOnlyLBM_
private

◆ bubbleModel_

template<typename FlagField_T , typename CommunicationStencil_T , typename LatticeModelStencil_T >
std::shared_ptr< bubble_model::BubbleModelBase > walberla::free_surface::LoadBalancer< FlagField_T, CommunicationStencil_T, LatticeModelStencil_T >::bubbleModel_
private

◆ communication_

template<typename FlagField_T , typename CommunicationStencil_T , typename LatticeModelStencil_T >
blockforest::SimpleCommunication< CommunicationStencil_T > walberla::free_surface::LoadBalancer< FlagField_T, CommunicationStencil_T, LatticeModelStencil_T >::communication_
private

◆ evaluator_

template<typename FlagField_T , typename CommunicationStencil_T , typename LatticeModelStencil_T >
ProcessLoadEvaluator< FlagField_T > walberla::free_surface::LoadBalancer< FlagField_T, CommunicationStencil_T, LatticeModelStencil_T >::evaluator_
private

◆ executionCounter_

template<typename FlagField_T , typename CommunicationStencil_T , typename LatticeModelStencil_T >
uint_t walberla::free_surface::LoadBalancer< FlagField_T, CommunicationStencil_T, LatticeModelStencil_T >::executionCounter_
private

◆ frequency_

template<typename FlagField_T , typename CommunicationStencil_T , typename LatticeModelStencil_T >
uint_t walberla::free_surface::LoadBalancer< FlagField_T, CommunicationStencil_T, LatticeModelStencil_T >::frequency_
private

◆ pdfCommunication_

template<typename FlagField_T , typename CommunicationStencil_T , typename LatticeModelStencil_T >
blockforest::SimpleCommunication< LatticeModelStencil_T > walberla::free_surface::LoadBalancer< FlagField_T, CommunicationStencil_T, LatticeModelStencil_T >::pdfCommunication_
private

◆ phantomWeightsPack

template<typename FlagField_T , typename CommunicationStencil_T , typename LatticeModelStencil_T >
std::function< void(mpi::SendBuffer& buffer, const PhantomBlock& block) > walberla::free_surface::LoadBalancer< FlagField_T, CommunicationStencil_T, LatticeModelStencil_T >::phantomWeightsPack
private
Initial value:
=
[](mpi::SendBuffer& buffer, const PhantomBlock& block) { buffer << block.getData< PhantomWeight >().weight(); }

◆ phantomWeightsUnpack

template<typename FlagField_T , typename CommunicationStencil_T , typename LatticeModelStencil_T >
std::function< void(mpi::RecvBuffer& buffer, const PhantomBlock&, walberla::any& data) > walberla::free_surface::LoadBalancer< FlagField_T, CommunicationStencil_T, LatticeModelStencil_T >::phantomWeightsUnpack
private
Initial value:
=
[](mpi::RecvBuffer& buffer, const PhantomBlock&, walberla::any& data) {
buffer >> w;
data = PhantomWeight(w);
}

◆ printStatistics_

template<typename FlagField_T , typename CommunicationStencil_T , typename LatticeModelStencil_T >
bool walberla::free_surface::LoadBalancer< FlagField_T, CommunicationStencil_T, LatticeModelStencil_T >::printStatistics_
private

The documentation for this class was generated from the following file:
blockforest::PhantomBlock PhantomBlock
Definition: PhantomBlock.h:377
uint_t blockWeightOnlyLBM_
Definition: LoadBalancing.h:193
GenericRecvBuffer<> RecvBuffer
Definition: RecvBuffer.h:176
uint_t blockWeightOnlyGasAndBoundary_
Definition: LoadBalancing.h:194
uint_t blockWeightFullFreeSurface_
Definition: LoadBalancing.h:192
static const SUID onlyGasAndBoundary
Definition: BlockStateDetectorSweep.h:52
static const SUID onlyLBM
Definition: BlockStateDetectorSweep.h:53
#define WALBERLA_ABORT(msg)
Definition: Abort.h:62
static const SUID fullFreeSurface
Definition: BlockStateDetectorSweep.h:51
blockforest::PhantomBlockForest PhantomBlockForest
Definition: PhantomBlockForest.h:124
GenericSendBuffer<> SendBuffer
Definition: SendBuffer.h:219
uint_t weight_t
Definition: LoadBalancing.h:206