docs(io,mesh): describe Gmsh and VTK extension workflows

Align module READMEs with the weakdep extension pattern: WriteVTK VTU export,
Gmsh MSH import, and thin stubs in the unconditional load path.

- Expand src/io/README with SPDX banner, VTK section, and stub policy note
- Mesh README import blurb cites Gmsh stubs and JuliaFEMGmshExt activation
This commit is contained in:
Jukka Aho
2026-05-11 02:59:02 +03:00
parent 9a0c9d4f14
commit 6e252d6a11
2 changed files with 32 additions and 11 deletions
+27 -9
View File
@@ -1,19 +1,37 @@
<!--
SPDX-FileCopyrightText: 2015-2026 Jukka Aho
SPDX-License-Identifier: MIT
-->
# src/io/
Policy for **external mesh formats** (Gmsh, Netgen, Abaqus, Code Aster, …).
Policy for **external mesh formats** and **visualisation export** (Gmsh, VTK, …).
The core package owns the type-stable mesh model (`Mesh{N, T}` under
`src/mesh/`) and assembly; it does **not** ship format-specific parsers in
`src/io/`. Converters that read third-party files and build `Mesh{…}`,
`element_sets`, and `node_sets` should live in **separate packages** or in
**JuliaFEM package extensions** wired through `[weakdeps]` / `[extensions]` in
`Project.toml`, mirroring the MPI extension pattern (`JuliaFEMMPIExt`).
`src/mesh/`) and assembly; it does **not** ship format-specific parsers or writers
in unconditional `src/io/*.jl` runtime paths. Converters live in **package
extensions** wired through `[weakdeps]` / `[extensions]` in `Project.toml`, mirroring
the MPI pattern (`JuliaFEMMPIExt`).
Legacy `.inp` / `.med` readers tied to the pre-reset API remain under
`src/legacy/io/` and load only with `JULIAFEM_ENABLE_LEGACY=1`.
## VTK (WriteVTK)
- Weak dependency: `WriteVTK` → extension `JuliaFEMWriteVTKExt`.
- User workflow: `using JuliaFEM, WriteVTK` then [`write_vtu_mesh`](@ref) to write
`.vtu` unstructured grids with optional nodal (`point_data`) and per-element
(`cell_data`) fields.
- Supported element shapes for export: linear `Seg2`, `Tri3`, `Quad4`, `Tet4`,
`Hex8` (same single-topology assumption as the rest of the mesh stack).
## Gmsh
- See [`read_gmsh_msh`](@ref) (`JuliaFEMGmshExt`).
## This directory
This folder holds **documentation only** until a new extension or companion
package is added. Do not grow unconditional `include("io/*.jl")` paths in
`JuliaFEM.jl` for heavy or format-specific I/O.
`write_vtu.jl` defines the [`write_vtu_mesh`](@ref) stub and docstring; the
implementation is in `ext/JuliaFEMWriteVTKExt.jl`. Do not add heavy or
format-specific I/O to unconditional `JuliaFEM.jl` includes beyond thin stubs
like this.
+5 -2
View File
@@ -69,8 +69,11 @@ longest edge of each element, doubling the element count per level.
Mesh import from external tools (Gmsh, Netgen, Abaqus, …) is **not** part of
the core load path; use optional extensions or companion packages that build
`Mesh{…}` (see `src/io/README.md`). VTK / XDMF output is not implemented in the
new path; legacy results writers under `src/legacy/` cover older tests.
`Mesh{…}` (see `src/io/README.md`). For **Gmsh**, load `Gmsh.jl` after JuliaFEM
so `JuliaFEMGmshExt` activates, then call [`read_gmsh_msh`](@ref) or
[`mesh_from_current_gmsh_model`](@ref) (`src/mesh/gmsh_stub.jl`). VTK / XDMF
output is not implemented in the new path; legacy results writers under
`src/legacy/` cover older tests.
## Related code