neso_fame.generators.field_aligned_3d(lower_dim_mesh: SliceCoords, field_line: FieldTrace, elements: Sequence[tuple[Index, Index, Index, Index]], extrusion_limits: tuple[float, float] = (0.0, 1.0), n: int = 10, spatial_interp_resolution: int = 11, subdivisions: int = 1, conform_to_bounds: bool = True) PrismMesh

Generate a 3D mesh.

Element edges follow field lines. Start with a 2D 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.

elements: Sequence[tuple[Index, Index, Index, Index]]

Defines groups of four points which together make up a quad in the 2D mesh. Consists of four integers (or tuples of integers) indicating the indices of the points which make up the corners.

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.

subdivisions: int = 1

Depth of cells in x3-direction in each layer.

conform_to_bounds: bool = True

If True, make the curves originating from boundary nodes straight lines, so that there are regular edges to the domain.

Returns:

A 3D field-aligned, non-conformal grid

Return type:

HexMesh


Last update: Nov 07, 2024