From a5ae45a3da050ec9b03e413330303e7998f91b41 Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Wed, 19 Jul 2023 17:25:42 +0200 Subject: [PATCH 1/4] Add precice.hpp and solver-interface changes to porting guide Very late follow-up of the changes related to https://github.com/precice/precice/issues/1458. The bindings may still need some updates, I would appreciate some feedback there. --- .../couple-your-code-porting-v2-3.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pages/docs/couple-your-code/couple-your-code-porting-v2-3.md b/pages/docs/couple-your-code/couple-your-code-porting-v2-3.md index 88fee0d824..e5b3662e72 100644 --- a/pages/docs/couple-your-code/couple-your-code-porting-v2-3.md +++ b/pages/docs/couple-your-code/couple-your-code-porting-v2-3.md @@ -16,6 +16,11 @@ Please add breaking changes here when merged to the `develop` branch. ## preCICE API +- The main preCICE header file was renamed. This means that you need to: + - Replace `#include "precice/SolverInterface.hpp"` with `#include "precice/precice.hpp"`. + - Where declaring a preCICE object, replace the `precice::SolverInterface` type with `precice::Participant` + - Where constructing a preCICE object, replace the `precice::SolverInterface( ... )` constructor with `precice::Participant( ... )`. + - Consider renaming your objects from, e.g., `interface` to `participant`, to better reflect the purpose and to be consistent with the rest of the changes. - Migrate connectivity information to the vertex-only API. All `setMeshX` methods take vertex IDs as input and return nothing. - Directly define face elements or cells of your coupling mesh available in your solver by passing their vectices to preCICE, which automatically handles edges of triangles etc. See [Mesh Connectivity](couple-your-code-defining-mesh-connectivity) for more information. - Rename `setMeshTriangleWithEdges` to `setMeshTriangle` and `setMeshQuadWithEdges` to `setMeshQuad`. The edge-based implementation was removed. @@ -84,6 +89,7 @@ error: ‘class precice::SolverInterface’ has no member named ‘initializeDat ## preCICE configuration file +- The XML tag `` was removed and all underlying functionality was moved to the `` tag. Remove the lines including `` and ``, and move any attributes (such as `dimensions="3"` or `experimental`) from the `solver-interface` to the `precice-configuration` tag. - Replace mapping constraint `scaled-consistent` with `scaled-consistent-surface`. - Replace `` with ``, and `` with ``. - Replace `` in `` with `` or simply remove it. @@ -134,6 +140,13 @@ A specific solver should only be configured if you want to force preCICE to use ## Language bindings +The renaming of the preCICE API from `SolverInterface` to `preCICE` also applies to all language bindings. The C++ header change `precice/SolverInterface.hpp` to `precice/precice.hpp` becomes: + +- In C: Replace `#include "precice/SolverInterfaceC.h"` with `#include "precice/preciceC.h"` and ` precicec_createSolverInterface( ... )` with ` precicec_createParticipant( ... )`. +- In Julia: Replace `precicec_createSolverInterface( ... )` with `precicec_createParticipant_withCommunicator( ... )`. +- In Matlab: Replace `SolverInterface` with `Participant` everywhere. +- In Fortran, Python: You don't need to change anything. +