OpenLB 1.7
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
olb::BaseSolver< T, PARAMETERS > Class Template Referenceabstract

BaseSolver implements the solving process of an instationary simulation, consisting of preSimulationTasks, time-stepping and postprocessing. More...

#include <lbSolver.h>

+ Inheritance diagram for olb::BaseSolver< T, PARAMETERS >:
+ Collaboration diagram for olb::BaseSolver< T, PARAMETERS >:

Public Types

using t = T
 
using Parameters_t = PARAMETERS
 

Public Member Functions

 BaseSolver (utilities::TypeIndexedSharedPtrTuple< PARAMETERS > params)
 
virtual void initialize ()=0
 Actions that shall be executed once after construction.
 
virtual void preProcess ()
 Configurations that take place before solving.
 
void solve ()
 
virtual void postProcess ()
 Actions that take place after solving.
 
template<typename KEY >
auto & parameters (KEY=KEY())
 Access to parameter structs as parameters(KEY())
 
template<typename KEY >
auto & parameters (KEY=KEY()) const
 
template<typename KEY >
auto & parameters (meta::id< KEY >)
 
template<typename KEY >
auto & parameters (meta::id< KEY >) const
 

Public Attributes

utilities::TypeIndexedSharedPtrTuple< PARAMETERS > _parameters
 

Protected Member Functions

virtual void prepareSimulation ()=0
 Actions that shall be executed before the time-stepping.
 
virtual void timeStep (std::size_t iT)=0
 Defines what to do in a single time step.
 
virtual bool exitCondition (std::size_t iT) const =0
 Condition, when to exit the time-stepping loop Returns true if the loop shall be continued.
 
virtual void postSimulation ()=0
 Actions that shall be executed after the time-stepping.
 

Protected Attributes

bool _isInitialized {false}
 
std::size_t _iT {0}
 
bool _finishedTimeLoop {false}
 

Detailed Description

template<typename T, typename PARAMETERS>
class olb::BaseSolver< T, PARAMETERS >

BaseSolver implements the solving process of an instationary simulation, consisting of preSimulationTasks, time-stepping and postprocessing.

Definition at line 40 of file lbSolver.h.

Member Typedef Documentation

◆ Parameters_t

template<typename T , typename PARAMETERS >
using olb::BaseSolver< T, PARAMETERS >::Parameters_t = PARAMETERS

Definition at line 47 of file lbSolver.h.

◆ t

template<typename T , typename PARAMETERS >
using olb::BaseSolver< T, PARAMETERS >::t = T

Definition at line 46 of file lbSolver.h.

Constructor & Destructor Documentation

◆ BaseSolver()

template<typename T , typename PARAMETERS >
olb::BaseSolver< T, PARAMETERS >::BaseSolver ( utilities::TypeIndexedSharedPtrTuple< PARAMETERS > params)
inline

Definition at line 56 of file lbSolver.h.

57 : _parameters(params)
58 { }
utilities::TypeIndexedSharedPtrTuple< PARAMETERS > _parameters
Definition lbSolver.h:48

Member Function Documentation

◆ exitCondition()

template<typename T , typename PARAMETERS >
virtual bool olb::BaseSolver< T, PARAMETERS >::exitCondition ( std::size_t iT) const
protectedpure virtual

Condition, when to exit the time-stepping loop Returns true if the loop shall be continued.

Implemented in olb::LbSolver< T, PARAMETERS, LATTICES >.

+ Here is the caller graph for this function:

◆ initialize()

template<typename T , typename PARAMETERS >
virtual void olb::BaseSolver< T, PARAMETERS >::initialize ( )
pure virtual

Actions that shall be executed once after construction.

Implemented in olb::LbSolver< T, PARAMETERS, LATTICES >.

+ Here is the caller graph for this function:

◆ parameters() [1/4]

template<typename T , typename PARAMETERS >
template<typename KEY >
auto & olb::BaseSolver< T, PARAMETERS >::parameters ( KEY = KEY())
inline

Access to parameter structs as parameters(KEY())

Definition at line 104 of file lbSolver.h.

104 {
105 return *_parameters.template get<KEY>();
106 }

References olb::BaseSolver< T, PARAMETERS >::_parameters.

+ Here is the caller graph for this function:

◆ parameters() [2/4]

template<typename T , typename PARAMETERS >
template<typename KEY >
auto & olb::BaseSolver< T, PARAMETERS >::parameters ( KEY = KEY()) const
inline

Definition at line 108 of file lbSolver.h.

108 {
109 return *_parameters.template get<KEY>();
110 }

References olb::BaseSolver< T, PARAMETERS >::_parameters.

◆ parameters() [3/4]

template<typename T , typename PARAMETERS >
template<typename KEY >
auto & olb::BaseSolver< T, PARAMETERS >::parameters ( meta::id< KEY > )
inline

