ERROR: This participant attempted to modify the Mesh

Hello everyone,

I am trying to make an adapter for fluid side (flowPsi). I am using two meshes approach:

  1. FluidFace-Mesh: faces centroids to write forces
  2. Fluid-Mesh: nodes locations to read displacement
<participant name="Fluid">
      <use-mesh name="Fluid-Mesh" provide="yes" />
      <use-mesh name="FluidFace-Mesh" provide="yes" />
      <use-mesh name="Solid-Mesh" from="Solid" />
      <write-data name="Force" mesh="FluidFace-Mesh" />
      <read-data name="Displacement" mesh="Fluid-Mesh" />
      <read-data name="Displacement" mesh="FluidFace-Mesh" />
      <mapping:nearest-neighbor
        direction="write"
        from="FluidFace-Mesh"
        to="Solid-Mesh"
        constraint="conservative" />
      <mapping:nearest-neighbor
        direction="read"
        from="Solid-Mesh"
        to="Fluid-Mesh"
        constraint="consistent" />
    </participant>

In the first iteration, when displacement are still zero but grid motion module is already active, I got an error:

---[precice] ERROR:  This participant attempted to modify the Mesh "FluidFace-Mesh" while locked. Mesh modification is only allowed before calling initialize().
---[precice]  Implicitly finalizing in destructor
---[precice]  Synchronize participants and close communication channels

Below is attached config file. I would appreciate any suggestions how to deal with that.

precice-config.xml (2.1 KB)

Best regards,
Michal

Hi,

As the error message states: you are attempting to create vertices after calling initialize() which is not allowed.
You need to define the mesh using the setMesh API functions before calling initialize.

Best
Frédéric

Hi Frédéric,

Thank you for you reply. I used setMeshVertices for both Fluid-Mesh and FluidFace-Mesh. I don’t think new vertices are created. I used grid moving feature with dummy displacement defined by formula, it doesn’t create any new vertices, just move existing ones according to displacement vector.
extreme left position:


extrime rigth position:

neutral position:

Is that kind of mesh movent not allowed by preCICE?

Best regards,
Michal

@Michal preCICE cannot handle moving meshes directly, hence you can call setMeshVertices only once at the beginning, and not in every time step. There are several ways in which moving meshes can be handled in preCICE, which are explained on our website: Moving or changing meshes | preCICE - The Coupling Library