# About read/write data in explicite

**URL:** <https://precice.discourse.group/t/about-read-write-data-in-explicite/1716>\
**Category:** Using preCICE\
**Tags:** coupling-schemes\
**Created:** [December 18, 2023, 1:22am UTC](https://precice.discourse.group/t/about-read-write-data-in-explicite/1716 "2023-12-18T01:22:28Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ilovenili](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/ilovenili/32/1663_2.png) [@ilovenili](https://precice.discourse.group/u/ilovenili)\
**Post date:** [December 18, 2023, 1:22am UTC](https://precice.discourse.group/t/about-read-write-data-in-explicite/1716/1 "2023-12-18T01:22:28Z")

</div>

@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?

---

<div class="post-metadata">

**Author:** ![IshaanDesai](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/ishaandesai/32/1048_2.png) [@IshaanDesai](https://precice.discourse.group/u/IshaanDesai)\
**Post date:** [December 18, 2023, 9:05am UTC](https://precice.discourse.group/t/about-read-write-data-in-explicite/1716/2 "2023-12-18T09:05:30Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ilovenili](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/ilovenili/32/1663_2.png) [@ilovenili](https://precice.discourse.group/u/ilovenili)\
**Post date:** [December 19, 2023, 1:21am UTC](https://precice.discourse.group/t/about-read-write-data-in-explicite/1716/3 "2023-12-19T01:21:54Z")

</div>

i have reserch time interpolate, one question is 🙂  
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?

---

<div class="post-metadata">

**Author:** ![fsimonis](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/fsimonis/32/6_2.png) [@fsimonis](https://precice.discourse.group/u/fsimonis)\
**Post date:** [December 20, 2023, 11:30am UTC](https://precice.discourse.group/t/about-read-write-data-in-explicite/1716/4 "2023-12-20T11:30:04Z")

</div>

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 | ❌ | ❌ |
| parallel-implicit | it\>1 | it\>1 |
| serial-explicit | ❌ | ✅ |
| serial-implicit | it\>1 | ✅ |

---

<div class="post-metadata">

**Author:** ![ilovenili](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/ilovenili/32/1663_2.png) [@ilovenili](https://precice.discourse.group/u/ilovenili)\
**Post date:** [December 21, 2023, 1:36am UTC](https://precice.discourse.group/t/about-read-write-data-in-explicite/1716/5 "2023-12-21T01:36:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ilovenili](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/ilovenili/32/1663_2.png) [@ilovenili](https://precice.discourse.group/u/ilovenili)\
**Post date:** [January 4, 2024, 5:06am UTC](https://precice.discourse.group/t/about-read-write-data-in-explicite/1716/6 "2024-01-04T05:06:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![fsimonis](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/fsimonis/32/6_2.png) [@fsimonis](https://precice.discourse.group/u/fsimonis)\
**Post date:** [January 4, 2024, 12:03pm UTC](https://precice.discourse.group/t/about-read-write-data-in-explicite/1716/7 "2024-01-04T12:03:17Z")

</div>

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 ... />`

---

<div class="post-metadata">

**Author:** ![ilovenili](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/ilovenili/32/1663_2.png) [@ilovenili](https://precice.discourse.group/u/ilovenili)\
**Post date:** [January 8, 2024, 10:21am UTC](https://precice.discourse.group/t/about-read-write-data-in-explicite/1716/8 "2024-01-08T10:21:19Z")

</div>

it’s clear,very thanks!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/precice/original/1X/67d2a5fa6f80e597e2267ff17fa8c1673cd11caa.svg) [@system](https://precice.discourse.group/u/system)\
**Post date:** [January 21, 2024, 10:41pm UTC](https://precice.discourse.group/t/about-read-write-data-in-explicite/1716/9 "2024-01-21T22:41:29Z")

</div>

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