Skip to content

Commit

Permalink
add xdmf stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
aradermacher committed Oct 18, 2023
1 parent d1b3f03 commit ed4389e
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions amworkflow/meshing/meshing.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,16 @@ def create(
phy_gp = model.getPhysicalGroups()
model_name = model.get_current()

# # save
# msh, cell_markers, facet_markers = gmshio.model_to_mesh(model, MPI.COMM_SELF, 0)
# msh.name = model_name
# cell_markers.name = f"{msh.name}_cells"
# facet_markers.name = f"{msh.name}_facets"
# with XDMFFile(msh.comm, out_xdmf, "w") as file:
# file.write_mesh(msh)
# file.write_meshtags(cell_markers)
# msh.topology.create_connectivity(msh.topology.dim - 1, msh.topology.dim)
# file.write_meshtags(facet_markers)
# save
msh, cell_markers, facet_markers = gmshio.model_to_mesh(model, MPI.COMM_SELF, 0)
msh.name = model_name
cell_markers.name = f"{msh.name}_cells"
facet_markers.name = f"{msh.name}_facets"
with XDMFFile(msh.comm, out_xdmf, "w") as file:
file.write_mesh(msh)
file.write_meshtags(cell_markers)
msh.topology.create_connectivity(msh.topology.dim - 1, msh.topology.dim)
file.write_meshtags(facet_markers)

if out_vtk:
gmsh.write(str(out_vtk))
Expand Down

0 comments on commit ed4389e

Please sign in to comment.