Skip to content

Commit

Permalink
add smoke test for CVODE solver
Browse files Browse the repository at this point in the history
  • Loading branch information
jcschaff committed Jul 28, 2024
1 parent b9988df commit cf41797
Show file tree
Hide file tree
Showing 11 changed files with 1,538 additions and 13 deletions.
11 changes: 11 additions & 0 deletions IDAWin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ install(TARGETS IDAWin ARCHIVE DESTINATION bin)

enable_testing()

if (MINGW)
set(test_sundials_exe ${CMAKE_BINARY_DIR}/bin/${EXE_FILE}.exe)
else (MINGW)
set(test_sundials_exe ${CMAKE_BINARY_DIR}/bin/${EXE_FILE})
endif (MINGW)
set(test_dir ${CMAKE_CURRENT_SOURCE_DIR}/tests/smoke)

# smoke test as a bash script, for python test example, see NFsim/tests/smoke
add_test(NAME ${EXE_FILE}_smoke COMMAND bash -c "${test_dir}/smoke.sh ${test_sundials_exe}" WORKING_DIRECTORY ${test_dir})


add_executable(
hello_test
hello_test.cpp
Expand Down
13 changes: 13 additions & 0 deletions IDAWin/tests/smoke/SimID_1298727889_0_.cvodeInput
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
SOLVER CVODE
STARTING_TIME 0.0
ENDING_TIME 1.0
RELATIVE_TOLERANCE 1.0E-9
ABSOLUTE_TOLERANCE 1.0E-9
MAX_TIME_STEP 1.0
KEEP_EVERY 1
NUM_EQUATIONS 2
ODE s2 INIT 4.0;
RATE - ((2.0 * (-1.0 + (0.5 * s2)) * s2) - (4.0 * (3.5 - (0.5 * s2))));
ODE s4 INIT 0.0;
RATE 0.0;

10 changes: 10 additions & 0 deletions IDAWin/tests/smoke/SimID_1298727889_0_.functions
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
##---------------------------------------------
## /Users/jimschaff/.vcell/simdata/temp/SimID_1298727889_0_.functions
##---------------------------------------------

Compartment::J_r0; ((2.0 * (-1.0 + (0.5 * s2)) * s2) - (4.0 * (3.5 - (0.5 * s2)))); ; Nonspatial_VariableType; false
Compartment::J_r1; 0.0; ; Nonspatial_VariableType; false
Compartment::s0; (2.0 * (-1.0 + (0.5 * s2))); ; Nonspatial_VariableType; false
Compartment::s1; (2.0 * (3.5 - (0.5 * s2))); ; Nonspatial_VariableType; false
Compartment::s3; - s4; ; Nonspatial_VariableType; false

119 changes: 119 additions & 0 deletions IDAWin/tests/smoke/SimID_1298727889_0_.ida.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
t:s2:s4:
0.00000000000000000E+00 4.00000000000000000E+00 0.00000000000000000E+00
1.48651441805552199E-05 3.99997027324676591E+00 0.00000000000000000E+00
2.97302883611104398E-05 3.99994055002821147E+00 0.00000000000000000E+00
7.03106428215170950E-05 3.99985942617623413E+00 0.00000000000000000E+00
1.10890997281923754E-04 3.99977832572827419E+00 0.00000000000000000E+00
1.51471351742330412E-04 3.99969725062747017E+00 0.00000000000000000E+00
1.92051706202737071E-04 3.99961620151555541E+00 0.00000000000000000E+00
2.74093820841242409E-04 3.99945242312521154E+00 0.00000000000000000E+00
4.23421345978895161E-04 3.99915460021103986E+00 0.00000000000000000E+00
7.13707415631975399E-04 3.99857666180608273E+00 0.00000000000000000E+00
1.25048298686421104E-03 3.99751150465873417E+00 0.00000000000000000E+00
1.78725855809644656E-03 3.99645090736035824E+00 0.00000000000000000E+00
2.32403412932868231E-03 3.99539485021374796E+00 0.00000000000000000E+00
2.86080970056091805E-03 3.99434331293374800E+00 0.00000000000000000E+00
3.41939153934100971E-03 3.99325383810517343E+00 0.00000000000000000E+00
3.97797337812110137E-03 3.99216921527774415E+00 0.00000000000000000E+00
4.53655521690119346E-03 3.99108941996223487E+00 0.00000000000000000E+00
5.74213315960114649E-03 3.98877526015485628E+00 0.00000000000000000E+00
6.94771110230109866E-03 3.98648325034444317E+00 0.00000000000000000E+00
8.15328904500105082E-03 3.98421316501310141E+00 0.00000000000000000E+00
9.35886698770100299E-03 3.98196478241938001E+00 0.00000000000000000E+00
1.05644449304009552E-02 3.97973788336407264E+00 0.00000000000000000E+00
1.17700228731009073E-02 3.97753225090277418E+00 0.00000000000000000E+00
1.29756008158008595E-02 3.97534767037113479E+00 0.00000000000000000E+00
1.67234253004214344E-02 3.96868855030449730E+00 0.00000000000000000E+00
1.89337197523741334E-02 3.96485319172153172E+00 0.00000000000000000E+00
2.11440142043268324E-02 3.96108446456472141E+00 0.00000000000000000E+00
2.33543086562795314E-02 3.95738115285649039E+00 0.00000000000000000E+00
2.55646031082322304E-02 3.95374206395657302E+00 0.00000000000000000E+00
2.77748975601849295E-02 3.95016602693239616E+00 0.00000000000000000E+00
2.99851920121376285E-02 3.94665189325195254E+00 0.00000000000000000E+00
3.39049650973853797E-02 3.94056863534787771E+00 0.00000000000000000E+00
3.78247381826331344E-02 3.93467043053284460E+00 0.00000000000000000E+00
4.17445112678808891E-02 3.92895138505977526E+00 0.00000000000000000E+00
4.56642843531286438E-02 3.92340580883081591E+00 0.00000000000000000E+00
4.95840574383763985E-02 3.91802820674839003E+00 0.00000000000000000E+00
5.35038305236241532E-02 3.91281327107547749E+00 0.00000000000000000E+00
5.74236036088719079E-02 3.90775587446059802E+00 0.00000000000000000E+00
6.13433766941196626E-02 3.90285106322542541E+00 0.00000000000000000E+00
6.84728229020150347E-02 3.89430562565290339E+00 0.00000000000000000E+00
7.37428199410849750E-02 3.88828712325357273E+00 0.00000000000000000E+00
7.90128169801549152E-02 3.88251029559613814E+00 0.00000000000000000E+00
8.42828140192248554E-02 3.87696509848465487E+00 0.00000000000000000E+00
8.95528110582947956E-02 3.87164192979062172E+00 0.00000000000000000E+00
9.48228080973647358E-02 3.86653161204979012E+00 0.00000000000000000E+00
1.03895507740910858E-01 3.85820715640567258E+00 0.00000000000000000E+00
1.12968207384456981E-01 3.85044556500262702E+00 0.00000000000000000E+00
1.22040907028003104E-01 3.84320776397366703E+00 0.00000000000000000E+00
1.31113606671549227E-01 3.83645751934507606E+00 0.00000000000000000E+00
1.40186306315095349E-01 3.83016121349890604E+00 0.00000000000000000E+00
1.49259005958641472E-01 3.82428764594274551E+00 0.00000000000000000E+00
1.58331705602187595E-01 3.81880784918148475E+00 0.00000000000000000E+00
1.67404405245733717E-01 3.81369491665000870E+00 0.00000000000000000E+00
1.76477104889279840E-01 3.80892384475510415E+00 0.00000000000000000E+00
1.85549804532825963E-01 3.80447138986503042E+00 0.00000000000000000E+00
1.94622504176372085E-01 3.80031593806204171E+00 0.00000000000000000E+00
2.03695203819918208E-01 3.79643738500637262E+00 0.00000000000000000E+00
2.12767903463464331E-01 3.79281702477258964E+00 0.00000000000000000E+00
2.21840603107010453E-01 3.78943744750896849E+00 0.00000000000000000E+00
2.30913302750556576E-01 3.78628244550990312E+00 0.00000000000000000E+00
2.39986002394102699E-01 3.78333692677324018E+00 0.00000000000000000E+00
2.49058702037648821E-01 3.78058683512230864E+00 0.00000000000000000E+00
2.58131401681194972E-01 3.77801907631750922E+00 0.00000000000000000E+00
2.67204101324741095E-01 3.77562144978565639E+00 0.00000000000000000E+00
2.76276800968287217E-01 3.77338258555965789E+00 0.00000000000000000E+00
2.85349500611833340E-01 3.77129188596279263E+00 0.00000000000000000E+00
2.94422200255379463E-01 3.76933947156831506E+00 0.00000000000000000E+00
3.03494899898925585E-01 3.76751613113105677E+00 0.00000000000000000E+00
3.12567599542471708E-01 3.76581327519609887E+00 0.00000000000000000E+00
3.21640299186017831E-01 3.76422289308732960E+00 0.00000000000000000E+00
3.30712998829563953E-01 3.76273751299914583E+00 0.00000000000000000E+00
3.39785698473110076E-01 3.76135016494949248E+00 0.00000000000000000E+00
3.48858398116656199E-01 3.76005434638016833E+00 0.00000000000000000E+00
3.57931097760202321E-01 3.75884399020569138E+00 0.00000000000000000E+00
3.67003797403748444E-01 3.75771343512392031E+00 0.00000000000000000E+00
3.76076497047294567E-01 3.75665739801656251E+00 0.00000000000000000E+00
3.85149196690840689E-01 3.75567094828400894E+00 0.00000000000000000E+00
3.94221896334386812E-01 3.75474948397272268E+00 0.00000000000000000E+00
4.03294595977932935E-01 3.75388870956413268E+00 0.00000000000000000E+00
4.12367295621479057E-01 3.75308461530349158E+00 0.00000000000000000E+00
4.21439995265025180E-01 3.75233345795667939E+00 0.00000000000000000E+00
4.30512694908571303E-01 3.75163174289208223E+00 0.00000000000000000E+00
4.44159393104912537E-01 3.75066225727547398E+00 0.00000000000000000E+00
4.57806091301253770E-01 3.74978710730619946E+00 0.00000000000000000E+00
4.71452789497595004E-01 3.74899709401433023E+00 0.00000000000000000E+00
4.85099487693936238E-01 3.74828391848170916E+00 0.00000000000000000E+00
4.98746185890277471E-01 3.74764009455926406E+00 0.00000000000000000E+00
5.12392884086618761E-01 3.74705886856906956E+00 0.00000000000000000E+00
5.26039582282959994E-01 3.74653414626810255E+00 0.00000000000000000E+00
5.39686280479301228E-01 3.74606042778060777E+00 0.00000000000000000E+00
5.53332978675642462E-01 3.74563274969380977E+00 0.00000000000000000E+00
5.66979676871983695E-01 3.74524663281769499E+00 0.00000000000000000E+00
5.80626375068324929E-01 3.74489803471053317E+00 0.00000000000000000E+00
5.94273073264666163E-01 3.74458330675762285E+00 0.00000000000000000E+00
6.07919771461007397E-01 3.74429915562765103E+00 0.00000000000000000E+00
6.21566469657348630E-01 3.74404260864832494E+00 0.00000000000000000E+00
6.35213167853689864E-01 3.74381098255801570E+00 0.00000000000000000E+00
6.48859866050031098E-01 3.74360185524668188E+00 0.00000000000000000E+00
6.62506564246372331E-01 3.74341304024822019E+00 0.00000000000000000E+00
6.76153262442713565E-01 3.74324256376294118E+00 0.00000000000000000E+00
6.89799960639054799E-01 3.74308864395120899E+00 0.00000000000000000E+00
7.03446658835396033E-01 3.74294967224440933E+00 0.00000000000000000E+00
7.17093357031737266E-01 3.74282419646718356E+00 0.00000000000000000E+00
7.30740055228078500E-01 3.74271090560538200E+00 0.00000000000000000E+00
7.44386753424419734E-01 3.74260861606723871E+00 0.00000000000000000E+00
7.58033451620760967E-01 3.74251625928863207E+00 0.00000000000000000E+00
7.78504463495302002E-01 3.74239425897741995E+00 0.00000000000000000E+00
7.98975475369843036E-01 3.74228959135233685E+00 0.00000000000000000E+00
8.19446487244384070E-01 3.74219979287007698E+00 0.00000000000000000E+00
8.39917499118925104E-01 3.74212274979894621E+00 0.00000000000000000E+00
8.60388510993466138E-01 3.74205664985144182E+00 0.00000000000000000E+00
8.80859522868007172E-01 3.74199993902022765E+00 0.00000000000000000E+00
9.01330534742548206E-01 3.74195128387593856E+00 0.00000000000000000E+00
9.21801546617089240E-01 3.74190953994056041E+00 0.00000000000000000E+00
9.42272558491630274E-01 3.74187372523816819E+00 0.00000000000000000E+00
9.62743570366171308E-01 3.74184299751532601E+00 0.00000000000000000E+00
9.83214582240712343E-01 3.74181663430575906E+00 0.00000000000000000E+00
1.00000000000000000E+00 3.74179783640909713E+00 0.00000000000000000E+00
4 changes: 4 additions & 0 deletions IDAWin/tests/smoke/SimID_1298727889_0_.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
IDAData logfile
IDAData text format version 1
SimID_1298727889_0_.ida
KeepMost 1000
76 changes: 76 additions & 0 deletions IDAWin/tests/smoke/SimID_1298727889_0__0.simtask.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<SimulationTask xmlns="http://sourceforge.net/projects/vcell/vcml" TaskId="0" JobIndex="0" isPowerUser="false">
<MathDescription Name="Application0_generated">
<Constant Name="_F_">96485.3321</Constant>
<Constant Name="_F_nmol_">9.64853321E-5</Constant>
<Constant Name="_K_GHK_">1.0E-9</Constant>
<Constant Name="_N_pmol_">6.02214179E11</Constant>
<Constant Name="_PI_">3.141592653589793</Constant>
<Constant Name="_R_">8314.46261815</Constant>
<Constant Name="_T_">300.0</Constant>
<Constant Name="K_millivolts_per_volt">1000.0</Constant>
<Constant Name="Kf_r0">1.0</Constant>
<Constant Name="Kf_r1">0.0</Constant>
<Constant Name="KMOLE">0.001660538783162726</Constant>
<Constant Name="Kr_r0">2.0</Constant>
<Constant Name="Kr_r1">0.0</Constant>
<Constant Name="s0_init_uM">2.0</Constant>
<Constant Name="s1_init_uM">3.0</Constant>
<Constant Name="s2_init_uM">4.0</Constant>
<Constant Name="s3_init_uM">0.0</Constant>
<Constant Name="s4_init_uM">0.0</Constant>
<Constant Name="Size_c0">0.5</Constant>
<VolumeVariable Name="s2" Domain="Compartment" />
<VolumeVariable Name="s4" Domain="Compartment" />
<Function Name="J_r0" Domain="Compartment">(((Kf_r0 * s0) * s2) - (Kr_r0 * s1))</Function>
<Function Name="J_r1" Domain="Compartment">((Kf_r1 * s3) - (Kr_r1 * s4))</Function>
<Function Name="K_s0_total" Domain="Compartment">((Size_c0 * s0_init_uM) - (Size_c0 * s2_init_uM))</Function>
<Function Name="K_s1_total" Domain="Compartment">((Size_c0 * s1_init_uM) + (Size_c0 * s2_init_uM))</Function>
<Function Name="K_s3_total" Domain="Compartment">((Size_c0 * s3_init_uM) + (Size_c0 * s4_init_uM))</Function>
<Function Name="s0" Domain="Compartment">((K_s0_total + (Size_c0 * s2)) / Size_c0)</Function>
<Function Name="s1" Domain="Compartment">((K_s1_total - (Size_c0 * s2)) / Size_c0)</Function>
<Function Name="s3" Domain="Compartment">((K_s3_total - (Size_c0 * s4)) / Size_c0)</Function>
<CompartmentSubDomain Name="Compartment">
<BoundaryType Boundary="Xm" Type="Value" />
<BoundaryType Boundary="Xp" Type="Value" />
<BoundaryType Boundary="Ym" Type="Value" />
<BoundaryType Boundary="Yp" Type="Value" />
<BoundaryType Boundary="Zm" Type="Value" />
<BoundaryType Boundary="Zp" Type="Value" />
<OdeEquation Name="s2" SolutionType="Unknown">
<Rate>- J_r0</Rate>
<Initial>s2_init_uM</Initial>
</OdeEquation>
<OdeEquation Name="s4" SolutionType="Unknown">
<Rate>J_r1</Rate>
<Initial>s4_init_uM</Initial>
</OdeEquation>
</CompartmentSubDomain>
<Version Name="Application0_generated" KeyValue="95705054" BranchId="95705055" Archived="0" Date="06-Aug-2015 13:27:28" FromVersionable="false">
<Owner Name="schaff" Identifier="17" />
<GroupAccess Type="1" />
</Version>
</MathDescription>
<Simulation Name="Simulation0">
<SolverTaskDescription TaskType="Unsteady" UseSymbolicJacobian="false" Solver="Combined Stiff Solver (IDA/CVODE)">
<TimeBound StartTime="0.0" EndTime="1.0" />
<TimeStep DefaultTime="0.1" MinTime="1.0E-8" MaxTime="1.0" />
<ErrorTolerance Absolut="1.0E-9" Relative="1.0E-9" />
<OutputOptions KeepEvery="1" KeepAtMost="1000" />
<NumberProcessors>1</NumberProcessors>
</SolverTaskDescription>
<MathOverrides />
<Version Name="temp simulation" KeyValue="1298727889" BranchId="1" Archived="1" Date="28-Jul-2024 16:41:38" FromVersionable="false">
<Owner Name="temp" Identifier="123" />
<GroupAccess Type="1" />
</Version>
</Simulation>
<Geometry Name="non-spatial420951543" Dimension="0">
<Extent X="10.0" Y="10.0" Z="10.0" />
<Origin X="0.0" Y="0.0" Z="0.0" />
<SubVolume Name="Compartment" Handle="0" Type="Compartmental" KeyValue="95705043" />
<Version Name="non-spatial420951543" KeyValue="95705039" BranchId="95705040" Archived="0" Date="06-Aug-2015 13:27:28" FromVersionable="false">
<Owner Name="schaff" Identifier="17" />
<GroupAccess Type="1" />
</Version>
</Geometry>
</SimulationTask>
Loading

0 comments on commit cf41797

Please sign in to comment.