Chaste Release::3.1
|
#include <AbstractOdeBasedContractionModel.hpp>
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) |
Protected Attributes | |
std::vector< double > | mTemporaryStateVariables |
double | mTime |
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.
AbstractOdeBasedContractionModel::AbstractOdeBasedContractionModel | ( | unsigned | numStateVariables | ) | [inline] |
Constructor
numStateVariables | number of state variables |
Definition at line 74 of file AbstractOdeBasedContractionModel.hpp.
void AbstractOdeBasedContractionModel::RunAndUpdate | ( | double | startTime, |
double | endTime, | ||
double | timeStep | ||
) | [inline, virtual] |
Solves the ODEs and updates the state variable to the new solution
Alternative usage: RunDoNotUpdate(); // .. UpdateStateVariables(); // if keeping this solution
startTime | start time |
endTime | end time |
timeStep | timestep 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 | ||
) | [inline, virtual] |
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).
startTime | start time |
endTime | end time |
timeStep | timestep 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 | ( | ) | [inline, virtual] |
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().
std::vector<double> AbstractOdeBasedContractionModel::mTemporaryStateVariables [protected] |
A second vector of state variables, where the results will go when RunDoNotUpdate() is called
Definition at line 64 of file AbstractOdeBasedContractionModel.hpp.
Referenced by NhsModelWithBackwardSolver::CalculateBackwardEulerResidual(), NhsModelWithBackwardSolver::GetNextActiveTension(), Nash2004ContractionModel::GetNextActiveTension(), Kerchoffs2003ContractionModel::GetNextActiveTension(), NhsModelWithBackwardSolver::ImplicitSolveForQ(), NhsModelWithBackwardSolver::NhsModelWithBackwardSolver(), NhsModelWithBackwardSolver::RunDoNotUpdate(), RunDoNotUpdate(), and UpdateStateVariables().
double AbstractOdeBasedContractionModel::mTime [protected] |
The time (at the next timestep) to be used in GetActiveTension if required
Definition at line 67 of file AbstractOdeBasedContractionModel.hpp.
Referenced by Kerchoffs2003ContractionModel::GetActiveTension(), Kerchoffs2003ContractionModel::Kerchoffs2003ContractionModel(), RunAndUpdate(), and Kerchoffs2003ContractionModel::SetInputParameters().