Hello,
first of all, my excuses if i am not clear enought please bear with me as It is my first post.
I want to use FEniCSx to do some FEM simulations, I do not use Gmsh but Salome for my geometry and mesh generation.
I installed FEniCSx using:
sudo add-apt-repository ppa:fenics-packages/fenics
sudo apt update
sudo apt install fenicsx
and now in python i can import dolfinx
The first thing i would like to do is be able to import my mesh generated in salome:
In salome, similar to gmsh, i can create dedicated groups for the boundary conditions and other, 1D, 2D and 3D groups (where they will contain, edges, faces, and volumes/cells of the mesh).
Nativally I can export the mesh in the following formats: GMF Ascii, MED 4.2, IDEAS (unv),cgns.
I could also use the integrated meshio to export to .msh (nevertheless I am less keen to use the integrated meshio, as it has proved in the past to be buggy, such as it has the exporting on format xdmf which from what I found is the ideal format for fenicsx does not work.).
Reason for this current post,
I am looking to bring the mesh created (with the different groups) from salome to a fenicsx simulation. I tried using (in a python file test.py outside of salome):
import meshio
mesh = meshio.read(
'/home/franco/Downloads/dummyFiles/test/hexa.med'
)
mesh.write(
'/home/franco/Downloads/dummyFiles/test/hexa.xdmf' )
Then run it by using python3 test.py, this proven to ‘write’ the mesh in the desired xdmf format, nevertheless, i am having some trouble still:
The groups I have created in salome disappeared, there is only a cell_tags i can see in paraview, that are negative from -12 to 0, where each negative int value looks like it corresponds to one of the groups that i had in salome, from the -12 until the -6 but the -5 to -1 are empty and furthermore the 0 I dont finish of recognizing what corresponds to as it does not completely correspond to anything I have a tag on salome nor the submeshes.
my questions and what i would require help/recommendations would be:
- with the formats i can export to, what would be a good workflow where I could keep the boundary names? to use in the simulation after? for example, I can see that the UNV format keeps the names of the groups stored in the file, I can not say it for the MED nor cgns (as they are write in binary), the GMF does not save anything related to the groups,
- once I get the mesh in the correct format with all the information (point 1.) how can I import it to fenicxs to run a simple simulation over it? I did not find any tutorial with mesh importation + definition of a simple boundary conditions.
I am sorry if it is not clear enough, I do not have experience with fenicxs (nor gmsh), but have some with OpenFOAM and a lot with salome. what I would like to succed right now is to do the complete pre processing with salome for fenicxs as I did for OpenFOAM, that once the workflow was developed i could simply ‘plug’ it to it and get my simulation to be able to run (obviously after one needs to define the boundary conditions and physics for the solver).
thanks in advance,




