Import mesh from XDMF file


39
views
1
11 days ago by
Dear FEniCS community,

Does anyone have examples of how to import a mesh from XDMF file to FEniCS including facet and subdomain markers?

Sincerely,

Meen
Community: FEniCS Project

1 Answer


3
11 days ago by

hdf5_file = HDF5File(mpi_comm_world (), \
"mesh_data.hdf5", "r")
# read  mesh  data
mesh = Mesh()
hdf5_file.read(mesh , "Mesh", False)
mvc = MeshValueCollection("size_t", mesh , 0)
hdf5_file.read(mvc , "Mesh/SubDomains")
mf = MeshFunction("size_t", mesh , mvc)​


information above from this presentation: https://fenicsproject.org/pub/course/lectures/2017-nordic-phdcourse/lecture_20_tools_for_visualisation.pdf

1
Thank you very much!
written 10 days ago by Teeratorn Kadeethum  
Please login to add an answer/comment or follow this question.

Similar posts:
Search »