Cardiovascular.h
1 /* Distributed under the Apache License, Version 2.0.
2  See accompanying NOTICE file for details.*/
3 
4 #pragma once
5 #include "controller/System.h"
6 #include "system/physiology/SECardiovascularSystem.h"
7 class SEPatient;
13 class SEFluidCircuit;
14 class SEFluidCircuitNode;
15 class SEFluidCircuitPath;
17 
31 {
32  friend class PBPulsePhysiology;//friend the serialization class
33  friend class PulseController;
34  friend class PulseEngineTest;
35 protected:
38 
39 public:
40  virtual ~Cardiovascular();
41 
42  void Clear();
43 
44 protected:
45  // Set members to a stable homeostatic state
46  void Initialize();
47  // Set pointers and other member varialbes common to both homeostatic initialization and loading a state
48  void SetUp();
49 
50  void AtSteadyState();
51  void PreProcess();
52  void Process();
53  void PostProcess();
54 
55  //Condition Methods
56  void ChronicRenalStenosis();
57  void ChronicAnemia();
58  void ChronicHeartFailure();
59  void ChronicPericardialEffusion();
60 
61  // PreProcess:
62  void HeartDriver();
63  void AdjustVascularTone();
64  void BeginCardiacCycle();
65  void CalculateHeartElastance();
66  void UpdateHeartRhythm();
67  // IF STABILIZING
68  void TuneCircuit();
69  void TunePaths(double systemicResistanceScale, double systemicComplianceScale, double aortaResistanceScale, double aortaComplianceScale, double rightHeartResistanceScale, double venaCavaComplianceScale);
70  // ELSE
71  void MetabolicToneResponse();
72  void ProcessActions();
73  //Action methods
74  void CPR();
75  /****/void CalculateAndSetCPRcompressionForce();
76  void Hemorrhage();
77  void InternalHemorrhagePressureApplication();
78  void PericardialEffusion();
79  void PericardialEffusionPressureApplication();
80  void CardiacArrest();
81  void TraumaticBrainInjury();
82 
83  // Process:
84  void CalculateVitalSigns();
85  void CalculateHeartRate();
86  void RecordAndResetCardiacCycle();
87 
88  // Serializable member variables (Set in Initialize and in schema)
89  //Driver
92  bool m_EnterCardiacArrest;// Can't go into cardiac arrest during the middle of a cycle
94  double m_CurrentCardiacCycleDuration_s; // How long have we been in this heart beat
95  double m_LeftHeartElastanceModifier;// from Heart Failure and such
102  //CPR
106  //Hemorrhage
107  std::vector<SEFluidCircuitPath*> m_HemorrhagePaths;
108  std::vector<SEFluidCircuitPath*> m_InternalHemorrhagePaths;
109  std::vector<SELiquidCompartmentLink*> m_HemorrhageLinks;
110  std::vector<SELiquidCompartmentLink*> m_InternalHemorrhageLinks;
111  // Vitals and Averages
113  double m_CardiacCycleDiastolicVolume_mL; // Maximum left heart volume for the current cardiac cycle
114  double m_CardiacCycleAortaPressureLow_mmHg; // The current low for this cycle - Reset at the start of systole
115  double m_CardiacCycleAortaPressureHigh_mmHg; // The current high for this cycle - Reset at the start of systole
119  double m_CardiacCycleStrokeVolume_mL; // Total volume of the left heart flow for the current cardiac cycle
128 
129  // Stateless member variable (Set in SetUp())
130  double m_dT_s;
131  bool m_TuneCircuit = true;
132  std::string m_TuningFile;
133 
135 
138 
140 
143 
147 
152 
157 
174 
182 
185 
188 
191 
207 
208  std::vector<SEFluidCircuitPath*> m_systemicResistancePaths;
209  std::vector<SEFluidCircuitPath*> m_systemicCompliancePaths;
210 };
211 
212 
213 
214 
bool m_StartSystole
Definition: Cardiovascular.h:90
SEFluidCircuitPath * m_RightPulmonaryArteriesToVeins
Definition: Cardiovascular.h:155
SELiquidCompartment * m_RightPulmonaryCapillaries
Definition: Cardiovascular.h:203
double m_CompressionTime_s
Definition: Cardiovascular.h:103
std::string m_TuningFile
Definition: Cardiovascular.h:132
SEFluidCircuitPath * m_pMyocardiumToVenaCava
Definition: Cardiovascular.h:168
SERunningAverage * m_CardiacCyclePulmonaryCapillariesFlow_mL_Per_s
Definition: Cardiovascular.h:123
double m_LeftHeartElastanceModifier
Definition: Cardiovascular.h:95
bool m_EnterCardiacArrest
Definition: Cardiovascular.h:92
SEPatient * m_patient
Definition: Cardiovascular.h:139
double m_RightHeartElastanceMin_mmHg_Per_mL
Definition: Cardiovascular.h:101
Definition: SEPatient.h:61
SEFluidCircuitPath * m_pAortaToLargeIntestine
Definition: Cardiovascular.h:164
SEFluidCircuitPath * m_pBrainToVenaCava
Definition: Cardiovascular.h:161
SEFluidCircuitPath * m_pAortaToLeftKidney
Definition: Cardiovascular.h:163
SEFluidCircuitPath * m_pAortaToMyocardium
Definition: Cardiovascular.h:167
SERunningAverage * m_CardiacCyclePulmonaryArteryPressure_mmHg
Definition: Cardiovascular.h:125
SEFluidCircuitPath * m_pAortaToBone
Definition: Cardiovascular.h:159
SEFluidCircuitPath * m_pLeftHeart
Definition: Cardiovascular.h:180
SELiquidCompartment * m_Pericardium
Definition: Cardiovascular.h:201
SELiquidCompartmentGraph * m_CirculatoryGraph
Definition: Cardiovascular.h:142
Manages and controls execution of all data/systems in Pulse.
Definition: Controller.h:50
SEFluidCircuitPath * m_pGndToAbdominalCavity
Definition: Cardiovascular.h:189
SEFluidCircuitPath * m_pAortaToLiver
Definition: Cardiovascular.h:162
Definition: SEFluidCircuitPath.h:8
SELiquidCompartment * m_RightHeart
Definition: Cardiovascular.h:202
SELiquidCompartment * m_Brain
Definition: Cardiovascular.h:195
std::vector< SEFluidCircuitPath * > m_systemicCompliancePaths
Definition: Cardiovascular.h:209
Definition: PulsePhysiologySystems.h:19
SEFluidCircuitPath * m_pMuscleToVenaCava
Definition: Cardiovascular.h:166
std::vector< SEFluidCircuitPath * > m_HemorrhagePaths
Definition: Cardiovascular.h:107
double m_CurrentCardiacCycleDuration_s
Definition: Cardiovascular.h:94
std::vector< SELiquidCompartmentLink * > m_HemorrhageLinks
Definition: Cardiovascular.h:109
double m_dT_s
Definition: Cardiovascular.h:130
SEFluidCircuitNode * m_LeftHeart2
Definition: Cardiovascular.h:145
SELiquidCompartment * m_AbdominalCavity
Definition: Cardiovascular.h:192
SEFluidCircuitPath * m_LeftHeartToAorta
Definition: Cardiovascular.h:181
SELiquidCompartment * m_LeftPulmonaryArteries
Definition: Cardiovascular.h:199
double m_CurrentCardiacCycleTime_s
Definition: Cardiovascular.h:112
virtual void SetUp()=0
Definition: SECardiovascularSystem.h:11
Definition: SERunningAverage.h:7
double m_RightHeartElastance_mmHg_Per_mL
Definition: Cardiovascular.h:99
SELiquidTransporter * m_transporter
Definition: Cardiovascular.h:137
SEFluidCircuitPath * m_pAortaToMuscle
Definition: Cardiovascular.h:165
Definition: SELiquidSubstanceQuantity.h:11
SEFluidCircuitPath * m_pAortaToSpleen
Definition: Cardiovascular.h:173
SEFluidCircuitPath * m_VenaCavaCompliance
Definition: Cardiovascular.h:150
SEFluidCircuitPath * m_pAortaToSmallIntestine
Definition: Cardiovascular.h:171
double m_minIndividialSystemicResistance__mmHg_s_Per_mL
Definition: Cardiovascular.h:134
SEFluidCircuitCalculator * m_circuitCalculator
Definition: Cardiovascular.h:136
The Cardiovascular system utilizes circuit methodology to characterize the intravascular fluid dynami...
Definition: Cardiovascular.h:30
SERunningAverage * m_CardiacCycleArterialPressure_mmHg
Definition: Cardiovascular.h:120
double m_LastCardiacCycleMeanArterialCO2PartialPressure_mmHg
Definition: Cardiovascular.h:118
SEFluidCircuitPath * m_pAortaToBrain
Definition: Cardiovascular.h:160
SEFluidCircuitPath * m_pPericardiumToGnd
Definition: Cardiovascular.h:176
Generic class for handling the Pulse stabilization methodology.
Definition: System.h:10
virtual void Clear()
Definition: SECardiovascularSystem.cpp:56
SELiquidCompartment * m_LeftPulmonaryCapillaries
Definition: Cardiovascular.h:198
std::vector< SEFluidCircuitPath * > m_systemicResistancePaths
Definition: Cardiovascular.h:208
SELiquidCompartment * m_Aorta
Definition: Cardiovascular.h:193
Definition: PBPulsePhysiology.h:18
Definition: SELiquidCompartment.h:10
SELiquidCompartment * m_Groundcmpt
Definition: Cardiovascular.h:196
double m_CardiacCyclePulmonaryArteryPressureHigh_mmHg
Definition: Cardiovascular.h:117
double m_CompressionRatio
Definition: Cardiovascular.h:104
SEFluidCircuitPath * m_pAortaToRightKidney
Definition: Cardiovascular.h:169
std::vector< SEFluidCircuitPath * > m_InternalHemorrhagePaths
Definition: Cardiovascular.h:108
SEFluidCircuitPath * m_pAbdominalCavityToGnd
Definition: Cardiovascular.h:190
SERunningAverage * m_CardiacCycleSkinFlow_mL_Per_s
Definition: Cardiovascular.h:127
virtual void Initialize()
Default system values to their homeostatic values
Definition: System.h:16
SEFluidCircuitPath * m_pRightHeart
Definition: Cardiovascular.h:178
double m_CardiacCyclePulmonaryArteryPressureLow_mmHg
Definition: Cardiovascular.h:116
double m_LeftHeartElastance_mmHg_Per_mL
Definition: Cardiovascular.h:96
Definition: SEFluidCircuitNode.h:7
Definition: SEFluidCircuit.h:11
SEFluidCircuitPath * m_pBrainResistanceDownstream
Definition: Cardiovascular.h:184
double m_LeftHeartElastanceMin_mmHg_Per_mL
Definition: Cardiovascular.h:98
SEFluidCircuitPath * m_InternalHemorrhageToAorta
Definition: Cardiovascular.h:158
double m_LeftHeartElastanceMax_mmHg_Per_mL
Definition: Cardiovascular.h:97
SERunningAverage * m_CardiacCycleCentralVenousPressure_mmHg
Definition: Cardiovascular.h:126
bool m_HeartFlowDetected
Definition: Cardiovascular.h:91
SERunningAverage * m_CardiacCycleArterialCO2PartialPressure_mmHg
Definition: Cardiovascular.h:121
virtual void AtSteadyState()
Notify systems that steady state has been achieved.
Definition: System.h:20
SEFluidCircuitPath * m_pLeftHeartToGnd
Definition: Cardiovascular.h:179
double m_CardiacCycleAortaPressureHigh_mmHg
Definition: Cardiovascular.h:115
Definition: SESubstanceTransport.h:110
SELiquidCompartment * m_LeftPulmonaryVeins
Definition: Cardiovascular.h:200
SELiquidSubstanceQuantity * m_AortaCO2
Definition: Cardiovascular.h:194
double m_CardiacCyclePeriod_s
Definition: Cardiovascular.h:93
Definition: SELiquidCompartmentGraph.h:11
SEFluidCircuit * m_CirculatoryCircuit
Definition: Cardiovascular.h:141
SELiquidCompartment * m_RightPulmonaryVeins
Definition: Cardiovascular.h:205
virtual void PostProcess()=0
SEFluidCircuitPath * m_LeftPulmonaryArteriesToVeins
Definition: Cardiovascular.h:153
SELiquidCompartment * m_VenaCava
Definition: Cardiovascular.h:206
SERunningAverage * m_CardiacCyclePulmonaryShuntFlow_mL_Per_s
Definition: Cardiovascular.h:124
SEFluidCircuitPath * m_pRightHeartToGnd
Definition: Cardiovascular.h:177
SEFluidCircuitPath * m_pBrainResistanceUpstream
Definition: Cardiovascular.h:183
double m_CardiacCycleStrokeVolume_mL
Definition: Cardiovascular.h:119
SEFluidCircuitPath * m_pAortaToSkin
Definition: Cardiovascular.h:170
double m_CardiacCycleDiastolicVolume_mL
Definition: Cardiovascular.h:113
SERunningAverage * m_CardiacCyclePulmonaryCapillariesWedgePressure_mmHg
Definition: Cardiovascular.h:122
SEFluidCircuitPath * m_rightRenalArteryPath
Definition: Cardiovascular.h:187
SEFluidCircuitNode * m_Ground
Definition: Cardiovascular.h:146
double m_CardiacCycleAortaPressureLow_mmHg
Definition: Cardiovascular.h:114
PulseController & m_data
Definition: Cardiovascular.h:37
double m_RightHeartElastanceMax_mmHg_Per_mL
Definition: Cardiovascular.h:100
std::vector< SELiquidCompartmentLink * > m_InternalHemorrhageLinks
Definition: Cardiovascular.h:110
SEFluidCircuitPath * m_LeftPulmonaryArteriesToCapillaries
Definition: Cardiovascular.h:154
SEFluidCircuitPath * m_AortaCompliance
Definition: Cardiovascular.h:148
SEFluidCircuitPath * m_pAortaToSplanchnic
Definition: Cardiovascular.h:172
SELiquidCompartment * m_RightPulmonaryArteries
Definition: Cardiovascular.h:204
virtual void Process()=0
SEFluidCircuitPath * m_RightPulmonaryArteriesToCapillaries
Definition: Cardiovascular.h:156
SEFluidCircuitPath * m_RightHeartResistance
Definition: Cardiovascular.h:151
virtual void PreProcess()=0
Definition: SEFluidCircuitCalculator.h:9
SEFluidCircuitPath * m_AortaResistance
Definition: Cardiovascular.h:149
SEFluidCircuitPath * m_leftRenalArteryPath
Definition: Cardiovascular.h:186
SEFluidCircuitPath * m_pGndToPericardium
Definition: Cardiovascular.h:175
SEFluidCircuitNode * m_MainPulmonaryArteries
Definition: Cardiovascular.h:144
SELiquidCompartment * m_LeftHeart
Definition: Cardiovascular.h:197
double m_CompressionPeriod_s
Definition: Cardiovascular.h:105