Skip to content

Commit

Permalink
Use micro_dt instead of micro_time_window_size
Browse files Browse the repository at this point in the history
  • Loading branch information
IshaanDesai committed Jun 11, 2024
1 parent 6308787 commit 51e2f91
Show file tree
Hide file tree
Showing 15 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## latest

- Set initial time window size of micro simulation in the configuration, and use it in the coupling https://github.com/precice/micro-manager/pull/112
- 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
- Check if initial data returned from the micro simulation is the data that the adaptivity computation requires https://github.com/precice/micro-manager/pull/109
Expand Down
2 changes: 1 addition & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Parameter | Description
`macro_mesh_name` | Name of the macro mesh as stated in the preCICE configuration.
`read_data_names` | A Python dictionary with the names of the data to be read from preCICE as keys and `"scalar"` or `"vector"` as values depending on the nature of the data.
`write_data_names` | A Python dictionary with the names of the data to be written to preCICE as keys and `"scalar"` or `"vector"` as values depending on the nature of the data.
`micro_time_window_size` | Initial time window size (dt) of the micro simulation.
`micro_dt` | Initial time window size (dt) of the micro simulation.

## Simulation Parameters

Expand Down
2 changes: 1 addition & 1 deletion examples/micro-manager-cpp-adaptivity-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"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_time_window_size": 1.0
"micro_dt": 1.0
},
"simulation_params": {
"macro_domain_bounds": [0.0, 25.0, 0.0, 25.0, 0.0, 25.0],
Expand Down
2 changes: 1 addition & 1 deletion examples/micro-manager-cpp-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"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_time_window_size": 1.0
"micro_dt": 1.0
},
"simulation_params": {
"macro_domain_bounds": [0.0, 25.0, 0.0, 25.0, 0.0, 25.0]
Expand Down
2 changes: 1 addition & 1 deletion examples/micro-manager-python-adaptivity-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"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_time_window_size": 1.0
"micro_dt": 1.0
},
"simulation_params": {
"macro_domain_bounds": [0.0, 25.0, 0.0, 25.0, 0.0, 25.0],
Expand Down
2 changes: 1 addition & 1 deletion examples/micro-manager-python-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"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_time_window_size": 1.0
"micro_dt": 1.0
},
"simulation_params": {
"macro_domain_bounds": [0.0, 25.0, 0.0, 25.0, 0.0, 25.0]
Expand Down
8 changes: 4 additions & 4 deletions micro_manager/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __init__(self, logger, config_filename):
self._macro_mesh_name = None
self._read_data_names = dict()
self._write_data_names = dict()
self._micro_time_window_size = None
self._micro_dt = None

self._macro_domain_bounds = None
self._ranks_per_axis = None
Expand Down 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_time_window_size = data["coupling_params"]["micro_time_window_size"]
self._micro_dt = data["coupling_params"]["micro_dt"]

self._macro_domain_bounds = data["simulation_params"]["macro_domain_bounds"]

Expand Down Expand Up @@ -435,7 +435,7 @@ def is_adaptivity_required_in_every_implicit_iteration(self):
"""
return self._adaptivity_every_implicit_iteration

def get_micro_time_window_size(self):
def get_micro_dt(self):
"""
Get the size of the micro time window.
Expand All @@ -444,4 +444,4 @@ def get_micro_time_window_size(self):
micro_time_window : float
Size of the micro time window.
"""
return self._micro_time_window_size
return self._micro_dt
2 changes: 1 addition & 1 deletion micro_manager/micro_manager_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __init__(self, config_file):
self._logger.info("Provided configuration file: {}".format(config_file))
self._config = Config(self._logger, config_file)

self._micro_dt = self._config.get_micro_time_window_size()
self._micro_dt = self._config.get_micro_dt()

def initialize(self):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"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_time_window_size": 1.0
"micro_dt": 1.0
},
"simulation_params": {
"macro_domain_bounds": [0, 1, 0, 1, 0, 1],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"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_time_window_size": 1.0
"micro_dt": 1.0
},
"simulation_params": {
"macro_domain_bounds": [0, 1, 0, 1, 0, 1],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"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_time_window_size": 1.0
"micro_dt": 1.0
},
"simulation_params": {
"macro_domain_bounds": [0, 1, 0, 1, 0, 1],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"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_time_window_size": 1.0
"micro_dt": 1.0
},
"simulation_params": {
"macro_domain_bounds": [0, 1, 0, 1, 0, 1],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"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_time_window_size": 1.0
"micro_dt": 1.0
},
"simulation_params": {
"macro_domain_bounds": [0, 1, 0, 1, 0, 1],
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/micro-manager-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"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_time_window_size": 0.1
"micro_dt": 0.1
},
"simulation_params": {
"macro_domain_bounds": [0.0, 25.0, 0.0, 25.0, 0.0, 25.0],
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/micro-manager-config_crash.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"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_time_window_size": 1.0
"micro_dt": 1.0
},
"simulation_params": {
"macro_domain_bounds": [0.0, 25.0, 0.0, 25.0, 0.0, 25.0],
Expand Down

0 comments on commit 51e2f91

Please sign in to comment.