SPHinXsys  alpha version
Public Member Functions | List of all members
SPH::StateEngine::StateVariable Class Referenceabstract

#include <state_engine.h>

Inherited by SPH::StateEngine::AddedStateVariable.

Public Member Functions

 StateVariable ()
 
 StateVariable (std::string &name, StateEngine &owner, SimTK::SubsystemIndex subsys, int varindex)
 
std::string & getName ()
 
StateEnginegetOwner ()
 
int & getVarIndex ()
 
SimTK::SubsystemIndex & getSubsysIndex ()
 
SimTK::SystemYIndex & getSystemYIndex ()
 
void setVarIndex (int index)
 
void setSubsystemIndex (SimTK::SubsystemIndex &subsysindx)
 
virtual Real getValue ()=0
 
virtual void setValue (Real value)=0
 
virtual Real getDerivative ()=0
 
virtual void setDerivative (Real deriv)=0
 

Detailed Description

Derived simbodysate must create concrete StateVariables to expose their state variables. When exposing state variables allocated by the underlying Simbody (MobilizedBody, Constraint, Force, etc...) use its interface to implement the virtual methods below.

Constructor & Destructor Documentation

◆ StateVariable() [1/2]

SPH::StateEngine::StateVariable::StateVariable ( )
inline

Concstructor and destructor.

◆ StateVariable() [2/2]

SPH::StateEngine::StateVariable::StateVariable ( std::string &  name,
StateEngine owner,
SimTK::SubsystemIndex  subsys,
int  varindex 
)
inlineexplicit
Parameters
namestate var name.
ownerowning component.
subsyssubsystem for allocation.
varindexvariable's index in subsystem.

Member Function Documentation

◆ getSubsysIndex()

SimTK::SubsystemIndex& SPH::StateEngine::StateVariable::getSubsysIndex ( )
inline

Return the index of the subsystem used to make resource allocations.

◆ getSystemYIndex()

SimTK::SystemYIndex& SPH::StateEngine::StateVariable::getSystemYIndex ( )
inline

Return the index in the global list of continuous state variables, Y.

◆ getValue()

virtual Real SPH::StateEngine::StateVariable::getValue ( )
pure virtual

Concrete StateEngines implement how the state variable value is evaluated.

Implemented in SPH::StateEngine::AddedStateVariable.

◆ getVarIndex()

int& SPH::StateEngine::StateVariable::getVarIndex ( )
inline

Get the index of simbody state variable.

◆ setDerivative()

virtual void SPH::StateEngine::StateVariable::setDerivative ( Real  deriv)
pure virtual

The derivative a state should be a cache entry and thus does not change the state.

Implemented in SPH::StateEngine::AddedStateVariable.

◆ setSubsystemIndex()

void SPH::StateEngine::StateVariable::setSubsystemIndex ( SimTK::SubsystemIndex &  subsysindx)
inline

Set the index of the subsystem used to resource allocations.

◆ setVarIndex()

void SPH::StateEngine::StateVariable::setVarIndex ( int  index)
inline

Set the index of simbody variable.


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