Definition at line 112 of file lbSolver.h.

112 {
113 return *_parameters.template get<KEY>();
114 }

References olb::BaseSolver< T, PARAMETERS >::_parameters.

◆ parameters() [4/4]

template<typename T , typename PARAMETERS >
template<typename KEY >
auto & olb::BaseSolver< T, PARAMETERS >::parameters ( meta::id< KEY > ) const
inline

Definition at line 116 of file lbSolver.h.

116 {
117 return *_parameters.template get<KEY>();
118 }

References olb::BaseSolver< T, PARAMETERS >::_parameters.

◆ postProcess()

template<typename T , typename PARAMETERS >
virtual void olb::BaseSolver< T, PARAMETERS >::postProcess ( )
inlinevirtual

Actions that take place after solving.

Definition at line 85 of file lbSolver.h.

85{ }

◆ postSimulation()

template<typename T , typename PARAMETERS >
virtual void olb::BaseSolver< T, PARAMETERS >::postSimulation ( )
protectedpure virtual

Actions that shall be executed after the time-stepping.

Implemented in olb::LbSolver< T, PARAMETERS, LATTICES >.

+ Here is the caller graph for this function:

◆ prepareSimulation()

template<typename T , typename PARAMETERS >
virtual void olb::BaseSolver< T, PARAMETERS >::prepareSimulation ( )
protectedpure virtual

Actions that shall be executed before the time-stepping.

Implemented in olb::LbSolver< T, PARAMETERS, LATTICES >.

+ Here is the caller graph for this function:

◆ preProcess()

template<typename T , typename PARAMETERS >
virtual void olb::BaseSolver< T, PARAMETERS >::preProcess ( )
inlinevirtual

Configurations that take place before solving.

Definition at line 64 of file lbSolver.h.

64{ }

◆ solve()

template<typename T , typename PARAMETERS >
void olb::BaseSolver< T, PARAMETERS >::solve ( )
inline

Definition at line 66 of file lbSolver.h.

67 {
68 if (! _isInitialized) {
69 initialize();
70 }
71
73
74 do
75 {
77 ++_iT;
78 } while (! exitCondition(_iT));
79
80 _finishedTimeLoop = true;
82 }
virtual void prepareSimulation()=0
Actions that shall be executed before the time-stepping.
std::size_t _iT
Definition lbSolver.h:52
virtual void initialize()=0
Actions that shall be executed once after construction.
virtual bool exitCondition(std::size_t iT) const =0
Condition, when to exit the time-stepping loop Returns true if the loop shall be continued.
bool _isInitialized
Definition lbSolver.h:51
bool _finishedTimeLoop
Definition lbSolver.h:53
virtual void timeStep(std::size_t iT)=0
Defines what to do in a single time step.
virtual void postSimulation()=0
Actions that shall be executed after the time-stepping.

References olb::BaseSolver< T, PARAMETERS >::_finishedTimeLoop, olb::BaseSolver< T, PARAMETERS >::_isInitialized, olb::BaseSolver< T, PARAMETERS >::_iT, olb::BaseSolver< T, PARAMETERS >::exitCondition(), olb::BaseSolver< T, PARAMETERS >::initialize(), olb::BaseSolver< T, PARAMETERS >::postSimulation(), olb::BaseSolver< T, PARAMETERS >::prepareSimulation(), and olb::BaseSolver< T, PARAMETERS >::timeStep().

+ Here is the call graph for this function:

◆ timeStep()

template<typename T , typename PARAMETERS >
virtual void olb::BaseSolver< T, PARAMETERS >::timeStep ( std::size_t iT)
protectedpure virtual

Defines what to do in a single time step.

Implemented in olb::LbSolver< T, PARAMETERS, LATTICES >.

+ Here is the caller graph for this function:

Member Data Documentation

◆ _finishedTimeLoop

template<typename T , typename PARAMETERS >
bool olb::BaseSolver< T, PARAMETERS >::_finishedTimeLoop {false}
protected

Definition at line 53 of file lbSolver.h.

53{false};

◆ _isInitialized

template<typename T , typename PARAMETERS >
bool olb::BaseSolver< T, PARAMETERS >::_isInitialized {false}
protected

Definition at line 51 of file lbSolver.h.

51{false};

◆ _iT

template<typename T , typename PARAMETERS >
std::size_t olb::BaseSolver< T, PARAMETERS >::_iT {0}
protected

Definition at line 52 of file lbSolver.h.

52{0};

◆ _parameters

template<typename T , typename PARAMETERS >
utilities::TypeIndexedSharedPtrTuple<PARAMETERS> olb::BaseSolver< T, PARAMETERS >::_parameters

Definition at line 48 of file lbSolver.h.


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