Chaste  Release::3.4
AbstractOdeBasedContractionModel Class Reference

#include <AbstractOdeBasedContractionModel.hpp>

+ Inheritance diagram for AbstractOdeBasedContractionModel:
+ Collaboration diagram for AbstractOdeBasedContractionModel:

Public Member Functions

 AbstractOdeBasedContractionModel (unsigned numStateVariables)
 
virtual void RunDoNotUpdate (double startTime, double endTime, double timeStep)
 
void UpdateStateVariables ()
 
void RunAndUpdate (double startTime, double endTime, double timeStep)
 
- Public Member Functions inherited from AbstractOdeSystem
 AbstractOdeSystem (unsigned numberOfStateVariables)
 
virtual ~AbstractOdeSystem ()
 
virtual void EvaluateYDerivatives (double time, const std::vector< double > &rY, std::vector< double > &rDY)=0
 
virtual bool CalculateStoppingEvent (double time, const std::vector< double > &rY)
 
virtual double CalculateRootFunction (double time, const std::vector< double > &rY)
 
bool GetUseAnalyticJacobian ()
 
const std::vector< double > & rGetConstStateVariables () const
 
- Public Member Functions inherited from AbstractParameterisedSystem< std::vector< double > >
 AbstractParameterisedSystem (unsigned numberOfStateVariables)
 
std::vector< double > & rGetStateVariables ()
 
std::vector< doubleGetStateVariables ()
 
void SetStateVariables (const std::vector< double > &rStateVariables)
 
double GetStateVariable (unsigned index) const
 
double GetStateVariable (const std::string &rName) const
 
void SetStateVariable (unsigned index, double newValue)
 
void SetStateVariable (const std::string &rName, double newValue)
 
virtual void VerifyStateVariables ()
 
void SetDefaultInitialConditions (const std::vector< double > &rInitialConditions)
 
void SetDefaultInitialCondition (unsigned index, double initialCondition)
 
std::vector< doubleGetInitialConditions () const
 
void ResetToInitialConditions ()
 
double GetParameter (unsigned index) const
 
double GetParameter (const std::string &rName) const
 
void SetParameter (const std::string &rName, double value)
 
void SetParameter (unsigned index, double value)
 
double GetAnyVariable (unsigned index, double time=0.0, std::vector< double > *pDerivedQuantities=NULL)
 
double GetAnyVariable (const std::string &rName, double time=0.0, std::vector< double > *pDerivedQuantities=NULL)
 
void SetAnyVariable (unsigned index, double value)
 
void SetAnyVariable (const std::string &rName, double value)
 
virtual std::vector< doubleComputeDerivedQuantities (double time, const std::vector< double > &rState)
 
std::vector< doubleComputeDerivedQuantitiesFromCurrentState (double time)
 
- Public Member Functions inherited from AbstractUntemplatedParameterisedSystem
 AbstractUntemplatedParameterisedSystem (unsigned numberOfStateVariables)
 
virtual ~AbstractUntemplatedParameterisedSystem ()
 
boost::shared_ptr< const
AbstractOdeSystemInformation
GetSystemInformation () const
 
std::string GetSystemName () const
 
unsigned GetNumberOfAttributes () const
 
bool HasAttribute (const std::string &rName) const
 
double GetAttribute (const std::string &rName) const
 
unsigned GetNumberOfStateVariables () const
 
const std::vector< std::string > & rGetStateVariableNames () const
 
const std::vector< std::string > & rGetStateVariableUnits () const
 
unsigned GetStateVariableIndex (const std::string &rName) const
 
bool HasStateVariable (const std::string &rName) const
 
std::string GetStateVariableUnits (unsigned index) const
 
unsigned GetNumberOfParameters () const
 
const std::vector< std::string > & rGetParameterNames () const
 
const std::vector< std::string > & rGetParameterUnits () const
 
unsigned GetParameterIndex (const std::string &rName) const
 
bool HasParameter (const std::string &rName) const
 
std::string GetParameterUnits (unsigned index) const
 
unsigned GetNumberOfDerivedQuantities () const
 
const std::vector< std::string > & rGetDerivedQuantityNames () const
 
const std::vector< std::string > & rGetDerivedQuantityUnits () const
 
unsigned GetDerivedQuantityIndex (const std::string &rName) const
 
bool HasDerivedQuantity (const std::string &rName) const
 
std::string GetDerivedQuantityUnits (unsigned index) const
 
unsigned GetAnyVariableIndex (const std::string &rName) const
 
bool HasAnyVariable (const std::string &rName) const
 
std::string GetAnyVariableUnits (unsigned index) const
 
std::string GetAnyVariableUnits (const std::string &rName) const
 
- Public Member Functions inherited from AbstractContractionModel
 AbstractContractionModel ()
 
virtual ~AbstractContractionModel ()
 
virtual bool IsStretchDependent ()=0
 
virtual bool IsStretchRateDependent ()=0
 
virtual void SetInputParameters (ContractionModelInputParameters &rInputParameters)=0
 
virtual void SetStretchAndStretchRate (double stretch, double stretchRate)=0
 
void SetStretch (double stretch)
 
virtual double GetActiveTension ()=0
 
virtual double GetNextActiveTension ()=0
 

Protected Attributes

std::vector< doublemTemporaryStateVariables
 
double mTime
 
- Protected Attributes inherited from AbstractOdeSystem
bool mUseAnalyticJacobian
 
- Protected Attributes inherited from AbstractParameterisedSystem< std::vector< double > >
std::vector< doublemStateVariables
 
std::vector< doublemParameters
 
- Protected Attributes inherited from AbstractUntemplatedParameterisedSystem
unsigned mNumberOfStateVariables
 
boost::shared_ptr
< AbstractOdeSystemInformation
mpSystemInfo
 

Additional Inherited Members

- Protected Member Functions inherited from AbstractParameterisedSystem< std::vector< double > >
std::string DumpState (const std::string &rMessage)
 
std::string DumpState (const std::string &rMessage, std::vector< double >Y)
 
std::string DumpState (const std::string &rMessage, std::vector< double >Y, double time)
 
void CheckParametersOnLoad (const std::vector< double > &rParameters, const std::vector< std::string > &rParameterNames)
 

Detailed Description

Abstract base class for ODE-based contraction models. Inherits from AbstractOdeSystem and AbstractContractionModel and deals with the ODE solving.

Usage is either: // for the explicit electromechanics algorithm RunAndUpdate(); // solves and updates state variables to the solution

or // for the implicit electromechanics algorithm RunDoNotUpdate(); // .. UpdateStateVariables(); // if keeping this solution

Definition at line 58 of file AbstractOdeBasedContractionModel.hpp.

Constructor & Destructor Documentation

AbstractOdeBasedContractionModel::AbstractOdeBasedContractionModel ( unsigned  numStateVariables)
inline

Constructor

Parameters
numStateVariablesnumber of state variables

Definition at line 74 of file AbstractOdeBasedContractionModel.hpp.

Member Function Documentation

void AbstractOdeBasedContractionModel::RunAndUpdate ( double  startTime,
double  endTime,
double  timeStep 
)
inlinevirtual

Solves the ODEs and updates the state variable to the new solution

Alternative usage: RunDoNotUpdate(); // .. UpdateStateVariables(); // if keeping this solution

Parameters
startTimestart time
endTimeend time
timeSteptimestep for integrating ODEs

Implements AbstractContractionModel.

Reimplemented in NhsModelWithBackwardSolver.

Definition at line 142 of file AbstractOdeBasedContractionModel.hpp.

References mTime, and AbstractIvpOdeSolver::SolveAndUpdateStateVariable().

Referenced by RunDoNotUpdate().

virtual void AbstractOdeBasedContractionModel::RunDoNotUpdate ( double  startTime,
double  endTime,
double  timeStep 
)
inlinevirtual

Solves the ODEs, but doesn't update the state variables, instead keeps them in a temporary store. Call UpdateStateVariables() to save the new values. Call GetNextActiveTension() to get the active tension corresponding to the new values (if UpdateStateVariables() has not been called). Also saves the time (using endTime).

Parameters
startTimestart time
endTimeend time
timeSteptimestep for integrating ODEs

Implements AbstractContractionModel.

Reimplemented in NhsModelWithBackwardSolver.

Definition at line 93 of file AbstractOdeBasedContractionModel.hpp.

References AbstractParameterisedSystem< std::vector< double > >::mStateVariables, mTemporaryStateVariables, and RunAndUpdate().

void AbstractOdeBasedContractionModel::UpdateStateVariables ( )
inlinevirtual

After RunDoNotUpdate() has been called, this call be used to update the state variables to the new (saved) values

Implements AbstractContractionModel.

Definition at line 121 of file AbstractOdeBasedContractionModel.hpp.

References AbstractParameterisedSystem< std::vector< double > >::mStateVariables, and mTemporaryStateVariables.

Referenced by NhsModelWithBackwardSolver::RunAndUpdate().

Member Data Documentation

double AbstractOdeBasedContractionModel::mTime
protected

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