Skip to content
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

Storing a scalar property of the whole grid in a VTK file #1446

Open
maneesh29s opened this issue Dec 7, 2023 · 1 comment · May be fixed by #1460
Open

Storing a scalar property of the whole grid in a VTK file #1446

maneesh29s opened this issue Dec 7, 2023 · 1 comment · May be fixed by #1460

Comments

@maneesh29s
Copy link

I want to store 100x100 grid cells in a VTK file.
Along with the cells and points, I want to store 2 scalar values,
X = 100
Y = 100,
which represent the X and Y dimensions of the grid

The above values can not be stored as point_data or cell_data as X and Y are properties of the whole grid.

https://examples.vtk.org/site/Cxx/PolyData/FieldData/
The above link mentions that "For data that does not align with either points or cells, FieldData should be used"
The Mesh class has a field_data attribute

But the vtk_sections list present in _vtk_51.py does not have any section related to field data.

So what is the best way to store this?

As a workaround, I tried adding a FIELD_DATA section in the _vtk_51.py and made some changes to the write() and _read_section() methods.
This approach solves my issue, but I am not sure if this is valid from the domain point of view.

@chrisflesher
Copy link

chrisflesher commented Jan 4, 2024

I am interested in something similar, storing a single scalar metadata value in a PLY file.

@kaiserls kaiserls linked a pull request Feb 26, 2024 that will close this issue
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 a pull request may close this issue.

2 participants