OpenLB 1.7
|
LbSolver is a generic solver for Lattice-Boltzmann problems. More...
#include <lbSolver.h>
Public Member Functions | |
LbSolver (utilities::TypeIndexedSharedPtrTuple< PARAMETERS > params) | |
void | buildAndReturn () |
Build geometry, lattice and call computeResults. | |
void | initialize () override |
Set up geometry. | |
Public Member Functions inherited from olb::BaseSolver< T, PARAMETERS > | |
BaseSolver (utilities::TypeIndexedSharedPtrTuple< PARAMETERS > params) | |
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 |
Protected Types | |
template<typename... DESCRIPTORS> | |
using | SuperLattices = std::tuple<std::shared_ptr<SuperLattice<T,DESCRIPTORS>>...> |
Protected Member Functions | |
void | prepareSimulation () override |
Set up lattice and initialize fields. | |
void | timeStep (std::size_t iT) override |
Collide-and-stream + additional computations. | |
void | postSimulation () override |
Evaluate results. | |
virtual void | prepareGeometry ()=0 |
Define the geometry. | |
virtual void | prepareLattices ()=0 |
Choose dynamics and boundary conditions. | |
virtual void | setInitialValues ()=0 |
Define fields and initialize lattice populations. | |
virtual void | setBoundaryValues (std::size_t iT)=0 |
Update fields and boundary values. | |
virtual void | getResults (std::size_t iT) |
Computation of results and output with full flexibility. | |
virtual void | computeResults (std::size_t iT) |
Perform further computations (compute errors etc.) | |
virtual void | computeResults () |
virtual bool | exitCondition (std::size_t iT) const override |
Condition, when to exit the time-stepping loop Returns true if the loop shall be continued. | |
virtual bool | checkStability (std::size_t iT) |
check stability: maxU should be <= _boundMaxU for a stable simulation Returns true if this fulfilled | |
virtual void | printLog (std::size_t iT) const |
virtual void | writeLogConverter () const |
virtual void | prepareVTK () const |
Write geometric information for vtk output The default version writes geometry, cuboid, rank and works for several lattices. | |
virtual void | writeVTK (std::size_t iT) const |
virtual void | writeImages (std::size_t iT) const |
virtual void | writeGnuplot (std::size_t iT) const |
template<typename... ARGS> | |
auto & | converter (ARGS &&... args) |
template<typename... ARGS> | |
auto & | converter (ARGS &&... args) const |
template<typename KEY > | |
auto & | lattice (KEY=KEY()) |
template<typename KEY > | |
auto & | lattice (KEY=KEY()) const |
template<typename KEY > | |
auto & | lattice (meta::id< KEY >) |
template<typename KEY > | |
auto & | lattice (meta::id< KEY >) const |
auto & | lattice () |
auto & | lattice () const |
auto & | geometry () |
auto & | geometry () const |
Static Protected Member Functions | |
static constexpr unsigned | getNumberStationaryLattices () |
Protected Attributes | |
std::shared_ptr< SuperGeometry< T, dim > > | _sGeometry |
std::shared_ptr< CuboidGeometry< T, dim > > | _cGeometry |
std::shared_ptr< LoadBalancer< T > > | _loadBalancer |
LATTICES::values_t::template decompose_into< SuperLattices > | _sLattices |
std::unique_ptr< util::Timer< BaseType< T > > > | _timer |
std::array< std::unique_ptr< util::ValueTracer< T > >, getNumberStationaryLattices()> | _convergenceCheck |
bool | _exitMaxU {false} |
BaseType< T > | _boundMaxU {1.0} |
std::size_t | _itCheckStability {1} |
std::size_t | _itBoundaryUpdate {1} |
Protected Attributes inherited from olb::BaseSolver< T, PARAMETERS > | |
bool | _isInitialized {false} |
std::size_t | _iT {0} |
bool | _finishedTimeLoop {false} |
Static Protected Attributes | |
static constexpr unsigned | dim = LATTICES::values_t::template get<0>::d |
static constexpr bool | isStationary = PARAMETERS::keys_t::template contains<names::Stationarity>() |
static constexpr bool | outputGnuplot = PARAMETERS::keys_t::template contains<names::VisualizationGnuplot>() |
static constexpr bool | outputImages = PARAMETERS::keys_t::template contains<names::VisualizationImages>() |
static constexpr bool | outputVTK = PARAMETERS::keys_t::template contains<names::VisualizationVTK>() |
Additional Inherited Members | |
Public Types inherited from olb::BaseSolver< T, PARAMETERS > | |
using | t = T |
using | Parameters_t = PARAMETERS |
Public Attributes inherited from olb::BaseSolver< T, PARAMETERS > | |
utilities::TypeIndexedSharedPtrTuple< PARAMETERS > | _parameters |
LbSolver is a generic solver for Lattice-Boltzmann problems.
It holds geometry and lattices and defines the abstract methods of BaseSolver. Every simulation app should be able to inherit from this class.
Definition at line 130 of file lbSolver.h.
|
protected |
Definition at line 139 of file lbSolver.h.
|
inline |
Definition at line 171 of file lbSolver.h.
void olb::LbSolver< T, PARAMETERS, LATTICES >::buildAndReturn | ( | ) |
Build geometry, lattice and call computeResults.
Definition at line 60 of file lbSolver.hh.
|
protectedvirtual |
check stability: maxU should be <= _boundMaxU for a stable simulation Returns true if this fulfilled
Definition at line 278 of file lbSolver.hh.
References olb::meta::tuple_for_each().
|
inlineprotectedvirtual |
Definition at line 217 of file lbSolver.h.
|
inlineprotectedvirtual |
Perform further computations (compute errors etc.)
Definition at line 215 of file lbSolver.h.
|
inlineprotected |
Definition at line 255 of file lbSolver.h.
References olb::BaseSolver< T, PARAMETERS >::parameters().
|
inlineprotected |
Definition at line 266 of file lbSolver.h.
References olb::BaseSolver< T, PARAMETERS >::parameters().
|
overrideprotectedvirtual |
Condition, when to exit the time-stepping loop Returns true if the loop shall be continued.
Implements olb::BaseSolver< T, PARAMETERS >.
Definition at line 257 of file lbSolver.hh.
|
inlineprotected |
Definition at line 300 of file lbSolver.h.
References olb::LbSolver< T, PARAMETERS, LATTICES >::_sGeometry.
|
inlineprotected |
Definition at line 303 of file lbSolver.h.
References olb::LbSolver< T, PARAMETERS, LATTICES >::_sGeometry.
|
inlinestaticconstexprprotected |
Definition at line 150 of file lbSolver.h.
References olb::LbSolver< T, PARAMETERS, LATTICES >::isStationary.
|
inlineprotectedvirtual |
Computation of results and output with full flexibility.
Definition at line 210 of file lbSolver.h.
|
overridevirtual |
Set up geometry.
Implements olb::BaseSolver< T, PARAMETERS >.
Definition at line 36 of file lbSolver.hh.
|
inlineprotected |
Definition at line 292 of file lbSolver.h.
References olb::LbSolver< T, PARAMETERS, LATTICES >::_sLattices.
|
inlineprotected |
Definition at line 296 of file lbSolver.h.
References olb::LbSolver< T, PARAMETERS, LATTICES >::_sLattices.
|
inlineprotected |
Definition at line 277 of file lbSolver.h.
References olb::LbSolver< T, PARAMETERS, LATTICES >::_sLattices.
|
inlineprotected |
Definition at line 281 of file lbSolver.h.
References olb::LbSolver< T, PARAMETERS, LATTICES >::_sLattices.
|
inlineprotected |
Definition at line 285 of file lbSolver.h.
References olb::LbSolver< T, PARAMETERS, LATTICES >::_sLattices.
|
inlineprotected |
Definition at line 289 of file lbSolver.h.
References olb::LbSolver< T, PARAMETERS, LATTICES >::_sLattices.
|
overrideprotectedvirtual |
Evaluate results.
Implements olb::BaseSolver< T, PARAMETERS >.
Definition at line 208 of file lbSolver.hh.
References olb::Evaluation, and olb::meta::tuple_for_each().
|
protectedpure virtual |
Define the geometry.
|
protectedpure virtual |
Choose dynamics and boundary conditions.
|
overrideprotectedvirtual |
Set up lattice and initialize fields.
Implements olb::BaseSolver< T, PARAMETERS >.
Definition at line 100 of file lbSolver.hh.
References olb::meta::tuple_for_each().
|
protectedvirtual |
Write geometric information for vtk output The default version writes geometry, cuboid, rank and works for several lattices.
This method may be overridden in case e.g. discrete normals shall be visualized (cf. example cavity2d).
Writes the geometry, cuboid no. and rank no. as vti file for visualization
Definition at line 324 of file lbSolver.hh.
|
protectedvirtual |
Definition at line 306 of file lbSolver.hh.
|
protectedpure virtual |
Update fields and boundary values.
|
protectedpure virtual |
Define fields and initialize lattice populations.
|
overrideprotectedvirtual |
Collide-and-stream + additional computations.
Implements olb::BaseSolver< T, PARAMETERS >.
Definition at line 134 of file lbSolver.hh.
References olb::meta::tuple_for_each().
|
inlineprotectedvirtual |
Definition at line 251 of file lbSolver.h.
|
inlineprotectedvirtual |
Definition at line 248 of file lbSolver.h.
|
protectedvirtual |
Definition at line 317 of file lbSolver.hh.
|
inlineprotectedvirtual |
Definition at line 245 of file lbSolver.h.
|
protected |
Definition at line 166 of file lbSolver.h.
|
protected |
Definition at line 142 of file lbSolver.h.
|
protected |
Definition at line 159 of file lbSolver.h.
|
protected |
Definition at line 165 of file lbSolver.h.
|
protected |
Definition at line 168 of file lbSolver.h.
|
protected |
Definition at line 167 of file lbSolver.h.
|
protected |
Definition at line 143 of file lbSolver.h.
|
protected |
Definition at line 141 of file lbSolver.h.
|
protected |
Definition at line 145 of file lbSolver.h.
|
protected |
Definition at line 147 of file lbSolver.h.
|
staticconstexprprotected |
Definition at line 136 of file lbSolver.h.
|
staticconstexprprotected |
Definition at line 149 of file lbSolver.h.
|
staticconstexprprotected |
Definition at line 161 of file lbSolver.h.
|
staticconstexprprotected |
Definition at line 162 of file lbSolver.h.
|
staticconstexprprotected |
Definition at line 163 of file lbSolver.h.