Search and Interpolation

ExtendableGrids.gFindLocal! — Function
icellfound=GFindLocal!(xref,cellfinder,p; icellstart=1,eps=1.0e-14, trybrute=true)

Find cell containing point p starting with cell number icellstart.

Returns cell number if found, zero otherwise. If trybrute==true try gFindBruteForce! before giving up. Upon return, xref contains the local (barycentric) coordinates of the point: xref[1]:xref[dim] are the coordinates along the reference edges from node 1 to nodes 2..dim+1 (i.e., the barycentric weights of nodes 2..dim+1) and xref[dim+1] is the barycentric weight of node 1. On Parallelogram2D cells xref = (ξ, η, 1-ξ) and on Parallelepiped3D cells xref = (ξ, η, ζ, 1-ξ), where (ξ,η[,ζ]) are the coordinates in the reference cell.

Note

Supported cell geometries: Edge1D, Triangle2D, Tetrahedron3D, Parallelogram2D, and Parallelepiped3D (also in mixed grids).

source
ExtendableGrids.gFindBruteForce! — Function
icellfound=gFindBruteForce!(xref,cellfinder,p; icellstart=1,eps=1.0e-14)

Find cell containing point p starting with cell number icellstart.

Returns cell number if found, zero otherwise. Upon return, xref contains the local (barycentric) coordinates of the point: xref[1]:xref[dim] are the coordinates along the reference edges from node 1 to nodes 2..dim+1 (i.e., the barycentric weights of nodes 2..dim+1) and xref[dim+1] is the barycentric weight of node 1. On Parallelogram2D cells xref = (ξ, η, 1-ξ) and on Parallelepiped3D cells xref = (ξ, η, ζ, 1-ξ), where (ξ,η[,ζ]) are the coordinates in the reference cell.

Note

Supported cell geometries: Edge1D, Triangle2D, Tetrahedron3D, Parallelogram2D, and Parallelepiped3D (also in mixed grids).

source

Interpolation

ExtendableGrids.interpolate — Function
u_to=interpolate(grid_to, u_from, grid_from;eps=1.0e-14,trybrute=true)

Piecewise polynomial interpolation of function u_from on grid grid_from to grid_to; the value at each node of grid_to is reconstructed with the shape functions of the cell of grid_from the node lies in (linear on simplices, bilinear on Parallelogram2D cells, trilinear on Parallelepiped3D cells). Works for matrices with second dimension corresponding to grid nodes and for vectors.

Warning

May be slow on non-convex domains. If trybrute==false it may even fail.

Note

Supported cell geometries: Edge1D, Triangle2D, Tetrahedron3D, Parallelogram2D, and Parallelepiped3D (also in mixed grids).

source