Do you wonder why there is no sendData and receiveData in preCICE? Instead, there only is advance. We call this a high-level API. On this page, you learn which advantages a high-level API has and how communication and control flow in preCICE works.
Updated 01 Jun 23

preCICE distinguishes between serial and parallel coupling schemes:

  • serial: the participants run after one another,
  • parallel: the participants run simultaneously.

Serial coupling schemes

In our example, we currently use a serial coupling scheme:

  <participants first="FluidSolver" second="SolidSolver"/>

FluidSolver is first and SolidSolver second. This means that FluidSolver starts the simulation and computes the first time step, while SolidSolver still waits. Where does it wait? Well, communication in preCICE only happens within initialize and advance:

  • FluidSolver computes the first time step and then sends and receives data in advance. The receive call blocks.
  • SolidSolver waits in initialize for the first data. When it receives the data it computes its first time step and then calls advance.
  • Now, FluidSolver receives data and SolidSolver blocks again.

Serial coupling flow

Try to swap the roles of first and second in your example. Do you see the difference? If everything is just too fast, add some sleep calls.

Parallel coupling schemes

In a way, parallel coupling schemes are much easier here (numerically, they are not, but that’s a different story). Everything is symmetric:

Parallel coupling flow