The Open FUSION Toolkit 1.0.0-beta7
An open-source framework for fusion and plasma science and engineering
Loading...
Searching...
No Matches
TokaMaker Class Reference

Detailed Description

TokaMaker G-S solver class.

Public Member Functions

 __del__ (self)
 Free Fortran-side objects by calling reset() before object is deleted or GC'd.
 __init__ (self, OFT_env)
 Initialize TokaMaker object.
 reset (self)
 Reset G-S object to enable loading a new mesh and coil configuration.
 setup (self, order=2, F0=0.0, full_domain=False)
 Setup G-S solver.
 setup_mesh (self, r=None, lc=None, reg=None, mesh_file=None)
 Setup mesh for static and time-dependent G-S calculations.
 setup_regions (self, cond_dict={}, coil_dict={})
 Define mesh regions (coils and conductors).

Public Attributes

float alam = 0.1
 F*F' normalization value.
list coil_set_names = []
 Coil set names in order of id number.
dict coil_sets = {}
 Coil set definitions, including sub-coils.
dict dist_coils = {}
 Distribution coils, only (currently) saved for plotting utility.
 lc = None
 Mesh triangles [nc,3].
 lim_contour = None
 Limiting contour.
list lim_contours = None
 Limiting contours (if multiple).
 lim_point = None
 Limiting point (limter or active X-point) [2].
int nc = -1
 Number of cells in mesh.
 ncoils = ncoils.value
 Number of coils in mesh.
int np = -1
 Number of points in mesh.
int nregs = -1
 Number of regions in mesh.
int nvac = 0
 Number of vacuum regions in mesh.
 o_point = None
 Location of O-point (magnetic axis) [2].
float pnorm = 0.1
 P' normalization value.
 psi_bounds = None
 Bounding values for \(\psi\) ( \(\psi_a\), \(\psi_0\)) [2].
int psi_convention = 0
 Normalized flux convention (0 -> tokamak, 1 -> spheromak).
 r = None
 Mesh vertices [np,3] (last column should be all zeros).
 reg = None
 Mesh regions [nc].
 settings = tokamaker_default_settings(self._oft_env)
 General settings object.
 x_points = None
 Location of X-points [20,2].

Protected Attributes

 _alam = None
 F*F' normalization value [1] (use alam property).
dict _coil_dict = {}
 Coil definition dictionary.
dict _cond_dict = {}
 Conductor definition dictionary.
 _diverted = None
 Diverted (limited) flag [1] (use diverted property).
 _estore_target = c_double(self._oft_env.float_disable_flag)
 Stored energy target value (use set_targets).
float _F0 = 0.0
 Vacuum F value.
 _flux_targets = None
 Flux constraint points (use set_flux).
 _Ip_ratio_target = c_double(self._oft_env.float_disable_flag)
 Plasma current target ratio I_p(FF') / I_p(P') (use set_targets).
 _Ip_target = c_double(self._oft_env.float_disable_flag)
 Plasma current target value (use set_targets).
 _isoflux_targets = None
 Isoflux constraint points (use set_isoflux).
 _mesh_ptr = c_void_p()
 Internal mesh object.
 _oft_env = OFT_env
 _pax_target = c_double(self._oft_env.float_disable_flag)
 Axis pressure target value (use set_targets).
 _pnorm = None
 Pressure normalization value [1] (use pnorm property).
 _R0_target = c_double(self._oft_env.float_disable_flag)
 R0 target value (use set_targets).
 _saddle_targets = None
 Saddle constraint points (use set_saddles).
 _tMaker_ptr = c_void_p()
 Internal Grad-Shafranov object (gs_eq).
 _V0_target = c_double(self._oft_env.float_disable_flag)
 V0 target value (use set_targets).
dict _vac_dict = {}
 Vacuum definition dictionary.
dict _virtual_coils = {'#VSC': -1}
 Virtual coils, if present (currently only '#VSC').

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
OFT_env )

Initialize TokaMaker object.

Parameters
OFT_envOFT runtime environment object (See OFT_env)

◆ __del__()

__del__ ( self)

Free Fortran-side objects by calling reset() before object is deleted or GC'd.

Member Function Documentation

◆ reset()

reset ( self)

Reset G-S object to enable loading a new mesh and coil configuration.

◆ setup()

setup ( self,
order = 2,
F0 = 0.0,
full_domain = False )

Setup G-S solver.

Parameters
orderOrder of FE representation to use
F0Vacuum \(F(\psi)\) value (B0*R0)

◆ setup_mesh()

setup_mesh ( self,
r = None,
lc = None,
reg = None,
mesh_file = None )

Setup mesh for static and time-dependent G-S calculations.

A mesh should be specified by passing "r", "lc", and optionally "reg" or using a "mesh_file". When a region is specified the following ordering should apply:

  • 1: Plasma region
  • 2: Vacuum/air regions
  • 3+: Conducting regions and coils
Parameters
rMesh point list [np,2]
lcMesh cell list [nc,3] (base one)
regMesh region list [nc] (base one)
mesh_fileFilename containing mesh to load (native format only)

◆ setup_regions()

setup_regions ( self,
cond_dict = {},
coil_dict = {} )

Define mesh regions (coils and conductors).

Parameters
cond_dictDictionary specifying conducting regions

Member Data Documentation

◆ _alam

_alam = None
protected

F*F' normalization value [1] (use alam property).

◆ _coil_dict

dict _coil_dict = {}
protected

Coil definition dictionary.

◆ _cond_dict

dict _cond_dict = {}
protected

Conductor definition dictionary.

◆ _diverted

_diverted = None
protected

Diverted (limited) flag [1] (use diverted property).

◆ _estore_target

_estore_target = c_double(self._oft_env.float_disable_flag)
protected

Stored energy target value (use set_targets).

◆ _F0

float _F0 = 0.0
protected

Vacuum F value.

◆ _flux_targets

_flux_targets = None
protected

Flux constraint points (use set_flux).

◆ _Ip_ratio_target

_Ip_ratio_target = c_double(self._oft_env.float_disable_flag)
protected

Plasma current target ratio I_p(FF') / I_p(P') (use set_targets).

◆ _Ip_target

_Ip_target = c_double(self._oft_env.float_disable_flag)
protected

Plasma current target value (use set_targets).

◆ _isoflux_targets

_isoflux_targets = None
protected

Isoflux constraint points (use set_isoflux).

◆ _mesh_ptr

_mesh_ptr = c_void_p()
protected

Internal mesh object.

◆ _oft_env

_oft_env = OFT_env
protected

◆ _pax_target

_pax_target = c_double(self._oft_env.float_disable_flag)
protected

Axis pressure target value (use set_targets).

◆ _pnorm

_pnorm = None
protected

Pressure normalization value [1] (use pnorm property).

◆ _R0_target

_R0_target = c_double(self._oft_env.float_disable_flag)
protected

R0 target value (use set_targets).

◆ _saddle_targets

_saddle_targets = None
protected

Saddle constraint points (use set_saddles).

◆ _tMaker_ptr

_tMaker_ptr = c_void_p()
protected

Internal Grad-Shafranov object (gs_eq).

◆ _V0_target

_V0_target = c_double(self._oft_env.float_disable_flag)
protected

V0 target value (use set_targets).

◆ _vac_dict

dict _vac_dict = {}
protected

Vacuum definition dictionary.

◆ _virtual_coils

dict _virtual_coils = {'#VSC': -1}
protected

Virtual coils, if present (currently only '#VSC').

◆ alam

float alam = 0.1

F*F' normalization value.

◆ coil_set_names

list coil_set_names = []

Coil set names in order of id number.

◆ coil_sets

dict coil_sets = {}

Coil set definitions, including sub-coils.

◆ dist_coils

dict dist_coils = {}

Distribution coils, only (currently) saved for plotting utility.

◆ lc

lc = None

Mesh triangles [nc,3].

Number of cells in mesh

Mesh vertices [np,3] (last column should be all zeros)

Mesh triangles [nc,3]

◆ lim_contour

lim_contour = None

Limiting contour.

◆ lim_contours

list lim_contours = None

Limiting contours (if multiple).

◆ lim_point

lim_point = None

Limiting point (limter or active X-point) [2].

◆ nc

int nc = -1

Number of cells in mesh.

Number of cells in mesh

◆ ncoils

ncoils = ncoils.value

Number of coils in mesh.

◆ np

int np = -1

Number of points in mesh.

◆ nregs

nregs = -1

Number of regions in mesh.

◆ nvac

int nvac = 0

Number of vacuum regions in mesh.

◆ o_point

o_point = None

Location of O-point (magnetic axis) [2].

◆ pnorm

float pnorm = 0.1

P' normalization value.

◆ psi_bounds

psi_bounds = None

Bounding values for \(\psi\) ( \(\psi_a\), \(\psi_0\)) [2].

◆ psi_convention

int psi_convention = 0

Normalized flux convention (0 -> tokamak, 1 -> spheromak).

◆ r

r = None

Mesh vertices [np,3] (last column should be all zeros).

Number of cells in mesh

Mesh vertices [np,3] (last column should be all zeros)

◆ reg

reg = None

Mesh regions [nc].

Number of cells in mesh

Mesh vertices [np,3] (last column should be all zeros)

Mesh triangles [nc,3]

Mesh regions [nc]

◆ settings

settings = tokamaker_default_settings(self._oft_env)

General settings object.

◆ x_points

x_points = None

Location of X-points [20,2].


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