Chaste Release::3.1
CombinedOdeSystem Class Reference

#include <CombinedOdeSystem.hpp>

Inheritance diagram for CombinedOdeSystem:
Collaboration diagram for CombinedOdeSystem:

List of all members.

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)

Private Attributes

std::vector< AbstractOdeSystem * > mOdeSystems
std::vector< std::vector
< double > > 
mWorkingStateVars
std::vector< std::vector
< double > > 
mWorkingDerivs
std::vector< unsignedmOffsets
std::vector< struct
VariableParameterMap
mVariableParameterMaps

Detailed Description

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 $dy/dt = f(y, t)$ from subsystems $dy_1/dt = f_1(y_1, t; y_2)$ and $dy_2/dt = f_2(y_2, t; y_1)$ where $y = (y_1, y_2)$.

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.


Constructor & Destructor Documentation

CombinedOdeSystem::CombinedOdeSystem ( std::vector< AbstractOdeSystem * >  odeSystems)

Member Function Documentation

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.

Parameters:
rVariableParameterMapa map specifying which state variables (keys) are mapped to which parameters (values).
pVariableOdeSystemthe ODE subsystem providing state variable values.
pParameterOdeSystemthe 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.

void CombinedOdeSystem::EvaluateYDerivatives ( double  time,
const std::vector< double > &  rY,
std::vector< double > &  rDY 
) [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.

Parameters:
timethe current time
rYthe current values of the state variables
rDYstorage 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.


Member Data Documentation

The subsystems forming this combined system.

Definition at line 71 of file CombinedOdeSystem.hpp.

Referenced by CombinedOdeSystem(), Configure(), and EvaluateYDerivatives().

std::vector<unsigned> CombinedOdeSystem::mOffsets [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().

Stores the information passed to Configure calls.

Definition at line 104 of file CombinedOdeSystem.hpp.

Referenced by Configure(), and EvaluateYDerivatives().

std::vector<std::vector<double> > CombinedOdeSystem::mWorkingDerivs [private]

Working memory for the DY vectors of the subsystems.

Definition at line 76 of file CombinedOdeSystem.hpp.

Referenced by CombinedOdeSystem(), and EvaluateYDerivatives().

std::vector<std::vector<double> > CombinedOdeSystem::mWorkingStateVars [private]

Working memory for the Y vectors of the subsystems.

Definition at line 74 of file CombinedOdeSystem.hpp.

Referenced by CombinedOdeSystem(), and EvaluateYDerivatives().


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