Skip to content

VTI (VTK XML Imagedata) Support#110

Merged
diogosiebert merged 2 commits intoOPM:devfrom
poro-labcc:vtk
Feb 18, 2026
Merged

VTI (VTK XML Imagedata) Support#110
diogosiebert merged 2 commits intoOPM:devfrom
poro-labcc:vtk

Conversation

@diogosiebert
Copy link
Collaborator

This pull request introduces support for VTI/VTK output (Parallel VTK ImageData XML format), enabling seamless integration with ParaView and facilitating post-processing using Python or MATLAB scripts.

I am submitting a new pull request for this feature because the previous one included additional changes to the code, which would make it harder to track modifications in the future.

This is a standalone implementation and does not require external libraries to build.

In the previous pull request, @JamesEMcClure suggested adding a CMake option to disable building VTK support. Initially, I thought this would be a good idea, but after modifying the CMake configuration, I realized it would require several changes to the CMake scripts for a feature that does not depend on external libraries. Since users can simply ignore it if they do not want to use it, the added complexity does not seem justified.

The implementation has been designed to preserve the existing structure of the IO module and to reuse already allocated arrays, ensuring both consistency and memory efficiency.

The output format can be configured through the simulation input file as follows:

Visualization {
   format = "vtk"
}

When selected, this option generates VTK-compatible output files that can be directly visualized in ParaView or used for further analysis in external tools.

Due to the current approach used for storing velocity components—where each component is maintained as a separate scalar array—the velocity field is not written as a vector field in the VTK output.

This limitation does not affect the correctness of the data and can be easily addressed in ParaView by combining the individual scalar components into a vector field. The same behavior also occurs in the SILO output format.

Also included in this PR is a small bug fix related to IO::initialize function usage. This function requires a bool parameter but some calls in code used "true" or "false" as a string leading to incorrect behavior.

@diogosiebert diogosiebert merged commit 58d0f7b into OPM:dev Feb 18, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants