cherab.imas.math.UnstructGridVectorFunction2DΒΆ

class cherab.imas.math.UnstructGridVectorFunction2DΒΆ

Bases: Function2D

Simple vector interpolator for the data defined on the 2D unstructured grid.

Find the cell containing the point (x, y) using the KDtree algorithm. Return the 3D vector value for this cell or the fill_vector if the grid does not contain the point.

Parameters:
vertex_coords : (N,3) array_like

2D array-like with the vertex coordinates of triangles.

triangles : (M,3) array_like

2D integer array-like with the vertex indices forming the triangles.

triangle_to_cell_map : (M,1) array_like

1D integer array-like with the indices of the grid cells (polygons) containing the triangles.

grid_vectors : (3,K) ndarray

Array containing 3D vectors in the grid cells.

fill_vector : Vector3D

3D vector returned outside the gird, by default Vector3D(0, 0, 0).

Methods

__call__

Evaluate the function f(x, y)

instance(instance[,Β grid_vectors,Β fill_vector])

Creates a new interpolator instance from an existing UnstructGridVectorFunction2D or UnstructGridFunction2D instance.

__call__()ΒΆ

Evaluate the function f(x, y)

Parameters:
x : float

function parameter x

y : float

function parameter y

Return type:

float

classmethod instance(instance, grid_vectors=None, fill_vector=None)ΒΆ

Creates a new interpolator instance from an existing UnstructGridVectorFunction2D or UnstructGridFunction2D instance.

The new interpolator instance will share the same internal acceleration data as the original interpolator. The grid_vectors of the new instance can be redefined. This method should be used if the user has multiple datasets that lie on the same mesh geometry. Using this methods avoids the repeated rebuilding of the mesh acceleration structures by sharing the geometry data between multiple interpolator objects.

If created from the UnstructGridFunction2D instance, the grid_vectors and the fill_vector must not be None.

Parameters:
instance : UnstructGridFunction2D | UnstructGridVectorFunction2DΒΆ

The instance from which to create the new interpolator.

grid_vectors : (3,K) ndarray, optionalΒΆ

Array containing vector grid data.

fill_vector : Vector3D, optionalΒΆ

3D vector returned outside the grid, by default Vector3D(0, 0, 0).

Returns:

The new interpolator instance.

Return type:

UnstructGridFunction2D | UnstructGridVectorFunction2D