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

#include <BioGearsSubstances.h>

Inheritance diagram for biogears::BioGearsSubstances:

Public Member Functions

 BioGearsSubstances (BioGears &data)
 
virtual ~BioGearsSubstances ()=default
 
virtual void Clear ()
 
virtual bool LoadSubstanceDirectory ()
 
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 ()
 
SESubstanceGetAlbumin ()
 
SESubstanceGetAminoAcids ()
 
SESubstanceGetBicarbonate ()
 
SESubstanceGetCalcium ()
 
SESubstanceGetChloride ()
 
SESubstanceGetCreatinine ()
 
SESubstanceGetGlobulin ()
 
SESubstanceGetGlucagon ()
 
SESubstanceGetGlucose ()
 
SESubstanceGetInsulin ()
 
SESubstanceGetKetones ()
 
SESubstanceGetLactate ()
 
SESubstanceGetPotassium ()
 
SESubstanceGetTriacylglycerol ()
 
SESubstanceGetSodium ()
 
SESubstanceGetUrea ()
 
SESubstanceGetPlatelets ()
 
SESubstanceGetAntigen_A ()
 
SESubstanceGetAntigen_B ()
 
SESubstanceGetRBC ()
 
SESubstanceGetWBC ()
 
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...
 
void SetLiquidCompartmentNonGasesForStarvation (double time_h)
 Sets the status of blood concentrations to appropriate starved values. 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 biogears::SESubstanceManager
 SESubstanceManager (Logger *logger)
 
virtual ~SESubstanceManager ()
 
virtual void Reset ()
 
virtual const std::vector< SESubstance * > & GetSubstances () const
 
virtual SESubstanceGetSubstance (const char *name) 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< SESubstance * > & GetActiveDrugs () const
 
virtual const std::vector< SESubstanceCompound * > & GetCompounds () const
 
virtual SESubstanceCompoundGetCompound (const char *name) 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)
 
virtual SESubstanceReadSubstanceFile (const char *xmlFile)
 
virtual SESubstanceReadSubstanceFile (const std::string &xmlFile)
 
- Public Member Functions inherited from biogears::Loggable
 Loggable ()
 
 Loggable (Logger *log)
 
virtual ~Loggable ()
 
virtual LoggerGetLogger () 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 SetSubstanceMolarity (SESubstance &, 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 Member Functions inherited from biogears::Loggable
virtual void Debug (const char *msg, const char *origin="") const
 
virtual void Debug (const std::string &msg, const std::string &origin=empty) const
 
virtual void Debug (std::ostream &msg, const std::string &origin=empty) const
 
virtual void Info (const char *msg, const char *origin="") const
 
virtual void Info (const std::string &msg, const std::string &origin=empty) const
 
virtual void Info (std::ostream &msg, const std::string &origin=empty) const
 
virtual void Warning (const char *msg, const char *origin="") const
 
virtual void Warning (const std::string &msg, const std::string &origin=empty) const
 
virtual void Warning (std::ostream &msg, const std::string &origin=empty) const
 
virtual void Error (const char *msg, const char *origin="") const
 
virtual void Error (const std::string msg, const std::string origin=empty) const
 
virtual void Error (std::ostream &msg, const std::string &origin=empty) const
 
virtual void Fatal (const char *msg, const char *origin="") const
 
virtual void Fatal (const std::string &msg, const std::string &origin=empty) const
 
virtual void Fatal (std::ostream &msg, const std::string &origin=empty) const
 

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_albumin
 
SESubstancem_aminoAcids
 
SESubstancem_calcium
 
SESubstancem_chloride
 
SESubstancem_creatinine
 
SESubstancem_globulin
 
SESubstancem_glucagon
 
SESubstancem_glucose
 
SESubstancem_insulin
 
SESubstancem_ketones
 
SESubstancem_lactate
 
SESubstancem_triacylglycerol
 
SESubstancem_potassium
 
SESubstancem_sodium
 
SESubstancem_urea
 
SESubstancem_platelets
 
SESubstancem_AntigenA
 
SESubstancem_AntigenB
 
SESubstancem_RBC
 
SESubstancem_WBC
 
bool m_isCOActive
 
std::map< SESubstance *, SizeIndependentDepositionEfficencyCoefficient * > m_SIDECoefficients
 
BioGearsm_data
 
- Protected Attributes inherited from biogears::SESubstanceManager
std::vector< SESubstance * > m_Substances
 
std::vector< SESubstance * > m_ActiveSubstances
 
std::vector< SESubstance * > m_ActiveGases
 
std::vector< SESubstance * > m_ActiveLiquids
 
std::vector< SESubstance * > m_ActiveDrugs
 
std::vector< SESubstanceCompound * > m_Compounds
 
std::vector< SESubstanceCompound * > m_ActiveCompounds
 
- Protected Attributes inherited from biogears::Loggable
Loggerm_Logger
 

Friends

class BioGearsEngineTest
 

Additional Inherited Members

- Static Public Attributes inherited from biogears::Loggable
static const std::string empty
 
static const char * empty_cStr
 

Detailed Description

Manages and initializes all systems with substances needed by BioGears.

Constructor & Destructor Documentation

biogears::BioGearsSubstances::BioGearsSubstances ( BioGears data)
virtual biogears::BioGearsSubstances::~BioGearsSubstances ( )
virtualdefault

Member Function Documentation

void biogears::BioGearsSubstances::AddActiveSubstance ( SESubstance substance)
virtual

Reimplemented from biogears::SESubstanceManager.

void biogears::BioGearsSubstances::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.

void biogears::BioGearsSubstances::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.

void biogears::BioGearsSubstances::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.

void biogears::BioGearsSubstances::Clear ( )
virtual

Reimplemented from biogears::SESubstanceManager.

SESubstance& biogears::BioGearsSubstances::GetAlbumin ( )
inline
SESubstance& biogears::BioGearsSubstances::GetAminoAcids ( )
inline
SESubstance& biogears::BioGearsSubstances::GetAntigen_A ( )
inline
SESubstance& biogears::BioGearsSubstances::GetAntigen_B ( )
inline
SESubstance& biogears::BioGearsSubstances::GetBicarbonate ( )
inline
SESubstance& biogears::BioGearsSubstances::GetCalcium ( )
inline
SESubstance& biogears::BioGearsSubstances::GetChloride ( )
inline
SESubstance& biogears::BioGearsSubstances::GetCO ( )
inline
SESubstance& biogears::BioGearsSubstances::GetCO2 ( )
inline
SESubstance& biogears::BioGearsSubstances::GetCreatinine ( )
inline
SESubstance& biogears::BioGearsSubstances::GetEpi ( )
inline
SESubstance& biogears::BioGearsSubstances::GetGlobulin ( )
inline
SESubstance& biogears::BioGearsSubstances::GetGlucagon ( )
inline
SESubstance& biogears::BioGearsSubstances::GetGlucose ( )
inline
SESubstance& biogears::BioGearsSubstances::GetHb ( )
inline
SESubstance& biogears::BioGearsSubstances::GetHbCO ( )
inline
SESubstance& biogears::BioGearsSubstances::GetHbCO2 ( )
inline
SESubstance& biogears::BioGearsSubstances::GetHbO2 ( )
inline
SESubstance& biogears::BioGearsSubstances::GetHbO2CO2 ( )
inline
SESubstance& biogears::BioGearsSubstances::GetHCO3 ( )
inline
SESubstance& biogears::BioGearsSubstances::GetInsulin ( )
inline
SESubstance& biogears::BioGearsSubstances::GetKetones ( )
inline
SESubstance& biogears::BioGearsSubstances::GetLactate ( )
inline
SESubstance& biogears::BioGearsSubstances::GetN2 ( )
inline
SESubstance& biogears::BioGearsSubstances::GetO2 ( )
inline
SESubstance& biogears::BioGearsSubstances::GetPlatelets ( )
inline
SESubstance& biogears::BioGearsSubstances::GetPotassium ( )
inline
SESubstance& biogears::BioGearsSubstances::GetRBC ( )
inline
const SizeIndependentDepositionEfficencyCoefficient & biogears::BioGearsSubstances::GetSizeIndependentDepositionEfficencyCoefficient ( SESubstance substance)
SESubstance& biogears::BioGearsSubstances::GetSodium ( )
inline
double biogears::BioGearsSubstances::GetSubstanceMass ( SESubstance sub,
const std::vector< SELiquidCompartment * > &  cmpts,
const MassUnit unit 
)
double biogears::BioGearsSubstances::GetSubstanceMass ( SESubstance sub,
const std::vector< SETissueCompartment * > &  cmpts,
const MassUnit unit 
)
SESubstance& biogears::BioGearsSubstances::GetTriacylglycerol ( )
inline
SESubstance& biogears::BioGearsSubstances::GetUrea ( )
inline
SESubstance& biogears::BioGearsSubstances::GetWBC ( )
inline
void biogears::BioGearsSubstances::InitializeBloodGases ( SETissueCompartment tissue,
SELiquidCompartment vascular 
)
protectedvirtual
void biogears::BioGearsSubstances::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
void biogears::BioGearsSubstances::InitializeGasCompartments ( )
protectedvirtual
void biogears::BioGearsSubstances::InitializeLiquidCompartmentGases ( )
protectedvirtual
void biogears::BioGearsSubstances::InitializeLiquidCompartmentNonGases ( )
protectedvirtual
void biogears::BioGearsSubstances::InitializeSubstances ( )
virtual
bool biogears::BioGearsSubstances::IsActive ( const SESubstance sub) const
virtual

Reimplemented from biogears::SESubstanceManager.

bool biogears::BioGearsSubstances::LoadSubstanceDirectory ( )
virtual

Reimplemented from biogears::SESubstanceManager.

void biogears::BioGearsSubstances::ProbeBloodGases ( SELiquidCompartment cmpt,
const std::string &  prefix = "" 
)
void biogears::BioGearsSubstances::SetLiquidCompartmentNonGasesForStarvation ( double  time_h)

Sets the status of blood concentrations to appropriate starved values.

The blood concentrations of glucose and ketones are set to match literature values. Insulin and glucagon are not set because they react to set glucose quickly. Other metabolites are not set, but they could be in the future if appropriate validation data is found.

void biogears::BioGearsSubstances::SetSubstanceConcentration ( SESubstance sub,
const std::vector< SELiquidCompartment * > &  cmpts,
const SEScalarMassPerVolume concentration 
)
protected
void biogears::BioGearsSubstances::SetSubstanceConcentration ( SESubstance sub,
const std::vector< SETissueCompartment * > &  cmpts,
const SEScalarMassPerVolume concentration 
)
protected
void biogears::BioGearsSubstances::SetSubstanceConcentration ( SESubstance sub,
const std::vector< SETissueCompartment * > &  cmpts,
const SEScalarMassPerVolume extracellular,
const SEScalarMassPerVolume intracellular 
)
protected
void biogears::BioGearsSubstances::SetSubstanceMolarity ( SESubstance sub,
const std::vector< SELiquidCompartment * > &  cmpts,
const SEScalarAmountPerVolume molarity 
)
protected
void biogears::BioGearsSubstances::SetSubstanceMolarity ( SESubstance sub,
const std::vector< SETissueCompartment * > &  cmpts,
const SEScalarAmountPerVolume molarity 
)
protected
void biogears::BioGearsSubstances::SetSubstanceMolarity ( SESubstance sub,
const std::vector< SETissueCompartment * > &  cmpts,
const SEScalarAmountPerVolume extracellular,
const SEScalarAmountPerVolume intracellular 
)
protected
void biogears::BioGearsSubstances::SetSubstanceMolarity ( SESubstance sub,
const SEScalarAmountPerVolume extracellular,
const SEScalarAmountPerVolume intracellular 
)
protected
void biogears::BioGearsSubstances::WriteBloodGases ( )
void biogears::BioGearsSubstances::WritePulmonaryGases ( )

Friends And Related Function Documentation

friend class BioGearsEngineTest
friend

Member Data Documentation

SESubstance* biogears::BioGearsSubstances::m_albumin
protected
SESubstance* biogears::BioGearsSubstances::m_aminoAcids
protected
SESubstance* biogears::BioGearsSubstances::m_AntigenA
protected
SESubstance* biogears::BioGearsSubstances::m_AntigenB
protected
SESubstance* biogears::BioGearsSubstances::m_calcium
protected
SESubstance* biogears::BioGearsSubstances::m_chloride
protected
SESubstance* biogears::BioGearsSubstances::m_CO
protected
SESubstance* biogears::BioGearsSubstances::m_CO2
protected
SESubstance* biogears::BioGearsSubstances::m_creatinine
protected
BioGears& biogears::BioGearsSubstances::m_data
protected
SESubstance* biogears::BioGearsSubstances::m_epi
protected
SESubstance* biogears::BioGearsSubstances::m_globulin
protected
SESubstance* biogears::BioGearsSubstances::m_glucagon
protected
SESubstance* biogears::BioGearsSubstances::m_glucose
protected
SESubstance* biogears::BioGearsSubstances::m_Hb
protected
SESubstance* biogears::BioGearsSubstances::m_HbCO
protected
SESubstance* biogears::BioGearsSubstances::m_HbCO2
protected
SESubstance* biogears::BioGearsSubstances::m_HbO2
protected
SESubstance* biogears::BioGearsSubstances::m_HbO2CO2
protected
SESubstance* biogears::BioGearsSubstances::m_HCO3
protected
SESubstance* biogears::BioGearsSubstances::m_insulin
protected
bool biogears::BioGearsSubstances::m_isCOActive
protected
SESubstance* biogears::BioGearsSubstances::m_ketones
protected
SESubstance* biogears::BioGearsSubstances::m_lactate
protected
SESubstance* biogears::BioGearsSubstances::m_N2
protected
SESubstance* biogears::BioGearsSubstances::m_O2
protected
SESubstance* biogears::BioGearsSubstances::m_platelets
protected
SESubstance* biogears::BioGearsSubstances::m_potassium
protected
SESubstance* biogears::BioGearsSubstances::m_RBC
protected
std::map<SESubstance*, SizeIndependentDepositionEfficencyCoefficient*> biogears::BioGearsSubstances::m_SIDECoefficients
protected
SESubstance* biogears::BioGearsSubstances::m_sodium
protected
SESubstance* biogears::BioGearsSubstances::m_triacylglycerol
protected
SESubstance* biogears::BioGearsSubstances::m_urea
protected
SESubstance* biogears::BioGearsSubstances::m_WBC
protected