cherab / core

The core source repository for the Cherab project.
https://www.cherab.info
Other
44 stars 24 forks source link

Add CylindricalMapper and PeriodicMapperXD #387

Closed vsnever closed 9 months ago

vsnever commented 1 year ago

The AxisymmetricMapper maps the 2D function defined in the RZ-coordinates to Cartesian coordinates. However, Cherab does not currently have a function to map a 3D function defined in cylindrical coordinates to Cartesian coordinates. CylindricalMapper should fill this gap. The function being mapped is considered to be specified in the interval [0, 2π) in polar angle.

3D plasma simulation in tokamaks is often done for a toroidal sector, assuming periodicity in the toroidal direction. To map the results of such simulations to a full torus, a periodic mapper is needed. For generality, periodic mappers can be defined for 1D, 2D and 3D functions:

PeriodicMapper1D(function1d, period)
PeriodicMapper2D(function2d, period_x, period_y)
PeriodicMapper3D(function3d, period_x, period_y, period_z)

Here it is assumed that functions being mapped are defined in [0, period) intervals. period=None means no periodicity in a given direction.

Then, to map a function defined in cylindrical coordinates on a 20° toroidal sector, the user can do:

CylindricalMapper(PeriodicMapper3D(function, None, np.pi / 9, None))

This can be extended on vector functions as well.

vsnever commented 9 months ago

Implemented in #388.