Skip to content

fix interpolation

Ankang Gao requested to merge fix/GetLocCoords into master

The interpolation operation sometimes has a very large error, because function v_ContainsPoint returns an incorrect distance between one point and an element. Therefore, function GetExpIndex not always returns the nearest element. This merge request fixes this problem.

1, v_ContainsPoint is suitable for any element type provided spacedim>0, so I moved it to the base class Geometry and reload an empty function for Geometry0D.

2, v_GetLocCoords is moved the base class Geometry1/2/3D.

3, A new function LocCollapsedToLocCoord is added. This is the inverse function of LocCoordToLocCollapsed.

4, in v_LocCoordToLocCollapsed, the collapsed point is not processed properly. For example, in the triangular element, all points with fabs(xi[1]-1.0) < NekConstants::kNekZeroTol are taken as the collapsed point and therefore lie in the element. In actual, this kind of points should lie outside of element.

5, add a constant for machine precison of IEEE double: kNekMachineEpsilon = 2.22e-16;

Interpolation from one region to its subregion is of good accuracy. Extrapolation from one region to its outside regions may contain large errors.

Edited by Ankang Gao

Merge request reports