From 42fec0fe46b6f2f9c780757391e717982c10fb65 Mon Sep 17 00:00:00 2001 From: jcschaff Date: Sun, 28 Jul 2024 23:14:20 -0400 Subject: [PATCH] add smoke test for CVODE solver --- .gitignore | 2 + IDAWin/CMakeLists.txt | 13 + IDAWin/SundialsSolverStandalone.cpp | 6 + .../smoke/SimID_1489333437_0_.cvodeInput | 14 + .../tests/smoke/SimID_1489333437_0_.functions | 10 + .../smoke/SimID_1489333437_0_.ida.expected | 9 + IDAWin/tests/smoke/SimID_1489333437_0_.log | 3 + .../smoke/SimID_1489333437_0__0.simtask.xml | 76 +++ .../tests/smoke/simpleModel_Network_orig.vcml | 621 ++++++++++++++++++ IDAWin/tests/smoke/smoke.py | 72 ++ NFsim_v1.11/CMakeLists.txt | 7 +- .../tests/smoke/simpleModel_Network_orig.vcml | 621 ++++++++++++++++++ NFsim_v1.11/tests/smoke/smoke.sh | 21 +- 13 files changed, 1462 insertions(+), 13 deletions(-) create mode 100644 IDAWin/tests/smoke/SimID_1489333437_0_.cvodeInput create mode 100644 IDAWin/tests/smoke/SimID_1489333437_0_.functions create mode 100644 IDAWin/tests/smoke/SimID_1489333437_0_.ida.expected create mode 100644 IDAWin/tests/smoke/SimID_1489333437_0_.log create mode 100644 IDAWin/tests/smoke/SimID_1489333437_0__0.simtask.xml create mode 100644 IDAWin/tests/smoke/simpleModel_Network_orig.vcml create mode 100755 IDAWin/tests/smoke/smoke.py create mode 100644 NFsim_v1.11/tests/smoke/simpleModel_Network_orig.vcml diff --git a/.gitignore b/.gitignore index f006e512..c0b8d3fa 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,5 @@ NFsim_v1.11/tests/smoke/SimID_273069657_0_.gdat NFsim_v1.11/tests/smoke/SimID_273069657_0_.species + +IDAWin/tests/smoke/SimID_1489333437_0_.ida diff --git a/IDAWin/CMakeLists.txt b/IDAWin/CMakeLists.txt index 0be56202..0dcf9f0a 100644 --- a/IDAWin/CMakeLists.txt +++ b/IDAWin/CMakeLists.txt @@ -35,6 +35,19 @@ install(TARGETS IDAWin ARCHIVE DESTINATION bin) enable_testing() +if (MINGW) + set(test_sundials_exe ${CMAKE_BINARY_DIR}/bin/${EXE_FILE}.exe) + set(python_cmd py) +else (MINGW) + set(test_sundials_exe ${CMAKE_BINARY_DIR}/bin/${EXE_FILE}) + set(python_cmd python3) +endif (MINGW) +set(test_dir ${CMAKE_CURRENT_SOURCE_DIR}/tests/smoke) + +# smoke test as a python script, for bash test example, see NFsim/tests/smoke +add_test(NAME ${EXE_FILE}_smoke COMMAND ${python_cmd} ${test_dir}/smoke.py ${test_sundials_exe} WORKING_DIRECTORY ${test_dir}) + + add_executable( hello_test hello_test.cpp diff --git a/IDAWin/SundialsSolverStandalone.cpp b/IDAWin/SundialsSolverStandalone.cpp index bf88dadd..bbdcf3e6 100644 --- a/IDAWin/SundialsSolverStandalone.cpp +++ b/IDAWin/SundialsSolverStandalone.cpp @@ -194,6 +194,12 @@ int main(int argc, char *argv[]) { break; } } +#ifdef USE_MESSAGING + // should only happen during testing for solver compiled with messaging but run locally. + if (SimulationMessaging::getInstVar() == nullptr) { + SimulationMessaging::create(); + } +#endif if (solver.empty()) { throw "Solver not defined "; diff --git a/IDAWin/tests/smoke/SimID_1489333437_0_.cvodeInput b/IDAWin/tests/smoke/SimID_1489333437_0_.cvodeInput new file mode 100644 index 00000000..7afffdd1 --- /dev/null +++ b/IDAWin/tests/smoke/SimID_1489333437_0_.cvodeInput @@ -0,0 +1,14 @@ +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 +OUTPUT_TIMES 8 +0.0 1.0E-5 1.0E-4 0.001 0.01 0.1 0.5 1.0 +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; + diff --git a/IDAWin/tests/smoke/SimID_1489333437_0_.functions b/IDAWin/tests/smoke/SimID_1489333437_0_.functions new file mode 100644 index 00000000..bb726212 --- /dev/null +++ b/IDAWin/tests/smoke/SimID_1489333437_0_.functions @@ -0,0 +1,10 @@ +##--------------------------------------------- +## /Users/jimschaff/.vcell/simdata/temp/SimID_1489333437_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 + diff --git a/IDAWin/tests/smoke/SimID_1489333437_0_.ida.expected b/IDAWin/tests/smoke/SimID_1489333437_0_.ida.expected new file mode 100644 index 00000000..eb40f12d --- /dev/null +++ b/IDAWin/tests/smoke/SimID_1489333437_0_.ida.expected @@ -0,0 +1,9 @@ +t:s2:s4: +0.00000000000000000E+00 4.00000000000000000E+00 0.00000000000000000E+00 +1.00000000000000008E-05 3.99998000095349759E+00 0.00000000000000000E+00 +1.00000000000000005E-04 3.99980008070643711E+00 0.00000000000000000E+00 +1.00000000000000002E-03 3.99800797408532871E+00 0.00000000000000000E+00 +1.00000000000000002E-02 3.98077784306128457E+00 0.00000000000000000E+00 +1.00000000000000006E-01 3.86170998966032331E+00 0.00000000000000000E+00 +5.00000000000000000E-01 3.74758417187014503E+00 0.00000000000000000E+00 +1.00000000000000000E+00 3.74179783773998942E+00 0.00000000000000000E+00 diff --git a/IDAWin/tests/smoke/SimID_1489333437_0_.log b/IDAWin/tests/smoke/SimID_1489333437_0_.log new file mode 100644 index 00000000..ad570edb --- /dev/null +++ b/IDAWin/tests/smoke/SimID_1489333437_0_.log @@ -0,0 +1,3 @@ +IDAData logfile +IDAData text format version 1 +SimID_1489333437_0_.ida diff --git a/IDAWin/tests/smoke/SimID_1489333437_0__0.simtask.xml b/IDAWin/tests/smoke/SimID_1489333437_0__0.simtask.xml new file mode 100644 index 00000000..d173c8bc --- /dev/null +++ b/IDAWin/tests/smoke/SimID_1489333437_0__0.simtask.xml @@ -0,0 +1,76 @@ + + + 96485.3321 + 9.64853321E-5 + 1.0E-9 + 6.02214179E11 + 3.141592653589793 + 8314.46261815 + 300.0 + 1000.0 + 1.0 + 0.0 + 0.001660538783162726 + 2.0 + 0.0 + 2.0 + 3.0 + 4.0 + 0.0 + 0.0 + 0.5 + + + (((Kf_r0 * s0) * s2) - (Kr_r0 * s1)) + ((Kf_r1 * s3) - (Kr_r1 * s4)) + ((Size_c0 * s0_init_uM) - (Size_c0 * s2_init_uM)) + ((Size_c0 * s1_init_uM) + (Size_c0 * s2_init_uM)) + ((Size_c0 * s3_init_uM) + (Size_c0 * s4_init_uM)) + ((K_s0_total + (Size_c0 * s2)) / Size_c0) + ((K_s1_total - (Size_c0 * s2)) / Size_c0) + ((K_s3_total - (Size_c0 * s4)) / Size_c0) + + + + + + + + + - J_r0 + s2_init_uM + + + J_r1 + s4_init_uM + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IDAWin/tests/smoke/simpleModel_Network_orig.vcml b/IDAWin/tests/smoke/simpleModel_Network_orig.vcml new file mode 100644 index 00000000..75d2470a --- /dev/null +++ b/IDAWin/tests/smoke/simpleModel_Network_orig.vcml @@ -0,0 +1,621 @@ + + + + + + + + + + + + + + + + + + + + + + (((Kf * s0) * s2) - (Kr * s1)) + 1.0 + 2.0 + + + + + + + ((Kf * s3) - (Kr * s4)) + 0.0 + 0.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2.0 + 0.0 + + + 3.0 + 0.0 + + + 4.0 + 0.0 + + + 0.0 + 0.0 + + + 0.0 + 0.0 + + + + + + 96485.3321 + 9.64853321E-5 + 1.0E-9 + 6.02214179E11 + 3.141592653589793 + 8314.46261815 + 300.0 + 1000.0 + 1.0 + 0.0 + 0.001660538783162726 + 2.0 + 0.0 + 2.0 + 3.0 + 4.0 + 0.0 + 0.0 + 0.5 + + + (((Kf_r0 * s0) * s2) - (Kr_r0 * s1)) + ((Kf_r1 * s3) - (Kr_r1 * s4)) + ((Size_c0 * s0_init_uM) - (Size_c0 * s2_init_uM)) + ((Size_c0 * s1_init_uM) + (Size_c0 * s2_init_uM)) + ((Size_c0 * s3_init_uM) + (Size_c0 * s4_init_uM)) + ((K_s0_total + (Size_c0 * s2)) / Size_c0) + ((K_s1_total - (Size_c0 * s2)) / Size_c0) + ((K_s3_total - (Size_c0 * s4)) / Size_c0) + + + + + + + + + - J_r0 + s2_init_uM + + + J_r1 + s4_init_uM + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2.0 + 0.0 + + + 3.0 + 0.0 + + + 4.0 + 0.0 + + + 0.0 + 0.0 + + + 0.0 + 0.0 + + + + + + 96485.3321 + 9.64853321E-5 + 6.02214179E11 + 3.141592653589793 + 8314.46261815 + 300.0 + 1.0 + 0.0 + 0.001660538783162726 + 2.0 + 0.0 + 2.0 + 3.0 + 4.0 + 0.0 + 0.0 + 0.5 + (1.0 * pow(KMOLE, - 1.0)) + (1.0 * pow(KMOLE,1.0)) + + + + + + (((Kf_r0 * s0) * s2) - (Kr_r0 * s1)) + ((Kf_r1 * s3) - (Kr_r1 * s4)) + (Kf_r0 * s0_Count * s2_Count * UnitFactor_molecules_uM_neg_1_um_neg_3 * UnitFactor_uM_um3_molecules_neg_1 * UnitFactor_uM_um3_molecules_neg_1 / Size_c0) + (Kr_r0 * s1_Count * UnitFactor_molecules_uM_neg_1_um_neg_3 * UnitFactor_uM_um3_molecules_neg_1) + (Kf_r1 * s3_Count * UnitFactor_molecules_uM_neg_1_um_neg_3 * UnitFactor_uM_um3_molecules_neg_1) + (Kr_r1 * s4_Count * UnitFactor_molecules_uM_neg_1_um_neg_3 * UnitFactor_uM_um3_molecules_neg_1) + ((UnitFactor_uM_um3_molecules_neg_1 * s0_Count) / Size_c0) + (UnitFactor_molecules_uM_neg_1_um_neg_3 * Size_c0 * s0_Count_init_uM) + ((UnitFactor_uM_um3_molecules_neg_1 * s1_Count) / Size_c0) + (UnitFactor_molecules_uM_neg_1_um_neg_3 * Size_c0 * s1_Count_init_uM) + ((UnitFactor_uM_um3_molecules_neg_1 * s2_Count) / Size_c0) + (UnitFactor_molecules_uM_neg_1_um_neg_3 * Size_c0 * s2_Count_init_uM) + ((UnitFactor_uM_um3_molecules_neg_1 * s3_Count) / Size_c0) + (UnitFactor_molecules_uM_neg_1_um_neg_3 * Size_c0 * s3_Count_init_uM) + ((UnitFactor_uM_um3_molecules_neg_1 * s4_Count) / Size_c0) + (UnitFactor_molecules_uM_neg_1_um_neg_3 * Size_c0 * s4_Count_init_uM) + + + + + + + + s0_Count_initCount + s1_Count_initCount + s2_Count_initCount + s3_Count_initCount + s4_Count_initCount + + P_r0_probabilityRate + -1.0 + -1.0 + 1.0 + + + P_r0_reverse_probabilityRate + 1.0 + 1.0 + -1.0 + + + P_r1_probabilityRate + -1.0 + 1.0 + + + P_r1_reverse_probabilityRate + 1.0 + -1.0 + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2.0 + 0.0 + + + 3.0 + 0.0 + + + 4.0 + 0.0 + + + 0.0 + 0.0 + + + 0.0 + 0.0 + + + + + + + + + + + 96485.3321 + 9.64853321E-5 + 6.02214179E11 + 3.141592653589793 + 8314.46261815 + 300.0 + 1.0 + 0.0 + 0.001660538783162726 + 2.0 + 0.0 + 2.0 + 3.0 + 4.0 + 0.0 + 0.0 + 0.5 + (1.0 * pow(KMOLE, - 1.0)) + (1.0 * pow(KMOLE,1.0)) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ((O0_MT0_tot_Count * UnitFactor_uM_um3_molecules_neg_1) / Size_c0) + ((O0_MT1_tot_Count * UnitFactor_uM_um3_molecules_neg_1) / Size_c0) + ((O0_MT2_tot_Count * UnitFactor_uM_um3_molecules_neg_1) / Size_c0) + ((O0_MT3_tot_Count * UnitFactor_uM_um3_molecules_neg_1) / Size_c0) + ((O0_MT4_tot_Count * UnitFactor_uM_um3_molecules_neg_1) / Size_c0) + ((UnitFactor_uM_um3_molecules_neg_1 * Kf_r00) / Size_c0) + Kr_r00 + Kf_r10 + Kr_r10 + ((UnitFactor_uM_um3_molecules_neg_1 * s0_Count) / Size_c0) + (UnitFactor_molecules_uM_neg_1_um_neg_3 * Size_c0 * s0_Count_init_uM) + ((UnitFactor_uM_um3_molecules_neg_1 * s1_Count) / Size_c0) + (UnitFactor_molecules_uM_neg_1_um_neg_3 * Size_c0 * s1_Count_init_uM) + ((UnitFactor_uM_um3_molecules_neg_1 * s2_Count) / Size_c0) + (UnitFactor_molecules_uM_neg_1_um_neg_3 * Size_c0 * s2_Count_init_uM) + ((UnitFactor_uM_um3_molecules_neg_1 * s3_Count) / Size_c0) + (UnitFactor_molecules_uM_neg_1_um_neg_3 * Size_c0 * s3_Count_init_uM) + ((UnitFactor_uM_um3_molecules_neg_1 * s4_Count) / Size_c0) + (UnitFactor_molecules_uM_neg_1_um_neg_3 * Size_c0 * s4_Count_init_uM) + + + + + + + + + + + P_r00_probabilityRate + + + + + + + P_r00_reverse_probabilityRate + + + + + + + P_r10_probabilityRate + + + + + + P_r10_reverse_probabilityRate + + + + + + s0_Count_initCount + 0.0 + u + u + + 0.0 + 0.0 + 0.0 + 0.0 + + + + s1_Count_initCount + 0.0 + u + u + + 0.0 + 0.0 + 0.0 + 0.0 + + + + s2_Count_initCount + 0.0 + u + u + + 0.0 + 0.0 + 0.0 + 0.0 + + + + s3_Count_initCount + 0.0 + u + u + + 0.0 + 0.0 + 0.0 + 0.0 + + + + s4_Count_initCount + 0.0 + u + u + + 0.0 + 0.0 + 0.0 + 0.0 + + + + + + + + + + + + + + + true + false + true + true + 1000 + 1 + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/IDAWin/tests/smoke/smoke.py b/IDAWin/tests/smoke/smoke.py new file mode 100755 index 00000000..65f4d7fe --- /dev/null +++ b/IDAWin/tests/smoke/smoke.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python3 + +import os +import posixpath +import subprocess +import sys +from pathlib import Path + + +# function to numerically compare the contents of two text files to determine approximate equality +# each line is a space delimited list of numbers, compare them to within 8 significant figures +def compare_files(file1: Path, file2: Path, tolerance: float): + with open(file1, 'r') as f1, open(file2, 'r') as f2: + for line1, line2 in zip(f1, f2): + if (line1 := line1.strip()) == (line2 := line2.strip()): + continue + array1 = [float(x) for x in line1.split()] + array2 = [float(x) for x in line2.split()] + for x, y in zip(array1, array2): + if x != y and abs(x - y) > tolerance * max(abs(x), abs(y)): + return False + return True + + +# get the directory of this script +test_dir = os.path.dirname(os.path.realpath(__file__)) +# in the path replace \ with /, D:\ with /d/ +test_dir = test_dir.replace("\\", "/") +# tell os.path.join to use / as the path separator +os.path.sep = "/" +exe = sys.argv[1] + +print(f"test_dir: {test_dir}") +print(f"exe: {exe}") + +input_file = posixpath.join(test_dir, "SimID_1489333437_0_.cvodeInput") +output_file = posixpath.join(test_dir, "SimID_1489333437_0_.ida") +expected_output_file = posixpath.join(test_dir, "SimID_1489333437_0_.ida.expected") + +if not posixpath.exists(exe): + print(f"SundialsSolverStandalone_x64 executable {exe} not found. Exiting...") + sys.exit(1) + +if not posixpath.exists(input_file): + print(f"Input file {input_file} not found. Exiting...") + sys.exit(1) + +if not posixpath.exists(expected_output_file): + print(f"Expected output file {expected_output_file} not found. Exiting...") + sys.exit(1) + +command = [exe, input_file, output_file] +print(" ".join(command)) + +try: + subprocess.check_call(command) +except subprocess.CalledProcessError: + print("SundialsSolverStandalone_x64 failed to run. Exiting...") + sys.exit(1) + +# verify that the output files exist +if not os.path.isfile(output_file): + print(f"Output file {output_file} not found. Exiting...") + sys.exit(1) + +# verify that the output files match the expected output files +if not compare_files(file1=Path(output_file), file2=Path(expected_output_file), tolerance=1e-8): + print(f"Output file {output_file} does not match expected output {expected_output_file}. Exiting...") + sys.exit(1) + +print("SundialsSolverStandalone_x64 solver completed and solution matched expected output. Exiting...") +sys.exit(0) diff --git a/NFsim_v1.11/CMakeLists.txt b/NFsim_v1.11/CMakeLists.txt index 68771ed8..254e653b 100755 --- a/NFsim_v1.11/CMakeLists.txt +++ b/NFsim_v1.11/CMakeLists.txt @@ -89,10 +89,12 @@ if (ARCH_64bit) set(exe_target ${exe_target}_x64) endif (ARCH_64bit) -enable_testing() - add_executable(${exe_target} ${SRC_FILES}) target_link_libraries(${exe_target} vcommons vcellmessaging) +install(TARGETS ${exe_target} RUNTIME DESTINATION ${OPTION_EXE_DIRECTORY}) + + +enable_testing() if (MINGW) set(test_nfsim_exe ${CMAKE_BINARY_DIR}/bin/${exe_target}.exe) @@ -109,5 +111,4 @@ add_test(NAME ${exe_target}_smoke_python COMMAND ${python_cmd} ${test_dir}/smoke # smoke test as a bash script add_test(NAME ${exe_target}_smoke_bash COMMAND bash -c "${test_dir}/smoke.sh ${test_nfsim_exe}" WORKING_DIRECTORY ${test_dir}) -install(TARGETS ${exe_target} RUNTIME DESTINATION ${OPTION_EXE_DIRECTORY}) diff --git a/NFsim_v1.11/tests/smoke/simpleModel_Network_orig.vcml b/NFsim_v1.11/tests/smoke/simpleModel_Network_orig.vcml new file mode 100644 index 00000000..7b16957d --- /dev/null +++ b/NFsim_v1.11/tests/smoke/simpleModel_Network_orig.vcml @@ -0,0 +1,621 @@ + + + + + + + + + + + + + + + + + + + + + + (((Kf * s0) * s2) - (Kr * s1)) + 1.0 + 2.0 + + + + + + + ((Kf * s3) - (Kr * s4)) + 0.0 + 0.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2.0 + 0.0 + + + 3.0 + 0.0 + + + 4.0 + 0.0 + + + 0.0 + 0.0 + + + 0.0 + 0.0 + + + + + + 96485.3321 + 9.64853321E-5 + 1.0E-9 + 6.02214179E11 + 3.141592653589793 + 8314.46261815 + 300.0 + 1000.0 + 1.0 + 0.0 + 0.001660538783162726 + 2.0 + 0.0 + 2.0 + 3.0 + 4.0 + 0.0 + 0.0 + 0.5 + + + (((Kf_r0 * s0) * s2) - (Kr_r0 * s1)) + ((Kf_r1 * s3) - (Kr_r1 * s4)) + ((Size_c0 * s0_init_uM) - (Size_c0 * s2_init_uM)) + ((Size_c0 * s1_init_uM) + (Size_c0 * s2_init_uM)) + ((Size_c0 * s3_init_uM) + (Size_c0 * s4_init_uM)) + ((K_s0_total + (Size_c0 * s2)) / Size_c0) + ((K_s1_total - (Size_c0 * s2)) / Size_c0) + ((K_s3_total - (Size_c0 * s4)) / Size_c0) + + + + + + + + + - J_r0 + s2_init_uM + + + J_r1 + s4_init_uM + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2.0 + 0.0 + + + 3.0 + 0.0 + + + 4.0 + 0.0 + + + 0.0 + 0.0 + + + 0.0 + 0.0 + + + + + + 96485.3321 + 9.64853321E-5 + 6.02214179E11 + 3.141592653589793 + 8314.46261815 + 300.0 + 1.0 + 0.0 + 0.001660538783162726 + 2.0 + 0.0 + 2.0 + 3.0 + 4.0 + 0.0 + 0.0 + 0.5 + (1.0 * pow(KMOLE, - 1.0)) + (1.0 * pow(KMOLE,1.0)) + + + + + + (((Kf_r0 * s0) * s2) - (Kr_r0 * s1)) + ((Kf_r1 * s3) - (Kr_r1 * s4)) + (Kf_r0 * s0_Count * s2_Count * UnitFactor_molecules_uM_neg_1_um_neg_3 * UnitFactor_uM_um3_molecules_neg_1 * UnitFactor_uM_um3_molecules_neg_1 / Size_c0) + (Kr_r0 * s1_Count * UnitFactor_molecules_uM_neg_1_um_neg_3 * UnitFactor_uM_um3_molecules_neg_1) + (Kf_r1 * s3_Count * UnitFactor_molecules_uM_neg_1_um_neg_3 * UnitFactor_uM_um3_molecules_neg_1) + (Kr_r1 * s4_Count * UnitFactor_molecules_uM_neg_1_um_neg_3 * UnitFactor_uM_um3_molecules_neg_1) + ((UnitFactor_uM_um3_molecules_neg_1 * s0_Count) / Size_c0) + (UnitFactor_molecules_uM_neg_1_um_neg_3 * Size_c0 * s0_Count_init_uM) + ((UnitFactor_uM_um3_molecules_neg_1 * s1_Count) / Size_c0) + (UnitFactor_molecules_uM_neg_1_um_neg_3 * Size_c0 * s1_Count_init_uM) + ((UnitFactor_uM_um3_molecules_neg_1 * s2_Count) / Size_c0) + (UnitFactor_molecules_uM_neg_1_um_neg_3 * Size_c0 * s2_Count_init_uM) + ((UnitFactor_uM_um3_molecules_neg_1 * s3_Count) / Size_c0) + (UnitFactor_molecules_uM_neg_1_um_neg_3 * Size_c0 * s3_Count_init_uM) + ((UnitFactor_uM_um3_molecules_neg_1 * s4_Count) / Size_c0) + (UnitFactor_molecules_uM_neg_1_um_neg_3 * Size_c0 * s4_Count_init_uM) + + + + + + + + s0_Count_initCount + s1_Count_initCount + s2_Count_initCount + s3_Count_initCount + s4_Count_initCount + + P_r0_probabilityRate + -1.0 + -1.0 + 1.0 + + + P_r0_reverse_probabilityRate + 1.0 + 1.0 + -1.0 + + + P_r1_probabilityRate + -1.0 + 1.0 + + + P_r1_reverse_probabilityRate + 1.0 + -1.0 + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2.0 + 0.0 + + + 3.0 + 0.0 + + + 4.0 + 0.0 + + + 0.0 + 0.0 + + + 0.0 + 0.0 + + + + + + + + + + + 96485.3321 + 9.64853321E-5 + 6.02214179E11 + 3.141592653589793 + 8314.46261815 + 300.0 + 1.0 + 0.0 + 0.001660538783162726 + 2.0 + 0.0 + 2.0 + 3.0 + 4.0 + 0.0 + 0.0 + 0.5 + (1.0 * pow(KMOLE, - 1.0)) + (1.0 * pow(KMOLE,1.0)) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ((O0_MT0_tot_Count * UnitFactor_uM_um3_molecules_neg_1) / Size_c0) + ((O0_MT1_tot_Count * UnitFactor_uM_um3_molecules_neg_1) / Size_c0) + ((O0_MT2_tot_Count * UnitFactor_uM_um3_molecules_neg_1) / Size_c0) + ((O0_MT3_tot_Count * UnitFactor_uM_um3_molecules_neg_1) / Size_c0) + ((O0_MT4_tot_Count * UnitFactor_uM_um3_molecules_neg_1) / Size_c0) + ((UnitFactor_uM_um3_molecules_neg_1 * Kf_r00) / Size_c0) + Kr_r00 + Kf_r10 + Kr_r10 + ((UnitFactor_uM_um3_molecules_neg_1 * s0_Count) / Size_c0) + (UnitFactor_molecules_uM_neg_1_um_neg_3 * Size_c0 * s0_Count_init_uM) + ((UnitFactor_uM_um3_molecules_neg_1 * s1_Count) / Size_c0) + (UnitFactor_molecules_uM_neg_1_um_neg_3 * Size_c0 * s1_Count_init_uM) + ((UnitFactor_uM_um3_molecules_neg_1 * s2_Count) / Size_c0) + (UnitFactor_molecules_uM_neg_1_um_neg_3 * Size_c0 * s2_Count_init_uM) + ((UnitFactor_uM_um3_molecules_neg_1 * s3_Count) / Size_c0) + (UnitFactor_molecules_uM_neg_1_um_neg_3 * Size_c0 * s3_Count_init_uM) + ((UnitFactor_uM_um3_molecules_neg_1 * s4_Count) / Size_c0) + (UnitFactor_molecules_uM_neg_1_um_neg_3 * Size_c0 * s4_Count_init_uM) + + + + + + + + + + + P_r00_probabilityRate + + + + + + + P_r00_reverse_probabilityRate + + + + + + + P_r10_probabilityRate + + + + + + P_r10_reverse_probabilityRate + + + + + + s0_Count_initCount + 0.0 + u + u + + 0.0 + 0.0 + 0.0 + 0.0 + + + + s1_Count_initCount + 0.0 + u + u + + 0.0 + 0.0 + 0.0 + 0.0 + + + + s2_Count_initCount + 0.0 + u + u + + 0.0 + 0.0 + 0.0 + 0.0 + + + + s3_Count_initCount + 0.0 + u + u + + 0.0 + 0.0 + 0.0 + 0.0 + + + + s4_Count_initCount + 0.0 + u + u + + 0.0 + 0.0 + 0.0 + 0.0 + + + + + + + + + + + + + + + true + false + true + true + 1000 + 1 + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/NFsim_v1.11/tests/smoke/smoke.sh b/NFsim_v1.11/tests/smoke/smoke.sh index d58eb050..69ade0cb 100755 --- a/NFsim_v1.11/tests/smoke/smoke.sh +++ b/NFsim_v1.11/tests/smoke/smoke.sh @@ -2,7 +2,7 @@ set -e EXE=$1 -echo "Running NFsim solver with test2.sh $EXE" +echo "Running NFsim solver with smoke.sh $EXE" # get the directory of this script TEST_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" @@ -13,50 +13,51 @@ EXPECTED_OUTPUT="${TEST_DIR}/SimID_273069657_0_.gdat.expected" SPECIES="${TEST_DIR}/SimID_273069657_0_.species" EXPECTED_SPECIES="${TEST_DIR}/SimID_273069657_0_.species.expected" -if [ ! -f $EXE ]; then +if [ ! -f "$EXE" ]; then echo "NFsim executable $EXE not found. Exiting..." exit 1 fi -if [ ! -f $INPUT ]; then +if [ ! -f "$INPUT" ]; then echo "Input file $INPUT not found. Exiting..." exit 1 fi -if [ ! -f $EXPECTED_OUTPUT ]; then +if [ ! -f "$EXPECTED_OUTPUT" ]; then echo "Expected output file $EXPECTED_OUTPUT not found. Exiting..." exit 1 fi -if [ ! -f $EXPECTED_SPECIES ]; then +if [ ! -f "$EXPECTED_SPECIES" ]; then echo "Expected species file $EXPECTED_SPECIES not found. Exiting..." exit 1 fi command="$EXE -seed 505790288 -vcell -xml $INPUT -o $OUTPUT -sim 1.0 -ss $SPECIES -oStep 20 -notf -utl 1000 -cb -pcmatch -tid 0" -echo $command +echo "$command" if ! $command; then echo "NFsim failed to run. Exiting..." exit 1 fi # verify that the output files exist -if [ ! -f $OUTPUT ]; then +if [ ! -f "$OUTPUT" ]; then echo "Output file $OUTPUT not found. Exiting..." exit 1 fi +# shellcheck disable=SC2086 if [ ! -f $SPECIES ]; then echo "Species file $SPECIES not found. Exiting..." exit 1 fi # verify that the output files match the expected output files -if ! diff $OUTPUT $EXPECTED_OUTPUT; then +if ! diff "$OUTPUT" "$EXPECTED_OUTPUT"; then echo "Output file $OUTPUT does not match expected output $EXPECTED_OUTPUT. Exiting..." exit 1 fi -if ! diff $SPECIES $EXPECTED_SPECIES; then +if ! diff "$SPECIES" "$EXPECTED_SPECIES"; then echo "Species file $SPECIES does not match expected species $EXPECTED_SPECIES. Exiting..." exit 1 fi -echo "NFsim solver complted and solution matched expected output. Exiting..." +echo "NFsim solver completed and solution matched expected output. Exiting..." exit 0