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

The data in adaptivity setting didn't work as expected #100

Closed
Fujikawas opened this issue May 7, 2024 · 2 comments · Fixed by #109
Closed

The data in adaptivity setting didn't work as expected #100

Fujikawas opened this issue May 7, 2024 · 2 comments · Fixed by #109
Assignees
Labels
bug Something isn't working

Comments

@Fujikawas
Copy link
Member

With the develop branch, I want to run the two-scale-heat-conduction tutorial case with less data sets involved in the adaptivity study.
The original json file is here, I changed the simulation_params section to:

    "simulation_params": {
      "macro_domain_bounds": [0.0, 1.0, 0.0, 0.5],
      "adaptivity": "True",
      "adaptivity_settings": {
            "type": "global",
            "data": ["k_00", "concentration"],
            "history_param": 0.1,
            "coarsening_constant": 0.2,
            "refining_constant": 0.05,
            "every_implicit_iteration": "False",
            "similarity_measure": "L2rel"
        }
    },

to match the new format from commit e6641ba and use less data for the adaptivity.
It threw following error:

  File ".../two-scale-heat-conduction/micro-dumux/run_micro_manager.py", line 7, in <module>
    manager = MicroManager("micro-manager-config.json")
  File ".../python3.10/site-packages/micro_manager/micro_manager.py", line 128, in __init__
    self._initialize()
  File ".../python3.10/site-packages/micro_manager/micro_manager.py", line 483, in _initialize
    self._data_for_adaptivity[name][0] = initial_micro_output[name]
KeyError: 'k_11'
@Fujikawas Fujikawas added the bug Something isn't working label May 7, 2024
@tjwsch
Copy link
Collaborator

tjwsch commented May 7, 2024

The error probably occurs because "k_11" is set and returned in the initialize-method in nutils micro.py or dumux micro.cpp, respectively, leading to a mismatch as it is not expected to be initialized for the initial adaptivity computation. This can be solved by removing the line output_data["k_11"] = k[1][1] from the nutil micro.py (and correspondingly from the dumux micro.cpp). It is thus likely caused by a faulty microsimulation and not by a bug in the Micro Manager.

@IshaanDesai
Copy link
Member

This is indeed a problem which comes up when the initialize() method of the micro simulation does not return the correct quantities. Nevertheless, the error message can be better than what is seen right now. I will change it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants