create physical groups for gmsh export

Hello,
I have a 3D volumetric mesh inside paraview, I would like to create the ‘physical groups’ of define the ‘boundaries groups’ to use it in a simulation. currently the mesh is only composed of hexahedrals. the physical groups are on the faces, so firts i tried:

  1. extract surface
  2. group data with the extract surface and the 3D mesh

this gave (at least in logic) what i was looking for, ie., a object that has quads and hexas, but now i can not export anymore in gmsh format. I can only use it on the fully hexa mesh, but if i do this i dont have any physical group.
I would like to be able to divide my exterior faces manually in paraview (creating physical groups), regroup each of this groups with the 3D mesh and export it to a gmsh file (or a openFoam compatible format). is there a correct way to do this?

one can began from waveleght + unstructured cell types filter as 3D mesh to simulate the original workflow without the data.

Your best bet might be to use pyNastran to output a BDF file for the nodes and elements and then import that into gmesh. You can group the elements by property IDs

Hello,
thanks for the answer but i was looking to export directly from paraview, the I/O would be a bottleneck, I know (I think) how to do this using salome, i just wanted to do directly mesh creation → OpenFOAM without more programs involved. for the moment, i will use some utilities of OpenFOAM to be able to create the patches (reason for me of asking for the physical groups).

@mwestphal I allow myself to tag you as you are a direct developer of the pluging. could you confirm me if it is possible to create 2D physical groups for a 3D mesh directly from paraview so one can export the mesh in gmsh format directly?.
I thought about extracting the surface with extract surface filter, divide this filter by different regions and then use group data with the original volumetric mesh?
I would love to be able to not require 2 steps export/import.

The GmshIO plugin can write unstructured grid to Gmsh file format.
Im not sure if that covers you need.

when one needs to create a mesh for simulation, such as for fenicxs or openFoam, one needs to separate the boundaries so one can setup the conditions, such as inlet, outlet etc. when importing meshes from gmsh, one has what are called physical groups, which are for example, for 3D meshes (with volumetric elements) 2D faces on the external surfaces, or for 2D meshes (with only surface elements) 1D edges to indicate this elements.
without this the exporting in gmsh format is rader un usable as it is (at least for simulations) as one in any case needs to go thought gmsh to create them (or in some cases, such as openFOAM, one can more or less with some hacky create the boundaries).
when trying to export a mesh in gmsh format i saw that there is the ‘physical groups’ option in the exporting dialog but it looks like it was using the fields of the mesh, so be able to create only 3D physical groups, where what i was looking for is creating the 2D physical groups for a 3D mesh.