jax_sbgeom.flux_surfaces.flux_surfaces_utilities module
- generate_thickness_matrix(flux_surface: FluxSurfaceNormalExtendedNoPhi, mesh, n_theta: int, n_phi: int)[source]
Generate thickness matrix of an external mesh with respect to a no-phi extended flux surface.
Uses the internal raytracing utilities to compute the minimum distance from the flux surface to the mesh along the normal directions.
- Parameters:
flux_surface (
FluxSurfaceNormalExtendedNoPhi) – Flux surface to compute thickness from.mesh (Tuple[jnp.ndarray, jnp.ndarray]) – Mesh of the external object (vertices, connectivity).
n_theta (
int) – Number of poloidal points.n_phi (
int) – Number of toroidal points.
- Returns:
theta (jnp.ndarray [n_theta, n_phi]) – Poloidal angles of the thickness matrix.
phi (jnp.ndarray [n_theta, n_phi]) – Toroidal angles of the thickness matrix.
dmesh (jnp.ndarray [n_theta, n_phi]) – Thickness matrix values.
- convert_half_module_points_to_full_module(points_half: Array)[source]
Convert points defined in a half module to points in a full module.
points_half is assumed to be in a shape
[…., n_theta_points, n_phi_points, 3]
The first point in the half module is used to determine the module start.
Then, all points are transformed as
R_new = R Z_new = -Z phi_new = 2*phi_0 - phi
Finally, the points are flipped across the theta dimension to create the full module.
- Parameters:
points_half (
Array) – An array of shape (…, n_theta_points, n_phi_points, 3) containing the Cartesian coordinates of the points in the half module.- Returns:
points_full – An array of shape (…, 2*n_theta_points - 1, n_phi_points, 3) containing the Cartesian coordinates of the points in the full module.
- Return type:
jnp.ndarray
- convert_full_module_points_multiple_full_module(points_full_module: Array, toroidal_extent_full_module: ToroidalExtent, n_before: int, n_after: int)[source]
Convert points from a full module to multiple full modules.
- Parameters:
points_full_module (
Array) – The points of the full module, shape […, n_phi_points, 3]toroidal_extent_full_module (
ToroidalExtent) – The toroidal extent of the full module. (Although this could be derived by the points themselves, we keep it separate to allow for full modules that do not directly correspond to an exact phi plane on both ends, e.g. when using a non-constant phi flux surface extension)n_before (
int) – The number of full modules to add before the original full modulen_after (
int) – The number of full modules to add after the original full module
- convert_half_module_points_to_multiple_full_modules_mesh(points_half_module, toroidal_extent_full_module: ToroidalExtent, n_before: int, n_after: int, normals_orientation: bool)[source]
- convert_f_half_mod_to_full_mod(f_theta_phi_hm: Array)[source]
Converts a function defined on the half-module to the full module.
Flips over the theta at the boundary of the half-module. Since boundary is included
- Parameters:
f_theta_phi_hm (
Array) – The function defined on the half module: [0, 2 * pi] and [0, 2 * pi / (2 * n_fp)], including both endpoints.- Returns:
f_theta_phi_fm – The function defined on the full module.
- Return type:
jnp.ndarray […, n_theta, 2 * n_phi - 1]