neso_fame.generators.field_aligned_2d(lower_dim_mesh: SliceCoords, field_line: FieldTrace, extrusion_limits: tuple[float, float] = (0.0, 1.0), n: int = 10, spatial_interp_resolution: int = 11, connectivity: Sequence[tuple[int, int]] | None = None, boundaries: tuple[int, int] = (0, -1), subdivisions: int = 1, conform_to_bounds: bool = True) QuadMesh

Generate a 2D mesh.

Element edges follow field lines. Start with a 1D mesh defined in the poloidal plane. Edges are then traced along the field lines both backwards and forwards in the toroidal direction to form a single layer of field-aligned elements. The field is assumed not to vary in the toroidal direction, meaning this layer can be repeated. However, each layer will be non-conformal with the next.

Parameters:
lower_dim_mesh: SliceCoords

Locations of nodes in the x1-x2 plane, from which to project along field-lines. Unless providing connectivity, must be ordered.

field_line: FieldTrace

A callable which takes a SliceCoord defining a position on the x3=0 plane and an array-like object with x3 coordinates. It should return a 2-tuple. The first element is the locations found by tracing the magnetic field line beginning at the position of the first argument until reaching the x3 locations described in the second argument. The second element is the distance traversed along the field line.

extrusion_limits: tuple[float, float] = (0.0, 1.0)

The lower and upper limits of the domain in the x3-direction.

n: int = 10

Number of layers to generate in the x3 direction

spatial_interp_resolution: int = 11

Number of points used to interpolate distances along the field line.

connectivity: Sequence[tuple[int, int]] | None = None

Defines which points are connected to each other in the mesh. Consists of pairs of integers indicating the indices of two points which are connected by an edge. If not provided, assume points are connected in an ordered line.

boundaries: tuple[int, int] = (0, -1)

Indices of the quads (in the connectivity sequence) that make up the north and south boundary, respectively

subdivisions: int = 1

Depth of cells in x3-direction in each layer.

conform_to_bounds: bool = True

If True, make the first and last curves straight lines, so that there are regular edges to the domain.

Returns:

A 2D field-aligned, non-conformal grid

Return type:

QuadMesh


Last update: Sep 23, 2024