![]() |
The Open FUSION Toolkit 26.9
An open-source framework for fusion and plasma science and engineering
|
Container for a 3-node triangular ThinCurr surface mesh.
Public Member Functions | |
| __init__ (self, r, lc, reg, holes=None, jumpers=None, closures=None, nodesets=None, tc_props=None, mesh_props=None, coil_sets=None) | |
| Construct a mesh from its component arrays. | |
| append (self, other, distinct_regions=True) | |
| Append another mesh onto this one (in place). | |
| copy (self) | |
| Return a deep copy of the mesh. | |
| load (cls, filename) | |
| Load a mesh using read_ThinCurr_mesh and create instance of ThinCurrMesh. | |
| print_info (self) | |
| Print a short summary of the mesh contents. | |
| remove_regions (self, regions) | |
| Remove all cells belonging to the specified regions (in place). | |
| save (self, filename) | |
| Save the mesh contained in this object using write_ThinCurr_mesh. | |
| set_jumpers (self, indices) | |
| Mark the given nodesets as jumpers (all others become holes; in place). | |
| set_resistivity (self, eta_surf=None, eta_vol=None, thickness=None) | |
| Set per-region resistivity (and optional thickness) on the mesh (in place). | |
| transform (self, shift=None, rotate=None, scale=None, center=None) | |
| Apply a transform to the mesh coordinates (in place). | |
Public Attributes | |
| closures = np.ascontiguousarray(closures, dtype=np.int32) if closures is not None else None | |
| coil_sets = coil_sets | |
| list | holes = [np.ascontiguousarray(v, dtype=np.int32).reshape(-1) for v in holes] if holes is not None else None |
| list | jumpers = [np.ascontiguousarray(v, dtype=np.int32).reshape(-1) for v in jumpers] if jumpers is not None else None |
| int | lc = np.ascontiguousarray(lc, dtype=np.int32) |
| mesh_props = dict(mesh_props) if mesh_props else {} | |
| nc = None | |
| Number of cells (triangles). | |
| nclosures = None | |
| Number of closure nodesets. | |
| nholes = None | |
| Number of hole nodesets. | |
| njumpers = None | |
| Number of jumper nodesets. | |
| list | nodesets = [np.ascontiguousarray(v, dtype=np.int32).reshape(-1) for v in nodesets] if nodesets is not None else None |
| np = None | |
| Number of vertices. | |
| nregions = None | |
| Number of regions (maximum region index). | |
| tuple | r = np.ascontiguousarray(r, dtype=np.float64) |
| reg = np.ascontiguousarray(reg, dtype=np.int32).reshape(-1) | |
| dict | tc_props = dict(tc_props) if tc_props else {} |
Protected Member Functions | |
| _drop_props (self, operation) | |
| Clear ThinCurr properties that a structural operation would invalidate. | |
| _zz_doxygen_dummy (self) | |
Static Protected Attributes | |
| tuple | _MESH_PROP_KEYS = ('reg_names', 'reg_attrs') |
| tuple | _PROP_KEYS = ('eta_surf', 'eta_vol', 'thickness') |
| __init__ | ( | self, | |
| r, | |||
| lc, | |||
| reg, | |||
| holes = None, | |||
| jumpers = None, | |||
| closures = None, | |||
| nodesets = None, | |||
| tc_props = None, | |||
| mesh_props = None, | |||
| coil_sets = None ) |
Construct a mesh from its component arrays.
| r | Vertex list [np,3] |
| lc | Triangle vertex list [nc,3], 0-based |
| reg | Per-cell region index [nc] |
| holes | List of 0-based node-index arrays for holes (optional) |
| jumpers | List of 0-based node-index arrays for jumpers (optional) |
| closures | List of 0-based cell-index arrays for closures (optional) |
| nodesets | List of 0-based node-index arrays for unclassified nodesets (optional) |
| tc_props | Dict of ThinCurr properties to carry through (optional) |
| mesh_props | Dict of base mesh properties to carry through (optional) |
| coil_sets | List of ThinCurr coil sets (optional) |
|
protected |
Clear ThinCurr properties that a structural operation would invalidate.
|
protected |
| append | ( | self, | |
| other, | |||
| distinct_regions = True ) |
Append another mesh onto this one (in place).
| other | The ThinCurrMesh to append |
| distinct_regions | If True, offset the appended mesh's region indices so its regions remain distinct from this mesh's regions |
| copy | ( | self | ) |
Return a deep copy of the mesh.
| load | ( | cls, | |
| filename ) |
Load a mesh using read_ThinCurr_mesh and create instance of ThinCurrMesh.
| filename | Path to input mesh file |
| print_info | ( | self | ) |
Print a short summary of the mesh contents.
| remove_regions | ( | self, | |
| regions ) |
Remove all cells belonging to the specified regions (in place).
Surviving regions are renumbered contiguously (1..N), unreferenced vertices are dropped, and nodesets/sidesets are remapped, dropping any entries that reference removed nodes/cells.
| regions | Iterable of region indices to remove |
| save | ( | self, | |
| filename ) |
Save the mesh contained in this object using write_ThinCurr_mesh.
| filename | Path to output mesh file |
| set_jumpers | ( | self, | |
| indices ) |
Mark the given nodesets as jumpers (all others become holes; in place).
Indices are 0-based positions into the ordered nodesets list and may be negative (Python-style backward indexing).
| indices | Iterable of nodeset indices to mark as jumpers |
| set_resistivity | ( | self, | |
| eta_surf = None, | |||
| eta_vol = None, | |||
| thickness = None ) |
Set per-region resistivity (and optional thickness) on the mesh (in place).
Resistivity may be stored as surface resistivity (eta_surf, with thickness optional) or volumetric resistivity (eta_vol, which requires thickness); the two forms are mutually exclusive. Each argument is a per-region list; a single value is broadcast to every region. Values are stored in the ThinCurr property table and written to the output mesh.
| eta_surf | Surface resistivity per region (scalar or [nregions]) |
| eta_vol | Volumetric resistivity per region (scalar or [nregions]) |
| thickness | Thickness per region (scalar or [nregions]) |
| transform | ( | self, | |
| shift = None, | |||
| rotate = None, | |||
| scale = None, | |||
| center = None ) |
Apply a transform to the mesh coordinates (in place).
Multiple operations, if supplied, are applied in the order rotate, scale, shift (scaling is always about the origin)
| shift | Translation vector [3] (optional) |
| rotate | Tuple (axis, angle_deg) where axis is 'x', 'y', or 'z' (optional) |
| scale | Per-axis scale factors [3] applied about the origin (optional) |
| center | Center of rotation [3] (default: origin) |
|
staticprotected |
|
staticprotected |
| closures = np.ascontiguousarray(closures, dtype=np.int32) if closures is not None else None |
| coil_sets = coil_sets |
| list holes = [np.ascontiguousarray(v, dtype=np.int32).reshape(-1) for v in holes] if holes is not None else None |
| list jumpers = [np.ascontiguousarray(v, dtype=np.int32).reshape(-1) for v in jumpers] if jumpers is not None else None |
| lc = np.ascontiguousarray(lc, dtype=np.int32) |
| mesh_props = dict(mesh_props) if mesh_props else {} |
| nc = None |
Number of cells (triangles).
| nclosures = None |
Number of closure nodesets.
| nholes = None |
Number of hole nodesets.
| njumpers = None |
Number of jumper nodesets.
| list nodesets = [np.ascontiguousarray(v, dtype=np.int32).reshape(-1) for v in nodesets] if nodesets is not None else None |
| np = None |
Number of vertices.
| nregions = None |
Number of regions (maximum region index).
| r = np.ascontiguousarray(r, dtype=np.float64) |
| reg = np.ascontiguousarray(reg, dtype=np.int32).reshape(-1) |
| tc_props = dict(tc_props) if tc_props else {} |