Loose coupling (synchronisation after time window) with pypreCICE


I am wondering wether there is a guide to realize a loose coupling with the python interface pypreCICE .
With loose coupling I mean the autonomous iteration of the solvers for every time window.
After the compleation of every time window, the solvers should synchronize and check for convergence.

My guess to realize this constellation was to lookup the function is_time_window_complete() every iteration and then either exchange data or just advance to the next time step.
Do you think this concept would work?
And can I even advance in time steps without exchanging data?

Certainly yes, if you choose smaller time steps in the solvers than you use for the time windows used by preCICE. There is a nice description in the documentation.

However, I am not sure what you mean with

What do you mean with “autonomous iteration of the solvers”? Do you mean time steps of solvers per time window? Do mean other iterations (Newton solver, solver for linear system of equations…)? “Loose coupling” is, as mentioned on Gitter by @uekerman, usually refers to “explicit” coupling that can be configured out-of-the-box changing the preCICE configuration.

Maybe you could elaborate on what you want to achieve.

This video could also help: High-order and multi-rate time stepping with preCICE (Benjamin Rüth, preCICE Workshop 2020) - YouTube

Thank you for your reply!

I am sorry for the misunderstanding, I meant that the e.g. solid or fluid solver calculate their time window without exchanging data.
I think preCICE provides a solution for this case with implicit first participant time stepping. If I understand it correctly, (for example) the solid solver could do 1 timestep, while the fluid solver is making 5 timesteps. After one time window, the solvers can exchange their results and maybe do the time window again (in case of divergence).

Nice video, I think now I better understand the reason for the change to preCICE 2!

You probably already found everything you need, but maybe for the future reader: in our terms, what you describe we call “subcycling” and it currently works with any of the supporting coupling schemes. The participants can do as many uncoupled time steps as they need, while they have to synchronize at the end of every (arbitrary large) “coupling time window”. To do this, you simply set the solver’s timestep size as dt = min(precice_dt, dt) after an advance().

After overthinking the case again, I am not sure if I can realize this case of loose coupling with subcycling.
I have tried to illustrate my intention below. My idea was to let the both solvers calculate their timesteps in one timewindow individually and exchange / compare their solutions after the end of every time window. Therefore I am wondering if it is possible exchange data (e.g. forces and displacement) for one time window in advance (prediction of potential data).

The arrows you crossed out only mean that the solvers tell preCICE what timestep sizes they used, such that preCICE can track the time of both. No data is communicated here. Data is only communicated at the end of each time window.
If I understand your case correctly, preCICE already does what you want.

Therefore I am wondering if it is possible exchange data (e.g. forces and displacement) for one time window in advance (prediction of potential data).

You mean sth like an explicit coupling (every time window only computed once), but combined with some predictor-corrector method? This is not yet possible (but could be something @BenjaminRodenberg will add to preCICE in the future).

What you can do already now, however, is to use an implicit scheme. Then you have your predictor in the second iteration. And you could also restrict the amount of iterations to 2. Then you are pretty close to such a predictor-corrector scheme already.

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