# Interpolation errors

**URL:** https://discourse.paraview.org/t/interpolation-errors/11452
**Category:** ParaView Support
**Created:** [February 20, 2023, 9:23pm UTC](https://discourse.paraview.org/t/interpolation-errors/11452 "2023-02-20T21:23:05Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Frankx9](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/f/3e96dc/32.png) [@Frankx9](https://discourse.paraview.org/u/Frankx9)
#### Post date: [February 20, 2023, 9:23pm UTC](https://discourse.paraview.org/t/interpolation-errors/11452/1 "2023-02-20T21:23:05Z")

</div>

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:

```auto
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)

 ![Screenshot 2023-02-20 at 22.11.55](https://discourse.paraview.org/uploads/default/original/2X/3/3047a9d5cf97b78ca69b5122ff2177454a6ae5fc.png)  
 ![Screenshot 2023-02-20 at 22.11.38](https://discourse.paraview.org/uploads/default/original/2X/b/bcb328a0a5ee22de6e3a5a57d5f3ff7857d02dd7.png)

Regards,

---

<div class="post-metadata">

### Author: ![Kenneth\_Moreland](https://discourse.paraview.org/user_avatar/discourse.paraview.org/kenneth_moreland/32/15033_2.png) [@Kenneth\_Moreland](https://discourse.paraview.org/u/Kenneth_Moreland)
#### Post date: [February 20, 2023, 9:48pm UTC](https://discourse.paraview.org/t/interpolation-errors/11452/2 "2023-02-20T21:48:46Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Frankx9](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/f/3e96dc/32.png) [@Frankx9](https://discourse.paraview.org/u/Frankx9)
#### Post date: [February 20, 2023, 10:05pm UTC](https://discourse.paraview.org/t/interpolation-errors/11452/3 "2023-02-20T22:05:35Z")

</div>

Hi @Kenneth_Moreland,

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

---

<div class="post-metadata">

### Author: ![Kenneth\_Moreland](https://discourse.paraview.org/user_avatar/discourse.paraview.org/kenneth_moreland/32/15033_2.png) [@Kenneth\_Moreland](https://discourse.paraview.org/u/Kenneth_Moreland)
#### Post date: [February 21, 2023, 2:15pm UTC](https://discourse.paraview.org/t/interpolation-errors/11452/4 "2023-02-21T14:15:27Z")

</div>

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](https://discourse.paraview.org/t/plot-difference-between-two-slices/11299)

---

<div class="post-metadata">

### Author: ![Frankx9](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/f/3e96dc/32.png) [@Frankx9](https://discourse.paraview.org/u/Frankx9)
#### Post date: [February 21, 2023, 3:10pm UTC](https://discourse.paraview.org/t/interpolation-errors/11452/5 "2023-02-21T15:10:45Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Kenneth\_Moreland](https://discourse.paraview.org/user_avatar/discourse.paraview.org/kenneth_moreland/32/15033_2.png) [@Kenneth\_Moreland](https://discourse.paraview.org/u/Kenneth_Moreland)
#### Post date: [February 21, 2023, 6:13pm UTC](https://discourse.paraview.org/t/interpolation-errors/11452/6 "2023-02-21T18:13:09Z")

</div>

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).
