The Open FUSION Toolkit 1.0.0-8905cc5
Modeling tools for plasma and fusion research and engineering
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
ThinCurr_periodic_toroid Class Reference

Detailed Description

Helper class for working with periodic toroid models.

Public Member Functions

 __init__ (self, r_grid, nfp, ntheta, nphi)
 Build triangular mesh for the full surface from a uniform grid of a single field period (toroidal)
 
 condense_matrix (self, matrix, axis=None)
 Condense matrix to unique DOF only by combining poloidal nodesets.
 
 expand_vector (self, vector)
 Expand vector from unique DOF by duplicating poloidal nodesets.
 
 nodes_to_unique (self, vector, tor_val=0.0, pol_val=0.0, remove_closure=True)
 Maps a vector of values on all nodes within a single field period to unique DOFs.
 
 plot_mesh (self, fig, equal_aspect=True, surf_alpha=0.1, surf_cmap='viridis')
 Plot mesh and holes.
 
 unique_to_nodes_2D (self, data)
 Maps a vector of values for unique DOFs to all nodes within a single field period and reshape to a structured 2D grid.
 
 write_to_file (self, filename, reg=None, include_closures=True)
 Save mesh to file in ThinCurr format.
 

Public Attributes

 lc
 
 nfp
 
 nphi
 
 ntheta
 
 pnodesets
 
 r
 
 r_map
 
 tnodeset
 

Constructor & Destructor Documentation

◆ __init__()

__init__ (   self,
  r_grid,
  nfp,
  ntheta,
  nphi 
)

Build triangular mesh for the full surface from a uniform grid of a single field period (toroidal)

Parameters
r_gridUniform grid [nphi,ntheta,3] ( \( \phi \) and \( \theta \) vary along the first and second dimension respectively)
nfpNumber of field periods
nthetaNumber of node points in the poloidal direction
nphiNumber of node points (per field period) in the toroidal direction

Member Function Documentation

◆ condense_matrix()

condense_matrix (   self,
  matrix,
  axis = None 
)

Condense matrix to unique DOF only by combining poloidal nodesets.

Parameters
matrixInitial matrix in full ThinCurr representation (includes copies of poloidal nodesets)
axisAxis to act on (both if None)
Returns
Condensed matrix

◆ expand_vector()

expand_vector (   self,
  vector 
)

Expand vector from unique DOF by duplicating poloidal nodesets.

Parameters
vectorVector of values for unique DOF
Returns
Expanded vector

◆ nodes_to_unique()

nodes_to_unique (   self,
  vector,
  tor_val = 0.0,
  pol_val = 0.0,
  remove_closure = True 
)

Maps a vector of values on all nodes within a single field period to unique DOFs.

Parameters
vectorVector of values on nodes
tor_valValue of toroidal hole element
pol_valValue of poloidal hole element
remove_closureRemove closure element?

◆ plot_mesh()

plot_mesh (   self,
  fig,
  equal_aspect = True,
  surf_alpha = 0.1,
  surf_cmap = 'viridis' 
)

Plot mesh and holes.

Parameters
figFigure to use for plots (must be empty)
equal_aspectSet plot aspect ratio to be more physically realistic
surf_alphaTransparency of surface in hole plot (left plot)
surf_cmapColormap for mesh plot (right plot)

◆ unique_to_nodes_2D()

unique_to_nodes_2D (   self,
  data 
)

Maps a vector of values for unique DOFs to all nodes within a single field period and reshape to a structured 2D grid.

Parameters
vectorVector of values on nodes
tor_valValue of toroidal hole element
pol_valValue of poloidal hole element
remove_closureRemove closure element?

◆ write_to_file()

write_to_file (   self,
  filename,
  reg = None,
  include_closures = True 
)

Save mesh to file in ThinCurr format.

Parameters
filenameFilename for mesh file
regRegion list [nc,]
include_closuresInclude closure defitions in file?

Member Data Documentation

◆ lc

lc

◆ nfp

nfp

◆ nphi

nphi

◆ ntheta

ntheta

◆ pnodesets

pnodesets

◆ r

r

◆ r_map

r_map

◆ tnodeset

tnodeset

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