Hello.
I am trying to fetch data from an AMR dataset, but find that this process doesn’t include the point or cell arrays. When I check the data arrays I see that I only have one cell array for “vtkGhostType”.
I’ve gone through this process for Lagrangian data sets before without issue. Is there something special that has to be done for AMR datasets?
Note that I am using a custom AMR reader, in case that might somehow affect this process.
The code that I am using to check/test is below.
Thanks,
Ted
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import paraview.simple as pvs
pvs.sm = pvs.servermanager
famr = '/path/to/some/amr_file.hdf'
print('')
if not os.path.exists(famr):
sys.exit('File does not exist!\n')
ramr = pvs.VelodyneAMRReader(FileNames=[famr])
amr2mbds = pvs.ConvertAMRdatasettoMultiblock(Input=ramr)
amr_cd2pd = pvs.CellDatatoPointData(Input=amr2mbds)
amr_cd2pd.PassCellData = 1
amr_merge = pvs.MergeBlocks(Input=amr_cd2pd)
pvs.UpdatePipeline(0)
#to_fetch = amr2mbds
to_fetch = amr_cd2pd
#to_fetch = amr_merge
amr_mbds = pvs.sm.Fetch(to_fetch)
if to_fetch == amr_cd2pd or to_fetch == amr2mbds:
itero = amr_mbds.NewIterator()
itero.SetSkipEmptyNodes(1)
itero.SetTraverseSubTree(1)
itero.SetVisitOnlyLeaves(1)
itero.InitTraversal()
#itero.GoToNextItem()
cdo = itero.GetCurrentDataObject()
num_arrays_cell = cdo.GetCellData().GetNumberOfArrays()
num_arrays_point = cdo.GetPointData().GetNumberOfArrays()
elif to_fetch == amr_merge:
num_arrays_cell = amr_mbds.GetCellData().GetNumberOfArrays()
num_arrays_point = amr_mbds.GetPointData().GetNumberOfArrays()
print('Number of cell arrays: ', num_arrays_cell)
print('Number of point arrays:', num_arrays_point)