From adc8cae0d46f3d22444f74fd023c94690720ab7e Mon Sep 17 00:00:00 2001
From: Kyle <kyle.c.klenk@gmail.com>
Date: Wed, 2 Aug 2023 14:38:35 +0000
Subject: [PATCH] added toml file

---
 CMakeLists.txt                  |  1 +
 config.toml                     | 23 ++++++++++
 environment_setup/Dockerfile    | 19 ++++++---
 find_s2.py                      |  1 +
 simulations/input/new_basic.par | 12 +++---
 simulations/input/s1_s2.par     | 76 +++++++++++++++++++++++++++++++++
 6 files changed, 119 insertions(+), 13 deletions(-)
 create mode 100644 config.toml
 create mode 100644 simulations/input/s1_s2.par

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 48628ce..43dfd3f 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 0000000..31ef4ab
--- /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 0e19605..0eb6ef6 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 5d28d79..2d77474 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 158bf55..37f789c 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 0000000..cd75de6
--- /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
+
-- 
GitLab