Skip to content

Commit

Permalink
Put computation of counting active steps inside the adaptivity varian…
Browse files Browse the repository at this point in the history
…t condition (#130)

* Put computation of counting active steps inside the adaptivity variant condition

* Add CHANGELOG entry
  • Loading branch information
IshaanDesai authored Sep 16, 2024
1 parent d11c5e1 commit c815977
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
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

0 comments on commit c815977

Please sign in to comment.