The Open FUSION Toolkit 1.0.0-8905cc5
Modeling tools for plasma and fusion research and engineering
Loading...
Searching...
No Matches
Classes | Functions
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.
 
 write_ThinCurr_mesh (filename, r, lc, reg, holes=[], closures=[], pmap=None, nfp=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

◆ write_ThinCurr_mesh()

write_ThinCurr_mesh (   filename,
  r,
  lc,
  reg,
  holes = [],
  closures = [],
  pmap = None,
  nfp = 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] (1-based)
regRegion list [nc]
holesList of node sets for hole definitions
closuresList of closures
pmapPoint mapping for periodic meshes (single surface only)
nfpNumber of field periods for periodic meshes (single surface only)