<div dir="ltr"><div><div><div><div>Paraview Developers,<br><br></div><div>I have timeseries, structured multiblock, density data in the ensight format. For example purposes, say 1000 timesteps and 40 blocks. I would like to export all timesteps for only block#=12, IJK_index=(12,14,1). A common example of doing this is when treating a cell as a virtual pressure-tap. The problem I'm having is verifying that time is actually incrementing, and that the reshape from the 1D vtk array to a 3D numpy array is correct. The following is the core of the script I am using to perform this analysis.<br><br>#####################################################################<br>import paraview.simple as pv<br>pv._DisableFirstRenderCameraReset()<br>import paraview.servermanager as pvs<br>import paraview.numpy_support as pvn<br>import numpy as np<br><br></div><div># hard-coded path to ensight case file<br></div><div>ensight_case_path = '/path/to/ensight.case' # obviously my script has a valid path<br><br># Read in the ensight data<br>ensightcase = pv.EnSightReader(CaseFileName=ensight_case_path)<br>ensightcase.PointArrays = ['Density']<br><br></div><div># loop over each timestep<br></div><div>for t in ensightcase.TimestepValues:<br>    ensightcase.UpdatePipeline(time=t) # TODO: verify that this indeed updates time<br>    <br>    # bring the data to the client<br>    ensightcase_data = pvs.Fetch(ensightcase)<br></div><div><br>    # get the 12th index block (zero-based index, so actually the 13th block)<br>    block = ensightcase_data.GetBlock(12)<br>        <br>    # get the i,j,k dimensions (used next to reshape the numpy array)<br>    shape = block.GetDimensions()<br>        <br>    # "convert" the vtkFloatArray to numpy. comes in 1D, so reshape according to i,j,k<br></div><div>    # TODO: verify that passing vtk's `GetDimensions` to numpy's `reshape` has the desired effect<br></div><div>    block12_array3d = pvn.vtk_to_numpy(block.GetPointData().GetArray('Density')).reshape(shape)<br><br></div><div>    # my real script does stuff with the data. for this example, just print it<br></div><div>    print("time = ", t, "\tdensity = ", block12_array3d[12,14,1])</div><div>#####################################################################<br><br></div>This is a simple problem, but I'm not finding any documentation to backup my two assumptions. Given the importance of this script to my analysis, I wanted to request conformation from the community before going forward. I have quite a lot of data to analysis, so any performance suggestions are also welcome.<br><br></div>Thank you,<br><br></div>Ben Orr<br></div><a href="mailto:benjamincorr@gmail.com">benjamincorr@gmail.com</a><br></div>