fd_interpolate
fd_interpolate(P, gs, h, corner=np.array([0.0, 0.0]))
Bi/Trilinear interpolation matrix
Given a regular finite-difference grid described by the number of nodes on each side, the grid spacing, and the location of the bottom-left-front-most corner node, and a list of points, construct a sparse matrix of bilinear interpolation weights so that P = W @ x
Parameters:
Name | Type | Description | Default |
---|---|---|---|
P |
numpy double array
|
Matrix of interpolated point coordinates |
required |
gs |
numpy int array
|
Grid size [nx,ny(,nz)] |
required |
h |
numpy double array
|
Spacing between grid points [hx,hy(,hz)] |
required |
Returns:
Name | Type | Description |
---|---|---|
W |
scipy sparse.csr_matrix
|
Sparse matrix such that if x are the grid nodes, P = W @ x |
See Also
regular_square_mesh.
Notes
The ordering in the output is consistent with the mesh built in regular_square_mesh
Examples:
TO-DO
Source code in src/gpytoolbox/fd_interpolate.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
|