diff --git a/content/docs/couple-your-code/advanced/couple-your-code-coupling-flow.md b/content/docs/couple-your-code/advanced/couple-your-code-coupling-flow.md index 68ee6ad84b..0023a8ecc9 100644 --- a/content/docs/couple-your-code/advanced/couple-your-code-coupling-flow.md +++ b/content/docs/couple-your-code/advanced/couple-your-code-coupling-flow.md @@ -7,8 +7,8 @@ summary: "Do you wonder why there is no `sendData` and `receiveData` in preCICE? preCICE distinguishes between serial and parallel coupling schemes: -* **serial**: the participants run after one another, -* **parallel**: the participants run simultaneously. +- **serial**: the participants run after one another, +- **parallel**: the participants run simultaneously. ## Serial coupling schemes @@ -30,9 +30,83 @@ In our example, we currently use a serial coupling scheme: *** -Serial coupling flow + + -*** + +{% mermaid %} +sequenceDiagram +participant F as FluidSolver +participant S as SolidSolver + + Note over F: Participant("FluidSolver", ...) + Note over S: Participant("SolidSolver", ...) + + Note over F: precice.initialize() + Note over S: precice.initialize() + + S->>F: SolidMesh (send mesh → receive mesh) + + Note over F: solveTimeStep(...) + Note over F: precice.advance() + + Note over S: waiting + + Note over F: map write data
FluidMesh ––→ SolidMesh
(Forces) + F->>S: Forces (send data → receive data) + + Note over F: waiting + + Note over S: solveTimeStep(...) + Note over S: precice.advance() + + S-->>F: Displacements (send data → receive data) + + Note over F: map read data
FluidMesh ←–– SolidMesh
(Displacements) + + Note over F: solveTimeStep(...) + Note over F: precice.advance() + + Note over S: waiting + + Note over F: map write data
FluidMesh ––→ SolidMesh
(Forces) + F->>S: Forces (send data → receive data) + + Note over S: solveTimeStep(...) + Note over S: precice.advance() + + Note over F: precice.finalize() + Note over S: precice.finalize() + +{% endmermaid %} + +--- 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.