Skip to content

[MeshioPlusPlusApplication] Multi-format mesh I/O, mesh operations and field-data operations - #14583

Open
loumalouomega wants to merge 92 commits into
KratosMultiphysics:masterfrom
loumalouomega:core/adding-meshioplusplus-io
Open

[MeshioPlusPlusApplication] Multi-format mesh I/O, mesh operations and field-data operations#14583
loumalouomega wants to merge 92 commits into
KratosMultiphysics:masterfrom
loumalouomega:core/adding-meshioplusplus-io

Conversation

@loumalouomega

@loumalouomega loumalouomega commented Jul 17, 2026

Copy link
Copy Markdown
Member

name: ✨ Feature
about: MeshioPlusPlusApplication: multi-format mesh I/O, mesh operations and field-data operations


📝 Description

Adds MeshioPlusPlusApplication, wrapping the meshio++ library to bring multi-format mesh I/O, native read/write support for ~35 mesh file formats (vtu, vtk, gmsh, med, xdmf, abaqus, medit, stl, obj, su2, tecplot, unv, ...) in addition to .mdpa., and a full mesh/data operations layer into Kratos, consumed as a normal external dependency (nothing vendored — built and installed separately, linked via find_package(meshioplusplus CONFIG REQUIRED COMPONENTS CXX)).

I/O (MeshioPlusPlusIO)

  • 41 readable / 43 writable formats, including the Kratos-native mdpa, resolved explicitly or by extension.
  • Sub model parts map to meshio++ named regions (nesting included); registered entity names (SmallDisplacementElement3D4N, ...) and Properties material data are preserved across a round trip instead of degrading to the generic cell-type name / losing values.
  • Transient output: single-file XDMF temporal collections, file series for every other format, append-safe restart and crash-safe flushing.
  • kratos/python_scripts/python_solver.py's _ImportModelPart now delegates any input_type the core doesn't handle itself to this application (lazily imported, so the core has no hard dependency on it).

Mesh operations (MeshioPlusPlusMeshOperations)

  • Data-driven through Parameters, one "operation" name per meshio++ verb: clean, transform, convert_cells, refine, decimate, smooth, reorder, extract_surface, extract_skin, crop_bbox, crop_halfspace, slice, isosurface, attach_quality, split, partition, stats, quality, plus Merge, Diff, ComputeStatistics/Quality/Bandwidth as separate entry points.
  • Field-data operations layer: data_calc, data_condition, data_manage, data_info, point_data_to_cell_data, cell_data_to_point_data, and cross-mesh Interpolate (nearest/barycentric sampling of one mesh's field data onto another's geometry).
  • Nodal/elemental/conditional variables, flags and ids now flow through the operations layer end-to-end (opt-in via the same settings MeshioPlusPlusIO uses), which also makes isosurface usable in practice for the first time. A result array survives the trip back into Kratos only when its name matches a registered Variable — documented as a hard framework constraint, not a gap (e.g. attach_quality's own "quality:scaled_jacobian" naming never round-trips).

Python surface

  • Modelers: MeshioInputModeler, MeshioOperationModeler (generic, covers every single-source operation), MeshioInterpolateModeler (dedicated, since Interpolate needs two independent source model parts and doesn't fit the generic shape).
  • MeshioOutputProcess for transient/steady output from a solver's Parameters.
  • Registered in python_registry_lists.py and .github/workflows/ci_apps_linux.json.

Docs & tests

  • applications/MeshioPlusPlusApplication/README.md plus 5 pages under docs/pages/Applications/MeshioPlusPlus_Application/ (Overview, the three modelers, Mesh Operations, Output Process).
  • 79 C++ GTest cases (tests/cpp_tests/) and 56 Python unittest cases (tests/), covering format round trips, transient output, every mesh/data operation, field-data staging and write-back, the write-back constraint, and all three modelers.
  • meshio++ version handling is pinned on MESHIOPLUSPLUS_ABI_VERSION (currently 3, meshio++ v9.2.0+) rather than an exact release, so a release that can't affect a compiled consumer needs no rebuild; a real mismatch fails at configure/link time rather than silently.

This commit introduces the MeshioPlusPlusIO class, which facilitates reading and writing of approximately 35 different mesh file formats using the meshio++ library. The implementation supports both static and transient output, allowing for the extension of existing files or the creation of new ones. Additionally, a dedicated XdmfTimeSeriesWriter class is included to handle the writing of XDMF time series data, ensuring compatibility with ParaView. The new functionality enhances the flexibility and usability of the Kratos framework for various mesh operations.
…al for compatibility; increase buffer size in gmsh.cpp for precision in output formatting
@loumalouomega
loumalouomega force-pushed the core/adding-meshioplusplus-io branch from 870306a to 926cff0 Compare July 27, 2026 20:59
@loumalouomega
loumalouomega removed the request for review from a team July 27, 2026 21:00
@loumalouomega
loumalouomega marked this pull request as ready for review July 28, 2026 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants