gridap / gridap/Gridap.jl

Read meshes in MFEM or VTK format to build Gridap models

Open
#776 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
879
Forks
119
Avg merge
6d 3h
Merged PRs (30d)
4

Description

I am attempting to port [MFEM examples](https://mfem.org/examples/) to Gridap. They should be useful additions to Gridap's existing tutorial examples.

The first step is to read [example mesh files](https://github.com/mfem/mfem/tree/master/data) defined in [MFEM-supported mesh formats](https://mfem.org/mesh-formats/). Most are in [MFEM's own format](https://mfem.org/mesh-format-v1.0/) (`*.mesh`) and some are in VTK format (`*.vtk`).

Gridap reads Gmsh formats via GridapGmsh.jl, but not other formats. So I need to either:
1. Find a robust tool to convert MFEM `*.mesh` -> Gmsh `*.msh`. Can be any standalone tools possibly not in Julia.
- Unfortunately, the versatile meshio does not support MFEM mesh (nschloe/meshio#456).
- [MFEM's own IO utilities](https://github.com/mfem/mfem/blob/master/mesh/mesh.cpp) is able to read MFEM mesh (`ReadMFEMMesh()`), VTK mesh (`ReadVTKMesh()`) and GMSH (`ReadGmshMesh()`), but can only write out VTK format (`Mesh::PrintVTK`). There is no function to write out GMSH in MFEM; the last-resort is to write `WriteGmshMesh()` inside MFEM from scratch.
2. Write a parser in Julia from scratch, for MFEM-format mesh files. Then build Gripdap model/grid manually.
3. Use [ReadVTK.jl](https://github.com/trixi-framework/ReadVTK.jl) to read VTK-format mesh files, and convert to Gridap's grid representation. The VTK files can be existing files in MFEM's example directory (e.g. [beam-hex.vtk](https://github.com/mfem/mfem/blob/master/data/beam-hex.vtk)), or be converted from MFEM formats (via MFEM's `ReadMFEMMesh()` + `PrintVTK`).

Any suggestions on the quickest & most robust way for such mesh conversion? Thanks!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.