|
The Open FUSION Toolkit 1.0.0-beta6
Modeling tools for plasma and fusion research and engineering
|
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 | |
| __init__ | ( | self, | |
| r_grid, | |||
| nfp, | |||
| ntheta, | |||
| nphi | |||
| ) |
Build triangular mesh for the full surface from a uniform grid of a single field period (toroidal)
| r_grid | Uniform grid [nphi,ntheta,3] ( \( \phi \) and \( \theta \) vary along the first and second dimension respectively) |
| nfp | Number of field periods |
| ntheta | Number of node points in the poloidal direction |
| nphi | Number of node points (per field period) in the toroidal direction |
| condense_matrix | ( | self, | |
| matrix, | |||
axis = None |
|||
| ) |
Condense matrix to unique DOF only by combining poloidal nodesets.
| matrix | Initial matrix in full ThinCurr representation (includes copies of poloidal nodesets) |
| axis | Axis to act on (both if None) |
| expand_vector | ( | self, | |
| vector | |||
| ) |
Expand vector from unique DOF by duplicating poloidal nodesets.
| vector | Vector of values for unique DOF |
| 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.
| vector | Vector of values on nodes |
| tor_val | Value of toroidal hole element |
| pol_val | Value of poloidal hole element |
| remove_closure | Remove closure element? |
| plot_mesh | ( | self, | |
| fig, | |||
equal_aspect = True, |
|||
surf_alpha = 0.1, |
|||
surf_cmap = 'viridis' |
|||
| ) |
Plot mesh and holes.
| fig | Figure to use for plots (must be empty) |
| equal_aspect | Set plot aspect ratio to be more physically realistic |
| surf_alpha | Transparency of surface in hole plot (left plot) |
| surf_cmap | Colormap for mesh plot (right plot) |
| 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.
| vector | Vector of values on nodes |
| tor_val | Value of toroidal hole element |
| pol_val | Value of poloidal hole element |
| remove_closure | Remove closure element? |
| write_to_file | ( | self, | |
| filename, | |||
reg = None, |
|||
include_closures = True |
|||
| ) |
Save mesh to file in ThinCurr format.
| filename | Filename for mesh file |
| reg | Region list [nc,] |
| include_closures | Include closure defitions in file? |
| lc |
| nfp |
| nphi |
| ntheta |
| pnodesets |
| r |
| r_map |
| tnodeset |