jax_sbgeom.coils.coil_meshing module

mesh_coil_surface(coil: FiniteSizeCoil, n_s: int, width_radial: float, width_phi: float)[source]

Mesh the surface of a coil using a defined number of samples and coil width.

Parameters:
  • coil (FiniteSizeCoil) – Coil to mesh

  • n_s (int) – Number of samples along the coil

  • width_radial (float) – Radial width of the finite sized coil

  • width_phi (float) – Toroidal width of the finite sized coil

Returns:

  • jnp.ndarray – Vertices of the meshed coil surface

  • jnp.ndarray – Connectivity array of the meshed coil surface

mesh_coilset_surface(coils: FiniteSizeCoilSet, n_s: int, width_radial: float, width_phi: float)[source]

Mesh the surface of a coilset

The coils vertices are originally: [n_coils, n_s, 4, 3] (4 lines per coil)

The coils connectivity is originally: [n_coils, n_s, 4, 2, 3] (4 lines per coil, 2 triangles per quad) Both are reshaped to (-1,3) to facilate easier post processing.

Parameters:
  • coil (Coil) – Coil to mesh

  • n_s (int) – Number of samples along the coil

  • width_radial (float) – Radial width of the finite sized coil

  • width_phi (float) – Toroidal width of the finite sized coil

Returns:

  • jnp.ndarray – Vertices of the meshed coil surface

  • jnp.ndarray – Connectivity array of the meshed coil surface

refine_longitudinal_mesh(finite_size_lines, refinement_array: Array)[source]
mesh_coil_volumetric(coil: FiniteSizeCoil, n_longitudinal: int, n_grid: int, width_radial: float, width_phi: float, n_radial: int = None, n_toroidal: int = None, longitudinal_refinement: Array = None)[source]

Mesh the volume of a coil using a defined number of samples and coil width.

Parameters:
  • coil (FiniteSizeCoil) – Coil to mesh

  • n_longitudinal (int) – Number of samples along the coil

  • n_grid (int) – Number of grid points in the radial and toroidal directions

  • width_radial (float) – Radial width of the finite sized coil

  • width_phi (float) – Toroidal width of the finite sized coil

Returns:

  • jnp.ndarray – Vertices of the meshed coil volume

  • jnp.ndarray – Connectivity array of the meshed coil volume (tetrahedra)

intercoil_lines(coil1: FiniteSizeCoil, coil2: FiniteSizeCoil, n_longitudinal: int, coil_width_radial: float, coil_width_phi: float)[source]

Mesh the volume between two coils using a defined number of samples and coil width.

TODO: Take into account diffrent widths for the two coils, and different number of samples for the two coils.

Parameters:
  • coil1 (FiniteSizeCoil) – First coil

  • coil2 (FiniteSizeCoil) – Second coil

  • n_longitudinal (int) – Number of samples along the coil

  • n_grid (int) – Number of grid points in the toroidal direction

  • width_radial (float) – Radial width of the finite sized coil

  • width_phi (float) – Toroidal width of the finite sized coil

Returns:

  • jnp.ndarray – Vertices of the meshed inter-coil volume

  • jnp.ndarray – Connectivity array of the meshed inter-coil volume (tetrahedra)