HeartConfig Class Reference

#include <HeartConfig.hpp>

Collaboration diagram for HeartConfig:

Collaboration graph
[legend]

List of all members.

Public Member Functions

void SetUseFixedSchemaLocation (bool useFixedSchemaLocation)
void SetDefaultsFile (const std::string &rFileName)
void SetParametersFile (const std::string &rFileName)
void Write (bool useArchiveLocationInfo=false)
unsigned GetSpaceDimension () const
double GetSimulationDuration () const
domain_type GetDomain () const
ionic_models_available_type GetDefaultIonicModel () const
void GetIonicModelRegions (std::vector< ChasteCuboid > &definedRegions, std::vector< ionic_models_available_type > &ionicModels) const
bool IsMeshProvided () const
bool GetCreateMesh () const
bool GetCreateSlab () const
bool GetCreateSheet () const
bool GetCreateFibre () const
bool GetLoadMesh () const
void GetSlabDimensions (c_vector< double, 3 > &slabDimensions) const
void GetSheetDimensions (c_vector< double, 2 > &sheetDimensions) const
void GetFibreLength (c_vector< double, 1 > &fibreLength) const
double GetInterNodeSpace () const
std::string GetMeshName () const
media_type GetConductivityMedia () const
void GetStimuli (std::vector< boost::shared_ptr< SimpleStimulus > > &rStimuliApplied, std::vector< ChasteCuboid > &rStimulatedAreas) const
void GetCellHeterogeneities (std::vector< ChasteCuboid > &cellHeterogeneityAreas, std::vector< double > &scaleFactorGks, std::vector< double > &scaleFactorIto, std::vector< double > &scaleFactorGkr) const
bool GetConductivityHeterogeneitiesProvided () const
void GetConductivityHeterogeneities (std::vector< ChasteCuboid > &conductivitiesHeterogeneityAreas, std::vector< c_vector< double, 3 > > &intraConductivities, std::vector< c_vector< double, 3 > > &extraConductivities) const
std::string GetOutputDirectory () const
std::string GetOutputFilenamePrefix () const
void GetIntracellularConductivities (c_vector< double, 3 > &intraConductivities) const
void GetIntracellularConductivities (c_vector< double, 2 > &intraConductivities) const
void GetIntracellularConductivities (c_vector< double, 1 > &intraConductivities) const
void GetExtracellularConductivities (c_vector< double, 3 > &extraConductivities) const
void GetExtracellularConductivities (c_vector< double, 2 > &extraConductivities) const
void GetExtracellularConductivities (c_vector< double, 1 > &extraConductivities) const
double GetBathConductivity () const
double GetSurfaceAreaToVolumeRatio () const
double GetCapacitance () const
double GetOdeTimeStep () const
double GetPdeTimeStep () const
double GetPrintingTimeStep () const
bool GetUseAbsoluteTolerance () const
double GetAbsoluteTolerance () const
bool GetUseRelativeTolerance () const
double GetRelativeTolerance () const
const char * GetKSPSolver () const
const char * GetKSPPreconditioner () const
bool IsPostProcessingRequested () const
bool IsApdMapsRequested () const
void GetApdMaps (std::vector< std::pair< double, double > > &apd_maps) const
bool IsUpstrokeTimeMapsRequested () const
void GetUpstrokeTimeMaps (std::vector< double > &upstroke_time_maps) const
bool IsMaxUpstrokeVelocityMapRequested () const
bool IsConductionVelocityMapsRequested () const
void GetConductionVelocityMaps (std::vector< unsigned > &conduction_velocity_maps) const
void SetSpaceDimension (unsigned spaceDimension)
void SetSimulationDuration (double simulationDuration)
void SetDomain (domain_type domain)
void SetDefaultIonicModel (ionic_models_available_type ionicModel)
void SetSlabDimensions (double x, double y, double z, double inter_node_space)
void SetSheetDimensions (double x, double y, double inter_node_space)
void SetFibreLength (double x, double inter_node_space)
void SetMeshFileName (std::string meshPrefix, media_type fibreDefinition=media_type::NoFibreOrientation)
void SetConductivityHeterogeneities (std::vector< c_vector< double, 3 > > &cornerA, std::vector< c_vector< double, 3 > > &cornerB, std::vector< c_vector< double, 3 > > &intraConductivities, std::vector< c_vector< double, 3 > > &extraConductivities)
void SetOutputDirectory (const std::string &rOutputDirectory)
void SetOutputFilenamePrefix (const std::string &rOutputFilenamePrefix)
void SetIntracellularConductivities (const c_vector< double, 3 > &intraConductivities)
void SetIntracellularConductivities (const c_vector< double, 2 > &intraConductivities)
void SetIntracellularConductivities (const c_vector< double, 1 > &intraConductivities)
void SetExtracellularConductivities (const c_vector< double, 3 > &extraConductivities)
void SetExtracellularConductivities (const c_vector< double, 2 > &extraConductivities)
void SetExtracellularConductivities (const c_vector< double, 1 > &extraConductivities)
void SetBathConductivity (double bathConductivity)
void SetSurfaceAreaToVolumeRatio (double ratio)
void SetCapacitance (double capacitance)
void SetOdePdeAndPrintingTimeSteps (double odeTimeStep, double pdeTimeStep, double printingTimeStep)
void SetOdeTimeStep (double odeTimeStep)
void SetPdeTimeStep (double pdeTimeStep)
void SetPrintingTimeStep (double printingTimeStep)
void SetUseRelativeTolerance (double relativeTolerance)
void SetUseAbsoluteTolerance (double absoluteTolerance)
void SetKSPSolver (const char *kspSolver)
void SetKSPPreconditioner (const char *kspPreconditioner)
void SetApdMaps (const std::vector< std::pair< double, double > > &apd_maps)
void SetUpstrokeTimeMaps (std::vector< double > &upstroke_time_maps)
 ~HeartConfig ()

Static Public Member Functions

static HeartConfigInstance ()
static void Reset ()

Private Member Functions

