Tag the geometry with Salome

Hi all, I have a few questions about tagging the geometry with Salome. I would appreciate it if someone could help me.

def convert_med_to_xdmf(
    med_file,
    cell_file="mesh_domains.xdmf",
    facet_file="mesh_boundaries.xdmf",
    cell_type="tetra",
    facet_type="triangle",
):

Is cell_file refers to the groups of volumes in Salome, and is facet_file refers to the groups of faces in Salome? If yes, are the mesh files (.med) of the groups of volumes and the groups of faces exported separately into two .med files? How are the mesh files of groups of volumes and the groups of faces exported separately? Or is it just one mesh file containing the volumes and the faces, then use the meshio to separate the volumes and faces?

  1. What is the function of the code as below?
correspondance_dict = msh.cell_tags

cell_data_types = msh.cell_data_dict["cell_tags"].keys()

  1. “The subdomains (volumes and surfaces) in the .med file were given tags.” Does this mean that the tags are given when the subdomains are built with Salome? For example, tag (is tag=name?) the tungsten volume 6, Cu volume 7, CuCrZr volume 8 in Salome before exporting the meshing file (.med)?
id_top_surf = 9
id_coolant_surf = 10
id_left_surf = 11

If the geometry is built as below, are top_surf, coolant_surf and left_surf all on the X-Y plane with the geometry in Salome?
image
image

  1. In Salome, the mesh and groups of volumes and faces are exported to a single MED file.
    However in FESTIM needs two separate XDMF files for the volume mesh and tags and the facet tags (boundaries).
    The arguments cell_file and facet_file in this function are the path of these two files that will be written when converting the MED file.

  2. In salome, volumes and surfaces are given names (eg. top_surface, coolant_surface, tungsten_volume, etc.). In the XDMF files, each subdomain is tagged with an integer. The correspondance_dict has the correspondance between the names and the integers. cell_data_types is a list of cell types contained in the mesh. Typically, for a 3D unstructured mesh you will have only tetrahedra and triangles.

In salome you can only tag the subdomains with strings and the software automatically assign an integer to it and it’s not user-controlled. This is why correspondance_dict is very important!

You are showing a 3D geometry so it’s hard to draw parallels with the paper since it’s 2D. It depends how you tag things in SALOME.
A good way to check is to

  • Mesh and tag in SALOME
  • convert to XDMF with meshio
  • open the XDMF files in Paraview and inspect the subdomains
  1. In code as below, should I change the ‘med_file’ to the file name that I want to convert?
def convert_med_to_xdmf(
    med_file,
  1. Does “the software automatically assign an integer to it and it’s not user-controlled” mean that I should check the converted XDMF file to know the subdomains with their corresponding integer?

  2. I want to reproduce the 2D results in your article “Influence of interface conditions on hydrogen transport studies”. So I thought I can just use some surfaces from 3D geometry with Salome as the 2D W/Cu/CuCrZr model used in the paper. Is it a wrong way to do that?

  1. Yes
  2. The correspondance_dict in the conversion script should give you the correspondance between the names of the subdomains you have in the SALOME mesh and the integers. So in theory this should be enough, but you should double check by opening the converted XDMF files yes.
  3. I suppose this would work yes
1 Like

Thank you so much for answering all the questions. I really appreciate it.

1 Like