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 two adaptivity variants work with different data at the start of the time window #132

Open
IshaanDesai opened this issue Sep 16, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@IshaanDesai
Copy link
Member

In the current implementation, we offer two variants of how the adaptivity is computed:

  1. Compute the adaptivity at the start of every time window
  2. Compute the adaptivity in every iteration of every time window

In the time loop the following operations are done:

  1. Adjust the time step size
  2. Write a checkpoint
  3. If adaptivity computation variant 1 is selected, compute the adaptivity immediately after writing a checkpoint
  4. Read data from preCICE
  5. If adaptivity computation variant 2 is selected, compute the adaptivity

The problem here is that for variant 2, the adaptivity uses the newly read macro-scale data. Variant 1 on the other hand uses the old macro-scale data. In my opinion this is inconsistent.

@mathiskelm @Fujikawas opinions?

@IshaanDesai IshaanDesai self-assigned this Sep 16, 2024
@IshaanDesai IshaanDesai added the bug Something isn't working label Sep 16, 2024
@mathiskelm
Copy link
Collaborator

In the end we want to use the best available data. For the variant 1 this may not be the most recent one.

In addition to the frequency of computing adaptivity we should consider that the participants can be run in different orders. If the macro simulation runs first, then reading in the newly advanced macro-scale data in the first iteration of a new time-step would base the adaptivity on this not-converged data. In the case of variant 1, we should always base the adaptivity on the converged result of the previous iteration. Depending on the order of solvers this may be the data previously read (macro-first) or the new data (micro-first). If switching behavior based on participant order is not desirable, always using the previous data should be preferable, since the macro data didn't change much from the penultimate to last iteration (convergence criterion reached).

In the case of variant 2 the above problem does not arise, as the adaptivity is re-computed for each iteration. However, using older data seem more likely to cause trouble for the convergence and the most recent available macro-data would be best.

In summary, I think for variant 2 the current behavior is correct and for variant 1 the current behavior is the preferable default but delaying adaptivity computation to step 5 would be better if the micro-manager is the first participant in the preCICE coupling.

@Fujikawas
Copy link

In the end we want to use the best available data.

I fully agree.
From this point, I think even when the macro-scale is the first participant and the micro-scale would read in some non-converged data, these data are still useful for the adaptivity calculation. They contain information about the problem in the latest time window. So to do step 3 after data reading makes more sense for me.
And for variant 2 the current sequence is correct.

@IshaanDesai
Copy link
Member Author

If switching behavior based on participant order is not desirable, always using the previous data should be preferable, since the macro data didn't change much from the penultimate to last iteration (convergence criterion reached).

Such switching behavior could possibly be coded in, but in a hacky way. However I doubt how much benefit there is in using the most correct (in the sense of convergence) data from the previous time window. I agree that for variant 1, we should stick to using the converged macro data of the last time window.

for variant 1 the current behavior is the preferable default but delaying adaptivity computation to step 5 would be better if the micro-manager is the first participant in the preCICE coupling.

Why would delaying the adaptivity computation for variant 1 when the Micro manager is the participant be beneficial? Would we not read the same data from the macro participant as we did in the last iteration of the last time window?

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
Development

No branches or pull requests

3 participants