The Open FUSION Toolkit 1.0.0-beta6
Modeling tools for plasma and fusion research and engineering
Loading...
Searching...
No Matches
gs_Domain Class Reference

Detailed Description

Grad-Sharvanov domain definitions for TokaMaker with Triangle library meshing.

Public Member Functions

 __init__ (self, rextent=None, zextents=[None, None], rpad=1.2, zpad=[1.2, 1.2], json_filename=None)
 Create a new Grad-Shafranov domain.
 add_annulus (self, inner_countour, inner_name, outer_contour, annulus_name, parent_name=None, angle_tol=30.0, sliver_tol=120.0, small_thresh=None)
 Add annular geometry defining region boundaries to the mesh.
 add_enclosed (self, in_point, name)
 add_polygon (self, contour, name, parent_name=None, angle_tol=30.0, sliver_tol=120.0, small_thresh=None)
 Add polygon geometry defining region boundaries to the mesh.
 add_rectangle (self, rc, zc, w, h, name, parent_name=None, rot=None)
 Add rectangular geometry defining region boundaries to the mesh.
 build_mesh (self, debug=False, merge_thresh=1.E-4, require_boundary=True, setup_only=False)
 Build mesh for specified domains.
 define_region (self, name, dx, reg_type, eta=None, noncontinuous=None, nTurns=None, coil_set=None, allow_xpoints=False, inner_limiter=False)
 Define a new region and its properties (geometry is given in a separate call).
 get_coils (self)
 Get dictionary describing coil regions in domain.
 get_conductors (self)
 Get dictionary describing conducting regions in domain.
 plot_mesh (self, fig, ax, lw=0.5, show_legends=True, col_max=10, split_coil_sets=False)
 Plot machine geometry.
 plot_topology (self, fig, ax, linewidth=None)
 Plot mesh topology.
 save_json (self, filename)
 Create a JSON file containing a description of the mesh.

Public Attributes

 boundary_reg = input_dict['boundary_reg']
 mesh = Mesh(self.regions,debug=debug,extra_reg_defs=self._extra_reg_defs,merge_thresh=merge_thresh)
dict reg_type_counts = input_dict['reg_type_counts']
dict region_info = input_dict['region_info']
list regions = []
float rextent = input_dict['rextent']
float rmax = input_dict['rmax']
 rpad = input_dict['rpad']
 zextents = input_dict['zextents']
float zmax = input_dict['zmax']
float zmin = input_dict['zmin']
list zpad = input_dict['zpad']

Protected Attributes

list _extra_reg_defs = []
 _lc = None
 _r = None
int _reg = None

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
rextent = None,
zextents = [None,None],
rpad = 1.2,
zpad = [1.2,1.2],
json_filename = None )

Create a new Grad-Shafranov domain.

Parameters
region_listList of oftpy.Region objects that define mesh
merge_threshDistance threshold for merging nearby points

Member Function Documentation

◆ add_annulus()

add_annulus ( self,
inner_countour,
inner_name,
outer_contour,
annulus_name,
parent_name = None,
angle_tol = 30.0,
sliver_tol = 120.0,
small_thresh = None )

Add annular geometry defining region boundaries to the mesh.

Parameters
inner_contourCurve defining inner boundary
inner_nameName of region enclosed by the inner boundary
outer_contourCurve defining outer boundary
annulus_nameName of annular region between inner and outer boundaries
parent_nameName of region beyond the outer boundary
angle_tolCorner tolerance used when resampling curve at desired resolution
sliver_tolTolerance used for "sliver" region warnings
small_threshTolerance used for "small" curve warnings (default: dx/2)

◆ add_enclosed()

add_enclosed ( self,
in_point,
name )

◆ add_polygon()

add_polygon ( self,
contour,
name,
parent_name = None,
angle_tol = 30.0,
sliver_tol = 120.0,
small_thresh = None )

Add polygon geometry defining region boundaries to the mesh.