void CheckTimeSteps () const
template<class Archive>
void save (Archive &archive, const unsigned int version) const
template<class Archive>
void load (Archive &archive, const unsigned int version)
template<class TYPE>
TYPE * DecideLocation (TYPE *params_ptr, TYPE *defaults_ptr, const std::string &nameParameter) const
boost::shared_ptr
< chaste_parameters_type > 
ReadFile (const std::string &rFileName)

Private Attributes

boost::shared_ptr
< chaste_parameters_type > 
mpUserParameters
boost::shared_ptr
< chaste_parameters_type > 
mpDefaultParameters
bool mUseFixedSchemaLocation

Static Private Attributes

static std::auto_ptr< HeartConfigmpInstance

Friends

class boost::serialization::access
class TestHeartConfig


Detailed Description

A singleton class containing configuration parameters for heart simulations.

This class wraps the settings from the XML configuration file in a more friendly interface, providing methods to read and write all the settings, and round-trip them to/from XML format. It also deals with the complexities of supporting multiple versions of CodeSynthesis XSD.

chaste_parameters_type is a convenience class created by CodeSynthesis XSD

Definition at line 62 of file HeartConfig.hpp.


Constructor & Destructor Documentation

HeartConfig::~HeartConfig (  ) 

Destructor

Definition at line 112 of file HeartConfig.cpp.


Member Function Documentation

void HeartConfig::CheckTimeSteps (  )  const [private]

Throws if the time steps don't obey constraints (within machine precision) ode_step > 0.0 pde_step = n1 * ode_step (where n1 is a positive integer) printing_step = n2 * pde_step (where n2 is a positive integer)

Definition at line 1137 of file HeartConfig.cpp.

References GetOdeTimeStep(), GetPdeTimeStep(), and GetPrintingTimeStep().

Referenced by SetDefaultsFile(), SetOdePdeAndPrintingTimeSteps(), and SetParametersFile().

template<class Archive>
void HeartConfig::save ( Archive &  archive,
const unsigned int  version 
) const [inline, private]

Archive the object.

Parameters:
archive 
version 

Definition at line 82 of file HeartConfig.hpp.

References mpInstance.

template<class Archive>
void HeartConfig::load ( Archive &  archive,
const unsigned int  version 
) [inline, private]

Un-archive the object.

Parameters:
archive 
version 

Definition at line 94 of file HeartConfig.hpp.

References ArchiveLocationInfo::GetArchiveDirectory(), Instance(), SetDefaultsFile(), and SetParametersFile().

HeartConfig * HeartConfig::Instance (  )  [static]

Call this method to access the global parameters holder.

Returns:
a single instance of the class

Definition at line 92 of file HeartConfig.cpp.

References mpInstance.

Referenced by AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::AbstractCardiacPde(), BidomainDg0Assembler< ELEMENT_DIM, SPACE_DIM >::BidomainDg0Assembler(), BidomainPde< SPACE_DIM >::BidomainPde(), CardiacElectroMechanicsProblem< DIM >::CardiacElectroMechanicsProblem(), AbstractCardiacProblem< ELEM_DIM, SPACE_DIM, PROBLEM_DIM >::CloseFilesAndPostProcess(), BidomainWithBathAssembler< ELEMENT_DIM, SPACE_DIM >::ComputeMatrixTerm(), BidomainWithBathMatrixBasedAssembler< ELEMENT_DIM, SPACE_DIM >::ConstructVectorForMatrixBasedRhsAssembly(), BidomainMatrixBasedAssembler< ELEMENT_DIM, SPACE_DIM >::ConstructVectorForMatrixBasedRhsAssembly(), AbstractConvergenceTester< CELL, CARDIAC_PROBLEM, DIM, PROBLEM_DIM >::Converge(), AbstractConvergenceTester< CELL, CARDIAC_PROBLEM, DIM, PROBLEM_DIM >::DisplayRun(), AbstractCardiacProblem< ELEM_DIM, SPACE_DIM, PROBLEM_DIM >::GetDataReader(), Hdf5ToMeshalyzerConverter::Hdf5ToMeshalyzerConverter(), CardiacElectroMechanicsProblem< DIM >::Initialise(), AbstractCardiacProblem< ELEM_DIM, SPACE_DIM, PROBLEM_DIM >::Initialise(), MonodomainDg0Assembler< ELEMENT_DIM, SPACE_DIM >::InitialiseForSolve(), BidomainDg0Assembler< ELEMENT_DIM, SPACE_DIM >::InitialiseForSolve(), AbstractCardiacProblem< ELEM_DIM, SPACE_DIM, PROBLEM_DIM >::InitialiseWriter(), load(), BidomainProblem< DIM >::PreSolveChecks(), AbstractCardiacProblem< ELEM_DIM, SPACE_DIM, PROBLEM_DIM >::PreSolveChecks(), CardiacElectroMechanicsProblem< DIM >::Solve(), AbstractCardiacProblem< ELEM_DIM, SPACE_DIM, PROBLEM_DIM >::Solve(), Hdf5ToMeshalyzerConverter::Write(), PostProcessingWriter::WriteApdMapFile(), PostProcessingWriter::WriteConductionVelocityMap(), PostProcessingWriter::WriteMaxUpstrokeVelocityMap(), and PostProcessingWriter::WriteUpstrokeTimeMap().

void HeartConfig::SetUseFixedSchemaLocation ( bool  useFixedSchemaLocation  ) 

Parameters:
useFixedSchemaLocation whether to read the schema location from the XML file (false) or use the schema located at heart/src/io/ChasteParameters.xsd in the Chaste source tree (true).

Definition at line 1279 of file HeartConfig.cpp.

References mUseFixedSchemaLocation.

void HeartConfig::SetDefaultsFile ( const std::string &  rFileName  ) 

Parameters:
rFileName The name of the default file - set by default to "ChasteDefaults.xml" on construction

Definition at line 116 of file HeartConfig.cpp.

References CheckTimeSteps(), mpDefaultParameters, mpUserParameters, and ReadFile().

Referenced by load().

void HeartConfig::SetParametersFile ( const std::string &  rFileName  ) 

mpUserParameters is set to a new context associated with a parameters file

Parameters:
rFileName The name of the parameters file

Definition at line 190 of file HeartConfig.cpp.

References CheckTimeSteps(), mpUserParameters, and ReadFile().

Referenced by load().

void HeartConfig::Write ( bool  useArchiveLocationInfo = false  ) 

Write out the complete configuration set (ChasteParameters and ChasteDefaults) as an XML file. Note that the location of ChasteParameters.xsd (schema definition) will be hard-coded in the XML file.

Parameters:
useArchiveLocationInfo if false, then use self's GetOutputDirectory() and open in /output subfolder if true, then use ArchiveLocationInfo

Definition at line 129 of file HeartConfig.cpp.

References ArchiveLocationInfo::GetArchiveDirectory(), GetOutputDirectory(), OutputFileHandler::GetOutputDirectoryFullPath(), mpDefaultParameters, and mpUserParameters.

Referenced by AbstractCardiacProblem< ELEM_DIM, SPACE_DIM, PROBLEM_DIM >::CloseFilesAndPostProcess(), and CardiacElectroMechanicsProblem< DIM >::Solve().

void HeartConfig::Reset (  )  [static]

Throw away the current instance by resetting auto_ptr mpInstance to NULL. "New" another mpInstance

Definition at line 198 of file HeartConfig.cpp.

References mpInstance.

Referenced by CardiacElectroMechanicsProblem< DIM >::Solve().

unsigned HeartConfig::GetSpaceDimension (  )  const

Returns:
space dimension 1, 2 or 3.

Definition at line 220 of file HeartConfig.cpp.

References DecideLocation(), mpDefaultParameters, and mpUserParameters.

Referenced by GetFibreLength(), GetInterNodeSpace(), GetSheetDimensions(), and GetSlabDimensions().

double HeartConfig::GetSimulationDuration (  )  const

Returns:
duration of the simulation (ms)

Definition at line 227 of file HeartConfig.cpp.

References DecideLocation(), mpDefaultParameters, and mpUserParameters.

Referenced by AbstractCardiacProblem< ELEM_DIM, SPACE_DIM, PROBLEM_DIM >::PreSolveChecks().

domain_type HeartConfig::GetDomain (  )  const

domain_type is an xsd convenience class type

Returns:
domain type of simulation bi- mono-domain

Definition at line 234 of file HeartConfig.cpp.

References DecideLocation(), mpDefaultParameters, and mpUserParameters.

ionic_models_available_type HeartConfig::GetDefaultIonicModel (  )  const

Default cardiac cell model to use at all mesh nodes (unless otherwise specified by IonicModelRegions) ionic_models_available_type is an xsd convenience class type

Returns:
type of model

Definition at line 241 of file HeartConfig.cpp.

References DecideLocation(), mpDefaultParameters, and mpUserParameters.

void HeartConfig::GetIonicModelRegions ( std::vector< ChasteCuboid > &  definedRegions,
std::vector< ionic_models_available_type > &  ionicModels 
) const

Regions where we need to use a different cell model (think infarction) ionic_models_available_type is an xsd convenience class type.

Todo:
  • do we assume the vectors are initially empty? The standard vectors returned are of the same length (one entry per region)
Parameters:
definedRegions vector of axis-aligned box regions (one per cellular heterogeneity)
ionicModels vector of models (one per cellular heterogeneity)
Todo:
No set method

Definition at line 248 of file HeartConfig.cpp.

References DecideLocation(), mpDefaultParameters, and mpUserParameters.

bool HeartConfig::IsMeshProvided (  )  const

