Chaste  Release::2018.1
HeartConfigDefaults.hpp File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MERGE_PARAM(path)
 
#define ELSE_IF_DEFAULT(path)   else if (pDefaults->path().present())
 

Functions

boost::shared_ptr
< cp::chaste_parameters_type > 
CreateDefaultParameters ()
 
void MergeDefaults (boost::shared_ptr< cp::chaste_parameters_type > pParams, boost::shared_ptr< cp::chaste_parameters_type > pDefaults)
 

Detailed Description

This file is designed to be included within HeartConfig.cpp, and defines a single function, CreateDefaultParameters. The only reason it is a separate file is for easy identification of what the default parameters are.

Definition in file HeartConfigDefaults.hpp.

Macro Definition Documentation

#define ELSE_IF_DEFAULT (   path)    else if (pDefaults->path().present())

An "else if" clause that tests if the given parameter is present in the defaults.

Parameters
paththe XSD data model path to the given parameter

Definition at line 172 of file HeartConfigDefaults.hpp.

Referenced by MergeDefaults().

#define MERGE_PARAM (   path)
Value:
if (!pParams->path().present()) { \
if (pDefaults->path().present()) { \
pParams->path().set(pDefaults->path().get()); \
} \
}

If the given parameter is not present in the user parameters, but is in the defaults, then copy its value from defaults to user parameters.

Parameters
paththe XSD data model path to the given parameter

Definition at line 161 of file HeartConfigDefaults.hpp.

Referenced by MergeDefaults().

Function Documentation

boost::shared_ptr<cp::chaste_parameters_type> CreateDefaultParameters ( )
Returns
the default Chaste parameters.

It sets up an object equivalent to the following XML file:

<?xml version="1.0" encoding="UTF-8"?>
<ChasteParameters>
    <Simulation>
        <SpaceDimension>3</SpaceDimension>
        <Domain>Mono</Domain>
        <IonicModels>
            <Default><Hardcoded>LuoRudyI</Hardcoded></Default>
        </IonicModels>
        <OutputDirectory>ChasteResults</OutputDirectory>
        <OutputFilenamePrefix>SimulationResults</OutputFilenamePrefix>
    </Simulation>

    <Physiological>
        <IntracellularConductivities longi="1.75" trans="1.75" normal="1.75" unit="mS/cm" />
        <ExtracellularConductivities longi="7.0"  trans="7.0"  normal="7.0" unit="mS/cm" />
        <BathConductivity unit="mS/cm"> 7.0 </BathConductivity>
        <SurfaceAreaToVolumeRatio unit="1/cm"> 1400 </SurfaceAreaToVolumeRatio>
        <Capacitance unit="uF/cm^2"> 1.0 </Capacitance>
        <Purkinje>
            <SurfaceAreaToVolumeRatio unit="1/cm"> 2800 </SurfaceAreaToVolumeRatio>
            <Capacitance unit="uF/cm^2"> 1.0 </Capacitance>
            <Conductivity unit="mS/cm"> 1.75 </Conductivity>
        </Purkinje>
    </Physiological>

    <Numerical>
        <TimeSteps ode="0.01" pde="0.01" printing="0.01" unit="ms" />
        <KSPTolerances>
            <KSPAbsolute>2e-4</KSPAbsolute>
        </KSPTolerances>
        <KSPSolver>cg</KSPSolver>
        <KSPPreconditioner>bjacobi</KSPPreconditioner>
        <MeshPartitioning>parmetis</MeshPartitioning>
        <UseStateVariableInterpolation>no</UseStateVariableInterpolation>
    </Numerical>
</ChasteParameters>

Definition at line 90 of file HeartConfigDefaults.hpp.

Referenced by HeartConfig::HeartConfig(), and HeartConfig::SetParametersFile().

void MergeDefaults ( boost::shared_ptr< cp::chaste_parameters_type >  pParams,
boost::shared_ptr< cp::chaste_parameters_type >  pDefaults 
)

Merge the default parameters (as defined by CreateDefaultParameters above) into given user parameters. Any parameter that is in the defaults but not the user parameters will have its value copied over.

Parameters
pParamsthe user parameters
pDefaultsthe default parameters, which must have been created by CreateDefaultParameters (or be a subset thereof) for this method to work as intended

Definition at line 184 of file HeartConfigDefaults.hpp.

References ELSE_IF_DEFAULT, and MERGE_PARAM.

Referenced by HeartConfig::LoadFromCheckpoint(), and HeartConfig::SetParametersFile().