Stencil jumping

This algorithm finds extensive use in Computational Fluid Dynamics (CFD) in terms of holecutting and interpolation when two meshes lie one inside the other.

A combination of both the binary search and the stencil jumping algorithm will yield an optimum result in the minimum possible time.

The vertices of the grid element are denoted by A, B, C and D and the vectors AB, BC, CD, DA, OA, OB, OC and OD are represented.

The cross product of OA and AB will yield a vector perpendicular to the plane coming out of the screen.

It will be observed that the cross products of OB and BC, OC and CD; and OD and DA are all positive.

The point O lies inside the grid element ABCD.
The point O lies outside the grid element ABCD.