Returns:
true if a mesh file name is given. (Otherwise it's assumed that this is a cuboid simulation.)

Definition at line 278 of file HeartConfig.cpp.

References DecideLocation(), mpDefaultParameters, and mpUserParameters.

Referenced by AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::AbstractCardiacPde(), and BidomainPde< SPACE_DIM >::BidomainPde().

bool HeartConfig::GetCreateMesh (  )  const

Returns:
true if it's cuboid simulation (no mesh on disk)

Definition at line 293 of file HeartConfig.cpp.

References DecideLocation(), mpDefaultParameters, and mpUserParameters.

Referenced by GetInterNodeSpace().

bool HeartConfig::GetCreateSlab (  )  const

Returns:
true if it's cuboid simulation (no mesh on disk)

Definition at line 302 of file HeartConfig.cpp.

References DecideLocation(), mpDefaultParameters, and mpUserParameters.

Referenced by GetSlabDimensions().

bool HeartConfig::GetCreateSheet (  )  const

Returns:
true if it's cuboid simulation (no mesh on disk)

Definition at line 311 of file HeartConfig.cpp.

References DecideLocation(), mpDefaultParameters, and mpUserParameters.

Referenced by GetSheetDimensions().

bool HeartConfig::GetCreateFibre (  )  const

Returns:
true if it's cuboid simulation (no mesh on disk)

Definition at line 320 of file HeartConfig.cpp.

References DecideLocation(), mpDefaultParameters, and mpUserParameters.

Referenced by GetFibreLength().

bool HeartConfig::GetLoadMesh (  )  const

Returns:
true if a mesh file name is given and we are expecting to load a mesh from file

Definition at line 330 of file HeartConfig.cpp.

References DecideLocation(), mpDefaultParameters, and mpUserParameters.

Referenced by AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::AbstractCardiacPde(), BidomainPde< SPACE_DIM >::BidomainPde(), GetConductivityMedia(), and GetMeshName().

void HeartConfig::GetSlabDimensions ( c_vector< double, 3 > &  slabDimensions  )  const

Todo:
IsMeshProvided and GetLoadMesh are subtly different but very similar. Can one of them go?
Parameters:
slabDimensions return vector for the (cuboid) mesh dimensions (cm)

Definition at line 337 of file HeartConfig.cpp.

References DecideLocation(), GetCreateSlab(), GetSpaceDimension(), mpDefaultParameters, and mpUserParameters.

Referenced by AbstractCardiacProblem< ELEM_DIM, SPACE_DIM, PROBLEM_DIM >::Initialise().

void HeartConfig::GetSheetDimensions ( c_vector< double, 2 > &  sheetDimensions  )  const

Parameters:
sheetDimensions return vector for the (cuboid) mesh dimensions (cm)

Definition at line 353 of file HeartConfig.cpp.

References DecideLocation(), GetCreateSheet(), GetSpaceDimension(), mpDefaultParameters, and mpUserParameters.

Referenced by AbstractCardiacProblem< ELEM_DIM, SPACE_DIM, PROBLEM_DIM >::Initialise().

void HeartConfig::GetFibreLength ( c_vector< double, 1 > &  fibreLength  )  const

Parameters:
fibreLength return vector for the (cuboid) mesh dimensions (cm)

Definition at line 368 of file HeartConfig.cpp.

References DecideLocation(), GetCreateFibre(), GetSpaceDimension(), mpDefaultParameters, and mpUserParameters.

Referenced by AbstractCardiacProblem< ELEM_DIM, SPACE_DIM, PROBLEM_DIM >::Initialise().

double HeartConfig::GetInterNodeSpace (  )  const

std::string HeartConfig::GetMeshName (  )  const

media_type HeartConfig::GetConductivityMedia (  )  const

Returns:
media (Orthotropic/Axisymmetric/NoFibreOrientation) so that we know whether to read a .ortho/.axi file

Definition at line 420 of file HeartConfig.cpp.

References DecideLocation(), GetLoadMesh(), mpDefaultParameters, and mpUserParameters.

Referenced by AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::AbstractCardiacPde(), and BidomainPde< SPACE_DIM >::BidomainPde().

void HeartConfig::GetStimuli ( std::vector< boost::shared_ptr< SimpleStimulus > > &  rStimuliApplied,
std::vector< ChasteCuboid > &  rStimulatedAreas 
) const

Return a number of stimulated regions (Axis-aligned boxes)

Todo:
  • do we assume the vectors are initially empty? The returned std::vectors are all of the same length
Parameters:
rStimuliApplied rStimuliApplied[0] is stimulus for the first region
rStimulatedAreas rStimulatedAreas[0] is the first region to be stimulated
Todo:
There is no set method

Definition at line 429 of file HeartConfig.cpp.

References DecideLocation(), mpDefaultParameters, and mpUserParameters.

void HeartConfig::GetCellHeterogeneities ( std::vector< ChasteCuboid > &  cellHeterogeneityAreas,
std::vector< double > &  scaleFactorGks,
std::vector< double > &  scaleFactorIto,
std::vector< double > &  scaleFactorGkr 
) const

Return a number of heterogeneous regions (Axis-aligned boxes) for special gating variable changes

Todo:
  • do we assume the vectors are initially empty? The returned std::vectors are all of the same length
Parameters:
cellHeterogeneityAreas cellHeterogeneityAreas[0] is the first region
scaleFactorGks scaleFactorGks[0] is a scaling factorfor the first region
scaleFactorIto scaleFactorIto[0] is a scaling factorfor the first region
scaleFactorGkr scaleFactorGkr[0] is a scaling factorfor the first region
Todo:
There is no set method

Definition at line 460 of file HeartConfig.cpp.

References DecideLocation(), mpDefaultParameters, and mpUserParameters.

bool HeartConfig::GetConductivityHeterogeneitiesProvided (  )  const

Returns:
true if there are conductivity heterogeneities for GetConductivityHeterogeneities to return

Definition at line 493 of file HeartConfig.cpp.

References DecideLocation(), mpDefaultParameters, and mpUserParameters.

Referenced by AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::AbstractCardiacPde(), and BidomainPde< SPACE_DIM >::BidomainPde().

void HeartConfig::GetConductivityHeterogeneities ( std::vector< ChasteCuboid > &  conductivitiesHeterogeneityAreas,
std::vector< c_vector< double, 3 > > &  intraConductivities,
std::vector< c_vector< double, 3 > > &  extraConductivities 
) const

Return a number of heterogeneous regions (Axis-aligned boxes)

Todo:
  • do we assume the vectors are initially empty? The returned std::vectors are all of the same length
Parameters:
conductivitiesHeterogeneityAreas conductivitiesHeterogeneityAreas[0] is the first region
intraConductivities intraConductivities[0] is conductivity vector for the first region
extraConductivities extraConductivities[0] is conductivity vector for the first region

Definition at line 508 of file HeartConfig.cpp.

References DecideLocation(), GetExtracellularConductivities(), GetIntracellularConductivities(), mpDefaultParameters, and mpUserParameters.

Referenced by AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::AbstractCardiacPde(), and BidomainPde< SPACE_DIM >::BidomainPde().

std::string HeartConfig::GetOutputDirectory (  )  const

std::string HeartConfig::GetOutputFilenamePrefix (  )  const

Returns:
Prefix for files If set to "res" this produces [path]/res.h5 [path]/output/res_mesh.pts [path]/output/res_mesh.tri [path]/output/res_parameters.xml (a copy of this configuration at the end of the simulation) [path]/output/res_times.info [path]/output/res_V.dat

Definition at line 576 of file HeartConfig.cpp.

References DecideLocation(), mpDefaultParameters, and mpUserParameters.

Referenced by AbstractCardiacProblem< ELEM_DIM, SPACE_DIM, PROBLEM_DIM >::InitialiseWriter(), and AbstractCardiacProblem< ELEM_DIM, SPACE_DIM, PROBLEM_DIM >::Solve().

void HeartConfig::GetIntracellularConductivities ( c_vector< double, 3 > &  intraConductivities  )  const

3D version

Parameters:
intraConductivities DIM-vector for returning intracellular conductivities (mS/cm)

Definition at line 583 of file HeartConfig.cpp.

References DecideLocation(), mpDefaultParameters, and mpUserParameters.

Referenced by AbstractCardiacPde< ELEM_DIM, SPACE_DIM >::AbstractCardiacPde(), and GetConductivityHeterogeneities().

void HeartConfig::GetIntracellularConductivities ( c_vector< double, 2 > &  intraConductivities  )  const

2D version

Parameters:
intraConductivities DIM-vector for returning intracellular conductivities (mS/cm)

Definition at line 600 of file HeartConfig.cpp.

References DecideLocation(), mpDefaultParameters, and mpUserParameters.

void HeartConfig::GetIntracellularConductivities ( c_vector< double, 1 > &  intraConductivities  )  const

1D version

Parameters:
intraConductivities DIM-vector for returning intracellular conductivities (mS/cm)

Definition at line 614 of file HeartConfig.cpp.

References DecideLocation(), mpDefaultParameters, and mpUserParameters.

void HeartConfig::GetExtracellularConductivities ( c_vector< double, 3 > &  extraConductivities  )  const

3D version

Parameters:
extraConductivities DIM-vector for returning extracellular conductivities (mS/cm)

Definition at line 624 of file HeartConfig.cpp.

References DecideLocation(), mpDefaultParameters, and mpUserParameters.

Referenced by BidomainPde< SPACE_DIM >::BidomainPde(), and GetConductivityHeterogeneities().

void HeartConfig::GetExtracellularConductivities ( c_vector< double, 2 > &  extraConductivities  )  const

2D version

Parameters:
extraConductivities DIM-vector for returning extracellular conductivities (mS/cm)

Definition at line 641 of file HeartConfig.cpp.

References DecideLocation(), mpDefaultParameters, and mpUserParameters.

void HeartConfig::GetExtracellularConductivities ( c_vector< double, 1 > &  extraConductivities  )  const

1D version

Parameters:
extraConductivities DIM-vector for returning extracellular conductivities (mS/cm)

Definition at line 655 of file HeartConfig.cpp.

References DecideLocation(), mpDefaultParameters, and mpUserParameters.

double HeartConfig::GetBathConductivity (  )  const

Returns:
conductivity for perfusing bath (mS/cm)

Definition at line 665 of file HeartConfig.cpp.

References DecideLocation(), mpDefaultParameters, and mpUserParameters.

Referenced by BidomainWithBathAssembler< ELEMENT_DIM, SPACE_DIM >::ComputeMatrixTerm().

double HeartConfig::GetSurfaceAreaToVolumeRatio (  )  const

double HeartConfig::GetCapacitance (  )  const

double HeartConfig::GetOdeTimeStep (  )  const

Returns:
ODE time-step (ms)

Definition at line 689 of file HeartConfig.cpp.

References DecideLocation(), mpDefaultParameters, and mpUserParameters.

Referenced by CheckTimeSteps(), SetPdeTimeStep(), and SetPrintingTimeStep().

double HeartConfig::GetPdeTimeStep (  )  const

double HeartConfig::GetPrintingTimeStep (  )  const

bool HeartConfig::GetUseAbsoluteTolerance (  )  const

Returns:
true if we are using KSP absolute tolerance

Definition at line 710 of file HeartConfig.cpp.

References DecideLocation(), mpDefaultParameters, and mpUserParameters.

Referenced by AbstractConvergenceTester< CELL, CARDIAC_PROBLEM, DIM, PROBLEM_DIM >::DisplayRun(), and GetAbsoluteTolerance().

double HeartConfig::GetAbsoluteTolerance (  )  const

bool HeartConfig::GetUseRelativeTolerance (  )  const

Returns:
true if we are using KSP relative tolerance

Definition at line 728 of file HeartConfig.cpp.

References DecideLocation(), mpDefaultParameters, and mpUserParameters.

Referenced by GetRelativeTolerance(), and BidomainProblem< DIM >::PreSolveChecks().

double HeartConfig::GetRelativeTolerance (  )  const

const char * HeartConfig::GetKSPSolver (  )  const

Returns:
name of -ksp_type from {"gmres", "cg", "symmlq"}

Definition at line 747 of file HeartConfig.cpp.

References DecideLocation(), mpDefaultParameters, and mpUserParameters.

const char * HeartConfig::GetKSPPreconditioner (  )  const

Returns:
name of -pc_type from {"ilu", "jacobi", "bjacobi", "hypre", "none"}

Definition at line 765 of file HeartConfig.cpp.

References DecideLocation(), mpDefaultParameters, and mpUserParameters.

bool HeartConfig::IsPostProcessingRequested (  )  const

Returns:
true if there is a post-processing section
Todo:
  • no set method

Definition at line 794 of file HeartConfig.cpp.

References DecideLocation(), mpDefaultParameters, and mpUserParameters.

Referenced by IsApdMapsRequested(), IsConductionVelocityMapsRequested(), IsMaxUpstrokeVelocityMapRequested(), and IsUpstrokeTimeMapsRequested().

bool HeartConfig::IsApdMapsRequested (  )  const

Returns:
true if APD maps have been requested

Definition at line 801 of file HeartConfig.cpp.

References DecideLocation(), IsPostProcessingRequested(), mpDefaultParameters, and mpUserParameters.

Referenced by GetApdMaps(), GetConductionVelocityMaps(), and GetUpstrokeTimeMaps().

void HeartConfig::GetApdMaps ( std::vector< std::pair< double, double > > &  apd_maps  )  const

Parameters:
apd_maps each entry is a request for a map with
  • a threshold (in mV)
  • a percentage in the range [1, 100)

Definition at line 812 of file HeartConfig.cpp.

References DecideLocation(), IsApdMapsRequested(), mpDefaultParameters, and mpUserParameters.

bool HeartConfig::IsUpstrokeTimeMapsRequested (  )  const

Returns:
true if upstroke time maps have been requested

Definition at line 832 of file HeartConfig.cpp.

References DecideLocation(), IsPostProcessingRequested(), mpDefaultParameters, and mpUserParameters.

void HeartConfig::GetUpstrokeTimeMaps ( std::vector< double > &  upstroke_time_maps  )  const

Parameters:
upstroke_time_maps each entry is a request for a map with
  • a threshold (in mV)
Todo:
  • no set method

Definition at line 842 of file HeartConfig.cpp.

References DecideLocation(), IsApdMapsRequested(), mpDefaultParameters, and mpUserParameters.

bool HeartConfig::IsMaxUpstrokeVelocityMapRequested (  )  const

Returns:
true maximum upstroke velocity maps have been requested
Todo:
  • no set method
Todo:
  • This method has "Is" in the name, others do not.

Definition at line 860 of file HeartConfig.cpp.

References DecideLocation(), IsPostProcessingRequested(), mpDefaultParameters, and mpUserParameters.

bool HeartConfig::IsConductionVelocityMapsRequested (  )  const

Returns:
true if conduction velocity maps have been requested

Definition at line 869 of file HeartConfig.cpp.

References DecideLocation(), IsPostProcessingRequested(), mpDefaultParameters, and mpUserParameters.

void HeartConfig::GetConductionVelocityMaps ( std::vector< unsigned > &  conduction_velocity_maps  )  const

Parameters:
conduction_velocity_maps each entry is a request for a map with
  • an index to treat as ths source for wave propagation
Todo:
  • no set method

Definition at line 880 of file HeartConfig.cpp.

References DecideLocation(), IsApdMapsRequested(), mpDefaultParameters, and mpUserParameters.

void HeartConfig::SetSpaceDimension ( unsigned  spaceDimension  ) 

Set the configuration dimension

Parameters:
spaceDimension 1, 2 or 3.

Definition at line 902 of file HeartConfig.cpp.

References mpUserParameters.

void HeartConfig::SetSimulationDuration ( double  simulationDuration  ) 

Set the configuration simulation duration

Parameters:
simulationDuration duration of the simulation (ms)

Definition at line 907 of file HeartConfig.cpp.

References mpUserParameters.

Referenced by AbstractConvergenceTester< CELL, CARDIAC_PROBLEM, DIM, PROBLEM_DIM >::Converge().

void HeartConfig::SetDomain ( domain_type  domain  ) 

Set the configuration to run mono or bidomain domain_type is an xsd convenience class type

Parameters:
domain type of simulation bi- mono-domain

Definition at line 913 of file HeartConfig.cpp.

References mpUserParameters.

void HeartConfig::SetDefaultIonicModel ( ionic_models_available_type  ionicModel  ) 

Set the configuration to place the given cardiac cell models at all mesh nodes (unless otherwise specified by IonicModelRegions) ionic_models_available_type is an xsd convenience class type

Parameters:
ionicModel type of model

Definition at line 918 of file HeartConfig.cpp.

References mpUserParameters.

void HeartConfig::SetSlabDimensions ( double  x,
double  y,
double  z,
double  inter_node_space 
)

Set dimensions of simulation for use with a cuboid mesh generated on the fly. 3-D.

Parameters:
x length in 1st dimension (cm)
y length in 2nd dimension (cm)
z length in 3rd dimension (cm)
inter_node_space Spacing in cartesian direction (cm). Diagonals will be longer.

Definition at line 923 of file HeartConfig.cpp.

References mpUserParameters.

void HeartConfig::SetSheetDimensions ( double  x,
double  y,
double  inter_node_space 
)

Set dimensions of simulation for use with a cuboid mesh generated on the fly. 2-D.

Parameters:
x length in 1st dimension (cm)
y length in 2nd dimension (cm)
inter_node_space Spacing in cartesian direction (cm). Diagonals will be longer.

Definition at line 935 of file HeartConfig.cpp.

References mpUserParameters.

void HeartConfig::SetFibreLength ( double  x,
double  inter_node_space 
)

Set dimensions of simulation for use with a cuboid mesh generated on the fly. 1-D.

Parameters:
x length in 1st dimension (cm)
inter_node_space Spacing in cartesian direction (cm).

Definition at line 947 of file HeartConfig.cpp.

References mpUserParameters.

void HeartConfig::SetMeshFileName ( std::string  meshPrefix,
media_type  fibreDefinition = media_type::NoFibreOrientation 
)

Sets the name of a mesh to be read from disk for this simulation

Parameters:
meshPrefix path and basename of a set of mesh files (.nodes .ele etc) in triangle/tetget format
fibreDefinition if set (Orthotropic/Axisymmetric) then a (.ortho/.axi) file should also be read
Todo:
There is no Get method

Definition at line 959 of file HeartConfig.cpp.

References mpUserParameters.

void HeartConfig::SetConductivityHeterogeneities ( std::vector< c_vector< double, 3 > > &  cornerA,
std::vector< c_vector< double, 3 > > &  cornerB,
std::vector< c_vector< double, 3 > > &  intraConductivities,
std::vector< c_vector< double, 3 > > &  extraConductivities 
)

Set a number of heterogeneous regions (Axis-aligned boxes) It is assumed that the std::vectors are all of the same length

Parameters:
cornerA cornerA[0] is the lowest vertex of the first region
cornerB cornerB[0] is the highest vertex of the first region
intraConductivities intraConductivities[0] is conductivity vector for the first region
extraConductivities extraConductivities[0] is conductivity vector for the first region

Definition at line 971 of file HeartConfig.cpp.

References mpUserParameters.

void HeartConfig::SetOutputDirectory ( const std::string &  rOutputDirectory  ) 

Parameters:
rOutputDirectory Full path to output directory (will be created if necessary)

Definition at line 1022 of file HeartConfig.cpp.

References mpUserParameters.

Referenced by CardiacElectroMechanicsProblem< DIM >::CardiacElectroMechanicsProblem(), AbstractConvergenceTester< CELL, CARDIAC_PROBLEM, DIM, PROBLEM_DIM >::Converge(), and CardiacElectroMechanicsProblem< DIM >::Solve().

void HeartConfig::SetOutputFilenamePrefix ( const std::string &  rOutputFilenamePrefix  ) 

Parameters:
rOutputFilenamePrefix Prefix for files If set to "res" this will produce [path]/res.h5 [path]/output/res_mesh.pts [path]/output/res_mesh.tri [path]/output/res_parameters.xml (a copy of this configuration at the end of the simulation) [path]/output/res_times.info [path]/output/res_V.dat

Definition at line 1027 of file HeartConfig.cpp.

References mpUserParameters.

Referenced by CardiacElectroMechanicsProblem< DIM >::CardiacElectroMechanicsProblem(), and AbstractConvergenceTester< CELL, CARDIAC_PROBLEM, DIM, PROBLEM_DIM >::Converge().

void HeartConfig::SetIntracellularConductivities ( const c_vector< double, 3 > &  intraConductivities  ) 

3D version

Parameters:
intraConductivities DIM-vector of intracellular conductivities (mS/cm)

Definition at line 1034 of file HeartConfig.cpp.

References mpUserParameters.

Referenced by CardiacElectroMechanicsProblem< DIM >::Initialise().

void HeartConfig::SetIntracellularConductivities ( const c_vector< double, 2 > &  intraConductivities  ) 

2D version

Parameters:
intraConductivities DIM-vector of intracellular conductivities (mS/cm)

Definition at line 1045 of file HeartConfig.cpp.

References mpUserParameters.

void HeartConfig::SetIntracellularConductivities ( const c_vector< double, 1 > &  intraConductivities  ) 

1D version

Parameters:
intraConductivities DIM-vector of intracellular conductivities (mS/cm)

Definition at line 1055 of file HeartConfig.cpp.

References mpUserParameters.

void HeartConfig::SetExtracellularConductivities ( const c_vector< double, 3 > &  extraConductivities  ) 

3D version

Parameters:
extraConductivities DIM-vector of extracellular conductivities (mS/cm)

Definition at line 1064 of file HeartConfig.cpp.

References mpUserParameters.

void HeartConfig::SetExtracellularConductivities ( const c_vector< double, 2 > &  extraConductivities  ) 

2D version

Parameters:
extraConductivities DIM-vector of extracellular conductivities (mS/cm)

Definition at line 1075 of file HeartConfig.cpp.

References mpUserParameters.

void HeartConfig::SetExtracellularConductivities ( const c_vector< double, 1 > &  extraConductivities  ) 

1D version

Parameters:
extraConductivities DIM-vector of extracellular conductivities (mS/cm)

Definition at line 1085 of file HeartConfig.cpp.

References mpUserParameters.

void HeartConfig::SetBathConductivity ( double  bathConductivity  ) 

Set bath conductivity

Parameters:
bathConductivity conductivity for perfusing bath (mS/cm)
Todo:
Is this used anywhere?

Definition at line 1094 of file HeartConfig.cpp.

References mpUserParameters.

void HeartConfig::SetSurfaceAreaToVolumeRatio ( double  ratio  ) 

Set surface area to volume ratio Am (for PDE)

Parameters:
ratio (1/cm)

Definition at line 1100 of file HeartConfig.cpp.

References mpUserParameters.

void HeartConfig::SetCapacitance ( double  capacitance  ) 

Set surface capacitance Cm (for PDE)

Parameters:
capacitance (uF/cm^2)

Definition at line 1106 of file HeartConfig.cpp.

References mpUserParameters.

void HeartConfig::SetOdePdeAndPrintingTimeSteps ( double  odeTimeStep,
double  pdeTimeStep,
double  printingTimeStep 
)

Set the configuration to use ode, pde and printing times of given values Calls CheckTimeSteps to ensure compatibility

Parameters:
odeTimeStep ode value to use
pdeTimeStep pde value to use
printingTimeStep printing value to use

Definition at line 1114 of file HeartConfig.cpp.

References CheckTimeSteps(), and mpUserParameters.

Referenced by AbstractConvergenceTester< CELL, CARDIAC_PROBLEM, DIM, PROBLEM_DIM >::Converge(), SetOdeTimeStep(), SetPdeTimeStep(), and SetPrintingTimeStep().

void HeartConfig::SetOdeTimeStep ( double  odeTimeStep  ) 

Set the configuration to use ode time of given value Calls CheckTimeSteps via SetOdePdeAndPrintingTimeSteps

Parameters:
odeTimeStep the value to use

Definition at line 1122 of file HeartConfig.cpp.

References GetPdeTimeStep(), GetPrintingTimeStep(), and SetOdePdeAndPrintingTimeSteps().

void HeartConfig::SetPdeTimeStep ( double  pdeTimeStep  ) 

Set the configuration to use pde time of given value Calls CheckTimeSteps via SetOdePdeAndPrintingTimeSteps

Parameters:
pdeTimeStep the value to use

Definition at line 1127 of file HeartConfig.cpp.

References GetOdeTimeStep(), GetPrintingTimeStep(), and SetOdePdeAndPrintingTimeSteps().

void HeartConfig::SetPrintingTimeStep ( double  printingTimeStep  ) 

Set the configuration to use printing time of given value Calls CheckTimeSteps via SetOdePdeAndPrintingTimeSteps

Parameters:
printingTimeStep the value to use

Definition at line 1132 of file HeartConfig.cpp.

References GetOdeTimeStep(), GetPdeTimeStep(), and SetOdePdeAndPrintingTimeSteps().

void HeartConfig::SetUseRelativeTolerance ( double  relativeTolerance  ) 

Set the configuration to use KSP relative tolerance of given value

Parameters:
relativeTolerance the value to use

Definition at line 1173 of file HeartConfig.cpp.

References mpUserParameters.

void HeartConfig::SetUseAbsoluteTolerance ( double  absoluteTolerance  ) 

Set the configuration to use KSP absolute tolerance of given value

Parameters:
absoluteTolerance the value to use

Definition at line 1180 of file HeartConfig.cpp.

References mpUserParameters.

void HeartConfig::SetKSPSolver ( const char *  kspSolver  ) 

Set the type of KSP solver as with the flag "-ksp_type"

Parameters:
kspSolver a string from {"gmres", "cg", "symmlq"}

Definition at line 1187 of file HeartConfig.cpp.

References mpUserParameters.

Referenced by BidomainDg0Assembler< ELEMENT_DIM, SPACE_DIM >::FinaliseAssembleSystem(), and BidomainWithBathAssembler< ELEMENT_DIM, SPACE_DIM >::FinaliseLinearSystem().

void HeartConfig::SetKSPPreconditioner ( const char *  kspPreconditioner  ) 

Set the type of preconditioner as with the flag "-pc_type"

Parameters:
kspPreconditioner a string from {"ilu", "jacobi", "bjacobi", "hypre", "blockdiagonal", "none"}

Definition at line 1209 of file HeartConfig.cpp.

References mpUserParameters.

void HeartConfig::SetApdMaps ( const std::vector< std::pair< double, double > > &  apd_maps  ) 

Set the parameters of the apd map requested

Parameters:
apd_maps each entry is a request for a map with
  • a threshold (in mV)
  • a percentage in the range [1, 100) (ranges are not checked by this method, but during the calculation)

Definition at line 1246 of file HeartConfig.cpp.

References mpUserParameters.

void HeartConfig::SetUpstrokeTimeMaps ( std::vector< double > &  upstroke_time_maps  ) 

Set the parameters of the conduction velocity map requested

Parameters:
upstroke_time_maps is the maps of upstroke velocities to set

Definition at line 1263 of file HeartConfig.cpp.

References mpUserParameters.

template<class TYPE>
TYPE * HeartConfig::DecideLocation ( TYPE *  params_ptr,
TYPE *  defaults_ptr,
const std::string &  nameParameter 
) const [inline, private]

DecideLocation is a convenience method used to get the correct parameter value from the defaults/parameters files. It checks if the first value is present and (if not) moves onto the second

Parameters:
params_ptr Pointer to quantity within the parameters file (checked first, since it will override a default)
defaults_ptr Pointer to quantity within the defaults file (used if there was no override)
nameParameter Name of quatity within params_ptr/defaults_ptr (so we can throw a meaningful exception if it's not found)

Definition at line 207 of file HeartConfig.cpp.

Referenced by GetAbsoluteTolerance(), GetApdMaps(), GetBathConductivity(), GetCapacitance(), GetCellHeterogeneities(), GetConductionVelocityMaps(), GetConductivityHeterogeneities(), GetConductivityHeterogeneitiesProvided(), GetConductivityMedia(), GetCreateFibre(), GetCreateMesh(), GetCreateSheet(), GetCreateSlab(), GetDefaultIonicModel(), GetDomain(), GetExtracellularConductivities(), GetFibreLength(), GetInterNodeSpace(), GetIntracellularConductivities(), GetIonicModelRegions(), GetKSPPreconditioner(), GetKSPSolver(), GetLoadMesh(), GetMeshName(), GetOdeTimeStep(), GetOutputDirectory(), GetOutputFilenamePrefix(), GetPdeTimeStep(), GetPrintingTimeStep(), GetRelativeTolerance(), GetSheetDimensions(), GetSimulationDuration(), GetSlabDimensions(), GetSpaceDimension(), GetStimuli(), GetSurfaceAreaToVolumeRatio(), GetUpstrokeTimeMaps(), GetUseAbsoluteTolerance(), GetUseRelativeTolerance(), IsApdMapsRequested(), IsConductionVelocityMapsRequested(), IsMaxUpstrokeVelocityMapRequested(), IsMeshProvided(), IsPostProcessingRequested(), and IsUpstrokeTimeMapsRequested().

boost::shared_ptr< chaste_parameters_type > HeartConfig::ReadFile ( const std::string &  rFileName  )  [private]

Utility method to parse an XML parameters file.

Parameters:
rFileName Name of XML file

Definition at line 163 of file HeartConfig.cpp.

References mpDefaultParameters, mpUserParameters, and mUseFixedSchemaLocation.

Referenced by SetDefaultsFile(), and SetParametersFile().


Friends And Related Function Documentation

friend class boost::serialization::access [friend]

Needed for serialization.

Definition at line 74 of file HeartConfig.hpp.


Member Data Documentation

boost::shared_ptr<chaste_parameters_type> HeartConfig::mpUserParameters [private]

Pointer to parameters read from the user's input XML file (override those given by mpDefaultParameters).

Definition at line 568 of file HeartConfig.hpp.

Referenced by GetAbsoluteTolerance(), GetApdMaps(), GetBathConductivity(), GetCapacitance(), GetCellHeterogeneities(), GetConductionVelocityMaps(), GetConductivityHeterogeneities(), GetConductivityHeterogeneitiesProvided(), GetConductivityMedia(), GetCreateFibre(), GetCreateMesh(), GetCreateSheet(), GetCreateSlab(), GetDefaultIonicModel(), GetDomain(), GetExtracellularConductivities(), GetFibreLength(), GetInterNodeSpace(), GetIntracellularConductivities(), GetIonicModelRegions(), GetKSPPreconditioner(), GetKSPSolver(), GetLoadMesh(), GetMeshName(), GetOdeTimeStep(), GetOutputDirectory(), GetOutputFilenamePrefix(), GetPdeTimeStep(), GetPrintingTimeStep(), GetRelativeTolerance(), GetSheetDimensions(), GetSimulationDuration(), GetSlabDimensions(), GetSpaceDimension(), GetStimuli(), GetSurfaceAreaToVolumeRatio(), GetUpstrokeTimeMaps(), GetUseAbsoluteTolerance(), GetUseRelativeTolerance(), IsApdMapsRequested(), IsConductionVelocityMapsRequested(), IsMaxUpstrokeVelocityMapRequested(), IsMeshProvided(), IsPostProcessingRequested(), IsUpstrokeTimeMapsRequested(), ReadFile(), SetApdMaps(), SetBathConductivity(), SetCapacitance(), SetConductivityHeterogeneities(), SetDefaultIonicModel(), SetDefaultsFile(), SetDomain(), SetExtracellularConductivities(), SetFibreLength(), SetIntracellularConductivities(), SetKSPPreconditioner(), SetKSPSolver(), SetMeshFileName(), SetOdePdeAndPrintingTimeSteps(), SetOutputDirectory(), SetOutputFilenamePrefix(), SetParametersFile(), SetSheetDimensions(), SetSimulationDuration(), SetSlabDimensions(), SetSpaceDimension(), SetSurfaceAreaToVolumeRatio(), SetUpstrokeTimeMaps(), SetUseAbsoluteTolerance(), SetUseRelativeTolerance(), and Write().

boost::shared_ptr<chaste_parameters_type> HeartConfig::mpDefaultParameters [private]

std::auto_ptr< HeartConfig > HeartConfig::mpInstance [static, private]

The single instance of the class

Definition at line 575 of file HeartConfig.hpp.

Referenced by Instance(), Reset(), and save().

Whether to read the schema location from the XML file (false) or use the schema located at heart/src/io/ChasteParameters.xsd in the Chaste source tree (true).

Definition at line 581 of file HeartConfig.hpp.

Referenced by ReadFile(), and SetUseFixedSchemaLocation().


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

Generated on Tue Aug 4 16:11:17 2009 for Chaste by  doxygen 1.5.5