VTKFortran v3.0.0 is out.
▎ Pure Fortran VTK XML API
- Documentation: VTKFortran Documentation
- GitHub: GitHub - szaghi/VTKFortran: pure Fortran VTK (XML) API · GitHub
VTKFortran is a pure Fortran 2008 library for writing and reading files in the VTK XML format, which ParaView and VisIt open natively. You give it your mesh and your fields as plain Fortran arrays. It writes .vts, .vtu, .pvtu, .vtm, .pvd… files in ASCII, Base64 binary or raw appended form, with optional zlib compression. Starting with this release, it also reads them back.
v3.0.0 is the largest release since the library was created. What’s new:
- Reading: initialize(filename, action=‘read’) reads any serial file, whatever its format, header type or compression. The file is indexed once, and only the arrays you ask for are decoded. It also reads parallel headers (and checks that their pieces exist), multi-block files and time series. Files written by VTK itself are part of the tests.
- New topologies: ImageData (.vti, .pvti) and PolyData (.vtp, .pvtp).
- Time series: a pvd_file writer. The collection stays valid after every dataset you add.
- Large data: 64-bit counts and connectivity for large meshes, and opt-in UInt64 headers for arrays beyond 4 GiB.
- zlib compression for binary and raw appended data.
- More data types: unsigned integer arrays, FieldData arrays and strings, and active arrays (the default scalars, vectors, … that ParaView picks).
- Fixes: polyhedra, GhostLevel, cell types, nested multi-blocks and ASCII rows are now written the way VTK expects.
- New documentation: an eight-chapter tutorial (a heat-equation solver, from the first file to an MPI run and a restart), a cookbook, and reference pages. Every example is a real program that the CI builds and runs, shown next to the ParaView render of the file it writes.
What it covers:
- Image, Rectilinear, Structured and Unstructured grids, and PolyData
- parallel partitioned files (.pvti, .pvtr, .pvts, .pvtu, .pvtp), multi-block files (.vtm, including nested blocks) and time series (.pvd)
- every PENF kind (I1P–I8P, R4P–R8P), with scalars, vectors and tensors
- thread and process safety: each OpenMP thread or MPI rank can write its own files at the same time
- error codes from every procedure, where zero means success
- and much more…
VTKFortran builds with FoBiS, fpm and CMake. It is tested with GNU gfortran (12 to 16) and Intel ifx, and is multi-licensed (GPLv3, BSD 2-Clause, BSD 3-Clause, MIT).
Feedback, issues, and contributions are welcome.
Stefano