1.7. Reading a 3D .vtu file
1.7.1. Read the Mesh
We start by reading a 3D vtu file. The resulting mesh and partition is shown below:
-- Setup the mesh
meshgen = mesh.MeshGenerator.Create({
inputs = {
mesh.FromFileMeshGenerator.Create({
filename = "../../test/assets/mesh/GMSH_AllTets.vtu",
}),
},
partitioner = mesh.PETScGraphPartitioner.Create({ type = "parmetis" }),
})
grid = meshgen:Execute()
mesh.ExportToPVTU(grid, "Read_3D_mesh_only")
1.7.2. The complete input is below:
You can copy/paste the text below or look in the file named tutorials/meshing/read_3D_vtu.lua
:
-- Setup the mesh
meshgen = mesh.MeshGenerator.Create({
inputs = {
mesh.FromFileMeshGenerator.Create({
filename = "../../test/assets/mesh/GMSH_AllTets.vtu",
}),
},
partitioner = mesh.PETScGraphPartitioner.Create({ type = "parmetis" }),
})
grid = meshgen:Execute()
mesh.ExportToPVTU(grid, "Read_3D_mesh_only")