Chaste  Build::
BaseUnits Class Reference

#include <BaseUnits.hpp>

+ Inheritance diagram for BaseUnits:
+ Collaboration diagram for BaseUnits:

Public Member Functions

units::quantity< unit::time > GetReferenceTimeScale ()
 
units::quantity< unit::length > GetReferenceLengthScale ()
 
units::quantity< unit::concentration > GetReferenceConcentrationScale ()
 
void SetReferenceTimeScale (units::quantity< unit::time > referenceTimeScale)
 
void SetReferenceLengthScale (units::quantity< unit::length > referenceLengthScale)
 
void SetReferenceConcentrationScale (units::quantity< unit::concentration > referenceConcentrationScale)
 

Static Public Member Functions

static BaseUnitsInstance ()
 
static boost::shared_ptr< BaseUnitsSharedInstance ()
 
static void Destroy ()
 

Protected Member Functions

 BaseUnits ()
 

Private Member Functions

template<class Archive >
void serialize (Archive &archive, const unsigned int version)
 

Private Attributes

units::quantity< unit::time > mTime
 
units::quantity< unit::length > mLength
 
units::quantity< unit::concentration > mConcentration
 

Static Private Attributes

static boost::shared_ptr< BaseUnitsmpInstance = boost::shared_ptr<BaseUnits>()
 

Friends

class boost::serialization::access
 

Detailed Description

This singleton manages base units of time and length. Its use needs some care.

The default values are Length: microns, Time: minutes, Concentration: micro Molar

After a length unit is set any features (Dimensional Chaste Point, Readers, Writers, Solvers) created after that point will use the length base unit as their reference length scale. Any already existing features won't be changed. It is better to explicitly set reference scales in a feature rather than changing this value often in a simulation.

After a time unit is set any timers depending on SimulationTime will use it as the reference time scale. Extra care should be taken if this value is changed during a simulation looping over solvers, to make sure it is changed back when needed.

Definition at line 59 of file BaseUnits.hpp.

Constructor & Destructor Documentation

BaseUnits::BaseUnits ( )
protected

Default constructor, force instantiation through factory method.

Definition at line 63 of file BaseUnits.cpp.

References mpInstance.

Referenced by Instance(), and SharedInstance().

Member Function Documentation

void BaseUnits::Destroy ( )
static

Destroy the current BaseUnits instance

Definition at line 102 of file BaseUnits.cpp.

References mpInstance.

Referenced by Instance(), and SharedInstance().

units::quantity< unit::concentration > BaseUnits::GetReferenceConcentrationScale ( )
Returns
the reference time scale

Definition at line 92 of file BaseUnits.cpp.

References mConcentration.

units::quantity< unit::length > BaseUnits::GetReferenceLengthScale ( )
template<class Archive >
void BaseUnits::serialize ( Archive &  archive,
const unsigned int  version 
)
inlineprivate

Serialization of a BaseUnits object must be done with care. Do not serialize this singleton directly. Instead, serialize the object returned by GetSerializationWrapper.

Parameters
archivethe archive
versionthe current version of this class

Definition at line 155 of file BaseUnits.hpp.

References mConcentration, mLength, and mTime.

void BaseUnits::SetReferenceConcentrationScale ( units::quantity< unit::concentration >  referenceConcentrationScale)

Sets reference concentration scale

Parameters
referenceConcentrationScalethe reference concentration scale

Definition at line 97 of file BaseUnits.cpp.

References mConcentration.

void BaseUnits::SetReferenceLengthScale ( units::quantity< unit::length >  referenceLengthScale)

Sets reference length scale

Parameters
referenceLengthScalethe reference length scale

Definition at line 87 of file BaseUnits.cpp.

References mLength.

void BaseUnits::SetReferenceTimeScale ( units::quantity< unit::time >  referenceTimeScale)

Sets reference time scale

Parameters
referenceTimeScalethe reference time scale

Definition at line 77 of file BaseUnits.cpp.

References mTime.

boost::shared_ptr< BaseUnits > BaseUnits::SharedInstance ( )
static
Returns
a pointer to the unit collection object. The first time this is called the unit collection object is created.

Definition at line 43 of file BaseUnits.cpp.

References BaseUnits(), Destroy(), and mpInstance.

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Needed for serialization.

Definition at line 144 of file BaseUnits.hpp.

Member Data Documentation

units::quantity<unit::concentration> BaseUnits::mConcentration
private

The concentration unit

Definition at line 79 of file BaseUnits.hpp.

Referenced by GetReferenceConcentrationScale(), serialize(), and SetReferenceConcentrationScale().

units::quantity<unit::length> BaseUnits::mLength
private

The length unit

Definition at line 74 of file BaseUnits.hpp.

Referenced by GetReferenceLengthScale(), serialize(), and SetReferenceLengthScale().

boost::shared_ptr< BaseUnits > BaseUnits::mpInstance = boost::shared_ptr<BaseUnits>()
staticprivate

A pointer to the singleton instance of this class.

Pointer to the single instance

Definition at line 64 of file BaseUnits.hpp.

Referenced by BaseUnits(), Destroy(), Instance(), and SharedInstance().

units::quantity<unit::time> BaseUnits::mTime
private

The time unit for increments

Definition at line 69 of file BaseUnits.hpp.

Referenced by GetReferenceTimeScale(), serialize(), and SetReferenceTimeScale().


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