Commit da69f06c authored by Bradley Feiger's avatar Bradley Feiger
Browse files

Add ability to output mean cerebral blood flow and mean cerebral perfusion...

Add ability to output mean cerebral blood flow and mean cerebral perfusion pressure and added simulation list option to sensitivity analysis.
parent 80c7824d
......@@ -190,6 +190,10 @@ void PBPhysiology::Serialize(const CDM_BIND::CardiovascularSystemData& src, SECa
PBProperty::Load(src.meanarterialcarbondioxidepartialpressuredelta(), dst.GetMeanArterialCarbonDioxidePartialPressureDelta());
if (src.has_meancentralvenouspressure())
PBProperty::Load(src.meancentralvenouspressure(), dst.GetMeanCentralVenousPressure());
if (src.has_meancerebralbloodflow())
PBProperty::Load(src.meancerebralbloodflow(), dst.GetMeanCerebralBloodFlow());
if (src.has_meancerebralperfusionpressure())
PBProperty::Load(src.meancerebralperfusionpressure(), dst.GetMeanCerebralPerfusionPressure());
if (src.has_meanskinflow())
PBProperty::Load(src.meanskinflow(), dst.GetMeanSkinFlow());
if (src.has_pulmonaryarterialpressure())
......@@ -259,6 +263,10 @@ void PBPhysiology::Serialize(const SECardiovascularSystem& src, CDM_BIND::Cardio
dst.set_allocated_meanarterialcarbondioxidepartialpressuredelta(PBProperty::Unload(*src.m_MeanArterialCarbonDioxidePartialPressureDelta));
if (src.HasMeanCentralVenousPressure())
dst.set_allocated_meancentralvenouspressure(PBProperty::Unload(*src.m_MeanCentralVenousPressure));
if (src.HasMeanCerebralBloodFlow())
dst.set_allocated_meancerebralbloodflow(PBProperty::Unload(*src.m_MeanCerebralBloodFlow));
if (src.HasMeanCerebralPerfusionPressure())
dst.set_allocated_meancerebralperfusionpressure(PBProperty::Unload(*src.m_MeanCerebralPerfusionPressure));
if (src.HasMeanSkinFlow())
dst.set_allocated_meanskinflow(PBProperty::Unload(*src.m_MeanSkinFlow));
if (src.HasPulmonaryArterialPressure())
......
......@@ -33,6 +33,8 @@ SECardiovascularSystem::SECardiovascularSystem(Logger* logger) : SESystem(logger
m_MeanArterialCarbonDioxidePartialPressure = nullptr;
m_MeanArterialCarbonDioxidePartialPressureDelta = nullptr;
m_MeanCentralVenousPressure = nullptr;
m_MeanCerebralBloodFlow = nullptr;
m_MeanCerebralPerfusionPressure = nullptr;
m_MeanSkinFlow = nullptr;
m_PulmonaryArterialPressure = nullptr;
m_PulmonaryCapillariesWedgePressure = nullptr;
......@@ -74,6 +76,8 @@ void SECardiovascularSystem::Clear()
SAFE_DELETE(m_MeanArterialCarbonDioxidePartialPressure);
SAFE_DELETE(m_MeanArterialCarbonDioxidePartialPressureDelta);
SAFE_DELETE(m_MeanCentralVenousPressure);
SAFE_DELETE(m_MeanCerebralBloodFlow);
SAFE_DELETE(m_MeanCerebralPerfusionPressure);
SAFE_DELETE(m_MeanSkinFlow);
SAFE_DELETE(m_PulmonaryArterialPressure);
SAFE_DELETE(m_PulmonaryCapillariesWedgePressure);
......@@ -123,6 +127,10 @@ const SEScalar* SECardiovascularSystem::GetScalar(const std::string& name)
return &GetMeanArterialCarbonDioxidePartialPressureDelta();
if (name.compare("MeanCentralVenousPressure") == 0)
return &GetMeanCentralVenousPressure();
if (name.compare("MeanCerebralBloodFlow") == 0)
return &GetMeanCerebralBloodFlow();
if (name.compare("MeanCerebralPerfusionPressure") == 0)
return &GetMeanCerebralPerfusionPressure();
if (name.compare("MeanSkinFlow") == 0)
return &GetMeanSkinFlow();
if (name.compare("PulmonaryArterialPressure") == 0)
......@@ -433,6 +441,40 @@ double SECardiovascularSystem::GetMeanCentralVenousPressure(const PressureUnit&
return m_MeanCentralVenousPressure->GetValue(unit);
}
bool SECardiovascularSystem::HasMeanCerebralBloodFlow() const
{
return m_MeanCerebralBloodFlow == nullptr ? false : m_MeanCerebralBloodFlow->IsValid();
}
SEScalarVolumePerTime& SECardiovascularSystem::GetMeanCerebralBloodFlow()
{
if (m_MeanCerebralBloodFlow == nullptr)
m_MeanCerebralBloodFlow = new SEScalarVolumePerTime();
return *m_MeanCerebralBloodFlow;
}
double SECardiovascularSystem::GetMeanCerebralBloodFlow(const VolumePerTimeUnit& unit) const
{
if (m_MeanCerebralBloodFlow == nullptr)
return SEScalar::dNaN();
return m_MeanCerebralBloodFlow->GetValue(unit);
}
bool SECardiovascularSystem::HasMeanCerebralPerfusionPressure() const
{
return m_MeanCerebralPerfusionPressure == nullptr ? false : m_MeanCerebralPerfusionPressure->IsValid();
}
SEScalarPressure& SECardiovascularSystem::GetMeanCerebralPerfusionPressure()
{
if (m_MeanCerebralPerfusionPressure == nullptr)
m_MeanCerebralPerfusionPressure = new SEScalarPressure();
return *m_MeanCerebralPerfusionPressure;
}
double SECardiovascularSystem::GetMeanCerebralPerfusionPressure(const PressureUnit& unit) const
{
if (m_MeanCerebralPerfusionPressure == nullptr)
return SEScalar::dNaN();
return m_MeanCerebralPerfusionPressure->GetValue(unit);
}
bool SECardiovascularSystem::HasMeanSkinFlow() const
{
return m_MeanSkinFlow == nullptr ? false : m_MeanSkinFlow->IsValid();
......
......@@ -87,6 +87,14 @@ public:
virtual SEScalarPressure& GetMeanCentralVenousPressure();
virtual double GetMeanCentralVenousPressure(const PressureUnit& unit) const;
virtual bool HasMeanCerebralBloodFlow() const;
virtual SEScalarVolumePerTime& GetMeanCerebralBloodFlow();
virtual double GetMeanCerebralBloodFlow(const VolumePerTimeUnit& unit) const;
virtual bool HasMeanCerebralPerfusionPressure() const;
virtual SEScalarPressure& GetMeanCerebralPerfusionPressure();
virtual double GetMeanCerebralPerfusionPressure(const PressureUnit& unit) const;
virtual bool HasMeanSkinFlow() const;
virtual SEScalarVolumePerTime& GetMeanSkinFlow();
virtual double GetMeanSkinFlow(const VolumePerTimeUnit& unit) const;
......@@ -158,6 +166,8 @@ protected:
SEScalarPressure* m_MeanArterialCarbonDioxidePartialPressure;
SEScalarPressure* m_MeanArterialCarbonDioxidePartialPressureDelta;
SEScalarPressure* m_MeanCentralVenousPressure;
SEScalarVolumePerTime* m_MeanCerebralBloodFlow;
SEScalarPressure* m_MeanCerebralPerfusionPressure;
SEScalarVolumePerTime* m_MeanSkinFlow;
SEScalarPressure* m_PulmonaryArterialPressure;
SEScalarPressure* m_PulmonaryCapillariesWedgePressure;
......@@ -166,9 +176,9 @@ protected:
SEScalarVolumePerTime* m_PulmonaryMeanCapillaryFlow;
SEScalarVolumePerTime* m_PulmonaryMeanShuntFlow;
SEScalarPressure* m_PulmonarySystolicArterialPressure;
SEScalarPressureTimePerVolume* m_PulmonaryVascularResistance;
SEScalarPressureTimePerVolume* m_PulmonaryVascularResistance;
SEScalarPressureTimePerVolumeArea* m_PulmonaryVascularResistanceIndex;
SEScalarPressure* m_PulsePressure;
SEScalarPressure* m_SystolicArterialPressure;
SEScalarPressureTimePerVolume* m_SystemicVascularResistance;
SEScalarPressureTimePerVolume* m_SystemicVascularResistance;
};
\ No newline at end of file
......@@ -94,6 +94,8 @@ void PBPulsePhysiology::Serialize(const PULSE_BIND::CardiovascularData& src, Car
PBProperty::Load(src.cardiaccyclepulmonaryshuntflow_ml_per_s(), *dst.m_CardiacCyclePulmonaryShuntFlow_mL_Per_s);
PBProperty::Load(src.cardiaccyclepulmonaryarterypressure_mmhg(), *dst.m_CardiacCyclePulmonaryArteryPressure_mmHg);
PBProperty::Load(src.cardiaccyclecentralvenouspressure_mmhg(), *dst.m_CardiacCycleCentralVenousPressure_mmHg);
PBProperty::Load(src.cardiaccyclecerebralbloodflow_ml_per_s(), *dst.m_CardiacCycleCerebralBloodFlow_mL_Per_s);
PBProperty::Load(src.cardiaccyclecerebralperfusionpressure_mmhg(), *dst.m_CardiacCycleCerebralPerfusionPressure_mmHg);
PBProperty::Load(src.cardiaccycleskinflow_ml_per_s(), *dst.m_CardiacCycleSkinFlow_mL_Per_s);
// As these are dynamically added to the system during run time,
......@@ -182,6 +184,8 @@ void PBPulsePhysiology::Serialize(const Cardiovascular& src, PULSE_BIND::Cardiov
dst.set_allocated_cardiaccyclepulmonaryshuntflow_ml_per_s(PBProperty::Unload(*src.m_CardiacCyclePulmonaryShuntFlow_mL_Per_s));
dst.set_allocated_cardiaccyclepulmonaryarterypressure_mmhg(PBProperty::Unload(*src.m_CardiacCyclePulmonaryArteryPressure_mmHg));
dst.set_allocated_cardiaccyclecentralvenouspressure_mmhg(PBProperty::Unload(*src.m_CardiacCycleCentralVenousPressure_mmHg));
dst.set_allocated_cardiaccyclecerebralbloodflow_ml_per_s(PBProperty::Unload(*src.m_CardiacCycleCerebralBloodFlow_mL_Per_s));
dst.set_allocated_cardiaccyclecerebralperfusionpressure_mmhg(PBProperty::Unload(*src.m_CardiacCycleCerebralPerfusionPressure_mmHg));
dst.set_allocated_cardiaccycleskinflow_ml_per_s(PBProperty::Unload(*src.m_CardiacCycleSkinFlow_mL_Per_s));
for (auto* l : src.m_HemorrhageLinks)
......
......@@ -73,6 +73,8 @@ Cardiovascular::Cardiovascular(PulseData& data) : PulseCardiovascularSystem(data
m_CardiacCyclePulmonaryShuntFlow_mL_Per_s = new SERunningAverage();
m_CardiacCyclePulmonaryArteryPressure_mmHg = new SERunningAverage();
m_CardiacCycleCentralVenousPressure_mmHg = new SERunningAverage();
m_CardiacCycleCerebralBloodFlow_mL_Per_s = new SERunningAverage();
m_CardiacCycleCerebralPerfusionPressure_mmHg = new SERunningAverage();
m_CardiacCycleSkinFlow_mL_Per_s = new SERunningAverage();
Clear();
}
......@@ -89,6 +91,8 @@ Cardiovascular::~Cardiovascular()
delete m_CardiacCyclePulmonaryShuntFlow_mL_Per_s;
delete m_CardiacCyclePulmonaryArteryPressure_mmHg;
delete m_CardiacCycleCentralVenousPressure_mmHg;
delete m_CardiacCycleCerebralBloodFlow_mL_Per_s;
delete m_CardiacCycleCerebralPerfusionPressure_mmHg;
delete m_CardiacCycleSkinFlow_mL_Per_s;
}
......@@ -168,6 +172,8 @@ void Cardiovascular::Clear()
m_CardiacCyclePulmonaryShuntFlow_mL_Per_s->Clear();
m_CardiacCyclePulmonaryArteryPressure_mmHg->Clear();
m_CardiacCycleCentralVenousPressure_mmHg->Clear();
m_CardiacCycleCerebralBloodFlow_mL_Per_s->Clear();
m_CardiacCycleCerebralPerfusionPressure_mmHg->Clear();
m_CardiacCycleSkinFlow_mL_Per_s->Clear();
m_HemorrhageLinks.clear();
......@@ -223,6 +229,8 @@ void Cardiovascular::Initialize()
// Set system data based on physiology norms
GetMeanCentralVenousPressure().SetValue(5.0, PressureUnit::mmHg);
GetMeanCerebralBloodFlow().SetValue(0, VolumePerTimeUnit::mL_Per_s);
GetMeanCerebralPerfusionPressure().SetValue(85, PressureUnit::mmHg);
m_CardiacCycleArterialCO2PartialPressure_mmHg->Sample(60.0);
m_LastCardiacCycleMeanArterialCO2PartialPressure_mmHg = 60.0;
GetMeanArterialCarbonDioxidePartialPressure().SetValue(60, PressureUnit::mmHg);
......@@ -661,6 +669,8 @@ void Cardiovascular::CalculateVitalSigns()
// Grab data from the circuit in order to calculate a running mean
double AortaNodePressure_mmHg = m_Aorta->GetPressure(PressureUnit::mmHg);
double AortaNodeCO2PartialPressure_mmHg = m_AortaCO2 == nullptr ? 0 : m_AortaCO2->GetPartialPressure(PressureUnit::mmHg); // This is here so we can Tune circuit w/o substances
double BrainFlow_mL_Per_s = m_Brain->GetInFlow(VolumePerTimeUnit::mL_Per_s);
double BrainNodePerfusionPressure_mmHg = AortaNodePressure_mmHg - m_Brain->GetPressure(PressureUnit::mmHg);
double LeftPulmonaryArteryVolume_mL = m_LeftPulmonaryArteries->GetVolume(VolumeUnit::mL);
double RightPulmonaryArteryVolume_mL = m_RightPulmonaryArteries->GetVolume(VolumeUnit::mL);
double TotalPulmonaryArteryVolume_mL = LeftPulmonaryArteryVolume_mL + RightPulmonaryArteryVolume_mL;
......@@ -685,7 +695,6 @@ void Cardiovascular::CalculateVitalSigns()
double SkinFlow_mL_Per_s = m_pAortaToSkin->GetNextFlow(VolumePerTimeUnit::mL_Per_s);
double LHeartFlow_mL_Per_s = m_LeftHeartToAorta->GetNextFlow(VolumePerTimeUnit::mL_Per_s);
double LHeartVolume_mL = m_LeftHeart->GetVolume(VolumeUnit::mL);
double muscleFlow_mL_Per_s = m_pAortaToMuscle->GetNextFlow(VolumePerTimeUnit::mL_Per_s);
double gutFlow_mL_Per_s = m_pAortaToLargeIntestine->GetNextFlow(VolumePerTimeUnit::mL_Per_s) +
......@@ -726,6 +735,8 @@ void Cardiovascular::CalculateVitalSigns()
m_CardiacCyclePulmonaryShuntFlow_mL_Per_s->Sample(PulmShuntFlow_mL_Per_s);
m_CardiacCyclePulmonaryArteryPressure_mmHg->Sample(PulmonaryArteryNodePressure_mmHg);
m_CardiacCycleCentralVenousPressure_mmHg->Sample(VenaCavaPressure_mmHg);
m_CardiacCycleCerebralBloodFlow_mL_Per_s->Sample(BrainFlow_mL_Per_s);
m_CardiacCycleCerebralPerfusionPressure_mmHg->Sample(BrainNodePerfusionPressure_mmHg);
m_CardiacCycleSkinFlow_mL_Per_s->Sample(SkinFlow_mL_Per_s);
/// \todo Make sure irreversible state is hit before we get here.
......@@ -882,6 +893,12 @@ void Cardiovascular::RecordAndResetCardiacCycle()
// Mean Central Venous Pressure
GetMeanCentralVenousPressure().SetValue(m_CardiacCycleCentralVenousPressure_mmHg->Value(), PressureUnit::mmHg);
m_CardiacCycleCentralVenousPressure_mmHg->Clear();
// Mean Cerebral Blood Flow
GetMeanCerebralBloodFlow().SetValue(m_CardiacCycleCerebralBloodFlow_mL_Per_s->Value(), VolumePerTimeUnit::mL_Per_s);
m_CardiacCycleCerebralBloodFlow_mL_Per_s->Clear();
// Mean Cerebral Perfusion Pressure
GetMeanCerebralPerfusionPressure().SetValue(m_CardiacCycleCerebralPerfusionPressure_mmHg->Value(), PressureUnit::mmHg);
m_CardiacCycleCerebralPerfusionPressure_mmHg->Clear();
// Mean Skin Flow
GetMeanSkinFlow().SetValue(m_CardiacCycleSkinFlow_mL_Per_s->Value(), VolumePerTimeUnit::mL_Per_s);
m_CardiacCycleSkinFlow_mL_Per_s->Clear();
......@@ -2019,26 +2036,29 @@ void Cardiovascular::AdjustVascularTone()
double UpdatedCompliance_mL_Per_mmHg = 0.0;
double totalResistanceChange_mmHg_s_Per_mL = 0.0;
double totalComplianceChange_mL_Per_mmHg = 0.0;
if (m_data.GetNervous().HasBaroreceptorResistanceScale())
if (m_data.GetConfiguration().IsNervousFeedbackEnabled())
{
for (SEFluidCircuitPath* Path : m_systemicResistancePaths)
if (m_data.GetNervous().HasBaroreceptorResistanceScale())
{
/// \todo We are treating all systemic resistance paths equally, including the brain.
UpdatedResistance_mmHg_s_Per_mL = m_data.GetNervous().GetBaroreceptorResistanceScale().GetValue()*Path->GetResistanceBaseline(PressureTimePerVolumeUnit::mmHg_s_Per_mL);
if (UpdatedResistance_mmHg_s_Per_mL < m_minIndividialSystemicResistance__mmHg_s_Per_mL)
for (SEFluidCircuitPath* Path : m_systemicResistancePaths)
{
UpdatedResistance_mmHg_s_Per_mL = m_minIndividialSystemicResistance__mmHg_s_Per_mL;
/// \todo We are treating all systemic resistance paths equally, including the brain.
UpdatedResistance_mmHg_s_Per_mL = m_data.GetNervous().GetBaroreceptorResistanceScale().GetValue() * Path->GetResistanceBaseline(PressureTimePerVolumeUnit::mmHg_s_Per_mL);
if (UpdatedResistance_mmHg_s_Per_mL < m_minIndividialSystemicResistance__mmHg_s_Per_mL)
{
UpdatedResistance_mmHg_s_Per_mL = m_minIndividialSystemicResistance__mmHg_s_Per_mL;
}
Path->GetNextResistance().SetValue(UpdatedResistance_mmHg_s_Per_mL, PressureTimePerVolumeUnit::mmHg_s_Per_mL);
}
Path->GetNextResistance().SetValue(UpdatedResistance_mmHg_s_Per_mL, PressureTimePerVolumeUnit::mmHg_s_Per_mL);
}
}
if (m_data.GetNervous().HasBaroreceptorComplianceScale())
{
for (SEFluidCircuitPath* Path : m_systemicCompliancePaths)
if (m_data.GetNervous().HasBaroreceptorComplianceScale())
{
UpdatedCompliance_mL_Per_mmHg = m_data.GetNervous().GetBaroreceptorComplianceScale().GetValue()*Path->GetComplianceBaseline(VolumePerPressureUnit::mL_Per_mmHg);
Path->GetNextCompliance().SetValue(UpdatedCompliance_mL_Per_mmHg, VolumePerPressureUnit::mL_Per_mmHg);
for (SEFluidCircuitPath* Path : m_systemicCompliancePaths)
{
UpdatedCompliance_mL_Per_mmHg = m_data.GetNervous().GetBaroreceptorComplianceScale().GetValue() * Path->GetComplianceBaseline(VolumePerPressureUnit::mL_Per_mmHg);
Path->GetNextCompliance().SetValue(UpdatedCompliance_mL_Per_mmHg, VolumePerPressureUnit::mL_Per_mmHg);
}
}
}
......
......@@ -129,6 +129,8 @@ protected:
SERunningAverage* m_CardiacCyclePulmonaryShuntFlow_mL_Per_s;
SERunningAverage* m_CardiacCyclePulmonaryArteryPressure_mmHg;
SERunningAverage* m_CardiacCycleCentralVenousPressure_mmHg;
SERunningAverage* m_CardiacCycleCerebralBloodFlow_mL_Per_s;
SERunningAverage* m_CardiacCycleCerebralPerfusionPressure_mmHg;
SERunningAverage* m_CardiacCycleSkinFlow_mL_Per_s;
// Stateless member variable (Set in SetUp())
......
......@@ -169,6 +169,9 @@ bool SARunner::RunSimulationUntilStable(std::string const& outDir, pulse::study:
pulse->GetEngineTracker()->GetDataRequestManager().CreatePhysiologyDataRequest("HeartStrokeVolume", VolumeUnit::mL);
pulse->GetEngineTracker()->GetDataRequestManager().CreatePhysiologyDataRequest("IntracranialPressure", PressureUnit::mmHg);
pulse->GetEngineTracker()->GetDataRequestManager().CreatePhysiologyDataRequest("MeanArterialPressure", PressureUnit::mmHg);
pulse->GetEngineTracker()->GetDataRequestManager().CreatePhysiologyDataRequest("MeanCentralVenousPressure", PressureUnit::mmHg);
pulse->GetEngineTracker()->GetDataRequestManager().CreatePhysiologyDataRequest("MeanCerebralBloodFlow", VolumePerTimeUnit::L_Per_min);
pulse->GetEngineTracker()->GetDataRequestManager().CreatePhysiologyDataRequest("MeanCerebralPerfusionPressure", PressureUnit::mmHg);
pulse->GetEngineTracker()->GetDataRequestManager().CreatePhysiologyDataRequest("PulmonaryArterialPressure", PressureUnit::mmHg);
pulse->GetEngineTracker()->GetDataRequestManager().CreatePhysiologyDataRequest("PulmonaryCapillariesWedgePressure", PressureUnit::mmHg);
pulse->GetEngineTracker()->GetDataRequestManager().CreatePhysiologyDataRequest("PulmonaryDiastolicArterialPressure", PressureUnit::mmHg);
......@@ -243,7 +246,10 @@ bool SARunner::RunSimulationUntilStable(std::string const& outDir, pulse::study:
//double currentMeanCVP_mmHg = pulse->GetCardiovascularSystem()->GetMeanCentralVenousPressure(PressureUnit::mmHg);
double currentBlood_mL = pulse->GetCardiovascularSystem()->GetBloodVolume(VolumeUnit::mL);
pulse->GetEngineTracker()->TrackData(time_s);
stableTime_s += timeStep_s;
time_s += timeStep_s;
bool stableMAP = true;
if (GeneralMath::PercentDifference(previoustMap_mmHg, currentMap_mmHg) > stabPercentTolerance)
{
......@@ -285,10 +291,6 @@ bool SARunner::RunSimulationUntilStable(std::string const& outDir, pulse::study:
}
}
// TODO BF Check that what we overrided is still set to the same value
// This ensures the engine did not do anything to our resistances for some reason
// If they are different, we need to return false and look into why
// Fill out our results
sim.set_achievedstabilization(stable);
sim.set_stabilizationtime_s(profiler.GetElapsedTime_s("Total"));
......@@ -304,6 +306,9 @@ bool SARunner::RunSimulationUntilStable(std::string const& outDir, pulse::study:
sim.set_heartstrokevolume_ml(pulse->GetCardiovascularSystem()->GetHeartStrokeVolume(VolumeUnit::mL));
sim.set_intracranialpressure_mmhg(pulse->GetCardiovascularSystem()->GetIntracranialPressure(PressureUnit::mmHg));
sim.set_meanarterialpressure_mmhg(pulse->GetCardiovascularSystem()->GetMeanArterialPressure(PressureUnit::mmHg));
sim.set_meancentralvenouspressure_mmhg(pulse->GetCardiovascularSystem()->GetMeanCentralVenousPressure(PressureUnit::mmHg));
sim.set_meancerebralbloodflow_l_per_min(pulse->GetCardiovascularSystem()->GetMeanCerebralBloodFlow(VolumePerTimeUnit::L_Per_min));
sim.set_meancerebralperfusionpressure_mmhg(pulse->GetCardiovascularSystem()->GetMeanCerebralPerfusionPressure(PressureUnit::mmHg));
sim.set_pulmonaryarterialpressure_mmhg(pulse->GetCardiovascularSystem()->GetPulmonaryArterialPressure(PressureUnit::mmHg));
sim.set_pulmonarycapillarieswedgepressure_mmhg(pulse->GetCardiovascularSystem()->GetPulmonaryCapillariesWedgePressure(PressureUnit::mmHg));
sim.set_pulmonarydiastolicarterialpressure_mmhg(pulse->GetCardiovascularSystem()->GetPulmonaryDiastolicArterialPressure(PressureUnit::mmHg));
......
......@@ -33,12 +33,12 @@ int main(int argc, char* argv[])
// Add some overrides
auto c = sim->mutable_overrides()->add_scalaroverride();
c->set_name("RightHeart1ToRightHeart3");
c->set_value(0.5);
c->set_value(41.150948289976427);
c->set_unit(VolumePerPressureUnit::mL_Per_mmHg.GetString());
auto r = sim->mutable_overrides()->add_scalaroverride();
r->set_name("Aorta1ToLiver1");
r->set_value(0.5);
r->set_value(10.3107256153246);
r->set_unit(PressureTimePerVolumeUnit::mmHg_s_Per_mL.GetString());
sar.Run(simList);
......@@ -54,6 +54,17 @@ int main(int argc, char* argv[])
std::cout << "Generated " << simList.simulation_size() << " simulations" << std::endl;
return !sar.Run(simList);
}
else if (mode == "sim_list")
{
if (argc != 3)
{
std::cerr << "Please provide a SimulationListData json file" << std::endl;
return 1;
}
SARunner sar("./test_results/sesitivity_analysis/SensitivityAnalysisRunner.log");
sar.Run(argv[2], SerializationFormat::JSON);
}
}
catch (std::exception ex)
{
......
......@@ -83,19 +83,21 @@ message CardiovascularSystemData
ScalarPressureData MeanArterialCarbonDioxidePartialPressure = 15;/**<< @brief The mean of the partial pressure of carbon dioxide in the aorta over a cardiac cycle.*/
ScalarPressureData MeanArterialCarbonDioxidePartialPressureDelta = 16;/**<< @brief The change of the the mean of the partial pressure of carbon dioxide in the aorta from the previous cardiac cycle.*/
ScalarPressureData MeanCentralVenousPressure = 17;/**<< @brief The average pressure in the vena cava over the course of a cardiac cycle.*/
ScalarVolumePerTimeData MeanSkinFlow = 18;/**<< @brief The blood flow to the skin averaged over the current cardiac cycle time*/
ScalarPressureData PulmonaryArterialPressure = 19;/**<< @brief The current pressure in the pulmonary arteries.*/
ScalarPressureData PulmonaryCapillariesWedgePressure = 20;/**<< @brief The pressure within the pulmonary capillaries.*/
ScalarPressureData PulmonaryDiastolicArterialPressure = 21;/**<< @brief The minimum pressure that occurs in the pulmonary arteries over the course of a cardiac cycle.*/
ScalarPressureData PulmonaryMeanArterialPressure = 22;/**<< @brief The average pressure that occurs in the pulmonary arteries over the course of a cardiac cycle.*/
ScalarVolumePerTimeData PulmonaryMeanCapillaryFlow = 23;/**<< @brief The average blood flow in the pulmonary capillaries over the course of a cardiac cycle.*/
ScalarVolumePerTimeData PulmonaryMeanShuntFlow = 24;/**<< @brief The average blood flow diverted from the pulmonary capillaries (not oxygenated) over the course of a cardiac cycle.*/
ScalarPressureData PulmonarySystolicArterialPressure = 25;/**<< @brief The maximum pressure in the pulmonary arteries over the course of a cardiac cycle.*/
ScalarPressureTimePerVolumeData PulmonaryVascularResistance = 26;/**<< @brief The resistance offered by the pulmonary circulation.*/
ScalarPressureTimePerVolumeAreaData PulmonaryVascularResistanceIndex = 27;/**<< @brief Relates pulmonary circulation performance to the size of the individual. */
ScalarPressureData PulsePressure = 28;/**<< @brief The difference between the systolic and diastolic pressures.*/
ScalarPressureTimePerVolumeData SystemicVascularResistance = 29;/**<< @brief The resistance to blood flow through the entire systemic vasculature, not including the pulmonary circulation.*/
ScalarPressureData SystolicArterialPressure = 30;/**<< @brief The maximum pressure in the aorta over the course of a cardiac cycle.*/
ScalarVolumePerTimeData MeanCerebralBloodFlow = 18;/**<< @brief The blood flow to the brain averaged over the current cardiac cycle time*/
ScalarPressureData MeanCerebralPerfusionPressure = 19;/**<< @brief The average pressure in the brain over the course of a cardiac cycle.*/
ScalarVolumePerTimeData MeanSkinFlow = 20;/**<< @brief The blood flow to the skin averaged over the current cardiac cycle time*/
ScalarPressureData PulmonaryArterialPressure = 21;/**<< @brief The current pressure in the pulmonary arteries.*/
ScalarPressureData PulmonaryCapillariesWedgePressure = 22;/**<< @brief The pressure within the pulmonary capillaries.*/
ScalarPressureData PulmonaryDiastolicArterialPressure = 23;/**<< @brief The minimum pressure that occurs in the pulmonary arteries over the course of a cardiac cycle.*/
ScalarPressureData PulmonaryMeanArterialPressure = 24;/**<< @brief The average pressure that occurs in the pulmonary arteries over the course of a cardiac cycle.*/
ScalarVolumePerTimeData PulmonaryMeanCapillaryFlow = 25;/**<< @brief The average blood flow in the pulmonary capillaries over the course of a cardiac cycle.*/
ScalarVolumePerTimeData PulmonaryMeanShuntFlow = 26;/**<< @brief The average blood flow diverted from the pulmonary capillaries (not oxygenated) over the course of a cardiac cycle.*/
ScalarPressureData PulmonarySystolicArterialPressure = 27;/**<< @brief The maximum pressure in the pulmonary arteries over the course of a cardiac cycle.*/
ScalarPressureTimePerVolumeData PulmonaryVascularResistance = 28;/**<< @brief The resistance offered by the pulmonary circulation.*/
ScalarPressureTimePerVolumeAreaData PulmonaryVascularResistanceIndex = 29;/**<< @brief Relates pulmonary circulation performance to the size of the individual. */
ScalarPressureData PulsePressure = 30;/**<< @brief The difference between the systolic and diastolic pressures.*/
ScalarPressureTimePerVolumeData SystemicVascularResistance = 31;/**<< @brief The resistance to blood flow through the entire systemic vasculature, not including the pulmonary circulation.*/
ScalarPressureData SystolicArterialPressure = 32;/**<< @brief The maximum pressure in the aorta over the course of a cardiac cycle.*/
}
/** @brief Provides transport of drugs through the blood and air in the cardiovascular and respiratory systems, respectively.
......
......@@ -51,12 +51,14 @@ message CardiovascularData
pulse.cdm.bind.RunningAverageData CardiacCyclePulmonaryShuntFlow_mL_Per_s = 29;
pulse.cdm.bind.RunningAverageData CardiacCyclePulmonaryArteryPressure_mmHg = 30;
pulse.cdm.bind.RunningAverageData CardiacCycleCentralVenousPressure_mmHg = 31;
pulse.cdm.bind.RunningAverageData CardiacCycleSkinFlow_mL_Per_s = 32;
pulse.cdm.bind.RunningAverageData CardiacCycleCerebralBloodFlow_mL_Per_s = 32;
pulse.cdm.bind.RunningAverageData CardiacCycleCerebralPerfusionPressure_mmHg = 33;
pulse.cdm.bind.RunningAverageData CardiacCycleSkinFlow_mL_Per_s = 34;
repeated string HemorrhageLinks = 33;
repeated string HemorrhagePaths = 34;
repeated string InternalHemorrhageLinks = 35;
repeated string InternalHemorrhagePaths = 36;
repeated string HemorrhageLinks = 35;
repeated string HemorrhagePaths = 36;
repeated string InternalHemorrhageLinks = 37;
repeated string InternalHemorrhagePaths = 38;
}
message DrugData
......
......@@ -26,18 +26,21 @@ message SimulationData
double HeartStrokeVolume_mL = 13;
double IntracranialPressure_mmHg = 14;
double MeanArterialPressure_mmHg = 15;
double PulmonaryArterialPressure_mmHg = 16;
double PulmonaryCapillariesWedgePressure_mmHg = 17;
double PulmonaryDiastolicArterialPressure_mmHg = 18;
double PulmonaryMeanArterialPressure_mmHg = 19;
double PulmonaryMeanCapillaryFlow_L_Per_min = 20;
double PulmonarySystolicArterialPressure_mmHg = 21;
double SystolicArterialPressure_mmHg = 22;
double SystemicVascularResistance_mmHg_s_Per_L = 23;
double MeanCentralVenousPressure_mmHg = 16;
double MeanCerebralBloodFlow_L_Per_min = 17;
double MeanCerebralPerfusionPressure_mmHg = 18;
double PulmonaryArterialPressure_mmHg = 19;
double PulmonaryCapillariesWedgePressure_mmHg = 20;
double PulmonaryDiastolicArterialPressure_mmHg = 21;
double PulmonaryMeanArterialPressure_mmHg = 22;
double PulmonaryMeanCapillaryFlow_L_Per_min = 23;
double PulmonarySystolicArterialPressure_mmHg = 24;
double SystolicArterialPressure_mmHg = 25;
double SystemicVascularResistance_mmHg_s_Per_L = 26;
// Stabilization Information
bool AchievedStabilization = 24;
double StabilizationTime_s = 25;
bool AchievedStabilization = 27;
double StabilizationTime_s = 28;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment