# Updating the mesh in every time step

**URL:** <https://precice.discourse.group/t/updating-the-mesh-in-every-time-step/1928>\
**Category:** Using preCICE\
**Tags:** dynamic-meshes\
**Created:** [May 16, 2024, 2:09am UTC](https://precice.discourse.group/t/updating-the-mesh-in-every-time-step/1928 "2024-05-16T02:09:02Z")\
**Posts on this page:** 7\
**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:** [May 16, 2024, 2:09am UTC](https://precice.discourse.group/t/updating-the-mesh-in-every-time-step/1928/1 "2024-05-16T02:09:02Z")

</div>

hi,all:

 ![image](https://global.discourse-cdn.com/free1/uploads/precice/original/2X/b/bb900a6d188de50329aafce2310ce516e6dcecf8.png)

As shown above, I want to do a mesh send at each step in the coupling process, what should I do?

---

<div class="post-metadata">

**Author:** ![Makis](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/makis/32/25_2.png) [@Makis](https://precice.discourse.group/u/Makis)\
**Post date:** [May 16, 2024, 7:41am UTC](https://precice.discourse.group/t/updating-the-mesh-in-every-time-step/1928/2 "2024-05-16T07:41:42Z")

</div>

You need to configure your coupling scheme, please read the documentation: [Coupling scheme configuration | preCICE - The Coupling Library](https://precice.org/configuration-coupling.html)

If you are asking how to exchange data in every solver time step, then you need to make the preCICE coupling time window the same as the solver time step size. If you need to use dynamic time step size in your fluid solver, then you can try the `first-participant` option: [Step 5 – Non-matching time step sizes | preCICE - The Coupling Library](https://precice.org/couple-your-code-time-step-sizes.html#first-participant-prescribes-time-step-size)

---

<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:** [May 16, 2024, 8:07am UTC](https://precice.discourse.group/t/updating-the-mesh-in-every-time-step/1928/3 "2024-05-16T08:07:40Z")

</div>

hi：  
“You need to configure your coupling scheme, please read the documentation:”  
I’ve had a look at what you’ve posted but am clueless, so I thought I’d spell out my needs in a bit more detail:  
The current case characterized by large deformations, which means that the mapping matrix of the mesh changes, but as you can see from the diagram I posted above, the mesh mapping matrix is created only once at initialization (shown by the red box line), in which case when the mesh undergoes a large deformation the mapping matrix has actually changed, can this requirement be met by modifying the configuration file?  
if have example is the best!,thanks

---

<div class="post-metadata">

**Author:** ![Makis](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/makis/32/25_2.png) [@Makis](https://precice.discourse.group/u/Makis)\
**Post date:** [May 16, 2024, 8:36am UTC](https://precice.discourse.group/t/updating-the-mesh-in-every-time-step/1928/4 "2024-05-16T08:36:09Z")

</div>

I think what you are referring to is what we call re-meshing / dynamic coupling meshes. You want to update the coupling mesh, not just the data on it:

> **[Moving or changing meshes | preCICE - The Coupling Library](https://precice.org/couple-your-code-moving-or-changing-meshes.html#remeshing-using-precice)**
>
> preCICE supports ALE-methods, direct-mesh-access, and pseudo-meshes to handle most scenarios of moving or changing meshes. A remeshing API is on the roadmap and being actively developped.

Note that this feature is currently in development and the current solution is not very efficient.

---

<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:** [May 16, 2024, 8:48am UTC](https://precice.discourse.group/t/updating-the-mesh-in-every-time-step/1928/5 "2024-05-16T08:48:19Z")

</div>

> [@Makis](#):
>
> want to update the coupling mesh

yes， I want to update the coupling mesh。

---

<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:** [May 16, 2024, 9:25am UTC](https://precice.discourse.group/t/updating-the-mesh-in-every-time-step/1928/6 "2024-05-16T09:25:34Z")

</div>

if use direct-access mesh,Does it mean I have to write my own mapping algorithm?

---

<div class="post-metadata">

**Author:** ![Makis](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/makis/32/25_2.png) [@Makis](https://precice.discourse.group/u/Makis)\
**Post date:** [May 16, 2024, 11:18am UTC](https://precice.discourse.group/t/updating-the-mesh-in-every-time-step/1928/7 "2024-05-16T11:18:35Z")

</div>

Yes, this is one of the use cases of direct mesh access.
