OdeSolution Class Reference

#include <OdeSolution.hpp>

Collaboration diagram for OdeSolution:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 OdeSolution ()
unsigned GetNumberOfTimeSteps ()
void SetNumberOfTimeSteps (unsigned numTimeSteps)
void SetOdeSystemInformation (boost::shared_ptr< const AbstractOdeSystemInformation > pOdeSystemInfo)
std::vector< doubleGetVariableAtIndex (unsigned index)
std::vector< double > & rGetTimes ()
std::vector< std::vector
< double > > & 
rGetSolutions ()
void WriteToFile (std::string directoryName, std::string baseResultsFilename, std::string timeUnits, unsigned stepsPerRow=1, bool cleanDirectory=true, unsigned precision=8)

Private Attributes

unsigned mNumberOfTimeSteps
std::vector< doublemTimes
std::vector< std::vector
< double > > 
mSolutions
boost::shared_ptr< const
AbstractOdeSystemInformation
mpOdeSystemInformation

Detailed Description

An OdeSolution class that that allows us to save the output data to file.

Definition at line 43 of file OdeSolution.hpp.


Constructor & Destructor Documentation

OdeSolution::OdeSolution (  ) 

Public constructor - ensures data is empty to start with.

Definition at line 32 of file OdeSolution.cpp.


Member Function Documentation

unsigned OdeSolution::GetNumberOfTimeSteps (  ) 

Get the number of timesteps.

Returns:
mNumberOfTimeSteps

Definition at line 38 of file OdeSolution.cpp.

References mNumberOfTimeSteps.

std::vector< double > OdeSolution::GetVariableAtIndex ( unsigned  index  ) 

Get the values of a state variable with a given index in the ODE system at each timestep.

Parameters:
index the index of the state variable in the system

Definition at line 55 of file OdeSolution.cpp.

References mSolutions.

std::vector< std::vector< double > > & OdeSolution::rGetSolutions (  ) 

Get the values of the solution to the ODE system at each timestep.

Returns:
mSolutions.

Definition at line 73 of file OdeSolution.cpp.

References mSolutions.

Referenced by AbstractBackwardEulerCardiacCell< SIZE >::Compute(), RungeKuttaFehlbergIvpOdeSolver::InternalSolve(), and AbstractOneStepIvpOdeSolver::Solve().

std::vector< double > & OdeSolution::rGetTimes (  ) 

Get the times at which the solution to the ODE system is stored.

Returns:
mTimes.

Definition at line 68 of file OdeSolution.cpp.

References mTimes.

Referenced by AbstractBackwardEulerCardiacCell< SIZE >::Compute(), RungeKuttaFehlbergIvpOdeSolver::InternalSolve(), and AbstractOneStepIvpOdeSolver::Solve().

void OdeSolution::SetNumberOfTimeSteps ( unsigned  numTimeSteps  ) 

Set the number of timesteps.

Parameters:
numTimeSteps the number of timesteps to use

Definition at line 43 of file OdeSolution.cpp.

References mNumberOfTimeSteps, mSolutions, and mTimes.

Referenced by AbstractBackwardEulerCardiacCell< SIZE >::Compute(), RungeKuttaFehlbergIvpOdeSolver::InternalSolve(), and AbstractOneStepIvpOdeSolver::Solve().

void OdeSolution::SetOdeSystemInformation ( boost::shared_ptr< const AbstractOdeSystemInformation pOdeSystemInfo  ) 

Set the ODE system information

Parameters:
pOdeSystemInfo ODE system information (used to get the names and units of variables).

Definition at line 50 of file OdeSolution.cpp.

References mpOdeSystemInformation.

Referenced by AbstractBackwardEulerCardiacCell< SIZE >::Compute(), and AbstractOneStepIvpOdeSolver::Solve().

void OdeSolution::WriteToFile ( std::string  directoryName,
std::string  baseResultsFilename,
std::string  timeUnits,
unsigned  stepsPerRow = 1,
bool  cleanDirectory = true,
unsigned  precision = 8 
)

Write the data to a file.

Parameters:
directoryName the directory in which to write the data to file
baseResultsFilename the name of the file in which to write the data
timeUnits name of the units of time used
stepsPerRow the solution to the ODE system is written to file every this number of timesteps (defaults to 1)
cleanDirectory whether to clean the directory (defaults to true)
precision the precision with which to write the data (i.e. exactly how many digits to display after the decimal point). Defaults to 8. Must be between 2 and 20 (inclusive).

Definition at line 78 of file OdeSolution.cpp.

References PetscTools::AmMaster(), mpOdeSystemInformation, mSolutions, and mTimes.


Member Data Documentation

Variable for the number of timesteps.

Definition at line 48 of file OdeSolution.hpp.

Referenced by GetNumberOfTimeSteps(), and SetNumberOfTimeSteps().

Information about the concrete ODE system class.

Used to get names and units into the file output.

Definition at line 61 of file OdeSolution.hpp.

Referenced by SetOdeSystemInformation(), and WriteToFile().

std::vector<std::vector<double> > OdeSolution::mSolutions [private]

Solutions for each variable at each timestep.

Definition at line 54 of file OdeSolution.hpp.

Referenced by GetVariableAtIndex(), rGetSolutions(), SetNumberOfTimeSteps(), and WriteToFile().

std::vector<double> OdeSolution::mTimes [private]

A vector of times at each timestep.

Definition at line 51 of file OdeSolution.hpp.

Referenced by rGetTimes(), SetNumberOfTimeSteps(), and WriteToFile().


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

Generated by  doxygen 1.6.2