WARPXM v1.10.0
|
A base class for solvers in WARPM. More...
#include <wmsolverbase.h>
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 WmDomain & | getDomain () const =0 |
Return unstructured domain. | |
virtual WmSubSolver * | getSubSolver (const std::string &name) const =0 |
Return pointer to subsolver. | |
virtual const wxm::variable::variable_t & | getConstVar (const std::string &name) const =0 |
Return constant reference to a read variable. | |
virtual wxm::variable::variable_t & | getVar (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_t & | getSolverParameters () 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. | |
WxIoBase & | getIo () |
Return reference to I/O object. | |
const WxIoBase & | getIo () const |
Return constant reference to I/O object. | |
WxMsgBase & | getMsg () |
Return reference to msg object. | |
const WxMsgBase & | getMsg () 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. | |
WmSolverBase::WmSolverBase | ( | const WmSimulation * | parentSim | ) |
Create new solver.
parent | WmSimulation class which owns this solver |
setDt_callback | pointer to optional callback function. When provided, function will be called after dt is updated, and before returning from the set member function. |
setCurrentTime_callback | pointer 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. |
|
virtual |
Destroy the object.
|
pure virtual |
Return constant reference to a read variable.
name | name of read variable to return |
Implemented in WmSolver.
|
pure virtual |
Return unstructured domain.
name | name of domain geometry to return |
Implemented in WmSolver.
std::string WmSolverBase::getSolverName | ( | ) | const |
Get the solver name (name associaton from the cryptset)
|
pure virtual |
|
inlinestatic |
Returns the source directory used for finding kernels.
|
pure virtual |
Return pointer to subsolver.
NOTE: this interface allows non-const access to the held subsolver through const member.
name | name of subsolver to return |
Implemented in WmSolver.
|
pure virtual |
Return reference to a variable.
NOTE: this interface allows non-const access to the held variable through const member.
name | name of read variable to return |
Implemented in WmSolver.
|
pure virtual |
Return a type_info reference for a variable known to the solver.
name | name of variable to return |
Implemented in WmSolver.
std::string WmSolverBase::runName | ( | ) | const |
Return the run name (name identifying this run of the simulation)
|
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.
wxc | Cryptset using which the object is set up. |
Reimplemented from WxObject.
Reimplemented in WmSolver.
|
pure virtual |
|
protected |
Parent WmSimulation that owns this solver.