Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Micro Manager changelog

## latest

- Put computation of counting active steps inside the adaptivity variant `if` condition https://github.com/precice/micro-manager/pull/130

## v0.5.0

- Use absolute values to calculate normalizing factor for relative norms in adaptivity https://github.com/precice/micro-manager/pull/125
Expand Down
28 changes: 14 additions & 14 deletions micro_manager/micro_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,20 +186,20 @@ def solve(self) -> None:
is_sim_active_cp = np.copy(is_sim_active)
sim_is_associated_to_cp = np.copy(sim_is_associated_to)

if self._adaptivity_type == "local":
active_sim_ids = np.where(is_sim_active)[0]
elif self._adaptivity_type == "global":
active_sim_ids = np.where(
is_sim_active[
self._global_ids_of_local_sims[
0
] : self._global_ids_of_local_sims[-1]
+ 1
]
)[0]

for active_id in active_sim_ids:
self._micro_sims_active_steps[active_id] += 1
if self._adaptivity_type == "local":
active_sim_ids = np.where(is_sim_active)[0]
elif self._adaptivity_type == "global":
active_sim_ids = np.where(
is_sim_active[
self._global_ids_of_local_sims[
0
] : self._global_ids_of_local_sims[-1]
+ 1
]
)[0]

for active_id in active_sim_ids:
self._micro_sims_active_steps[active_id] += 1

micro_sims_input = self._read_data_from_precice(dt)

Expand Down