diff --git a/CMakeLists.txt b/CMakeLists.txt index 48628cefbc45650e91ab550c8541638b14c7edce..43dfd3f16f4ba0857d911e7931e30104024d6df9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,7 @@ set_property(TARGET s1_s2_simulation PROPERTY CXX_STANDARD 17) target_link_libraries(s1_s2_simulation CAF::core CAF::io) target_link_libraries(s1_s2_simulation ${PYTHON_LIBRARIES}) target_link_libraries(s1_s2_simulation yaml-cpp) +target_include_directories("/opt/tomlplusplus/include") # Move the executable up one directory set_target_properties(s1_s2_simulation PROPERTIES RUNTIME_OUTPUT_DIRECTORY ..) diff --git a/config.toml b/config.toml new file mode 100644 index 0000000000000000000000000000000000000000..31ef4ab6dfefadaff5d2432c590476287c5f7617 --- /dev/null +++ b/config.toml @@ -0,0 +1,23 @@ +[actors] +# global parameters +output_dir = "/code/output/" +results_file = "results.csv" +tolerance = 1 + +# s1 parameters +s1_min = 30 +s1_max = 34 + +# s2 parameters +s2_args = ['openCARP', '+F', '/code/openCARP-Actors/simulations/input/s1_s2.par'] +s2_min = 100 +s2_max = 500 +s2_interval_min = 250 +s2_interval_max = 250 +s2_interval_increment = 5 + + +[petsc] + +[openCARP] +args = ['openCARP', '+F', '/code/openCARP-Actors/simulations/input/new_basic.par'] \ No newline at end of file diff --git a/environment_setup/Dockerfile b/environment_setup/Dockerfile index 0e19605a6cee955627d8bb53475c852cb9f26320..0eb6ef63c24e1fa2d1d94977add13ee237a0893d 100755 --- a/environment_setup/Dockerfile +++ b/environment_setup/Dockerfile @@ -79,14 +79,19 @@ RUN python3 ./bin/cusettings $HOME/.config/carputils/settings.yaml ADD settings.yaml /root/.config/carputils/ # Install YAML +# WORKDIR /opt +# RUN git clone https://github.com/jbeder/yaml-cpp.git +# WORKDIR /opt/yaml-cpp +# RUN mkdir build +# WORKDIR /opt/yaml-cpp/build +# RUN cmake .. +# RUN make +# RUN make install + +# Install TOML WORKDIR /opt -RUN git clone https://github.com/jbeder/yaml-cpp.git -WORKDIR /opt/yaml-cpp -RUN mkdir build -WORKDIR /opt/yaml-cpp/build -RUN cmake .. -RUN make -RUN make install +RUN git clone https://github.com/marzer/tomlplusplus.git + # Set entrypoint diff --git a/find_s2.py b/find_s2.py index 5d28d7969dabb1cd246c677a6a9aa7daf7e8930d..2d774741ceb7aa2a4a917767c33cff664fb64adb 100644 --- a/find_s2.py +++ b/find_s2.py @@ -127,6 +127,7 @@ def run(args, job): cmd += stim + electrode # Run simulation + print(cmd) job.carp(cmd) #cmd includes the params run() \ No newline at end of file diff --git a/simulations/input/new_basic.par b/simulations/input/new_basic.par index 158bf55f8e4d4ca17765052eda816372b6e5b9e3..37f789c1e4490c12a8de0638923aae3b300f1d08 100644 --- a/simulations/input/new_basic.par +++ b/simulations/input/new_basic.par @@ -2,13 +2,13 @@ # Output Folder Name # ---------------------------------------- -simID = Test_Output +simID = Test_Output/34 # ---------------------------------------- # Meshname # ---------------------------------------- -meshname = meshes/2023-07-21_hUDXjwCFKT/block +meshname = /code/openCARP-Actors/meshes/2023-06-30_TgWObjAUlq/block # ---------------------------------------- # Definition of physics region @@ -39,7 +39,7 @@ imp_region[0].im = DrouhardRoberge num_stim = 1 stimulus[0].name = S1 stimulus[0].stimtype = 0 -stimulus[0].strength = 20.0 +stimulus[0].strength = 34.0 stimulus[0].duration = 2.0 stimulus[0].x0 = -50.0 stimulus[0].xd = 2100.0 @@ -52,9 +52,9 @@ stimulus[0].zd = 300.0 # ------------------------------- # Definition of general parameters # ------------------------------- -tend = 20.0 -spacedt = 1.0 -timedt = 1.0 +tend = 20.0 # t_end - end of simulation +spacedt = 1.0 # Interval to output data to files +timedt = 1.0 # Interval to print progress to sceen # -------------------------------------------------- diff --git a/simulations/input/s1_s2.par b/simulations/input/s1_s2.par new file mode 100644 index 0000000000000000000000000000000000000000..cd75de6ffb7b3b0def8afa3366d08504232f9a0f --- /dev/null +++ b/simulations/input/s1_s2.par @@ -0,0 +1,76 @@ +# ---------------------------------------- +# Output Folder Name +# ---------------------------------------- + +simID = output/ + +# ---------------------------------------- +# Meshname +# ---------------------------------------- + +meshname = /code/openCARP-Actors/meshes/2023-06-30_TgWObjAUlq/block + +# ---------------------------------------- +# Definition of physics region +# ---------------------------------------- +num_phys_regions = 2 +phys_region[0].name = "Intracellular domain" +phys_region[0].ptype = 0 +phys_region[0].num_IDs = 1 +phys_region[0].ID[0] = 1 +phys_region[1].name = "Extracellular domain" +phys_region[1].ptype = 1 +phys_region[1].num_IDs = 1 +phys_region[1].ID[0] = 1 + +# ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- --------------- +# Definition of ionic model and plugins (IMP) for each unique tagged +# region in the mesh +# ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ------ ----- ---- +num_imp_regions = 1 + +imp_region[0].im = DrouhardRoberge + + +# -------------------- +# Definition of stimuli +# -------------------- + +num_stim = 2, +stimulus[0].name = S1 +stimulus[0].stimtype = 0 +stimulus[0].strength = 172.0 +stimulus[0].duration = 2.0 +stimulus[0].x0 = -50.0 +stimulus[0].xd = 2100.0 +stimulus[0].y0 = -50.0 +stimulus[0].yd = 400.0 +stimulus[0].z0 = -50.0 +stimulus[0].zd = 300.0 + +stimulus[1].name = S2 +stimulus[1].stimtype = 0 +stimulus[1].strength = 200.0 +stimulus[1].duration = 2.0 +stimulus[1].start = 150.0 + + +# ------------------------------- +# Definition of general parameters +# ------------------------------- +tend = 300.0 # t_end - end of simulation +spacedt = 1.0 # Interval to output data to files +timedt = 1.0 # Interval to print progress to sceen + + +# -------------------------------------------------- +# Definition of solving problem and numerical methods +# -------------------------------------------------- +bidomain = 0 +dt = 25 +parab_options_file = /root/.local/lib/python3.8/site-packages/carputils/resources/petsc_options/ilu_cg_opts +ellip_options_file = /root/.local/lib/python3.8/site-packages/carputils/resources/petsc_options/gamg_cg_opts +parab_solve = 1 +ellip_use_pt = 0 +parab_use_pt = 0 +