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

The WmHostAction class is a base class for sub-solvers in the WARPXM system. More...

#include <wmhostaction.h>

Inheritance diagram for WmHostAction:
WxStepper WxObject WmFillValue WmFunctionApplicator WmGhostSync WmICGenerator WmPatchProcessor WmProbeLocation WmSynchronizer WmTestSuggestedDt WmTimedSwapVariables WmVariableLoader WmVariableSwapper WmWriteOut wxm::diagnostics::Diagnostic wxm::diagnostics::DiagnosticsWriter wxm::dt_calc::time_stepper_base wxm::host_actions::data_loader wxm::temporal_solver wxm::va_runner

Detailed Description

The WmHostAction class is a base class for sub-solvers in the WARPXM system.

A hostaction is an object which encodes algorithms to transform input variables into output variables. It is like a subroutine in a programming langauge.

Public Member Functions

 ~WmHostAction () override
 Destroy hostaction.
 
void setup (const WxCryptSet &wxc) override
 Setup hostaction object using supplied cryptset.
 
std::vector< std::string > readVarNames () const
 Get names of all read variables used.
 
std::vector< std::string > writeVarNames () const
 Get names of all write variables used.
 
unsigned numExpectedReadVars () const
 Return number of read variables expected by this hostaction, or minimum number required for hostactions allowing variable number of read vars.
 
unsigned numExpectedWriteVars () const
 Return number of write variables expected by this hostaction, or minimum number required for hostactions allowing variable number of write vars.
 
bool allowsVariableReadVars () const
 Does this hostaction allow variable number of read variables?
 
bool allowsVariableWriteVars () const
 Does this hostaction allow variable number of write variables?
 
virtual bool needsDomain () const
 Return true if this updater needs a domain to work on.
 
void setParentStepHandler (WmExecutionStep< WmHostAction > *parentStepHandler)
 Set enclosing step handler TODO: convert this to being a friend function or something.
 
unsigned numActualReadVars () const
 Get number of actual read variables used when user calls this hostaction.
 
unsigned numActualWriteVars () const
 Get number of actual write variables used when user calls this hostaction.
 
const WmDomaingetDomain () const
 Get (unstructured) domain on which host action works.
 
std::vector< std::string > getWriteVarList () const
 Returns list of write variables for this hostaction.
 
std::vector< std::string > getReadVarList () const
 Returns list of read variables for this hostaction.
 
const WmSolverBasegetParent () const
 Get parent solver object.
 
- 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.
 

Protected Member Functions

 WmHostAction (const WmConstOpaquePtr &parent_solver)
 Create new hostaction.
 
const std::type_info & getVarType (const std::string &variableName) const
 Get a variable types from the parent solver.
 
const wxm::variable::variable_tgetReadVar (unsigned pos) const
 Get a reference to a read variable.
 
wxm::variable::variable_tgetWriteVar (unsigned pos) const
 Get a reference to a write variable.
 
virtual void typeCheck ()=0
 Check that the provided variables meet the expected variable types for this hostaction.
 
- 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.
 

Protected Attributes

bool _allReadVarsSameType
 
bool _allWriteVarsSameType
 
bool _allowsVariableReadVars
 
bool _allowsVariableWriteVars
 
bool _WriteVarConditionHasBeenSet
 
bool _ReadVarConditionHasBeenSet
 
unsigned _numExpectedReadVars
 
unsigned _numExpectedWriteVars
 

Additional Inherited Members

- Public Types inherited from WxStepper
typedef real time_t
 Time scalar data type.
 

Constructor & Destructor Documentation

◆ ~WmHostAction()

WmHostAction::~WmHostAction ( )
override

Destroy hostaction.

◆ WmHostAction()

WmHostAction::WmHostAction ( const WmConstOpaquePtr parent_solver)
protected

Create new hostaction.

Parameters
parent_solvertype opaque wrapper to parent solver

Member Function Documentation

◆ allowsVariableReadVars()

bool WmHostAction::allowsVariableReadVars ( ) const

Does this hostaction allow variable number of read variables?

Returns
true if variable number of read variables

◆ allowsVariableWriteVars()

bool WmHostAction::allowsVariableWriteVars ( ) const

Does this hostaction allow variable number of write variables?

Returns
true if variable number of write variables

