The Open FUSION Toolkit 26.9
An open-source framework for fusion and plasma science and engineering
Loading...
Searching...
No Matches
OpenFUSIONToolkit.ThinCurr.meshing Namespace Reference

Detailed Description

ThinCurr utilities for mesh generation and manipulation.

Authors
Chris Hansen
Date
March 2024

Classes

class  ThinCurr_periodic_toroid
 Helper class for working with periodic toroid models. More...

Functions

 build_regcoil_grid (filename, field_suffix, ntheta, nphi, full_torus=False)
 Build a uniform grid from a REGCOIL definition.
 build_ThinCurr_dummy (center, size=1.0, nsplit=0)
 Build simple square dummy mesh for ThinCurr (1 active node).
 build_torus_bnorm_grid (filename, nsample, nphi, resample_type='theta', use_spline=False)
 Build a uniform grid from a toroidal surface B-norm definition file.
 build_triangles_from_grid (data_grid, wrap_n=True, wrap_m=True)
 Build triangles from a uniform grid of points.
 read_ThinCurr_mesh (filename)
 Read mesh information and ThinCurr parameters from a native HDF5 mesh file.
 write_ThinCurr_mesh (filename, r, lc, reg, holes=None, jumpers=None, closures=None, eta_surf=None, eta_vol=None, thickness=None, coil_sets=None, pmap=None, nfp=None, reg_attrs=None, reg_names=None)
 Create a native HDF5 mesh file for ThinCurr from the given mesh information.

Function Documentation

◆ build_regcoil_grid()

build_regcoil_grid ( filename,
field_suffix,
ntheta,
nphi,
full_torus = False )

Build a uniform grid from a REGCOIL definition.

Parameters
field_suffixSuffix for netCDF fields (eg. "plasma" or "coil")
nthetaNumber of points in the \( \theta \) (poloidal) direction
nphiNumber of points (per field period) in the \( \phi \) (toroidal) direction
full_torusConstruct grid for the full torus (default: one field period)
Returns
rgrid Structed phi-theta grid of points [nphi,ntheta,3], nfp Number of field periods

◆ build_ThinCurr_dummy()

build_ThinCurr_dummy ( center,
size = 1.0,
nsplit = 0 )

Build simple square dummy mesh for ThinCurr (1 active node).

Parameters
centerCenter of mesh [3]
sizePhysical size of dummy mesh in X and Y
nsplitNumber of refinement iterations to perform on grid (starting mesh is np=5, nc=4)
Returns
r Point list [:,3], lc Cell list [:,3]

◆ build_torus_bnorm_grid()

build_torus_bnorm_grid ( filename,
nsample,
nphi,
resample_type = 'theta',
use_spline = False )

Build a uniform grid from a toroidal surface B-norm definition file.

Parameters
filenameFilename of B-norm poloidal mode definition
nsampleNumber of points in the \( \theta \) (poloidal) direction
nphiNumber of points in the \( \phi \) (toroidal) direction
resample_typeConstruct grid for the full torus (default: one field period)
use_splineFit a spline to the boundary to produce a smoother representation?
Returns
rgrid Structed phi-theta grid of points [nphi,ntheta,3], bnorm Bn on same grid [nphi,ntheta], nfp Number of field periods

◆ build_triangles_from_grid()

build_triangles_from_grid ( data_grid,
wrap_n = True,
wrap_m = True )

Build triangles from a uniform grid of points.

Parameters
data_gridUniform point grid [n,m,3]
wrap_nWrap grid in n-direction?
wrap_mWrap grid in m-direction?
Returns
point list [n*m,3], cell list [nc,3], nodeset in the n-direction, nodeset in the m-direction

◆ read_ThinCurr_mesh()

read_ThinCurr_mesh ( filename)

Read mesh information and ThinCurr parameters from a native HDF5 mesh file.

Parameters
filenameFilename for mesh file
Returns
Dictionary containing the mesh information and ThinCurr parameters

◆ write_ThinCurr_mesh()

write_ThinCurr_mesh ( filename,
r,
lc,
reg,
holes = None,
jumpers = None,
closures = None,
eta_surf = None,
eta_vol = None,
thickness = None,
coil_sets = None,
pmap = None,
nfp = None,
reg_attrs = None,
reg_names = None )

Create a native HDF5 mesh file for ThinCurr from the given mesh information.

Parameters
filenameFilename for mesh file
rPoints list [np,3]
lcCell list [nc,3] (0-based)
regRegion list [nc]
holesList of node sets for hole definitions (0-based)
jumpersList of jumper sets (0-based)
closuresList of closures (0-based)
eta_surfSurface electrical resistivity [Ohm]
eta_volVolumetric electrical resistivity [Ohm-m]
thicknessThickness of the mesh elements [m]
coil_setsList of ThinCurr_coil_set objects to include in the mesh file
pmapPoint mapping for periodic meshes (0-based,single surface only)
nfpNumber of field periods for periodic meshes (single surface only)
reg_attrsList of region attributes
reg_namesList of region names