Get field data at specific points

Hi, I have some vtk files at various time for velocity dataset. The default positions in the velocity field are random, that means the locations of points and number of points would vary for different vtk files. Now I want to get velocity at many specific points for all vtk files so that they have the data at same positions and same amount of data points. Is there any way to do that in paraview? Thanks!

Hi @Ying,

Thanks for posting!

I am not sure I understand the structure of your base data set. Is this a point cloud with velocity information? How do you propose to extrapolate your data to other points?

Is there any way you can share your data or something representative of it?

From your description of the problem, I think the Resample With Dataset filter might be what you are looking for. I cannot say for certain until I understand the structure of your data.

Kind regards,

Hi @jfausty,

Sorry about the unclear description. Yes, my dataset (vtk file) is composed of large amount of points, including coordinates of point (x,y,z) and the corresponding velocity vector (Vx, Vy, Vz).

The file is too large to upload. Each file has about 60,000 points. But I can show the field with points representation (see below).

I get the dataset directly from the surface sampling in OpenFOAM (cuttingPlane utility), and it randomly generates many points to represent a specific plane. So both the number of points and the location of points of these vtk files are different.

I plan to do POD(Proper orthogonal decomposition) on flow fields stored in 5,000 vtk files in chronological order, which demands same size and position of points in each vtk file. That’s why I would like to do that.

Look forward to your reply!

Hi @Ying,

Thanks for the elaboration.

I think your best bet is likely to be the Gaussian Resampling filter. Here is a state file with an example usage: gaussian_resmapling.pvsm (582.4 KB). I use it for random values defined on points of a sphere to output an image data. Here is a volume rendering of the resulting scalar field overlayed with the original points:

One thing to be careful of: I think the Gaussian Resampling filter only works with scalar data for now, so you might have to do it for each component of your vector field and resample them to the same data set afterwards.

Your result should lie on a static regular grid on which you can perform your POD.

Hope that helps!

Best,

Hi @jfausty,

Many thanks for your detailed reply! I find the Resample with Dataset filter seems to be more appropriate for my case.

For example, I have two vtk files with different coordinates of points:

  • file1.vtk with 66003 points
  • file2.vtk with 66089 points

Now I’d like to resample the vorticity-z value (scalar) of file2.vtk into the point cloud of file1.vtk, so I use the following steps:
(1) determine the coordinates of points in file1.vtk
read file1.vtk → open a new spreadsheet view (showing coordinates of points and other values) → Export Spreadsheet as pointTBL.csv
(2) read pointTBL.csv → Table To Points filter
(3) read file2.vtk → Resample with Dataset, choose file2.vtk as “Source” and TableToPoints1 as “Destination mesh” → tick the “Pass Point Array” and “Pass Field Array”
(4) save data to file2_resample.vtk

After above four steps, the dataset in file2_resample.vtk has the same coordinates of points as that in file1.vtk. I also upload the state file for your reference. resample.pvsm (183.6 KB)
Please let me know if my above steps have any problem.

Now my question is the new file2_resample.vtk has different format with file2.vtk.
In file2.vtk, each line has one coordinate (x1 y1 z1), see below:

# vtk DataFile Version 2.0
sampleSurface
ASCII
DATASET POLYDATA
POINTS 66089 double
-0.00206989 0.000506848 -5.98094e-33
-0.00200774 -0.013154 4.93514e-34
-0.00198901 -0.01727 0
....

But in file2_resample.vtk, each line has three coordinates (x1 y1 z1 x2 y2 z2 x3 y3 z3). Of course I can preprocess the file to reshape it format, but is there any way to generate vtk file with same structure directly from paraview?

Look forward to your reply!