Skip to content

Commit

Permalink
Move micro_dt from coupling parameters to simulation parameters in th…
Browse files Browse the repository at this point in the history
…e configuration (#114)

* Move micro_dt from coupling_params to simulation_params in the JSON config

* Update CHANGELOG
  • Loading branch information
IshaanDesai authored Jul 9, 2024
1 parent f1eac57 commit 29f93aa
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 23 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/micro-manager-cpp-adaptivity-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions examples/micro-manager-cpp-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions examples/micro-manager-python-adaptivity-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions examples/micro-manager-python-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion micro_manager/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
},
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/micro-manager-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/micro-manager-config_crash.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit 29f93aa

Please sign in to comment.