Parameters
contourCurve defining polygon
nameName of region enclosed by the polygon
parent_nameName of region outside the polygon
angle_tolCorner tolerance used when resampling curve at desired resolution
sliver_tolTolerance used for "sliver" region warnings
small_threshTolerance used for "small" curve warnings (default: dx/2)

◆ add_rectangle()

add_rectangle ( self,
rc,
zc,
w,
h,
name,
parent_name = None,
rot = None )

Add rectangular geometry defining region boundaries to the mesh.

Parameters
rcRadial center of rectangle
zcVertical center of rectangle
wWidth of rectangle (radial direction)
hHeight of the rectangle (vertical direction)
nameName of region enclosed by the polygon
parent_nameName of region outside the polygon
rotRotation of rectangle (degrees)

◆ build_mesh()

build_mesh ( self,
debug = False,
merge_thresh = 1.E-4,
require_boundary = True,
setup_only = False )

Build mesh for specified domains.

Returns
Meshed representation (pts[np,2], tris[nc,3], regions[nc])

◆ define_region()

define_region ( self,
name,
dx,
reg_type,
eta = None,
noncontinuous = None,
nTurns = None,
coil_set = None,
allow_xpoints = False,
inner_limiter = False )

Define a new region and its properties (geometry is given in a separate call).

Parameters
nameName of region
dxTarget mesh size for region
reg_typeType of region ("plasma", "vacuum", "boundary", "conductor", or "coil")
etaResistivity for "conductor" regions (raises error if region is other type)
nTurnsNumber of turns for "coil" regions (raises error if region is other type)
allow_xpointsAllow X-points in this region (for non-plasma regions only)
inner_limiterThis region forms the inner limiter (valid for non-plasma regions in Dipole mode only)

◆ get_coils()

get_coils ( self)

Get dictionary describing coil regions in domain.

Returns
Dictionary of coil regions and attributes

◆ get_conductors()

get_conductors ( self)

Get dictionary describing conducting regions in domain.

Returns
Dictionary of conducting regions and attributes

◆ plot_mesh()

plot_mesh ( self,
fig,
ax,
lw = 0.5,
show_legends = True,
col_max = 10,
split_coil_sets = False )

Plot machine geometry.

Parameters
figFigure to add to (unused)
axAxes to add to (must be scalar, [2], or [2,2])
lwWidth of lines in calls to "triplot()"
show_legendsShow legends for plots with more than one region?
col_maxMaximum number of entries per column in each legend

◆ plot_topology()

plot_topology ( self,
fig,
ax,
linewidth = None )

Plot mesh topology.

Parameters
figFigure to add to (unused)
axAxes to add to (must be scalar)
linewidthLine width for plots

◆ save_json()

save_json ( self,
filename )

Create a JSON file containing a description of the mesh.

Parameters
filenamePath to create JSON file

Member Data Documentation

◆ _extra_reg_defs

list _extra_reg_defs = []
protected

◆ _lc

_lc = None
protected

◆ _r

_r = None
protected

◆ _reg

int _reg = None
protected

◆ boundary_reg

boundary_reg = input_dict['boundary_reg']

◆ mesh

mesh = Mesh(self.regions,debug=debug,extra_reg_defs=self._extra_reg_defs,merge_thresh=merge_thresh)

◆ reg_type_counts

dict reg_type_counts = input_dict['reg_type_counts']

◆ region_info

region_info = input_dict['region_info']

◆ regions

list regions = []

◆ rextent

float rextent = input_dict['rextent']

◆ rmax

float rmax = input_dict['rmax']

◆ rpad

rpad = input_dict['rpad']

◆ zextents

zextents = input_dict['zextents']

◆ zmax

float zmax = input_dict['zmax']

◆ zmin

float zmin = input_dict['zmin']

◆ zpad

list zpad = input_dict['zpad']

The documentation for this class was generated from the following file: