Hello,
I have a mesh file in “xml” with the associated "facet_region.xml "and “physical_region.xml”
Could you please tell me how to introduce my pdes for each domain?
Thank you
dokken
April 11, 2020, 4:00pm
2
See for instance this demo . However, i would advice you to But use xml, But xdmf, as described in these two posts :
Hello,
I recently had to import GMSH mesh in Fenics, so I wrote a small script to ease the import.
This script uses meshio to convert a GMSH mesh file (msh2, msh40, msh41) into two XDMF files: one for the domain and another to store the physical groups defined in GMSH. There is also an utility function returning the Mesh and the MeshFunction associated to those files. The script and more details about its usage are available at: https://github.com/floiseau/msh2xdmf .
Feel free to recommend any…
and
@fforteneto , After some help from @nschloe , the following code will work with the newest meshio:
import meshio
msh = meshio.read("mesh.msh")
for cell in msh.cells:
if cell.type == "triangle":
triangle_cells = cell.data
elif cell.type == "tetra":
tetra_cells = cell.data
for key in msh.cell_data_dict["gmsh:physical"].keys():
if key == "triangle":
triangle_data = msh.cell_data_dict["gmsh:physical"][key]
elif key == "tetra":
tetra_data = msh.cell_da…
1 Like