cherab.imas.math.UnstructGridFunction3DΒΆ

class cherab.imas.math.UnstructGridFunction3DΒΆ

Bases: Function3D

Simple interpolator for the data defined on the 3D unstructured grid.

Find the cell containing the point (x, y, z) using the KDtree algorithm. Return the data value for this cell or the fill_value if the grid does not contain the point.

Parameters:
vertex_coords : (N,3) array_like

3D array-like with the vertex coordinates of tetrahedra.

tetrahedra : (M,4) array_like

3D integer array-like with the vertex indices forming the tetrahedra.

tetra_to_cell_map : (M,) array_like

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

grid_data : (L,) ndarray

Array containing data in the grid cells.

fill_value : float, optional

Value returned outside the grid, by default 0.

Methods

__call__

Evaluate the function f(x, y, z)

instance(instance[,Β grid_data,Β fill_value])

Create a new interpolator instance from an existing UnstructGridFunction3D or UnstructGridVectorFunction3D instance.

__call__()ΒΆ

Evaluate the function f(x, y, z)

Parameters:
x : float

function parameter x

y : float

function parameter y

y

function parameter z

Return type:

float

classmethod instance(instance, grid_data=None, fill_value=None)ΒΆ

Create a new interpolator instance from an existing UnstructGridFunction3D or UnstructGridVectorFunction3D instance.

The new interpolator instance will share the same internal acceleration data as the original interpolator. The grid_data 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 UnstructGridVectorFunction3D instance, the grid_data and the fill_value must not be None.

Parameters:
instance : UnstructGridFunction3D | UnstructGridVectorFunction3DΒΆ

The instance from which to create the new interpolator.

grid_data : (L,) ndarray, optionalΒΆ

Array containing data in the grid cells.

fill_value : float, optionalΒΆ

Value returned outside the grid, by default None. If None, inherited from the original instance.

Returns:

New interpolator instance.

Return type:

UnstructGridFunction3D | UnstructGridVectorFunction3D