About read/write data in explicite

@Makis ,hi:
you have said to me: “You can write and read data multiple times in a coupling time window, but data exchange will happen only inside an advance(). With time interpolation, you can also ask for interpolated values in readData(…).”.
my question is :
If I request read data multiple times within a time window, is the datas the same? and the data are all come from previous time window?

Hi @ilovenili

Yes, currently preCICE will return the same data if you call the read data command multiple times in a time window, without calling advance(). In the upcoming preCICE release, we will support time interpolation, which will then return interpolated values if you sample within a time window.

i have reserch time interpolate, one question is :slight_smile:
to get the interpolate function , must konw the data in previous time window and the data in current time windows, but the fact is no any data in curren time windows,because curren time window have not finish ,data have not exchange , so what error I understand?

Time interpolation is available if there is previous data available from the same time window.

So, this depends on the coupling-scheme and on the order of participants (first / second). Here a list:

  • parallel explicit
    Never available
  • parallel implicit / multi
    Available after the first iteration in a time window
  • serial explicit
    • first: never available
    • second: always available as it receives time data from the participant running first
  • serial implicit
    • first: available after the first iteration in a time window
    • second: always available as it receives time data from the participant running first

Or as a quick reference

coupling-scheme first second
parallel-explicit :x: :x:
parallel-implicit it>1 it>1
serial-explicit :x: :white_check_mark:
serial-implicit it>1 :white_check_mark:
4 Likes

very thanks, it’s that: the time interpolation function is changing when the number of iterations increases,?
@fsimonis

Here’s what “iteration” specifically refers to?@fsimonis

I’ll answer this with an example:

Let’s consider a parallel-implicit coupling with time-window-size 1.

Solvers start at t=0, and make a single time step to the end of the time window t=1 (dt = 1).
Then this first time step is your first iteration. Only initial data is available, thus reading data at t=0.5 will return the data at t=0 (constant extrapolation).
If your convergence measures aren’t fulfilled or min-iterations haven’t been reached, then the solvers will go back to t=0.

The solvers now take another time step to the end of the time window t=1.
This is your second iteration. Data of the previous iteration allows you to read data at t=0.5, which will then be interpolated between data at t=0 and t=1 (of the previous iteration).

The interpolation function depends on:

  • the start of the time window (or initial data in the first time window). This will not change between iterations of the same time window.
  • time steps of the previous iteration (only the end of the time window if substeps aren’t configured to be exchanged in the coupling scheme)
  • the configured waveform-degree in <data ... />
2 Likes

it’s clear,very thanks!

1 Like

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