walberla::lbm_mesapd_coupling::SubCyclingManager Class Reference

Detailed Description

Handles the execution of subcycles in a timeloop to allow for finer grained time steps than the LBM ones.

Supports registration of functions that are run before, during or after a subcycle. The SubCyclingManager itself has to be added to a parent (LBM) time loop, and will execute the functions registered for execution during the subcycling procedure numberOfSubCycles times.

#include <SubCyclingManager.h>

Public Types

using VoidVoidFunc = std::function< void()>
 

Public Member Functions

Construction & Destruction
 SubCyclingManager (size_t numberOfSubCycles, shared_ptr< WcTimingPool > timingPool=nullptr)
 
virtual ~SubCyclingManager ()=default
 
Execution Functions
void operator() ()
 

Registration Functions

using FuncHandle = size_t
 
FuncHandle addFuncBeforeSubCycles (const VoidVoidFunc &f, const std::string &identifier="Other")
 
FuncHandle addFuncDuringSubCycles (const VoidVoidFunc &f, const std::string &identifier="Other")
 
FuncHandle addFuncAfterSubCycles (const VoidVoidFunc &f, const std::string &identifier="Other")
 

Bookkeeping Functions

using IdentifiedFunc = std::pair< std::string, VoidVoidFunc >
 
size_t numberOfSubCycles_
 
shared_ptr< WcTimingPooltimingPool_
 
uint_t currentTimeStep_
 
std::vector< IdentifiedFuncbeforeFunctions_
 
std::vector< IdentifiedFuncduringFunctions_
 
std::vector< IdentifiedFuncafterFunctions_
 
uint_t getCurrentTimeStep () const
 
void setCurrentTimeStep (uint_t timestep)
 
void executeBeforeFunctions ()
 
void executeDuringFunctions ()
 
void executeAfterFunctions ()
 
void executeFunctions (std::vector< IdentifiedFunc > &functions)
 
void startTiming (const std::string &name)
 
void stopTiming (const std::string &name)
 

Member Typedef Documentation

◆ FuncHandle

◆ IdentifiedFunc

◆ VoidVoidFunc

Constructor & Destructor Documentation

◆ SubCyclingManager()

walberla::lbm_mesapd_coupling::SubCyclingManager::SubCyclingManager ( size_t  numberOfSubCycles,
shared_ptr< WcTimingPool timingPool = nullptr 
)
explicit

◆ ~SubCyclingManager()

virtual walberla::lbm_mesapd_coupling::SubCyclingManager::~SubCyclingManager ( )
virtualdefault

Member Function Documentation

◆ addFuncAfterSubCycles()

SubCyclingManager::FuncHandle walberla::lbm_mesapd_coupling::SubCyclingManager::addFuncAfterSubCycles ( const VoidVoidFunc f,
const std::string &  identifier = "Other" 
)

◆ addFuncBeforeSubCycles()

SubCyclingManager::FuncHandle walberla::lbm_mesapd_coupling::SubCyclingManager::addFuncBeforeSubCycles ( const VoidVoidFunc f,
const std::string &  identifier = "Other" 
)

◆ addFuncDuringSubCycles()

SubCyclingManager::FuncHandle walberla::lbm_mesapd_coupling::SubCyclingManager::addFuncDuringSubCycles ( const VoidVoidFunc f,
const std::string &  identifier = "Other" 
)

◆ executeAfterFunctions()

void walberla::lbm_mesapd_coupling::SubCyclingManager::executeAfterFunctions ( )
inlineprivate

◆ executeBeforeFunctions()

void walberla::lbm_mesapd_coupling::SubCyclingManager::executeBeforeFunctions ( )
inlineprivate

◆ executeDuringFunctions()

void walberla::lbm_mesapd_coupling::SubCyclingManager::executeDuringFunctions ( )
inlineprivate

◆ executeFunctions()

void walberla::lbm_mesapd_coupling::SubCyclingManager::executeFunctions ( std::vector< IdentifiedFunc > &  functions)
inlineprivate

◆ getCurrentTimeStep()

uint_t walberla::lbm_mesapd_coupling::SubCyclingManager::getCurrentTimeStep ( ) const
inline

◆ operator()()

void walberla::lbm_mesapd_coupling::SubCyclingManager::operator() ( )

◆ setCurrentTimeStep()

void walberla::lbm_mesapd_coupling::SubCyclingManager::setCurrentTimeStep ( uint_t  timestep)
inline

◆ startTiming()

void walberla::lbm_mesapd_coupling::SubCyclingManager::startTiming ( const std::string &  name)
inlineprivate

◆ stopTiming()

void walberla::lbm_mesapd_coupling::SubCyclingManager::stopTiming ( const std::string &  name)
inlineprivate

Member Data Documentation

◆ afterFunctions_

std::vector<IdentifiedFunc> walberla::lbm_mesapd_coupling::SubCyclingManager::afterFunctions_
private

◆ beforeFunctions_

std::vector<IdentifiedFunc> walberla::lbm_mesapd_coupling::SubCyclingManager::beforeFunctions_
private

◆ currentTimeStep_

uint_t walberla::lbm_mesapd_coupling::SubCyclingManager::currentTimeStep_
private

◆ duringFunctions_

std::vector<IdentifiedFunc> walberla::lbm_mesapd_coupling::SubCyclingManager::duringFunctions_
private

◆ numberOfSubCycles_

size_t walberla::lbm_mesapd_coupling::SubCyclingManager::numberOfSubCycles_
private

◆ timingPool_

shared_ptr<WcTimingPool> walberla::lbm_mesapd_coupling::SubCyclingManager::timingPool_
private

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