MATLAB: Interpolate values triangular prism mesh on unstructured tetrahedral mesh

3dinterpolation

I am trying to interpolate the values of a fine structured triangular prism (=wedge) mesh on a coarser unstructured tetrahedral mesh. For both meshes, I have the x,y,z coordinates of the cell center, so in principle it is just a question of finding the x nearest neighbors of the coarse mesh and assign a weight average of the values of these points to the tetrahedron of the coarse mesh. I actually thought this would be possible with the interp3 function, but it gives me an error message stating that my values are not monotonously increasing. Any clue on how I can efficiently to this interpolation job? Best regards and thanks in advance for your help. Sarah

Best Answer

interp3 is not designed to solve an interpolation on a scattered set. It REQUIRES a regular, rectangular mesh. If you lack that, then it won't work. Anyway, just finding the nearest set of k neighbors is a bad way to do interpolation, since it need not yield a continuous prediction.
You need to use tools like scatteredInterpolant, or if you already have the tessellated mesh, then something like tsearchn.