Interpolation errors

Hi,

I have created multiple slices in my domain and I’m trying to interpolate the value of my variables in
slice2 to ... sliceN onto slice1 to have a unique grid which defines those values

I’m using ResampleWithDataset as:

ResampleWithDataset(
                SourceDataArrays=slice2, DestinationMesh=slice1
            )
            Interpolate.PassPointArrays = 1
            Interpolate.ComputeTolerance = 1
            Interpolate.PassCellArrays = 1

But as you can see in the screenshot attached there are points where the interpolation fails - the blue zones (giving values which are nonsense, way lower than any other point in the two domains which I’m considering)


Regards,

Try using different cell locators. If I remember correctly, the default cell locator finds a close point and then traces cell connections trying to find the containing cell. If your data has discontinuous boundaries inside it, that tracing won’t work correctly.

Hi @Kenneth_Moreland,

thanks for the hint, unfortunately, even trying all cell locators the issue still persists, any further idea?

Looking again at your description, it appears that you might be trying to resample one slice with another slice. This is generally a bad idea because sampling a 2D surface in a 3D space often causes the sampling to miss. A better approach is to create a single slice, transform it to the location of the other slice(s), and then resample the original volume in the place of the new slice.

I describe that in more detail here: plot difference between two slices

Hi @Kenneth_Moreland

Thanks for the hint, I’ll try it very soon

As regards the interpolation issue, it is related to how the algorithm handles errors, it adds zeros when interpolation fails. This is not very robust as a patch to a fail into interpolation errors. I believe some improvements can be made onto this side, at least prompting an error message that says that this occurrence has happened it is something useful

The Resample With Dataset filter creates a new field array named vtkValidPointMask to robustly identify which values were outside the mesh (or due to interpolation errors).

1 Like