◆ getDomain()

const WmDomain & WmHostAction::getDomain ( ) const

Get (unstructured) domain on which host action works.

Returns
domain object

◆ getParent()

const WmSolverBase & WmHostAction::getParent ( ) const

Get parent solver object.

Returns
reference to parent

◆ getReadVar()

const wxm::variable::variable_t & WmHostAction::getReadVar ( unsigned  pos) const
protected

Get a reference to a read variable.

Parameters
posposition of variable in readVars list
Returns
reference to variable

◆ getReadVarList()

std::vector< std::string > WmHostAction::getReadVarList ( ) const

Returns list of read variables for this hostaction.

Returns
List of read variables

◆ getVarType()

const std::type_info & WmHostAction::getVarType ( const std::string &  variableName) const
protected

Get a variable types from the parent solver.

Parameters
posposition of variable in readVars list
Returns
reference to variable

◆ getWriteVar()

wxm::variable::variable_t & WmHostAction::getWriteVar ( unsigned  pos) const
protected

Get a reference to a write variable.

Parameters
posposition of variable in writeVars list
Returns
reference to variable

◆ getWriteVarList()

std::vector< std::string > WmHostAction::getWriteVarList ( ) const

Returns list of write variables for this hostaction.

Returns
List of write variables

◆ needsDomain()

◆ numActualReadVars()

unsigned WmHostAction::numActualReadVars ( ) const

Get number of actual read variables used when user calls this hostaction.

Parameters
numberof read variables

◆ numActualWriteVars()

unsigned WmHostAction::numActualWriteVars ( ) const

Get number of actual write variables used when user calls this hostaction.

Parameters
numberof write variables

◆ numExpectedReadVars()

unsigned WmHostAction::numExpectedReadVars ( ) const

Return number of read variables expected by this hostaction, or minimum number required for hostactions allowing variable number of read vars.

Returns
number of read variables expected,

◆ numExpectedWriteVars()

unsigned WmHostAction::numExpectedWriteVars ( ) const

Return number of write variables expected by this hostaction, or minimum number required for hostactions allowing variable number of write vars.

Returns
number of write variables expected, or minimum number required if variable read vars allowed

◆ readVarNames()

std::vector< std::string > WmHostAction::readVarNames ( ) const

Get names of all read variables used.

Returns
names of read variables

◆ setParentStepHandler()

void WmHostAction::setParentStepHandler ( WmExecutionStep< WmHostAction > *  parentStepHandler)

Set enclosing step handler TODO: convert this to being a friend function or something.

Or perhaps set with the constructor. It should not be public.

Parameters
parentStepHandlerpointer to associated step handler

◆ setup()

void WmHostAction::setup ( const WxCryptSet wxc)
overridevirtual

Setup hostaction object using supplied cryptset.

Parameters
wxcCryptset to use for setting

Reimplemented from WxObject.

Reimplemented in WmICGenerator, WmPatchProcessor, WmProbeLocation, WmSynchronizer, WmTestSuggestedDt, WmTimedSwapVariables, WmVariableLoader, WmVariableSwapper, wxm::temporal_solver, wxm::va_runner, and WmWriteOut.

◆ typeCheck()

virtual void WmHostAction::typeCheck ( )
protectedpure virtual

◆ writeVarNames()

std::vector< std::string > WmHostAction::writeVarNames ( ) const

Get names of all write variables used.

Returns
names of write variables

Member Data Documentation

◆ _allowsVariableReadVars

bool WmHostAction::_allowsVariableReadVars
protected

◆ _allowsVariableWriteVars

bool WmHostAction::_allowsVariableWriteVars
protected

◆ _allReadVarsSameType

bool WmHostAction::_allReadVarsSameType
protected

◆ _allWriteVarsSameType

bool WmHostAction::_allWriteVarsSameType
protected

◆ _numExpectedReadVars

unsigned WmHostAction::_numExpectedReadVars
protected

◆ _numExpectedWriteVars

unsigned WmHostAction::_numExpectedWriteVars
protected

◆ _ReadVarConditionHasBeenSet

bool WmHostAction::_ReadVarConditionHasBeenSet
protected

◆ _WriteVarConditionHasBeenSet

bool WmHostAction::_WriteVarConditionHasBeenSet
protected

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