Chaste
Release::3.4
|
#include <CombinedOdeSystem.hpp>
Classes | |
struct | VariableParameterMap |
Public Member Functions | |
CombinedOdeSystem (std::vector< AbstractOdeSystem * > odeSystems) | |
void | Configure (const std::map< unsigned, unsigned > &rVariableParameterMap, AbstractOdeSystem *pVariableOdeSystem, AbstractOdeSystem *pParameterOdeSystem) |
void | EvaluateYDerivatives (double time, const std::vector< double > &rY, std::vector< double > &rDY) |
Public Member Functions inherited from AbstractOdeSystem | |
AbstractOdeSystem (unsigned numberOfStateVariables) | |
virtual | ~AbstractOdeSystem () |
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< double > | GetStateVariables () |
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< double > | GetInitialConditions () 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< double > | ComputeDerivedQuantities (double time, const std::vector< double > &rState) |
std::vector< double > | ComputeDerivedQuantitiesFromCurrentState (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 |
Private Attributes | |
std::vector< AbstractOdeSystem * > | mOdeSystems |
std::vector< std::vector < double > > | mWorkingStateVars |
std::vector< std::vector < double > > | mWorkingDerivs |
std::vector< unsigned > | mOffsets |
std::vector< struct VariableParameterMap > | mVariableParameterMaps |
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) |
Protected Attributes inherited from AbstractOdeSystem | |
bool | mUseAnalyticJacobian |
Protected Attributes inherited from AbstractParameterisedSystem< std::vector< double > > | |
std::vector< double > | mStateVariables |
std::vector< double > | mParameters |
Protected Attributes inherited from AbstractUntemplatedParameterisedSystem | |
unsigned | mNumberOfStateVariables |
boost::shared_ptr < AbstractOdeSystemInformation > | mpSystemInfo |
An ODE system formed by combining several subsystems.
Instances of this class are formed by passing other ODE system instances to our constructor, and then calling Configure to set up any coupling between subsystems. This allows state variables from one system to be used as parameters in other systems.
This allows us to set up coupled systems such as from subsystems and where .
The vector of state variables for the combined system is formed as the concatenation of the state variable vectors of the subsystem. This class also makes use of the CombinedOdeSystemInformation class to provide initial conditions, etc.
Definition at line 66 of file CombinedOdeSystem.hpp.
CombinedOdeSystem::CombinedOdeSystem | ( | std::vector< AbstractOdeSystem * > | odeSystems | ) |
Create a combined ODE system from a vector of subsystems.
odeSystems | the subsystems. |
Definition at line 42 of file CombinedOdeSystem.cpp.
References CombinedOdeSystemInformation::Instance(), AbstractUntemplatedParameterisedSystem::mNumberOfStateVariables, mOdeSystems, mOffsets, AbstractUntemplatedParameterisedSystem::mpSystemInfo, mWorkingDerivs, mWorkingStateVars, and AbstractParameterisedSystem< std::vector< double > >::ResetToInitialConditions().
void CombinedOdeSystem::Configure | ( | const std::map< unsigned, unsigned > & | rVariableParameterMap, |
AbstractOdeSystem * | pVariableOdeSystem, | ||
AbstractOdeSystem * | pParameterOdeSystem | ||
) |
Configure a mapping between the state variables of one subsystem and the parameters of another.
rVariableParameterMap | a map specifying which state variables (keys) are mapped to which parameters (values). |
pVariableOdeSystem | the ODE subsystem providing state variable values. |
pParameterOdeSystem | the ODE subsystem whose parameters should be set. |
Definition at line 69 of file CombinedOdeSystem.cpp.
References mOdeSystems, mVariableParameterMaps, CombinedOdeSystem::VariableParameterMap::pParameterOdeSystem, CombinedOdeSystem::VariableParameterMap::pVariableOdeSystemIndex, and CombinedOdeSystem::VariableParameterMap::theMap.
|
virtual |
Evaluate the right-hand side of the combined system.
This calls EvaluateYDerivatives for each subsystem with the appropriate portion of rY and rDY, having set parameters from values in rY according to the configured maps.
time | the current time |
rY | the current values of the state variables |
rDY | storage for the derivatives of the system; will be filled in on return |
Implements AbstractOdeSystem.
Definition at line 87 of file CombinedOdeSystem.cpp.
References mOdeSystems, mOffsets, mVariableParameterMaps, mWorkingDerivs, and mWorkingStateVars.
|
private |
The subsystems forming this combined system.
Definition at line 71 of file CombinedOdeSystem.hpp.
Referenced by CombinedOdeSystem(), Configure(), and EvaluateYDerivatives().
|
private |
Keeps track of where the state variable vector for each subsystem is located within the combined state variable vector.
Definition at line 81 of file CombinedOdeSystem.hpp.
Referenced by CombinedOdeSystem(), and EvaluateYDerivatives().
|
private |
Stores the information passed to Configure calls.
Definition at line 104 of file CombinedOdeSystem.hpp.
Referenced by Configure(), and EvaluateYDerivatives().
|
private |
Working memory for the DY vectors of the subsystems.
Definition at line 76 of file CombinedOdeSystem.hpp.
Referenced by CombinedOdeSystem(), and EvaluateYDerivatives().
|
private |
Working memory for the Y vectors of the subsystems.
Definition at line 74 of file CombinedOdeSystem.hpp.
Referenced by CombinedOdeSystem(), and EvaluateYDerivatives().