Skip to content

Commit d8fede2

Browse files
authored
Fix Model Adaptivity active simulation mask generation for edge case (#270)
* add fix and changelog * Update CHANGELOG.md
1 parent 4cc4901 commit d8fede2

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## latest
44

5+
- Fixed model adaptivity active simulation mask generation for 0 local simulations [#270](https://github.com/precice/micro-manager/pull/270)
56
- Allow `initialize()` to return data that is not used by the adaptivity [#261](https://github.com/precice/micro-manager/pull/261)
67
- Fixed `MicroSimulation` initialization requiring positional parameters [#255](https://github.com/precice/micro-manager/pull/255)
78
- Fixed model adaptivity convergence at resolution boundaries to prevent infinite loops for out-of-range switching requests [#252](https://github.com/precice/micro-manager/pull/252)

micro_manager/adaptivity/model_adaptivity.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,7 @@ def _create_active_mask(self, active_sim_ids: list, size: int) -> np.ndarray:
453453
active_sims = np.ones(size)
454454
else:
455455
mask = np.zeros(size)
456-
mask[active_sim_ids] = 1
456+
if len(active_sim_ids) > 0:
457+
mask[active_sim_ids] = 1
457458
active_sims = mask
458459
return active_sims.astype(bool)

0 commit comments

Comments
 (0)