Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@BenjaminRodenberg
Copy link
Member

@BenjaminRodenberg BenjaminRodenberg commented Apr 22, 2023

Currently, the computation of the adaptive solverDt happens after the read. I would argue that it should happen before the read. I guess the original idea here was that the computation of the solverDt depends on the quantity that was read. However, I think this does not make sense for the following two reasons:

  1. If we use waveforms, we need the dt before reading, not after. See also v3: Make dt mandatory in documentation #257
  2. If the adaptive solverDt depends on the quantity read from preCICE, then we need to read that quantity also at the right location in time. This leads somehow to a deadlock, that we could, for example, solve by iterating:
bool solverDtChanging = true;
solverDt = beginTimeStep(displacements); // e.g. compute adaptive dt that depends on displacements
while(solverDtChanging) {
  dt = min(preciceDt, solverDt);
  precice.readBlockVectorData(displID, vertexSize, vertexIDs, dt, displacements);
  oldSolverDt = solverDt;
  solverDt = beginTimeStep(displacements);
  solverDtChanging = check(solverDt, oldSolverDt, tol);
}

Copy link
Member

@uekerman uekerman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense

@BenjaminRodenberg BenjaminRodenberg merged commit 3b82480 into master Apr 24, 2023
@BenjaminRodenberg BenjaminRodenberg deleted the adaptive-dt-before-read branch April 24, 2023 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants