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

How to read FieldData? #54

Closed
svretina opened this issue Feb 19, 2024 · 6 comments · Fixed by #66
Closed

How to read FieldData? #54

svretina opened this issue Feb 19, 2024 · 6 comments · Fixed by #66
Labels
enhancement New feature or request

Comments

@svretina
Copy link

Hi,
I am experimenting with the WriteVTK.jl and ReadVTK.jl. I would like to store some 3D scalar field data and the velocity and acceleration of a particle. What I am using to write the vtk file is something like the following:

vtk_grid(dataset, xcoord, ycoord, zcoord) do vtk
                    vtk["Phi"] = statevector[:, :, :, 1]
                    vtk["Pi"] = statevector[:, :, :, 2]
                    vtk["Psix"] = statevector[:, :, :, 3]
                    vtk["Psiy"] = statevector[:, :, :, 4]
                    vtk["Psiz"] = statevector[:, :, :, 5]
                    vtk["Position"] = [xcoord[i], ycoord[j], zcoord[k]]
                    vtk["Velocity"] = [vx, vy, vz]
                end

I can see that the info is written in the vti file correctly. Later in VisIt or with ReadVTK.jl
I cannot retrieve the data for the Position and Velocity which are FieldData.
How could I read these data?

@svretina
Copy link
Author

just saw that there is a PR regarding this issue. It should provide the functionality I am seeking.

@ranocha ranocha linked a pull request Feb 21, 2024 that will close this issue
@ranocha
Copy link
Member

ranocha commented Feb 21, 2024

Since it looks like the PR you mentioned is stalled due to a lack of examples/testing, you're welcome to contribute by helping out there.

@svretina
Copy link
Author

It seems to be an easy task to add some tests, since the functions are relatively simple. But I have not done a PR again, is there something to read to guide how to proceed with it?

@sloede
Copy link
Member

sloede commented Feb 26, 2024

TBH, I have not done it myself this way, but I imagine you could clone the fork used for #42, push the branch in question to your own fork, and then add your tests on top of it. Just to avoid redundant work, it would be good to communicate your plans in #42 such that everyone knows you are picking up there.

@svretina
Copy link
Author

I cloned your pr and had a look at the tests. Should I modify the example repo to add field data to it, or should I create an example file for each VTKData type which would include only some field data and test them instead? Some guidance would be much appreciated! its also a learning process for me.

@sloede
Copy link
Member

sloede commented Feb 26, 2024

I don't know the details of how much as required to test this properly, but assuming that field data is stored similarly for the various mesh file types, I'd say that adding a single file with field data and reading it should suffice.

@ranocha ranocha linked a pull request Oct 25, 2024 that will close this issue
@ranocha ranocha added the enhancement New feature or request label Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
3 participants