Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pulse Physiology Suite
engine
Commits
e7ba5999
Commit
e7ba5999
authored
Jun 26, 2020
by
Aaron Bray
Browse files
Fix the engine unit tests
parent
cb1d27d6
Changes
16
Hide whitespace changes
Inline
Side-by-side
data/config/EngineUnitTests.config
View file @
e7ba5999
...
...
@@ -23,10 +23,11 @@ ReadScenarios = EngineUnitTestDriver NoCompare Computed=./test_results/unit_test
@
group
Cardiovascular
CardiovascularCircuitAndTransport
=
EngineUnitTest
Results
=
CardiovascularCircuitOutput
,
CardiovascularTransportOutput
CardiovascularAndCerebrospinalFluidCircuitAndTransport
=
EngineUnitTest
Results
=
CardiovascularAndCerebrospinalFluidCircuitOutput
,
CardiovascularAndCerebrospinalFluidTransportOutput
#
CardiovascularAndCerebrospinalFluidCircuitAndTransport = EngineUnitTest Results=CardiovascularAndCerebrospinalFluidCircuitOutput,CardiovascularAndCerebrospinalFluidTransportOutput
CardiovascularAndRenalCircuitAndTransport
=
EngineUnitTest
Results
=
CardiovascularAndRenalCircuitOutput
,
CardiovascularAndRenalTransportOutput
CardiovascularAndTissueCircuitAndTransport
=
EngineUnitTest
Results
=
CardiovascularAndTissueCircuitOutput
,
CardiovascularAndTissueTransportOutput
FullCardiovascularCircuitAndTransport
=
EngineUnitTest
Results
=
FullCardiovascularCircuitOutput
,
FullCardiovascularTransportOutput
# Turn on CSF in this test when ready
CardiovascularBloodGases
=
EngineUnitTest
Results
=
CardiovascularBloodGasesTestCircuitOutput
,
CardiovascularBloodGasesTestTransportOutput
TuneCardiovascularCircuit
=
EngineUnitTest
NoCompare
...
...
data/human/adult/baselines/unit_tests/pulse/CardiovascularTissueAndRenalCircuitOutput.zip.sha512
deleted
100644 → 0
View file @
cb1d27d6
67594bab991ed31835610311341e397ba802edf005183c678289294d01c82b8b62c49a09a3116337a6ed27e55c57d389df944bfff5882bbea4276c7c3b91b8b6
\ No newline at end of file
src/cpp/cpm/PulseConfiguration.cpp
View file @
e7ba5999
...
...
@@ -393,7 +393,7 @@ void PulseConfiguration::Initialize(const std::string& dataDir, SESubstanceManag
GetAirSpecificHeat
().
SetValue
(
1.0035
,
HeatCapacitancePerMassUnit
::
kJ_Per_K_kg
);
GetMolarMassOfDryAir
().
SetValue
(
0.028964
,
MassPerAmountUnit
::
kg_Per_mol
);
GetMolarMassOfWaterVapor
().
SetValue
(
0.018016
,
MassPerAmountUnit
::
kg_Per_mol
);
if
(
!
dataDir
.
empty
())
if
(
!
dataDir
.
empty
()
&&
subMgr
!=
nullptr
)
GetInitialEnvironmentalConditions
().
SerializeFromFile
(
dataDir
+
"/environments/Standard.json"
,
*
subMgr
);
GetWaterDensity
().
SetValue
(
1000
,
MassPerVolumeUnit
::
kg_Per_m3
);
...
...
src/cpp/cpm/physiology/Cardiovascular.cpp
View file @
e7ba5999
...
...
@@ -485,7 +485,7 @@ void Cardiovascular::ChronicAnemia()
if
(
path
->
HasResistanceBaseline
())
{
path
->
GetResistanceBaseline
().
SetValue
(
path
->
GetResistanceBaseline
(
PressureTimePerVolumeUnit
::
mmHg_s_Per_mL
)
*
viscousModifier
,
PressureTimePerVolumeUnit
::
mmHg_s_Per_mL
);
}
}
}
}
...
...
src/cpp/cpm/test/AerosolTest.cpp
View file @
e7ba5999
...
...
@@ -267,7 +267,7 @@ void PulseEngineTest::DepositionFractionTest(SETestSuite& suite, SESubstance& su
pc
.
SetupPatient
(
patient
);
pc
.
GetSubstances
().
LoadSubstanceDirectory
(
"./"
);
pc
.
GetSaturationCalculator
().
Setup
();
pc
.
m_Config
->
Initialize
(
"./"
);
pc
.
m_Config
->
Initialize
(
"./"
,
&
pc
.
GetSubstances
()
);
pc
.
m_Config
->
EnableRenal
(
eSwitch
::
Off
);
pc
.
m_Config
->
EnableTissue
(
eSwitch
::
Off
);
pc
.
CreateCircuitsAndCompartments
();
...
...
src/cpp/cpm/test/AnesthesiaCircuit.cpp
View file @
e7ba5999
...
...
@@ -57,7 +57,7 @@ void PulseEngineTest::AnesthesiaMachineCircuitAndTransportTest(RespiratoryConfig
pc
.
SetupPatient
(
patient
);
pc
.
GetSubstances
().
LoadSubstanceDirectory
(
"./"
);
pc
.
GetSaturationCalculator
().
Setup
();
pc
.
m_Config
->
Initialize
(
"./"
);
pc
.
m_Config
->
Initialize
(
"./"
,
&
pc
.
GetSubstances
()
);
pc
.
m_Config
->
EnableRenal
(
eSwitch
::
Off
);
pc
.
m_Config
->
EnableTissue
(
eSwitch
::
Off
);
pc
.
CreateCircuitsAndCompartments
();
...
...
src/cpp/cpm/test/CardiovascularCircuit.cpp
View file @
e7ba5999
...
...
@@ -60,13 +60,13 @@ void PulseEngineTest::CardiovascularAndCerebrospinalFluidCircuitAndTransportTest
}
void
PulseEngineTest
::
FullCardiovascularCircuitAndTransportTest
(
const
std
::
string
&
sTestDirectory
)
{
CardiovascularCircuitAndTransportTest
(
Heart
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
true
,
true
,
tru
e
,
false
,
sTestDirectory
,
"FullCardiovascular"
,
false
);
{
// \todo enable csf when ready
CardiovascularCircuitAndTransportTest
(
Heart
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
true
,
true
,
fals
e
,
false
,
sTestDirectory
,
"FullCardiovascular"
,
false
);
}
void
PulseEngineTest
::
CardiovascularBloodGasesTest
(
const
std
::
string
&
sTestDirectory
)
{
CardiovascularCircuitAndTransportTest
(
Heart
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
true
,
true
,
tru
e
,
true
,
sTestDirectory
,
"CardiovascularBloodGasesTest"
,
false
);
{
// \todo enable csf when ready
CardiovascularCircuitAndTransportTest
(
Heart
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
true
,
true
,
fals
e
,
true
,
sTestDirectory
,
"CardiovascularBloodGasesTest"
,
false
);
}
void
PulseEngineTest
::
TuneCardiovascularCircuitTest
(
const
std
::
string
&
sTestDirectory
)
...
...
@@ -207,7 +207,7 @@ void PulseEngineTest::CardiovascularCircuitAndTransportTest(CardiovascularDriver
pc
.
SetupPatient
(
patient
);
pc
.
GetSubstances
().
LoadSubstanceDirectory
(
"./"
);
pc
.
GetSaturationCalculator
().
Setup
();
pc
.
m_Config
->
Initialize
(
"./"
);
pc
.
m_Config
->
Initialize
(
"./"
,
&
pc
.
GetSubstances
()
);
if
(
heartRate_bpm
<=
0
)
heartRate_bpm
=
pc
.
GetCurrentPatient
().
GetHeartRateBaseline
(
FrequencyUnit
::
Per_min
);
else
...
...
src/cpp/cpm/test/FourCompartmentTest.cpp
View file @
e7ba5999
...
...
@@ -90,7 +90,7 @@ void PulseEngineTest::FourCompartmentTest(bool usingAcidBase, bool usingProducti
pc
.
SetupPatient
(
patient
);
pc
.
GetSubstances
().
LoadSubstanceDirectory
(
"./"
);
pc
.
GetSaturationCalculator
().
Setup
();
pc
.
m_Config
->
Initialize
(
"./"
);
pc
.
m_Config
->
Initialize
(
"./"
,
&
pc
.
GetSubstances
()
);
pc
.
m_Config
->
EnableRenal
(
eSwitch
::
Off
);
pc
.
m_Config
->
EnableTissue
(
eSwitch
::
Off
);
pc
.
CreateCircuitsAndCompartments
();
...
...
src/cpp/cpm/test/MechanicalVentilatorCircuit.cpp
View file @
e7ba5999
...
...
@@ -57,7 +57,7 @@ void PulseEngineTest::MechanicalVentilatorCircuitAndTransportTest(RespiratoryCon
pc
.
SetupPatient
(
patient
);
pc
.
GetSubstances
().
LoadSubstanceDirectory
(
"./"
);
pc
.
GetSaturationCalculator
().
Setup
();
pc
.
m_Config
->
Initialize
(
"./"
);
pc
.
m_Config
->
Initialize
(
"./"
,
&
pc
.
GetSubstances
()
);
pc
.
m_Config
->
EnableRenal
(
eSwitch
::
Off
);
pc
.
m_Config
->
EnableTissue
(
eSwitch
::
Off
);
pc
.
CreateCircuitsAndCompartments
();
...
...
src/cpp/cpm/test/NervousTests.cpp
View file @
e7ba5999
...
...
@@ -74,7 +74,7 @@ void PulseEngineTest::BrainInjuryTest(const std::string& sTestDirectory)
pc
.
SetupPatient
(
patient
);
pc
.
GetSubstances
().
LoadSubstanceDirectory
(
"./"
);
pc
.
GetSaturationCalculator
().
Setup
();
pc
.
m_Config
->
Initialize
(
"./"
);
pc
.
m_Config
->
Initialize
(
"./"
,
&
pc
.
GetSubstances
()
);
//Renal and Tissue are on
pc
.
m_Config
->
EnableRenal
(
eSwitch
::
On
);
pc
.
m_Config
->
EnableTissue
(
eSwitch
::
On
);
...
...
src/cpp/cpm/test/RenalCircuit.cpp
View file @
e7ba5999
...
...
@@ -55,7 +55,7 @@ void PulseEngineTest::RenalCircuitAndTransportTest(const std::string& sTestDirec
pc
.
SetupPatient
(
patient
);
pc
.
GetSubstances
().
LoadSubstanceDirectory
(
"./"
);
pc
.
GetSaturationCalculator
().
Setup
();
pc
.
m_Config
->
Initialize
(
"./"
);
pc
.
m_Config
->
Initialize
(
"./"
,
&
pc
.
GetSubstances
()
);
pc
.
m_Config
->
EnableRenal
(
eSwitch
::
On
);
pc
.
m_Config
->
EnableTissue
(
eSwitch
::
Off
);
pc
.
CreateCircuitsAndCompartments
();
...
...
@@ -186,7 +186,7 @@ void PulseEngineTest::RenalFeedbackTest(RenalFeedback feedback, const std::strin
pc
.
SetupPatient
(
patient
);
pc
.
GetSubstances
().
LoadSubstanceDirectory
(
"./"
);
pc
.
GetSaturationCalculator
().
Setup
();
pc
.
m_Config
->
Initialize
(
"./"
);
pc
.
m_Config
->
Initialize
(
"./"
,
&
pc
.
GetSubstances
()
);
pc
.
m_Config
->
EnableRenal
(
eSwitch
::
On
);
pc
.
m_Config
->
EnableTissue
(
eSwitch
::
Off
);
pc
.
CreateCircuitsAndCompartments
();
...
...
@@ -505,7 +505,7 @@ void PulseEngineTest::RenalSystemTest(RenalSystems systemtest, const std::string
pc
.
SetupPatient
(
patient
);
pc
.
GetSubstances
().
LoadSubstanceDirectory
(
"./"
);
pc
.
GetSaturationCalculator
().
Setup
();
pc
.
m_Config
->
Initialize
(
"./"
);
pc
.
m_Config
->
Initialize
(
"./"
,
&
pc
.
GetSubstances
()
);
pc
.
m_Config
->
EnableRenal
(
eSwitch
::
On
);
pc
.
m_Config
->
EnableTissue
(
eSwitch
::
Off
);
pc
.
CreateCircuitsAndCompartments
();
...
...
src/cpp/cpm/test/RespiratoryCircuit.cpp
View file @
e7ba5999
...
...
@@ -52,7 +52,7 @@ void PulseEngineTest::RespiratoryCircuitAndTransportTest(RespiratoryConfiguratio
pc
.
SetupPatient
(
patient
);
pc
.
GetSubstances
().
LoadSubstanceDirectory
(
"./"
);
pc
.
GetSaturationCalculator
().
Setup
();
pc
.
m_Config
->
Initialize
(
"./"
);
pc
.
m_Config
->
Initialize
(
"./"
,
&
pc
.
GetSubstances
()
);
pc
.
m_Config
->
EnableRenal
(
eSwitch
::
Off
);
pc
.
m_Config
->
EnableTissue
(
eSwitch
::
Off
);
pc
.
CreateCircuitsAndCompartments
();
...
...
@@ -218,7 +218,7 @@ void PulseEngineTest::RespiratoryDriverTest(const std::string& sTestDirectory)
pc
.
SetupPatient
(
patient
);
pc
.
GetSubstances
().
LoadSubstanceDirectory
(
"./"
);
pc
.
GetSaturationCalculator
().
Setup
();
pc
.
m_Config
->
Initialize
(
"./"
);
pc
.
m_Config
->
Initialize
(
"./"
,
&
pc
.
GetSubstances
()
);
pc
.
m_Config
->
EnableRenal
(
eSwitch
::
Off
);
pc
.
m_Config
->
EnableTissue
(
eSwitch
::
Off
);
pc
.
CreateCircuitsAndCompartments
();
...
...
src/cpp/cpm/test/SolverTests.cpp
View file @
e7ba5999
...
...
@@ -53,7 +53,7 @@ void PulseEngineTest::SolverSpeedTest(const std::string& rptDirectory)
pc
.
SetupPatient
(
patient
);
pc
.
GetSubstances
().
LoadSubstanceDirectory
(
"./"
);
pc
.
GetSaturationCalculator
().
Setup
();
pc
.
m_Config
->
Initialize
(
"./"
);
pc
.
m_Config
->
Initialize
(
"./"
,
&
pc
.
GetSubstances
()
);
pc
.
m_Config
->
EnableRenal
(
eSwitch
::
On
);
pc
.
m_Config
->
EnableTissue
(
eSwitch
::
On
);
pc
.
CreateCircuitsAndCompartments
();
...
...
src/cpp/cpm/test/TemperatureCircuit.cpp
View file @
e7ba5999
...
...
@@ -45,7 +45,7 @@ void PulseEngineTest::InternalTemperatureVariableBMRCircuitTest(const std::strin
pc
.
SetupPatient
(
patient
);
pc
.
GetSubstances
().
LoadSubstanceDirectory
(
"./"
);
pc
.
GetSaturationCalculator
().
Setup
();
pc
.
m_Config
->
Initialize
(
"./"
);
pc
.
m_Config
->
Initialize
(
"./"
,
&
pc
.
GetSubstances
()
);
pc
.
m_Config
->
EnableRenal
(
eSwitch
::
Off
);
pc
.
m_Config
->
EnableTissue
(
eSwitch
::
Off
);
pc
.
CreateCircuitsAndCompartments
();
...
...
@@ -124,7 +124,7 @@ void PulseEngineTest::InternalTemperatureVariableSkinCircuitTest(const std::stri
pc
.
SetupPatient
(
patient
);
pc
.
GetSubstances
().
LoadSubstanceDirectory
(
"./"
);
pc
.
GetSaturationCalculator
().
Setup
();
pc
.
m_Config
->
Initialize
(
"./"
);
pc
.
m_Config
->
Initialize
(
"./"
,
&
pc
.
GetSubstances
()
);
pc
.
m_Config
->
EnableRenal
(
eSwitch
::
Off
);
pc
.
m_Config
->
EnableTissue
(
eSwitch
::
Off
);
pc
.
CreateCircuitsAndCompartments
();
...
...
@@ -226,7 +226,7 @@ void PulseEngineTest::InternalTemperatureVariableCoreCircuitTest(const std::stri
pc
.
SetupPatient
(
patient
);
pc
.
GetSubstances
().
LoadSubstanceDirectory
(
"./"
);
pc
.
GetSaturationCalculator
().
Setup
();
pc
.
m_Config
->
Initialize
(
"./"
);
pc
.
m_Config
->
Initialize
(
"./"
,
&
pc
.
GetSubstances
()
);
pc
.
m_Config
->
EnableRenal
(
eSwitch
::
Off
);
pc
.
m_Config
->
EnableTissue
(
eSwitch
::
Off
);
pc
.
CreateCircuitsAndCompartments
();
...
...
@@ -327,7 +327,7 @@ void PulseEngineTest::EnvironmentVariableTemperatureCircuitTest(const std::strin
pc
.
SetupPatient
(
patient
);
pc
.
GetSubstances
().
LoadSubstanceDirectory
(
"./"
);
pc
.
GetSaturationCalculator
().
Setup
();
pc
.
m_Config
->
Initialize
(
"./"
);
pc
.
m_Config
->
Initialize
(
"./"
,
&
pc
.
GetSubstances
()
);
pc
.
m_Config
->
EnableRenal
(
eSwitch
::
Off
);
pc
.
m_Config
->
EnableTissue
(
eSwitch
::
Off
);
pc
.
CreateCircuitsAndCompartments
();
...
...
@@ -456,7 +456,7 @@ void PulseEngineTest::CombinedInternalAndEnvironmentVariableBMRandTemperatureCir
pc
.
SetupPatient
(
patient
);
pc
.
GetSubstances
().
LoadSubstanceDirectory
(
"./"
);
pc
.
GetSaturationCalculator
().
Setup
();
pc
.
m_Config
->
Initialize
(
"./"
);
pc
.
m_Config
->
Initialize
(
"./"
,
&
pc
.
GetSubstances
()
);
pc
.
m_Config
->
EnableRenal
(
eSwitch
::
Off
);
pc
.
m_Config
->
EnableTissue
(
eSwitch
::
Off
);
pc
.
CreateCircuitsAndCompartments
();
...
...
@@ -615,7 +615,7 @@ void PulseEngineTest::CombinedInternalAndEnvironmentSkinTempDropCircuitTest(cons
pc
.
SetupPatient
(
patient
);
pc
.
GetSubstances
().
LoadSubstanceDirectory
(
"./"
);
pc
.
GetSaturationCalculator
().
Setup
();
pc
.
m_Config
->
Initialize
(
"./"
);
pc
.
m_Config
->
Initialize
(
"./"
,
&
pc
.
GetSubstances
()
);
pc
.
m_Config
->
EnableRenal
(
eSwitch
::
Off
);
pc
.
m_Config
->
EnableTissue
(
eSwitch
::
Off
);
pc
.
CreateCircuitsAndCompartments
();
...
...
@@ -714,7 +714,7 @@ void PulseEngineTest::EnvironmentISO7730ComparisonTest(const std::string& sTestD
pc
.
SetupPatient
(
patient
);
pc
.
GetSubstances
().
LoadSubstanceDirectory
(
"./"
);
pc
.
GetSaturationCalculator
().
Setup
();
pc
.
m_Config
->
Initialize
(
"./"
);
pc
.
m_Config
->
Initialize
(
"./"
,
&
pc
.
GetSubstances
()
);
pc
.
m_Config
->
EnableRenal
(
eSwitch
::
Off
);
pc
.
m_Config
->
EnableTissue
(
eSwitch
::
Off
);
pc
.
CreateCircuitsAndCompartments
();
...
...
src/csharp/howto/HowTo_EngineUse.cs
View file @
e7ba5999
...
...
@@ -70,7 +70,7 @@ namespace HowTo_UseEngine
pulse
.
SetLogFilename
(
"./test_results/HowTo_EngineUse.cs.log"
);
// You can also have pulse log to the console (std::cout)
// By default, console logging is turned off
//
pulse.LogToConsole(true);
pulse
.
LogToConsole
(
true
);
// It is recommended to listen and manage the log messages yourself
// With a listener, you can add messages to a log, display, or write them to console
pulse
.
SetLogListener
(
new
MyLogListener
());
...
...
@@ -78,7 +78,7 @@ namespace HowTo_UseEngine
// You must provide an event listener to get events
pulse
.
SetEventHandler
(
new
MyEventHandler
());
InitializationType
initType
=
InitializationType
.
StateString
;
InitializationType
initType
=
InitializationType
.
PatientObject
;
switch
(
initType
)
{
case
InitializationType
.
StateFileName
:
...
...
src/csharp/pulse/cdm/system/equipment/mechanical_ventilator/SEMechanicalVentilator.cs
View file @
e7ba5999
...
...
@@ -33,8 +33,8 @@ namespace Pulse.CDM
// Expiration Cyclye (Only set one)
protected
SEScalarVolumePerTime
expiration_cycle_flow
;
protected
SEScalarPressure
expiration_cycle_pressure
;
protected
SEScalarVolume
expiration_cycle_volume
;
protected
SEScalarTime
expiration_cycle_time
;
protected
SEScalarVolume
expiration_cycle_volume
;
protected
SEScalarPressureTimePerVolume
expiration_tube_resistance
;
protected
SEScalarPressureTimePerVolume
expiration_valve_resistance
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment