Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Put computation of counting active steps inside the adaptivity variant condition #130

Merged
merged 2 commits into from
Sep 16, 2024
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