Discrete3DMesh#
- class cherab.lhd.emc3.cython.Discrete3DMesh#
Bases:
IntegerFunction3DDiscrete 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]\):
indices1at \((R, Z, \phi_r)\)\(\phi_r \in (18, 36]\):
indices2at \((R, -Z, 36^\circ - \phi_r)\)\(\phi_r \in (36, 54]\):
indices3at \((R, Z, \phi_r - 36^\circ)\)\(\phi_r \in (54, 72]\):
indices4at \((R, -Z, 72^\circ - \phi_r)\)
indices1&indices2must be specified as 1-D numpy array, the others are optional. If they are None,indices3&indices4are referred toindices1&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:
- tetra
TetraMeshData TetraMeshDatainstances.- indices1
ndarray[uint32, ndim=1] 1-D EMC3-EIRENE’s cell indices array which is used in [0, 18] degree in toroidal.
- indices2
ndarray[uint32, ndim=1] 1-D EMC3-EIRENE’s cell indices array which is used in (18, 36] degree in toroidal.
- indices3
ndarray[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- indices4
ndarray[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
- tetra
Methods
Evaluate the function f(x, y, z)
Attributes
TetraMeshData: Tetrahedral mesh instance