Skip to content

Commit

Permalink
Warn if only micro-scale data is used in the similarity computation o…
Browse files Browse the repository at this point in the history
…f adaptivity. (#75)

* Warn if only micro-scale data is used in the similarity computation of adaptivity

* Formatting

* Reword warning

* Formatting
  • Loading branch information
IshaanDesai authored Jan 30, 2024
1 parent 6c08889 commit eef4811
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions micro_manager/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import json
import os
from warnings import warn


class Config:
Expand Down Expand Up @@ -123,6 +124,12 @@ def read_json(self, config_filename):
for dname in data["simulation_params"]["adaptivity"]["data"]:
self._data_for_adaptivity[dname] = exchange_data[dname]

if self._data_for_adaptivity.keys() == self._write_data_names.keys():
warn(
"Only micro simulation data is used for similarity computation in adaptivity. This would lead to the"
" same set of active and inactive simulations for the entire simulation time. If this is not intended,"
" please include macro simulation data as well.")

self._adaptivity_history_param = data["simulation_params"]["adaptivity"]["history_param"]
self._adaptivity_coarsening_constant = data["simulation_params"]["adaptivity"]["coarsening_constant"]
self._adaptivity_refining_constant = data["simulation_params"]["adaptivity"]["refining_constant"]
Expand Down

0 comments on commit eef4811

Please sign in to comment.