Manages and initializes all systems with substances needed by Pulse. More...

#include <Substances.h>

Inherits SESubstanceManager.

Public Member Functions

 PulseSubstances (PulseController &data)
 
virtual ~PulseSubstances ()=default
 
virtual void Clear ()
 
virtual bool LoadSubstanceDirectory (const std::string &data_dir=".")
 
virtual void InitializeSubstances ()
 
virtual void AddActiveSubstance (SESubstance &substance)
 
virtual bool IsActive (const SESubstance &sub) const
 
SESubstanceGetO2 ()
 
SESubstanceGetCO ()
 
SESubstanceGetCO2 ()
 
SESubstanceGetN2 ()
 
SESubstanceGetHb ()
 
SESubstanceGetHbO2 ()
 
SESubstanceGetHbCO2 ()
 
SESubstanceGetHbCO ()
 
SESubstanceGetHbO2CO2 ()
 
SESubstanceGetHCO3 ()
 
SESubstanceGetEpi ()
 
SESubstanceGetAcetoacetate ()
 
SESubstanceGetAlbumin ()
 
SESubstanceGetBicarbonate ()
 
SESubstanceGetCalcium ()
 
SESubstanceGetChloride ()
 
SESubstanceGetCreatinine ()
 
SESubstanceGetGlobulin ()
 
SESubstanceGetGlucose ()
 
SESubstanceGetInsulin ()
 
SESubstanceGetLactate ()
 
SESubstanceGetPotassium ()
 
SESubstanceGetTristearin ()
 
SESubstanceGetSodium ()
 
SESubstanceGetUrea ()
 
void CalculateGenericClearance (double volumeCleared_mL, SELiquidCompartment &cmpt, SESubstance &sub, SEScalarMass *cleared=nullptr)
 Calculates the substance mass cleared for a node. More...
 
void CalculateGenericClearance (double volumeCleared_mL, SETissueCompartment &cmpt, SESubstance &sub, SEScalarMass *cleared=nullptr)
 Calculates the substance mass cleared for a tissue compartment based on a volume. More...
 
void CalculateGenericExcretion (double VascularFlow_mL_Per_s, SETissueCompartment &cmpt, SESubstance &sub, double FractionExcreted, double timestep_s, SEScalarMass *excreted=nullptr)
 Calculates the substance mass excreted for a compartment. More...
 
const SizeIndependentDepositionEfficencyCoefficientGetSizeIndependentDepositionEfficencyCoefficient (SESubstance &substance)
 
double GetSubstanceMass (SESubstance &, const std::vector< SELiquidCompartment *> &, const MassUnit &unit)
 
double GetSubstanceMass (SESubstance &, const std::vector< SETissueCompartment *> &, const MassUnit &unit)
 
void WriteBloodGases ()
 
void WritePulmonaryGases ()
 
void ProbeBloodGases (SELiquidCompartment &cmpt, const std::string &prefix="")
 
- Public Member Functions inherited from SESubstanceManager
 SESubstanceManager (Logger *logger)
 
virtual ~SESubstanceManager ()
 
virtual void Reset ()
 
virtual const std::vector< SESubstance * > & GetSubstances () const
 
virtual SESubstanceGetSubstance (const std::string &name) const
 
virtual void AddSubstance (SESubstance &substance)
 
virtual const std::vector< SESubstance * > & GetActiveSubstances () const
 
virtual void RemoveActiveSubstance (const SESubstance &substance)
 
virtual void RemoveActiveSubstances (const std::vector< SESubstance *> &substances)
 
virtual void RemoveActiveSubstances ()
 
virtual const std::vector< SESubstance * > & GetActiveGases () const
 
virtual const std::vector< SESubstance * > & GetActiveLiquids () const
 
virtual const std::vector< SESubstanceCompound * > & GetCompounds () const
 
virtual SESubstanceCompoundGetCompound (const std::string &name) const
 
virtual void AddCompound (SESubstanceCompound &compound)
 
