diff --git a/src/io/README.md b/src/io/README.md index 6a4d254..4c5b7fc 100644 --- a/src/io/README.md +++ b/src/io/README.md @@ -1,19 +1,37 @@ + + # 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. diff --git a/src/mesh/README.md b/src/mesh/README.md index 416918b..13841ed 100644 --- a/src/mesh/README.md +++ b/src/mesh/README.md @@ -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