Exchange data in each time step

Hi everyone,

Recently I feel confused with a question about the data exchange…

I learn from docs that the data are only exchanged in the end of a time window by advance(), but the codes in docs say:

precice.readData("FluidMesh", "Displacements", vertexIDs, dt, displacements);
setDisplacements(displacements);
solveTimeStep(dt);
computeForces(forces);
precice.writeData("FluidMesh", "Forces", vertexIDs, forces);
// if dt = preciceDt, we will exactly reach the end of the window when calling advance
precice.advance(dt);

It seems whatever if the time window is reached, it always carry the readData and writeData, and it means they exchange data. So I am confused.

I also read the describe of advance() in doxygen, it says If computedTimeStepSize < getMaxTimeStepSize(), then the solver hasn't reached the end of a time window and it is subcycling. Depending on the configuration, written data can be used by preCICE to generate additional samples allowing for time interpolation using readData(). This call is computationally inexpensive., so is it relevant to time interpolation?

Thank you !!!

Hi,

Benjamin Rodenberg gave a talk at the last preCICE Workshop about this behaviour.

Feel free to ask further questions if things are still unclear.

Hi fsimonis,

Thank you for your sharing!

This video briefly shows the time interpolation function, but it seems not refer to the detail implementation.

So my questions are:

  1. No matter explicit or implicit coupling is, should we always call read data and write data functions in subcyling? And if it is, what will do in the last step to time window?
  2. Is time interpolation carried in both explicit and implicit coupling?

Thank you in advance!

Let me give you some pointers to our documentation.

Regarding time step sizes and subcycling:

Regarding reading and writing, I would say that in general:

  • read data wherever and whenever you need in the time-window
  • write data before calling advance

More information in our docs:

I answered the question of when time interpolation is available in this topic:

Hope that helps

Thank you fsimonis! It’s much more clear now!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.