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

Pending work VTK parallel file formats #91

Open
3 tasks
amartinhuertas opened this issue Oct 21, 2021 · 2 comments
Open
3 tasks

Pending work VTK parallel file formats #91

amartinhuertas opened this issue Oct 21, 2021 · 2 comments

Comments

@amartinhuertas
Copy link
Contributor

cc @jipolanco @fredrikekre @fverdugo

Some context on this issue:

Let me register here the tasks which are pending from PR #90 so that we do not lose track of them:

  • Extend current pvtk_grid API such that it is ALSO able to handle PImageData, PRectilinearGrid, and PStructuredGrid parallel formats as well. These formats have extra global and piece-wise attributes whose values have to be provided (to pvtk_grid I would say) apart from the attributes of the local portions. For example, WholeExtent (global) and Extent (piece-wise), respectively.
  • Develop the remaining code to support parallel file formats different from PUnstructuredGrid. This is a minor dev. E.g., the fact that PRectilinearGrid uses the <PCoordinates> XML element, instead of the <PPoints> one.
  • Test all parallel file formats different from PUnstructuredGrid.
@corentin-dev
Copy link
Contributor

I started the work here for PRectilinear and PStructuredGrid (but not yet PImageData): corentin-dev@49259fa

Do you have any idea how WholeExtent can be computed in the case of an MPI computation?

Is there any offset to add to Extent?

@corentin-dev
Copy link
Contributor

corentin-dev commented Jan 13, 2022

An example, not yet MPI:

using WriteVTK

nx,ny,nz = 128,128,128

x = Array(LinRange(0.,1.,nx))
y = Array(LinRange(0.,1.,ny))
z = Array(LinRange(0.,1.,nz))

x3 = repeat(x,1,ny,nz)
y3 = repeat(reshape(y,1,ny,1),nx,1,nz)
z3 = repeat(reshape(z,1,1,nz),nx,ny,1)

field = zeros(nx,ny,nz)
@. field = sin(2π*x) * sin(2π*y) * sin(2π*z)

vtkfile_ps = pvtk_grid("test-parallel", x3, y3, z3; part = 1, nparts = 1)
vtkfile_ps["field_point"] = field
vtkfile_ps["field_cell", VTKCellData()] = field[1:end-1,1:end-1,1:end-1]
vtk_save(vtkfile_ps)

vtkfile_pr = pvtk_grid("test-parallel", x, y, z; part = 1, nparts = 1)
vtkfile_pr["field_point"] = field
vtkfile_pr["field_cell", VTKCellData()] = field[1:end-1,1:end-1,1:end-1]
vtk_save(vtkfile_pr)

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

No branches or pull requests

2 participants