Issues with Reading SolidMesh with Fenics (provided mesh is empty)

I am attempting to do FSI coupling between OpenFOAM and Fenics, but am facing an issue. I am currently having no issues on the FOAM side of things, but receive the following error on the Solid side with Fenics. When I run the coupling, I get:

416216
206697
---[precice]  This is preCICE version 3.1.2
---[precice]  Revision info: no-info [git failed to run]
---[precice]  Build type: Release (without debug log)
---[precice]  Configuring preCICE with configuration "/home/kwasi_dp/CFD_FEA_Coupling_GUI/openfoam_case/precice-config.xml"
---[precice]  I am participant "Solid"
Rank 0 has no part of coupling boundary.
---[precice]  Setting up primary communication to coupling partner/s
---[precice]  Primary ranks are connected
---[precice]  Setting up preliminary secondary communication to coupling partner/s
---[precice]  Prepare partition for mesh Solid-Mesh
---[precice]  Gather mesh Solid-Mesh
---[precice]  Send global mesh Solid-Mesh
---[precice] ERROR:  The provided mesh "Solid-Mesh" is empty. Please set the mesh using setMeshVertex()/setMeshVertices() prior to calling initialize().

For reference, I have an STL downloaded from Solidworks, and converted to an xdmf file using meshio. I then have imported the XDMF file into Fenics and read it into my mesh object. I face no issues when I create a cube mesh directly in Fenics, but I get values back when I read the number of cells/vertices from the mesh after reading in the XDMF file. Any help/advice would be greatly appreciated. I have uploaded my config.xml file and my Fenics/Precice code to this post as well.
precice-config.xml (2.3 KB)
solidpy.txt (3.6 KB)

Hi @kwasi_dp

In the solid.py script, you are using the preCICE adapter for FEniCS, and also the Python bindings of the preCICE API. You don’t need to do:

# Assign the vertices to the mesh
precice._precice_vertex_ids = precice._participant.set_mesh_vertices(
    mesh_name,
    positions,
)

as this call is already done inside the initialize() function of the Adapter class. Please try by removing the above call.

Also, are you running FEniCS in serial in parallel?

Thank you for your response. I tried running my program with and without that section of code commented out, but it did not fix the error. I am running FEniCS in parallel alongside OpenFOAM.

Thanks for confirming. My best guess now is that the mesh imported from the XDMF file is not getting correctly filtered out for the coupling boundary. Manually checking if this filtering is working would make sense.

Additionally we have opened an issue in the FEniCS adapter repository about potentially issues and remedies with XDMF mesh imports: How to use a XDMF mesh in `initialize`? · Issue #193 · precice/fenics-adapter · GitHub

I understand, thank you for your help. In that case, how would you recommend I go about creating a mesh? I created my XDMF from an STL file using meshio, so I could attempt converting to a different format instead of XDMF, possibly GMSH. Do you know of any good sources or tutorials for creating a mesh for file types aside from XDMF?