iwfm.iwfm_parametric_interp

iwfm.iwfm_parametric_interp(pnode_xy, pnode_vals, pelems, targets, tol=1e-06)[source]

Interpolate parametric-grid values to target points using finite element shape functions, matching IWFM’s parametric grid method: linear (barycentric) interpolation within triangles and bilinear interpolation within quadrilaterals.

Parameters:
  • pnode_xy (dict) – key = parametric node ID, value = (x, y) coordinates

  • pnode_vals (dict) – key = parametric node ID, value = numpy array of shape (layers, nparam) with parameter values

  • pelems (list) – parametric element connectivity, one entry per element as [n1, n2, n3, n4] node IDs; n4 = 0 for triangles

  • targets (list) – (x, y) coordinates of the points to interpolate to

  • tol (float, default=1e-6) – tolerance for point-in-element tests (fraction of local coordinates)

Returns:

values – shape (len(targets), layers, nparam). Points outside the parametric grid receive the values of the nearest parametric node.

Return type:

numpy array