WARPXM v1.10.0
Loading...
Searching...
No Matches
WmSolverBase Class Referenceabstract

A base class for solvers in WARPM. More...

#include <wmsolverbase.h>

Inheritance diagram for WmSolverBase:
WxStepper WxObject WmSolver

Detailed Description

A base class for solvers in WARPM.

Classes

struct  solverParameters_t
 

Public Member Functions

 WmSolverBase (const WmSimulation *parentSim)
 Create new solver.
 
virtual ~WmSolverBase ()
 Destroy the object.
 
virtual void setup (const WxCryptSet &wxc)
 Setup object using supplied crypset.
 
std::string runName () const
 Return the run name (name identifying this run of the simulation)
 
std::string getSolverName () const
 Get the solver name (name associaton from the cryptset)
 
virtual void solve ()=0
 Run the solver.
 
virtual const WmDomaingetDomain () const =0
 Return unstructured domain.
 
virtual WmSubSolvergetSubSolver (const std::string &name) const =0
 Return pointer to subsolver.
 
virtual const wxm::variable::variable_tgetConstVar (const std::string &name) const =0
 Return constant reference to a read variable.
 
virtual wxm::variable::variable_tgetVar (const std::string &name) const =0
 Return reference to a variable.
 
virtual const std::type_info & getVarType (const std::string &name) const =0
 Return a type_info reference for a variable known to the solver.
 
virtual const solverParameters_tgetSolverParameters () const =0
 Return number of frames to output.
 
- Public Member Functions inherited from WxStepper
 WxStepper ()
 Create a new stepper.
 
virtual ~WxStepper ()
 Dtor: destroy object.
 
void setDt (time_t dt)
 Set time-step for the step method.
 
time_t getDt () const
 Get time-step for the step method.
 
void setTimeData (const WxStepper &timeData)
 Set time data for the step method.
 
void setCurrentTime (time_t tcurr)
 Set current time.
 
time_t incrementCurrentTime (time_t tadd)
 Increment current time.
 
time_t getCurrentTime () const
 Get the current time.
 
void setCurrentFrame (int frame)
 Set current frame number.
 
int incrementCurrentFrame ()
 Increment current frame number.
 
int getCurrentFrame () const
 Get the current frame number.
 
virtual WxStepperStatus step ()=0
 Advance the stepper by assigned time step.
 
virtual WxStepperStatus end ()
 Perform actions only done at simulation end.
 
- Public Member Functions inherited from WxObject
virtual ~WxObject ()
 Dtor: destroy object.
 
void setIo (WxIoBase &io)
 Set the I/O pointer for use in object.
 
void setMsg (WxMsgBase &msg)
 Set the msg pointer for use in object.
 
WxIoBasegetIo ()
 Return reference to I/O object.
 
const WxIoBasegetIo () const
 Return constant reference to I/O object.
 
WxMsgBasegetMsg ()
 Return reference to msg object.
 
const WxMsgBasegetMsg () const
 Return const reference to msg object.
 
virtual void setup (const WxCryptSet &wxc)
 Setup object using supplied crypset.
 
virtual void init ()
 Initialize the object.
 
virtual void finishBuild ()
 Finish building the object.
 
virtual void load (WxIoBase &io, const WxIoNodeType &grpNode)
 Load object from file.
 
virtual void dump (WxIoBase &io, WxIoNodeType &grpNode) const
 Dump object to file.
 
virtual std::string name () const
 Get name of object.
 
void setName (const std::string &nm)
 Set object's name.
 

Static Public Member Functions

static std::string getSrcDirectory ()
 Returns the source directory used for finding kernels.
 

Protected Attributes

const WmSimulation_parentSim
 Parent WmSimulation that owns this solver.
 

Additional Inherited Members

- Public Types inherited from WxStepper
typedef real time_t
 Time scalar data type.
 
- Protected Member Functions inherited from WxObject
 WxObject ()
 Create object, that will be initialized subsequently.
 
 WxObject (const std::string &name)
 Create object with given name bypassing object setup phase Protected because there is no reason to have a WxObject directly, as it is meant to be a parent class.
 

Constructor & Destructor Documentation

◆ WmSolverBase()

WmSolverBase::WmSolverBase ( const WmSimulation parentSim)

Create new solver.

Parameters
parentWmSimulation class which owns this solver
setDt_callbackpointer to optional callback function. When provided, function will be called after dt is updated, and before returning from the set member function.
setCurrentTime_callbackpointer to optional callback function. When provided, function will be called after current time is updated, and before returning from the set member function. Both callbacks provide a pointer to WxStepper instance and the new value in question.

◆ ~WmSolverBase()

virtual WmSolverBase::~WmSolverBase ( )
virtual

Destroy the object.

Member Function Documentation

◆ getConstVar()

virtual const wxm::variable::variable_t & WmSolverBase::getConstVar ( const std::string &  name) const
pure virtual

Return constant reference to a read variable.

Parameters
namename of read variable to return
Returns
reference to read variable

Implemented in WmSolver.

◆ getDomain()

virtual const WmDomain & WmSolverBase::getDomain ( ) const
pure virtual

Return unstructured domain.

Parameters
namename of domain geometry to return
Returns
matching domain geometry

Implemented in WmSolver.

◆ getSolverName()

std::string WmSolverBase::getSolverName ( ) const

Get the solver name (name associaton from the cryptset)

Returns
Solver name

◆ getSolverParameters()

virtual const solverParameters_t & WmSolverBase::getSolverParameters ( ) const
pure virtual

Return number of frames to output.

Returns
number of output frames

Implemented in WmSolver.

◆ getSrcDirectory()

static std::string WmSolverBase::getSrcDirectory ( )
inlinestatic

Returns the source directory used for finding kernels.

Returns
Source directory of code

◆ getSubSolver()

virtual WmSubSolver * WmSolverBase::getSubSolver ( const std::string &  name) const
pure virtual

Return pointer to subsolver.

NOTE: this interface allows non-const access to the held subsolver through const member.

Parameters
namename of subsolver to return

Implemented in WmSolver.

◆ getVar()

virtual wxm::variable::variable_t & WmSolverBase::getVar ( const std::string &  name) const
pure virtual

Return reference to a variable.

NOTE: this interface allows non-const access to the held variable through const member.

Parameters
namename of read variable to return
Returns
reference to read variable

Implemented in WmSolver.

◆ getVarType()

virtual const std::type_info & WmSolverBase::getVarType ( const std::string &  name) const
pure virtual

Return a type_info reference for a variable known to the solver.

Parameters
namename of variable to return
Returns
type_id reference for the variable

Implemented in WmSolver.

◆ runName()

std::string WmSolverBase::runName ( ) const

Return the run name (name identifying this run of the simulation)

◆ setup()

virtual void WmSolverBase::setup ( const WxCryptSet wxc)
virtual

Setup object using supplied crypset.

Currently no fields other than those considered by WxObject are utilized. Basically just sets this instance name, to that matching the crypt set name.

Parameters
wxcCryptset using which the object is set up.

Reimplemented from WxObject.

Reimplemented in WmSolver.

◆ solve()

virtual void WmSolverBase::solve ( )
pure virtual

Run the solver.

This must be provided by child classes.

Implemented in WmSolver.

Member Data Documentation

◆ _parentSim

const WmSimulation* WmSolverBase::_parentSim
protected

Parent WmSimulation that owns this solver.


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