Skip to content

Commit

Permalink
add FiniteVolume smoke test
Browse files Browse the repository at this point in the history
  • Loading branch information
jcschaff committed Aug 22, 2024
1 parent 4ce3fc8 commit 617cbb8
Show file tree
Hide file tree
Showing 15 changed files with 848 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@
tests/__pycache__/

*.whl

testFiles/output/
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ find_package(HDF5 COMPONENTS HL CXX C)
set(HDF_VERSION ${HDF5_VERSION})
###### ${HDF5_HL_LIBRARIES} ${HDF5_CXX_LIBRARIES}

if (OPTION_TARGET_TESTS)
enable_testing()
endif ()

add_subdirectory(VCellMessaging)

add_subdirectory(VCellZipUtils)
Expand Down
13 changes: 13 additions & 0 deletions VCell/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -243,5 +243,18 @@ endif()

# add google tests
if (OPTION_TARGET_TESTS)
enable_testing()
if (MINGW)
set(test_fvsolver_exe ${CMAKE_BINARY_DIR}/bin/${EXE_FILE}.exe)
set(python_cmd py)
else (MINGW)
set(test_fvsolver_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_fvsolver_exe} WORKING_DIRECTORY ${test_dir})

add_subdirectory(tests)
endif()
19 changes: 19 additions & 0 deletions VCell/tests/smoke/SimID_1585623750_0_.functions
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
##---------------------------------------------
## /Users/jimschaff/.vcell/simdata/temp/SimID_1585623750_0_.functions
##---------------------------------------------

subdomain1::J_flux0; (2.0 * (RanC_cyt - RanC_nuc)); ; Volume_VariableType; false
subdomain1::J_r0; ((2.0 * RanC_cyt) - (1000.0 * Ran_cyt * C_cyt)); ; Volume_VariableType; false
subdomain1::KFlux_nm_cyt; 1.0; ; Volume_Region_VariableType; false
subdomain1::KFlux_nm_nuc; 1.0; ; Volume_Region_VariableType; false
subdomain1::RanC_cyt_init_uM; (1.0 + x); ; Volume_VariableType; false
subdomain0_subdomain1_membrane::s2; 0.0; ; Membrane_Region_VariableType; false
subdomain1::Size_cyt; vcRegionVolume('subdomain1'); ; Volume_Region_VariableType; false
subdomain0::Size_EC; vcRegionVolume('subdomain0'); ; Volume_Region_VariableType; false
subdomain1::Size_nm; vcRegionVolume('subdomain1'); ; Volume_Region_VariableType; false
subdomain1::Size_nuc; vcRegionVolume('subdomain1'); ; Volume_Region_VariableType; false
subdomain0_subdomain1_membrane::Size_pm; vcRegionArea('subdomain0_subdomain1_membrane'); ; Membrane_Region_VariableType; false
subdomain0_subdomain1_membrane::sobj_subdomain11_subdomain00_size; vcRegionArea('subdomain0_subdomain1_membrane'); ; Membrane_Region_VariableType; false
subdomain0::vobj_subdomain00_size; vcRegionVolume('subdomain0'); ; Volume_Region_VariableType; false
subdomain1::vobj_subdomain11_size; vcRegionVolume('subdomain1'); ; Volume_Region_VariableType; false

157 changes: 157 additions & 0 deletions VCell/tests/smoke/SimID_1585623750_0_.fvinput
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
# Simulation Parameters
SIMULATION_PARAM_BEGIN
SOLVER SUNDIALS_PDE_SOLVER 1.0E-7 1.0E-9 0.1
BASE_FILE_NAME /Users/jimschaff/.vcell/simdata/temp/SimID_1585623750_0_
ENDING_TIME 0.01
TIME_STEP 0.005
KEEP_EVERY 1
SIMULATION_PARAM_END

# Model description: FEATURE name handle boundary_conditions
MODEL_BEGIN
FEATURE subdomain1 1 flux flux flux flux
FEATURE subdomain0 0 flux flux flux flux
MEMBRANE subdomain0_subdomain1_membrane subdomain1 subdomain0 flux flux flux flux
MODEL_END

# Mesh file
MESH_BEGIN
VCG_FILE SimID_1585623750_0_.vcg
MESH_END

# Variables : type name domain time_dependent_flag advection_flag grad_flag solve_whole_mesh_flag solve_regions
VARIABLE_BEGIN
VOLUME_PDE C_cyt subdomain1 false false false false subdomain1
VOLUME_PDE Ran_cyt subdomain1 false false false false subdomain1
VOLUME_PDE RanC_cyt subdomain1 false false false false subdomain1
VOLUME_PDE RanC_nuc subdomain1 false false false false subdomain1
VARIABLE_END

POST_PROCESSING_BLOCK_BEGIN
POST_PROCESSING_BLOCK_END

COMPARTMENT_BEGIN subdomain1

EQUATION_BEGIN RanC_cyt
INITIAL (1.0 + x);
RATE ( - ((2.0 * RanC_cyt) - (1000.0 * Ran_cyt * C_cyt)) - (2.0 * (RanC_cyt - RanC_nuc)));
DIFFUSION 10.0;
VELOCITY_X 0.0;
VELOCITY_Y 0.0;
BOUNDARY_XM 0.0;
BOUNDARY_XP 0.0;
BOUNDARY_YM 0.0;
BOUNDARY_YP 0.0;
EQUATION_END

EQUATION_BEGIN Ran_cyt
INITIAL 0.0;
RATE ((2.0 * RanC_cyt) - (1000.0 * Ran_cyt * C_cyt));
DIFFUSION 10.0;
VELOCITY_X 0.0;
VELOCITY_Y 0.0;
BOUNDARY_XM 0.0;
BOUNDARY_XP 0.0;
BOUNDARY_YM 0.0;
BOUNDARY_YP 0.0;
EQUATION_END

EQUATION_BEGIN C_cyt
INITIAL 0.0;
RATE ((2.0 * RanC_cyt) - (1000.0 * Ran_cyt * C_cyt));
DIFFUSION 10.0;
VELOCITY_X 0.0;
VELOCITY_Y 0.0;
BOUNDARY_XM 0.0;
BOUNDARY_XP 0.0;
BOUNDARY_YM 0.0;
BOUNDARY_YP 0.0;
EQUATION_END

EQUATION_BEGIN RanC_nuc
INITIAL 4.5E-4;
RATE (2.0 * (RanC_cyt - RanC_nuc));
DIFFUSION 10.0;
VELOCITY_X 0.0;
VELOCITY_Y 0.0;
BOUNDARY_XM 0.0;
BOUNDARY_XP 0.0;
BOUNDARY_YM 0.0;
BOUNDARY_YP 0.0;
EQUATION_END

COMPARTMENT_END

COMPARTMENT_BEGIN subdomain0

EQUATION_BEGIN C_cyt
INITIAL 0.0;
RATE 0.0;
DIFFUSION 0.0;
VELOCITY_X 0.0;
VELOCITY_Y 0.0;
BOUNDARY_XM 0.0;
BOUNDARY_XP 0.0;
BOUNDARY_YM 0.0;
BOUNDARY_YP 0.0;
EQUATION_END

EQUATION_BEGIN Ran_cyt
INITIAL 0.0;
RATE 0.0;
DIFFUSION 0.0;
VELOCITY_X 0.0;
VELOCITY_Y 0.0;
BOUNDARY_XM 0.0;
BOUNDARY_XP 0.0;
BOUNDARY_YM 0.0;
BOUNDARY_YP 0.0;
EQUATION_END

EQUATION_BEGIN RanC_cyt
INITIAL 0.0;
RATE 0.0;
DIFFUSION 0.0;
VELOCITY_X 0.0;
VELOCITY_Y 0.0;
BOUNDARY_XM 0.0;
BOUNDARY_XP 0.0;
BOUNDARY_YM 0.0;
BOUNDARY_YP 0.0;
EQUATION_END

EQUATION_BEGIN RanC_nuc
INITIAL 0.0;
RATE 0.0;
DIFFUSION 0.0;
VELOCITY_X 0.0;
VELOCITY_Y 0.0;
BOUNDARY_XM 0.0;
BOUNDARY_XP 0.0;
BOUNDARY_YM 0.0;
BOUNDARY_YP 0.0;
EQUATION_END

COMPARTMENT_END


MEMBRANE_BEGIN subdomain0_subdomain1_membrane subdomain1 subdomain0

JUMP_CONDITION_BEGIN RanC_cyt
FLUX subdomain1 0.0;
JUMP_CONDITION_END

JUMP_CONDITION_BEGIN Ran_cyt
FLUX subdomain1 0.0;
JUMP_CONDITION_END

JUMP_CONDITION_BEGIN C_cyt
FLUX subdomain1 0.0;
JUMP_CONDITION_END

JUMP_CONDITION_BEGIN RanC_nuc
FLUX subdomain1 0.0;
JUMP_CONDITION_END

MEMBRANE_END

Binary file added VCell/tests/smoke/SimID_1585623750_0_.hdf5
Binary file not shown.
Binary file not shown.
3 changes: 3 additions & 0 deletions VCell/tests/smoke/SimID_1585623750_0_.log.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
0 SimID_1585623750_0_0000.sim SimID_1585623750_0_00.zip 0
1 SimID_1585623750_0_0001.sim SimID_1585623750_0_00.zip 0.005
2 SimID_1585623750_0_0002.sim SimID_1585623750_0_00.zip 0.01
148 changes: 148 additions & 0 deletions VCell/tests/smoke/SimID_1585623750_0_.mesh
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
Version 1.2
CartesianMesh {
// X Y Z
Size 51 51 1
Extent 10 10 1
Origin 0 0 0

VolumeRegionsMapSubvolume {
2
//VolRegID SubvolID Volume
0 0 72.119999999999877 //subdomain0
1 1 27.879999999999583 //subdomain1
}

MembraneRegionsMapVolumeRegion {
1
//MemRegID VolReg1 VolReg2 Surface
0 1 0 18.471391535623798
}

VolumeElementsMapVolumeRegion {
2601 Compressed
789CEDD6D11100100C0451FA6F5A0306397166D84D01EFEF26A51011DDAE76EFBC902B8D8D0C672E
EC4BEBC68EE3506286E6C40DC571289A1175505050FE545E5A4BCDD172182EC5F3C3AC4A39398C91
444474BF06C24102BA
}

MembraneElements {
116
//Indx Vol1 Vol2 Conn0 Conn1 Conn2 Conn3 MemRegID
0 581 530 1 12 -1 -1 0
1 582 531 2 0 -1 -1 0
2 583 532 3 1 -1 -1 0
3 584 533 4 2 -1 -1 0
4 585 534 5 3 -1 -1 0
5 586 535 6 4 -1 -1 0
6 587 536 7 5 -1 -1 0
7 588 537 8 6 -1 -1 0
8 589 538 9 7 -1 -1 0
9 590 539 10 8 -1 -1 0
10 591 540 14 9 -1 -1 0
11 630 579 13 17 -1 -1 0
12 581 580 13 0 -1 -1 0
13 631 580 12 11 -1 -1 0
14 591 592 15 10 -1 -1 0
15 643 592 16 14 -1 -1 0
16 644 593 19 15 -1 -1 0
17 630 629 18 11 -1 -1 0
18 680 629 17 22 -1 -1 0
19 644 645 20 16 -1 -1 0
20 696 645 24 19 -1 -1 0
21 729 678 23 27 -1 -1 0
22 680 679 23 18 -1 -1 0
23 730 679 22 21 -1 -1 0
24 696 697 25 20 -1 -1 0
25 748 697 26 24 -1 -1 0
26 749 698 29 25 -1 -1 0
27 729 728 28 21 -1 -1 0
28 779 728 27 31 -1 -1 0
29 749 750 30 26 -1 -1 0
30 801 750 32 29 -1 -1 0
31 779 778 33 28 -1 -1 0
32 801 802 35 30 -1 -1 0
33 830 829 34 31 -1 -1 0
34 880 829 33 37 -1 -1 0
35 852 853 36 32 -1 -1 0
36 904 853 39 35 -1 -1 0
37 880 879 38 34 -1 -1 0
38 930 879 37 41 -1 -1 0
39 904 905 40 36 -1 -1 0
40 956 905 42 39 -1 -1 0
41 930 929 43 38 -1 -1 0
42 956 957 45 40 -1 -1 0
43 981 980 44 41 -1 -1 0
44 1031 980 43 47 -1 -1 0
45 1007 1008 46 42 -1 -1 0
46 1059 1008 48 45 -1 -1 0
47 1031 1030 49 44 -1 -1 0
48 1059 1060 50 46 -1 -1 0
49 1082 1081 51 47 -1 -1 0
50 1110 1111 52 48 -1 -1 0
51 1133 1132 53 49 -1 -1 0
52 1161 1162 54 50 -1 -1 0
53 1184 1183 55 51 -1 -1 0
54 1212 1213 56 52 -1 -1 0
55 1235 1234 57 53 -1 -1 0
56 1263 1264 58 54 -1 -1 0
57 1286 1285 59 55 -1 -1 0
58 1314 1315 60 56 -1 -1 0
59 1337 1336 61 57 -1 -1 0
60 1365 1366 62 58 -1 -1 0
61 1388 1387 63 59 -1 -1 0
62 1416 1417 64 60 -1 -1 0
63 1439 1438 65 61 -1 -1 0
64 1467 1468 66 62 -1 -1 0
65 1490 1489 67 63 -1 -1 0
66 1518 1519 69 64 -1 -1 0
67 1541 1540 68 65 -1 -1 0
68 1541 1592 71 67 -1 -1 0
69 1569 1570 70 66 -1 -1 0
70 1569 1620 69 72 -1 -1 0
71 1593 1592 73 68 -1 -1 0
72 1619 1620 75 70 -1 -1 0
73 1644 1643 74 71 -1 -1 0
74 1644 1695 77 73 -1 -1 0
75 1670 1671 76 72 -1 -1 0
76 1670 1721 75 79 -1 -1 0
77 1696 1695 78 74 -1 -1 0
78 1696 1747 81 77 -1 -1 0
79 1720 1721 80 76 -1 -1 0
80 1720 1771 79 82 -1 -1 0
81 1748 1747 83 78 -1 -1 0
82 1770 1771 85 80 -1 -1 0
83 1799 1798 84 81 -1 -1 0
84 1799 1850 87 83 -1 -1 0
85 1821 1822 86 82 -1 -1 0
86 1821 1872 85 91 -1 -1 0
87 1851 1850 88 84 -1 -1 0
88 1851 1902 89 87 -1 -1 0
89 1852 1903 93 88 -1 -1 0
90 1870 1921 92 95 -1 -1 0
91 1871 1872 92 86 -1 -1 0
92 1871 1922 91 90 -1 -1 0
93 1904 1903 94 89 -1 -1 0
94 1904 1955 97 93 -1 -1 0
95 1920 1921 96 90 -1 -1 0
96 1920 1971 95 101 -1 -1 0
97 1956 1955 98 94 -1 -1 0
98 1956 2007 99 97 -1 -1 0
99 1957 2008 103 98 -1 -1 0
100 1969 2020 102 114 -1 -1 0
101 1970 1971 102 96 -1 -1 0
102 1970 2021 101 100 -1 -1 0
103 2009 2008 104 99 -1 -1 0
104 2009 2060 105 103 -1 -1 0
105 2010 2061 106 104 -1 -1 0
106 2011 2062 107 105 -1 -1 0
107 2012 2063 108 106 -1 -1 0
108 2013 2064 109 107 -1 -1 0
109 2014 2065 110 108 -1 -1 0
110 2015 2066 111 109 -1 -1 0
111 2016 2067 112 110 -1 -1 0
112 2017 2068 113 111 -1 -1 0
113 2018 2069 115 112 -1 -1 0
114 2019 2020 115 100 -1 -1 0
115 2019 2070 114 113 -1 -1 0
}
}
Loading

0 comments on commit 617cbb8

Please sign in to comment.