From 29f93aa0eb4fa6305258caeb641ff1b375996aaa Mon Sep 17 00:00:00 2001 From: Ishaan Desai Date: Tue, 9 Jul 2024 14:04:33 +0200 Subject: [PATCH] Move micro_dt from coupling parameters to simulation parameters in the configuration (#114) * Move micro_dt from coupling_params to simulation_params in the JSON config * Update CHANGELOG --- CHANGELOG.md | 1 + examples/micro-manager-cpp-adaptivity-config.json | 4 ++-- examples/micro-manager-cpp-config.json | 4 ++-- examples/micro-manager-python-adaptivity-config.json | 4 ++-- examples/micro-manager-python-config.json | 4 ++-- micro_manager/config.py | 2 +- .../micro-manager-config-global-adaptivity-parallel.json | 4 ++-- .../micro-manager-config-global-adaptivity.json | 4 ++-- .../test_unit_cube/micro-manager-config-local-adaptivity.json | 4 ++-- .../test_unit_cube/micro-manager-config-parallel-1.json | 4 ++-- .../test_unit_cube/micro-manager-config-parallel-2.json | 4 ++-- tests/unit/micro-manager-config.json | 4 ++-- tests/unit/micro-manager-config_crash.json | 4 ++-- 13 files changed, 24 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4536e55..5850766 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## latest +- Move the config variable `micro_dt` from the coupling parameters section to the simulation parameters section https://github.com/precice/micro-manager/pull/114 - Set time step of micro simulation in the configuration, and use it in the coupling https://github.com/precice/micro-manager/pull/112 - Add a base class called `MicroManager` with minimal API and member function definitions, rename the existing `MicroManager` class to `MicroManagerCoupling` https://github.com/precice/micro-manager/pull/111 - Handle calling `initialize()` function of micro simulations written in languages other than Python https://github.com/precice/micro-manager/pull/110 diff --git a/examples/micro-manager-cpp-adaptivity-config.json b/examples/micro-manager-cpp-adaptivity-config.json index 2f36e07..89b424e 100644 --- a/examples/micro-manager-cpp-adaptivity-config.json +++ b/examples/micro-manager-cpp-adaptivity-config.json @@ -4,10 +4,10 @@ "config_file_name": "precice-config-adaptivity.xml", "macro_mesh_name": "macro-mesh", "read_data_names": {"macro-scalar-data": "scalar", "macro-vector-data": "vector"}, - "write_data_names": {"micro-scalar-data": "scalar", "micro-vector-data": "vector"}, - "micro_dt": 1.0 + "write_data_names": {"micro-scalar-data": "scalar", "micro-vector-data": "vector"} }, "simulation_params": { + "micro_dt": 1.0, "macro_domain_bounds": [0.0, 25.0, 0.0, 25.0, 0.0, 25.0], "adaptivity": "True", "adaptivity_settings": { diff --git a/examples/micro-manager-cpp-config.json b/examples/micro-manager-cpp-config.json index 01a15e0..d44f70b 100644 --- a/examples/micro-manager-cpp-config.json +++ b/examples/micro-manager-cpp-config.json @@ -4,10 +4,10 @@ "config_file_name": "precice-config.xml", "macro_mesh_name": "macro-mesh", "read_data_names": {"macro-scalar-data": "scalar", "macro-vector-data": "vector"}, - "write_data_names": {"micro-scalar-data": "scalar", "micro-vector-data": "vector"}, - "micro_dt": 1.0 + "write_data_names": {"micro-scalar-data": "scalar", "micro-vector-data": "vector"} }, "simulation_params": { + "micro_dt": 1.0, "macro_domain_bounds": [0.0, 25.0, 0.0, 25.0, 0.0, 25.0] }, "diagnostics": { diff --git a/examples/micro-manager-python-adaptivity-config.json b/examples/micro-manager-python-adaptivity-config.json index 595aee8..14640fa 100644 --- a/examples/micro-manager-python-adaptivity-config.json +++ b/examples/micro-manager-python-adaptivity-config.json @@ -4,10 +4,10 @@ "config_file_name": "precice-config-adaptivity.xml", "macro_mesh_name": "macro-mesh", "read_data_names": {"macro-scalar-data": "scalar", "macro-vector-data": "vector"}, - "write_data_names": {"micro-scalar-data": "scalar", "micro-vector-data": "vector"}, - "micro_dt": 1.0 + "write_data_names": {"micro-scalar-data": "scalar", "micro-vector-data": "vector"} }, "simulation_params": { + "micro_dt": 1.0, "macro_domain_bounds": [0.0, 25.0, 0.0, 25.0, 0.0, 25.0], "adaptivity": "True", "adaptivity_settings": { diff --git a/examples/micro-manager-python-config.json b/examples/micro-manager-python-config.json index cc170d8..85f8493 100644 --- a/examples/micro-manager-python-config.json +++ b/examples/micro-manager-python-config.json @@ -4,10 +4,10 @@ "config_file_name": "precice-config.xml", "macro_mesh_name": "macro-mesh", "read_data_names": {"macro-scalar-data": "scalar", "macro-vector-data": "vector"}, - "write_data_names": {"micro-scalar-data": "scalar", "micro-vector-data": "vector"}, - "micro_dt": 1.0 + "write_data_names": {"micro-scalar-data": "scalar", "micro-vector-data": "vector"} }, "simulation_params": { + "micro_dt": 1.0, "macro_domain_bounds": [0.0, 25.0, 0.0, 25.0, 0.0, 25.0] }, "diagnostics": { diff --git a/micro_manager/config.py b/micro_manager/config.py index 55aef23..35af9ac 100644 --- a/micro_manager/config.py +++ b/micro_manager/config.py @@ -115,7 +115,7 @@ def read_json(self, config_filename): "No read data names provided. Micro manager will only write data to preCICE." ) - self._micro_dt = data["coupling_params"]["micro_dt"] + self._micro_dt = data["simulation_params"]["micro_dt"] self._macro_domain_bounds = data["simulation_params"]["macro_domain_bounds"] diff --git a/tests/integration/test_unit_cube/micro-manager-config-global-adaptivity-parallel.json b/tests/integration/test_unit_cube/micro-manager-config-global-adaptivity-parallel.json index 50da60f..5938af6 100644 --- a/tests/integration/test_unit_cube/micro-manager-config-global-adaptivity-parallel.json +++ b/tests/integration/test_unit_cube/micro-manager-config-global-adaptivity-parallel.json @@ -4,10 +4,10 @@ "config_file_name": "precice-config.xml", "macro_mesh_name": "macro-cube-mesh", "read_data_names": {"macro-scalar-data": "scalar", "macro-vector-data": "vector"}, - "write_data_names": {"micro-scalar-data": "scalar", "micro-vector-data": "vector"}, - "micro_dt": 1.0 + "write_data_names": {"micro-scalar-data": "scalar", "micro-vector-data": "vector"} }, "simulation_params": { + "micro_dt": 1.0, "macro_domain_bounds": [0, 1, 0, 1, 0, 1], "decomposition": [2, 1, 1], "adaptivity": "True", diff --git a/tests/integration/test_unit_cube/micro-manager-config-global-adaptivity.json b/tests/integration/test_unit_cube/micro-manager-config-global-adaptivity.json index 835b983..f3c5361 100644 --- a/tests/integration/test_unit_cube/micro-manager-config-global-adaptivity.json +++ b/tests/integration/test_unit_cube/micro-manager-config-global-adaptivity.json @@ -4,10 +4,10 @@ "config_file_name": "precice-config.xml", "macro_mesh_name": "macro-cube-mesh", "read_data_names": {"macro-scalar-data": "scalar", "macro-vector-data": "vector"}, - "write_data_names": {"micro-scalar-data": "scalar", "micro-vector-data": "vector"}, - "micro_dt": 1.0 + "write_data_names": {"micro-scalar-data": "scalar", "micro-vector-data": "vector"} }, "simulation_params": { + "micro_dt": 1.0, "macro_domain_bounds": [0, 1, 0, 1, 0, 1], "adaptivity": "True", "adaptivity_settings": { diff --git a/tests/integration/test_unit_cube/micro-manager-config-local-adaptivity.json b/tests/integration/test_unit_cube/micro-manager-config-local-adaptivity.json index 5a6581c..ad1d2be 100644 --- a/tests/integration/test_unit_cube/micro-manager-config-local-adaptivity.json +++ b/tests/integration/test_unit_cube/micro-manager-config-local-adaptivity.json @@ -4,10 +4,10 @@ "config_file_name": "precice-config.xml", "macro_mesh_name": "macro-cube-mesh", "read_data_names": {"macro-scalar-data": "scalar", "macro-vector-data": "vector"}, - "write_data_names": {"micro-scalar-data": "scalar", "micro-vector-data": "vector"}, - "micro_dt": 1.0 + "write_data_names": {"micro-scalar-data": "scalar", "micro-vector-data": "vector"} }, "simulation_params": { + "micro_dt": 1.0, "macro_domain_bounds": [0, 1, 0, 1, 0, 1], "adaptivity": "True", "adaptivity_settings": { diff --git a/tests/integration/test_unit_cube/micro-manager-config-parallel-1.json b/tests/integration/test_unit_cube/micro-manager-config-parallel-1.json index aaece10..2a56740 100644 --- a/tests/integration/test_unit_cube/micro-manager-config-parallel-1.json +++ b/tests/integration/test_unit_cube/micro-manager-config-parallel-1.json @@ -4,10 +4,10 @@ "config_file_name": "precice-config.xml", "macro_mesh_name": "macro-cube-mesh", "read_data_names": {"macro-scalar-data": "scalar", "macro-vector-data": "vector"}, - "write_data_names": {"micro-scalar-data": "scalar", "micro-vector-data": "vector"}, - "micro_dt": 1.0 + "write_data_names": {"micro-scalar-data": "scalar", "micro-vector-data": "vector"} }, "simulation_params": { + "micro_dt": 1.0, "macro_domain_bounds": [0, 1, 0, 1, 0, 1], "decomposition": [1, 1, 2] }, diff --git a/tests/integration/test_unit_cube/micro-manager-config-parallel-2.json b/tests/integration/test_unit_cube/micro-manager-config-parallel-2.json index 7c8b065..478e0f0 100644 --- a/tests/integration/test_unit_cube/micro-manager-config-parallel-2.json +++ b/tests/integration/test_unit_cube/micro-manager-config-parallel-2.json @@ -4,10 +4,10 @@ "config_file_name": "precice-config.xml", "macro_mesh_name": "macro-cube-mesh", "read_data_names": {"macro-scalar-data": "scalar", "macro-vector-data": "vector"}, - "write_data_names": {"micro-scalar-data": "scalar", "micro-vector-data": "vector"}, - "micro_dt": 1.0 + "write_data_names": {"micro-scalar-data": "scalar", "micro-vector-data": "vector"} }, "simulation_params": { + "micro_dt": 1.0, "macro_domain_bounds": [0, 1, 0, 1, 0, 1], "decomposition": [1, 2, 3] }, diff --git a/tests/unit/micro-manager-config.json b/tests/unit/micro-manager-config.json index e5c5aa7..c4d886c 100644 --- a/tests/unit/micro-manager-config.json +++ b/tests/unit/micro-manager-config.json @@ -4,10 +4,10 @@ "config_file_name": "dummy-config.xml", "macro_mesh_name": "dummy-macro-mesh", "read_data_names": {"macro-scalar-data": "scalar", "macro-vector-data": "vector"}, - "write_data_names": {"micro-scalar-data": "scalar", "micro-vector-data": "vector"}, - "micro_dt": 0.1 + "write_data_names": {"micro-scalar-data": "scalar", "micro-vector-data": "vector"} }, "simulation_params": { + "micro_dt": 0.1, "macro_domain_bounds": [0.0, 25.0, 0.0, 25.0, 0.0, 25.0], "adaptivity": "True", "adaptivity_settings": { diff --git a/tests/unit/micro-manager-config_crash.json b/tests/unit/micro-manager-config_crash.json index 455bb1d..00261b7 100644 --- a/tests/unit/micro-manager-config_crash.json +++ b/tests/unit/micro-manager-config_crash.json @@ -4,10 +4,10 @@ "config_file_name": "dummy-config.xml", "macro_mesh_name": "dummy-macro-mesh", "read_data_names": {"macro-scalar-data": "scalar", "macro-vector-data": "vector"}, - "write_data_names": {"micro-scalar-data": "scalar", "micro-vector-data": "vector"}, - "micro_dt": 1.0 + "write_data_names": {"micro-scalar-data": "scalar", "micro-vector-data": "vector"} }, "simulation_params": { + "micro_dt": 1.0, "macro_domain_bounds": [0.0, 25.0, 0.0, 25.0, 0.0, 25.0], "adaptivity": "True", "adaptivity_settings": {