LBIBCell
 All Classes Functions Variables Friends Pages
LbmLib::solver::BaseCDESolver< T > Struct Template Reference

The Base class for all CDESolver implementations This classes uses the recursive template idiom to automatically register child classes in the factory. To implement a solver, inherit from this class and provide the same class as a template argument. Additionally, the class should provide a static member to store a unique name for the class. Preferentially, declare the constructor and the static member name private and make the BaseCDESolver a friend class of this. An Example for a CDESolver: More...

#include <CDEAbstractSolver.hpp>

Inheritance diagram for LbmLib::solver::BaseCDESolver< T >:
LbmLib::solver::CDEAbstractSolver LbmLib::solver::AbstractSolver

Public Member Functions

std::string getName ()
 getName More...
 
- Public Member Functions inherited from LbmLib::solver::CDEAbstractSolver
virtual ~CDEAbstractSolver ()
 ~CDEAbstractSolver virtual Destructor
 
void initCDESolver (const nodes::PhysicalNode *physicalNode, size_t id)
 initCDESolver This connects the Solver with an physical node this should be executed before using this class More...
 
virtual double calculateEquilibrium (const Direction &dir)=0
 calculateEquilibrium calculates the equilibirum for direction dir More...
 
virtual double getC () const =0
 getC Calculates the concentration on this node More...
 
virtual void reinitialise ()=0
 reinitialise this solver iff the corresponding physical node has changed domain identifier
 
size_t getId ()
 return the id of this solver More...
 
- Public Member Functions inherited from LbmLib::solver::AbstractSolver
virtual ~AbstractSolver ()
 ~AbstractSolver Destructor
 
virtual void initSolver ()=0
 initSolver Use this to initalise the solver
 
virtual void collide ()=0
 collide The collision step of the LBM
 
virtual void advect ()=0
 advect The advect step of the LBM
 
virtual void loadSolver (std::stringstream *const stream)=0
 loads the solver from the stream More...
 
virtual void writeSolver (std::ostream *const stream)=0
 writes the solver to the stream More...
 
virtual double & accessDistribution (const Direction &dir)=0
 accessDistribution Access to the distribution More...
 
virtual void rescaleDistributions (const double factor)=0
 Rescales all distributions by a factor. More...
 
void setTau (double tau)
 setTau Setter method for the tau parameter of the solver More...
 
double getTau () const
 getTau Getter method for the tau parameter More...
 

Protected Member Functions

 BaseCDESolver ()
 BaseCDESolver The Constructor which enforces that the specialisation is done.
 
virtual ~BaseCDESolver ()
 ~BaseCDESolver virtual Destructor
 
- Protected Member Functions inherited from LbmLib::solver::CDEAbstractSolver
 CDEAbstractSolver ()
 CDEAbstractSolver protected Constructor only use create method for instantiation.
 
- Protected Member Functions inherited from LbmLib::solver::AbstractSolver
 AbstractSolver ()
 AbstractSolver Protected to disable direct instantiation.
 

Static Protected Member Functions

static CDEAbstractSolvercreate ()
 Create static constructor. A pointer to this function along with the name of the algorithm is registered with the Solver Factory. More...
 
static bool init ()
 init Registers the class in the Solver Factory More...
 

Static Protected Attributes

static bool reg = BaseCDESolver<T>::init()
 reg True if registration was successful
 

Additional Inherited Members

- Protected Attributes inherited from LbmLib::solver::CDEAbstractSolver
const nodes::PhysicalNodephysicalNode_
 physicalNode_ The physical Node which owns this solver
 
size_t solverID_
 solverID_ The ID of the solver instance. Coincides with the index in the vector PhysicalNode::cdeSolvers_ (which stores all CDE solvers).
 

Detailed Description

template<class T>
struct LbmLib::solver::BaseCDESolver< T >

The Base class for all CDESolver implementations This classes uses the recursive template idiom to automatically register child classes in the factory. To implement a solver, inherit from this class and provide the same class as a template argument. Additionally, the class should provide a static member to store a unique name for the class. Preferentially, declare the constructor and the static member name private and make the BaseCDESolver a friend class of this. An Example for a CDESolver:

class CDESolverD2Q5 : public BaseCDESolver<CDESolverD2Q5>{
private:
friend class BaseCDESolver;
CDESolverD2Q5();
static const std::string name; // the name of the CDEsolver, e.g. CDESolverD2Q5
}

Definition at line 127 of file CDEAbstractSolver.hpp.

Member Function Documentation

template<class T>
static CDEAbstractSolver* LbmLib::solver::BaseCDESolver< T >::create ( )
inlinestaticprotected

Create static constructor. A pointer to this function along with the name of the algorithm is registered with the Solver Factory.

Returns
Pointer to a new AbstractCDESolver instance. Responsibility for allocated memory lies with the caller.

Definition at line 157 of file CDEAbstractSolver.hpp.

template<class T>
std::string LbmLib::solver::BaseCDESolver< T >::getName ( )
inlinevirtual

getName

Returns
returns the name of the solver.

Implements LbmLib::solver::CDEAbstractSolver.

Definition at line 133 of file CDEAbstractSolver.hpp.

template<class T>
static bool LbmLib::solver::BaseCDESolver< T >::init ( )
inlinestaticprotected

init Registers the class in the Solver Factory

Returns
True if successful

Definition at line 169 of file CDEAbstractSolver.hpp.


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