virtual bool IsActive (const SESubstanceCompound &compound) const
 
virtual const std::vector< SESubstanceCompound * > & GetActiveCompounds () const
 
virtual void AddActiveCompound (SESubstanceCompound &compound)
 
virtual void RemoveActiveCompound (SESubstanceCompound &compound)
 
virtual void RemoveActiveCompounds (const std::vector< SESubstanceCompound *> &compounds)
 
- Public Member Functions inherited from Loggable
 Loggable ()
 
 Loggable (Logger *log)
 
virtual ~Loggable ()
 
virtual LoggerGetLogger () const
 
virtual void Debug (std::string const &msg, std::string const &origin=empty) const
 
virtual void Debug (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Debug (std::ostream &msg, std::string const &origin=empty) const
 
virtual void Info (std::string const &msg, std::string const &origin=empty) const
 
virtual void Info (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Info (const std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Info (std::ostream &msg, std::string const &origin=empty) const
 
virtual void Warning (std::string const &msg, std::string const &origin=empty) const
 
virtual void Warning (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Warning (std::ostream &msg, std::string const &origin=empty) const
 
virtual void Error (std::string const &msg, std::string const &origin=empty) const
 
virtual void Error (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Error (std::ostream &msg, std::string const &origin=empty) const
 
virtual void Fatal (std::string const &msg, std::string const &origin=empty) const
 
virtual void Fatal (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Fatal (std::ostream &msg, std::string const &origin=empty) const
 

Protected Member Functions

virtual void InitializeGasCompartments ()
 
virtual void InitializeLiquidCompartmentGases ()
 
virtual void InitializeLiquidCompartmentNonGases ()
 
virtual void InitializeBloodGases (SETissueCompartment &tissue, SELiquidCompartment &vascular)
 
virtual void InitializeBloodGases (SELiquidCompartment &cmpt, double Hb_total_mM, double O2_sat, double O2_mmol_Per_L, double CO2_sat, double CO2_mmol_Per_L, double HCO3_mmol_Per_L, double pH, bool distribute=true)
 
void SetSubstanceMolarity (SESubstance &, const std::vector< SELiquidCompartment *> &, const SEScalarAmountPerVolume &molarity)
 
void SetSubstanceMolarity (SESubstance &, const std::vector< SETissueCompartment *> &, const SEScalarAmountPerVolume &molarity)
 
void SetSubstanceMolarity (SESubstance &, const std::vector< SETissueCompartment *> &, const SEScalarAmountPerVolume &extracellular, const SEScalarAmountPerVolume &intracellular)
 
void SetSubstanceConcentration (SESubstance &, const std::vector< SELiquidCompartment *> &, const SEScalarMassPerVolume &concentration)
 
void SetSubstanceConcentration (SESubstance &, const std::vector< SETissueCompartment *> &, const SEScalarMassPerVolume &concentration)
 
void SetSubstanceConcentration (SESubstance &, const std::vector< SETissueCompartment *> &, const SEScalarMassPerVolume &extracellular, const SEScalarMassPerVolume &intracellular)
 

Protected Attributes

SESubstancem_O2
 
SESubstancem_CO
 
SESubstancem_CO2
 
SESubstancem_N2
 
SESubstancem_Hb
 
SESubstancem_HbO2
 
SESubstancem_HbCO2
 
SESubstancem_HbCO
 
SESubstancem_HbO2CO2
 
SESubstancem_HCO3
 
SESubstancem_epi
 
SESubstancem_acetoacetate
 
SESubstancem_albumin
 
SESubstancem_calcium
 
SESubstancem_chloride
 
SESubstancem_creatinine
 
SESubstancem_globulin
 
SESubstancem_glucose
 
SESubstancem_insulin
 
SESubstancem_lactate
 
SESubstancem_tristearin
 
SESubstancem_potassium
 
SESubstancem_sodium
 
SESubstancem_urea
 
bool m_isCOActive
 
std::map< SESubstance *, SizeIndependentDepositionEfficencyCoefficient * > m_SIDECoefficients
 
PulseControllerm_data
 
- Protected Attributes inherited from SESubstanceManager
std::vector< SESubstance * > m_Substances
 
std::vector< SESubstance * > m_ActiveSubstances
 
std::vector< SESubstance * > m_ActiveGases
 
std::vector< SESubstance * > m_ActiveLiquids
 
std::vector< SESubstanceCompound * > m_Compounds
 
std::vector< SESubstanceCompound * > m_ActiveCompounds
 
- Protected Attributes inherited from Loggable
Loggerm_Logger
 

Friends

class PulseEngineTest
 

Additional Inherited Members

- Static Public Attributes inherited from Loggable
static const std::string empty
 

Detailed Description

Manages and initializes all systems with substances needed by Pulse.

Constructor & Destructor Documentation

◆ PulseSubstances()

PulseSubstances::PulseSubstances ( PulseController data)

◆ ~PulseSubstances()

virtual PulseSubstances::~PulseSubstances ( )
virtualdefault

Member Function Documentation

◆ AddActiveSubstance()

void PulseSubstances::AddActiveSubstance ( SESubstance substance)
virtual

Reimplemented from SESubstanceManager.

◆ CalculateGenericClearance() [1/2]

void PulseSubstances::CalculateGenericClearance ( double  volumeCleared_mL,
SELiquidCompartment cmpt,
SESubstance sub,
SEScalarMass cleared = nullptr 
)

Calculates the substance mass cleared for a node.


The volume cleared, the compartment, and the substance are provided to clear the mass of the substance from the node. This generic methodology can be used by other systems to calculate the mass cleared.

◆ CalculateGenericClearance() [2/2]

void PulseSubstances::CalculateGenericClearance ( double  VolumeCleared_mL,
SETissueCompartment tissue,
SESubstance sub,
SEScalarMass cleared = nullptr 
)

Calculates the substance mass cleared for a tissue compartment based on a volume.


Parameters
VolumeCleared_mLthe volume of fluid cleared of a substance by some process
tissuea tissue compartment
suba substance
clearedmass cleared

The volume cleared, the compartment, and the substance are provided to clear the mass of the substance from the node. This generic methodology can be used by other systems to calculate the mass cleared.

◆ CalculateGenericExcretion()

void PulseSubstances::CalculateGenericExcretion ( double  VascularFlow_mL_Per_s,
SETissueCompartment tissue,
SESubstance sub,
double  FractionExcreted,
double  timestep_s,
SEScalarMass excreted = nullptr 
)

Calculates the substance mass excreted for a compartment.


The volume cleared, the compartment, and the substance are provided to clear the mass of the substance from the node. This generic methodology can be used by other systems to calculate the mass excreted.

◆ Clear()

void PulseSubstances::Clear ( )
virtual

Reimplemented from SESubstanceManager.

◆ GetAcetoacetate()

SESubstance& PulseSubstances::GetAcetoacetate ( )
inline

◆ GetAlbumin()

SESubstance& PulseSubstances::GetAlbumin ( )
inline

◆ GetBicarbonate()

SESubstance& PulseSubstances::GetBicarbonate ( )
inline

◆ GetCalcium()

SESubstance& PulseSubstances::GetCalcium ( )
inline

◆ GetChloride()

SESubstance& PulseSubstances::GetChloride ( )
inline

◆ GetCO()

SESubstance& PulseSubstances::GetCO ( )
inline

◆ GetCO2()

SESubstance& PulseSubstances::GetCO2 ( )
inline

◆ GetCreatinine()

SESubstance& PulseSubstances::GetCreatinine ( )
inline

◆ GetEpi()

SESubstance& PulseSubstances::GetEpi ( )
inline

◆ GetGlobulin()

SESubstance& PulseSubstances::GetGlobulin ( )
inline

◆ GetGlucose()

SESubstance& PulseSubstances::GetGlucose ( )
inline

◆ GetHb()

SESubstance& PulseSubstances::GetHb ( )
inline

◆ GetHbCO()

SESubstance& PulseSubstances::GetHbCO ( )
inline

◆ GetHbCO2()

SESubstance& PulseSubstances::GetHbCO2 ( )
inline

◆ GetHbO2()

SESubstance& PulseSubstances::GetHbO2 ( )
inline

◆ GetHbO2CO2()

SESubstance& PulseSubstances::GetHbO2CO2 ( )
inline

◆ GetHCO3()

SESubstance& PulseSubstances::GetHCO3 ( )
inline

◆ GetInsulin()

SESubstance& PulseSubstances::GetInsulin ( )
inline

◆ GetLactate()

SESubstance& PulseSubstances::GetLactate ( )
inline

◆ GetN2()

SESubstance& PulseSubstances::GetN2 ( )
inline

◆ GetO2()

SESubstance& PulseSubstances::GetO2 ( )
inline

◆ GetPotassium()

SESubstance& PulseSubstances::GetPotassium ( )
inline

◆ GetSizeIndependentDepositionEfficencyCoefficient()

const SizeIndependentDepositionEfficencyCoefficient & PulseSubstances::GetSizeIndependentDepositionEfficencyCoefficient ( SESubstance substance)

◆ GetSodium()

SESubstance& PulseSubstances::GetSodium ( )
inline

◆ GetSubstanceMass() [1/2]

double PulseSubstances::GetSubstanceMass ( SESubstance sub,
const std::vector< SELiquidCompartment *> &  cmpts,
const MassUnit unit 
)

◆ GetSubstanceMass() [2/2]

double PulseSubstances::GetSubstanceMass ( SESubstance sub,
const std::vector< SETissueCompartment *> &  cmpts,
const MassUnit unit 
)

◆ GetTristearin()

SESubstance& PulseSubstances::GetTristearin ( )
inline

◆ GetUrea()

SESubstance& PulseSubstances::GetUrea ( )
inline

◆ InitializeBloodGases() [1/2]

void PulseSubstances::InitializeBloodGases ( SETissueCompartment tissue,
SELiquidCompartment vascular 
)
protectedvirtual

◆ InitializeBloodGases() [2/2]

void PulseSubstances::InitializeBloodGases ( SELiquidCompartment cmpt,
double  Hb_total_mM,
double  O2_sat,
double  O2_mmol_Per_L,
double  CO2_sat,
double  CO2_mmol_Per_L,
double  HCO3_mmol_Per_L,
double  pH,
bool  distribute = true 
)
protectedvirtual

◆ InitializeGasCompartments()

void PulseSubstances::InitializeGasCompartments ( )
protectedvirtual

◆ InitializeLiquidCompartmentGases()

void PulseSubstances::InitializeLiquidCompartmentGases ( )
protectedvirtual

◆ InitializeLiquidCompartmentNonGases()

void PulseSubstances::InitializeLiquidCompartmentNonGases ( )
protectedvirtual
Todo:
Tristearin is actually all triacylglycerols. Change name.

◆ InitializeSubstances()

void PulseSubstances::InitializeSubstances ( )
virtual

◆ IsActive()

bool PulseSubstances::IsActive ( const SESubstance sub) const
virtual

Reimplemented from SESubstanceManager.

◆ LoadSubstanceDirectory()

bool PulseSubstances::LoadSubstanceDirectory ( const std::string &  data_dir = ".")
virtual

Reimplemented from SESubstanceManager.

◆ ProbeBloodGases()

void PulseSubstances::ProbeBloodGases ( SELiquidCompartment cmpt,
const std::string &  prefix = "" 
)

◆ SetSubstanceConcentration() [1/3]

void PulseSubstances::SetSubstanceConcentration ( SESubstance sub,
const std::vector< SELiquidCompartment *> &  cmpts,
const SEScalarMassPerVolume concentration 
)
protected

◆ SetSubstanceConcentration() [2/3]

void PulseSubstances::SetSubstanceConcentration ( SESubstance sub,
const std::vector< SETissueCompartment *> &  cmpts,
const SEScalarMassPerVolume concentration 
)
protected

◆ SetSubstanceConcentration() [3/3]

void PulseSubstances::SetSubstanceConcentration ( SESubstance sub,
const std::vector< SETissueCompartment *> &  cmpts,
const SEScalarMassPerVolume extracellular,
const SEScalarMassPerVolume intracellular 
)
protected

◆ SetSubstanceMolarity() [1/3]

void PulseSubstances::SetSubstanceMolarity ( SESubstance sub,
const std::vector< SELiquidCompartment *> &  cmpts,
const SEScalarAmountPerVolume molarity 
)
protected

◆ SetSubstanceMolarity() [2/3]

void PulseSubstances::SetSubstanceMolarity ( SESubstance sub,
const std::vector< SETissueCompartment *> &  cmpts,
const SEScalarAmountPerVolume molarity 
)
protected

◆ SetSubstanceMolarity() [3/3]

void PulseSubstances::SetSubstanceMolarity ( SESubstance sub,
const std::vector< SETissueCompartment *> &  cmpts,
const SEScalarAmountPerVolume extracellular,
const SEScalarAmountPerVolume intracellular 
)
protected

◆ WriteBloodGases()

void PulseSubstances::WriteBloodGases ( )

◆ WritePulmonaryGases()

void PulseSubstances::WritePulmonaryGases ( )

Friends And Related Function Documentation

◆ PulseEngineTest

friend class PulseEngineTest
friend

Member Data Documentation

◆ m_acetoacetate

SESubstance* PulseSubstances::m_acetoacetate
protected

◆ m_albumin

SESubstance* PulseSubstances::m_albumin
protected

◆ m_calcium

SESubstance* PulseSubstances::m_calcium
protected

◆ m_chloride

SESubstance* PulseSubstances::m_chloride
protected

◆ m_CO

SESubstance* PulseSubstances::m_CO
protected

◆ m_CO2

SESubstance* PulseSubstances::m_CO2
protected

◆ m_creatinine

SESubstance* PulseSubstances::m_creatinine
protected

◆ m_data

PulseController& PulseSubstances::m_data
protected

◆ m_epi

SESubstance* PulseSubstances::m_epi
protected

◆ m_globulin

SESubstance* PulseSubstances::m_globulin
protected

◆ m_glucose

SESubstance* PulseSubstances::m_glucose
protected

◆ m_Hb

SESubstance* PulseSubstances::m_Hb
protected

◆ m_HbCO

SESubstance* PulseSubstances::m_HbCO
protected

◆ m_HbCO2

SESubstance* PulseSubstances::m_HbCO2
protected

◆ m_HbO2

SESubstance* PulseSubstances::m_HbO2
protected

◆ m_HbO2CO2

SESubstance* PulseSubstances::m_HbO2CO2
protected

◆ m_HCO3

SESubstance* PulseSubstances::m_HCO3
protected

◆ m_insulin

SESubstance* PulseSubstances::m_insulin
protected

◆ m_isCOActive

bool PulseSubstances::m_isCOActive
protected

◆ m_lactate

SESubstance* PulseSubstances::m_lactate
protected

◆ m_N2

SESubstance* PulseSubstances::m_N2
protected

◆ m_O2

SESubstance* PulseSubstances::m_O2
protected

◆ m_potassium

SESubstance* PulseSubstances::m_potassium
protected

◆ m_SIDECoefficients

std::map<SESubstance*, SizeIndependentDepositionEfficencyCoefficient*> PulseSubstances::m_SIDECoefficients
protected

◆ m_sodium

SESubstance* PulseSubstances::m_sodium
protected

◆ m_tristearin

SESubstance* PulseSubstances::m_tristearin
protected

◆ m_urea

SESubstance* PulseSubstances::m_urea
protected