Discrete3DMesh#

class cherab.lhd.emc3.cython.discrete3dmesh.Discrete3DMesh#

Bases: IntegerFunction3D

Discrete interpolator for indices on a 3-D EMC3-EIRENE cell.

This class offers the callable taking \((X, Y ,Z)\) positional arguments and returning the corresponding cell index.

One cell consists of 8 vertices forming a cubic-like shape (not appropriate cubic), and each cell is divided six tetrahedra to create a tetrahedral mesh.

EMC3-EIRENE cells in LHD have specific periodicity along to the toroidal direction. The region between [0, 72] degree has periodicity in LHD’s equilibrium configuration. Moreover, there are 4 regions: [0, 18], [18, 36], [36, 54], [54, 72] degree in toroidal.

Toroidal angle \(\phi\) is converted like \(\phi_r \equiv \phi \% 72^\circ\). The returned cell index depends on which region includes the point. The relationship between cell indices and \((R, Z, \phi_r)\) in each toroidal regions is represented as follows:

  • \(\phi_r \in [0, 18]\): indices1 at \((R, Z, \phi_r)\)

  • \(\phi_r \in (18, 36]\): indices2 at \((R, -Z, 36^\circ - \phi_r)\)

  • \(\phi_r \in (36, 54]\): indices3 at \((R, Z, \phi_r - 36^\circ)\)

  • \(\phi_r \in (54, 72]\): indices4 at \((R, -Z, 72^\circ - \phi_r)\)

indices1 & indices2 must be specified as 1-D numpy array, the others are optional. If they are None, indices3 & indices4 are referred to indices1 & indices2, respectively.

If the specified point is outside the defined tetrahedral mesh, this callble always returns -1.

To optimise the lookup of tetrahedra, acceleration structure (a KD-Tree) is used from the specified instance of TetraMeshData.

Parameters:
tetraTetraMeshData

TetraMeshData instances.

indices1ndarray[uint32, ndim=1]

1-D EMC3-EIRENE’s cell indices array which is used in [0, 18] degree in toroidal.

indices2ndarray[uint32, ndim=1]

1-D EMC3-EIRENE’s cell indices array which is used in (18, 36] degree in toroidal.

indices3ndarray[uint32, ndim=1], optional

1-D EMC3-EIRENE’s cell indices array which is used in (36, 54] degree in toroidal, if None, this is referred to indices1

indices4ndarray[uint32, ndim=1], optional

1-D EMC3-EIRENE’s cell indices array which is used in (54, 72] degree in toroidal, if None, this is referred to indices2

Methods

__call__

Evaluate the function f(x, y, z)

Attributes

tetra_mesh

TetraMeshData: Tetrahedral mesh instance