-
-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reuse mesh when saving to VTX #2738
Reuse mesh when saving to VTX #2738
Conversation
A few things that I think could be useful to consider:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only thing I'm missing from this PR is a test in C++ or Python on usage, as adding it with no testing in the library is a way of introducing bugs.
@jorgensd I added a unit test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small comments then I think this can be merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a test that checks if data is placed in appropriate steps with the VTXMeshPolicy.update
and VTXMeshPolicy.reuse
.
I guess we should add a note somewhere that reuse
can only be opened in Paraview>=5.12
Co-authored-by: Jørgen Schartum Dokken <dokken92@gmail.com>
Anything else that I can do for you guys? :) |
Similarly to Fides, VTX too supports saving the mesh only once and reusing it for all time steps. The reason this didn't work out-of-the-box when we implemented the corresponding functionality for Fides was that, while the mesh was only saved once and the actual finite element functions were saved many times -- which is correct -- the functions
"vtkOriginalPointIds"
and"vtkGhostType"
were saved only once too as they are saved when saving a mesh. For some reason, ADIOS2 needs them to be saved for each time step, probably because it needs all functions to be saved at all time steps. See https://gitlab.kitware.com/vtk/vtk/-/issues/19033 for more details.This pull request follows in the footsteps of the one that implemented mesh reuse for Fides but also fixes this issue by caching the data for
"vtkOriginalPointIds"
and"vtkGhostType"
when the mesh is written and saving additional copies of these functions at each time step.The main change is in
VTXWriter::write
where the code now checks if the policy is to always write the mesh [or if it's the first write], in which case it writes the mesh before writing the functions. In case the policy is to reuse the mesh, it only writes the necessary data [as discussed above] and the functions.