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

Detailed Description

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')

Constructor & Destructor Documentation

◆ __init__()

__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.

Parameters
rVertex list [np,3]
lcTriangle vertex list [nc,3], 0-based
regPer-cell region index [nc]
holesList of 0-based node-index arrays for holes (optional)
jumpersList of 0-based node-index arrays for jumpers (optional)
closuresList of 0-based cell-index arrays for closures (optional)
nodesetsList of 0-based node-index arrays for unclassified nodesets (optional)
tc_propsDict of ThinCurr properties to carry through (optional)
mesh_propsDict of base mesh properties to carry through (optional)
coil_setsList of ThinCurr coil sets (optional)

Member Function Documentation

◆ _drop_props()

_drop_props ( self,
operation )
protected

Clear ThinCurr properties that a structural operation would invalidate.

◆ _zz_doxygen_dummy()

_zz_doxygen_dummy ( self)
protected

◆ append()

append ( self,
other,
distinct_regions = True )

Append another mesh onto this one (in place).

Parameters
otherThe ThinCurrMesh to append
distinct_regionsIf True, offset the appended mesh's region indices so its regions remain distinct from this mesh's regions

◆ copy()

copy ( self)

Return a deep copy of the mesh.

◆ load()

load ( cls,
filename )

Load a mesh using read_ThinCurr_mesh and create instance of ThinCurrMesh.

Parameters
filenamePath to input mesh file
Returns
New ThinCurrMesh instance

◆ print_info()

print_info ( self)

Print a short summary of the mesh contents.

◆ remove_regions()

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.

Parameters
regionsIterable of region indices to remove

◆ save()

save ( self,
filename )

Save the mesh contained in this object using write_ThinCurr_mesh.

Parameters
filenamePath to output mesh file

◆ set_jumpers()

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).

Parameters
indicesIterable of nodeset indices to mark as jumpers

◆ set_resistivity()

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.

Parameters
eta_surfSurface resistivity per region (scalar or [nregions])
eta_volVolumetric resistivity per region (scalar or [nregions])
thicknessThickness per region (scalar or [nregions])

◆ transform()

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)

Parameters
shiftTranslation vector [3] (optional)
rotateTuple (axis, angle_deg) where axis is 'x', 'y', or 'z' (optional)
scalePer-axis scale factors [3] applied about the origin (optional)
centerCenter of rotation [3] (default: origin)

Member Data Documentation

◆ _MESH_PROP_KEYS

tuple _MESH_PROP_KEYS = ('reg_names', 'reg_attrs')
staticprotected

◆ _PROP_KEYS

tuple _PROP_KEYS = ('eta_surf', 'eta_vol', 'thickness')
staticprotected

◆ closures

closures = np.ascontiguousarray(closures, dtype=np.int32) if closures is not None else None

◆ coil_sets

coil_sets = coil_sets

◆ holes

list holes = [np.ascontiguousarray(v, dtype=np.int32).reshape(-1) for v in holes] if holes is not None else None

◆ jumpers

list jumpers = [np.ascontiguousarray(v, dtype=np.int32).reshape(-1) for v in jumpers] if jumpers is not None else None

◆ lc

lc = np.ascontiguousarray(lc, dtype=np.int32)

◆ mesh_props

mesh_props = dict(mesh_props) if mesh_props else {}

◆ nc

nc = None

Number of cells (triangles).

◆ nclosures

nclosures = None

Number of closure nodesets.

◆ nholes

nholes = None

Number of hole nodesets.

◆ njumpers

njumpers = None

Number of jumper nodesets.

◆ nodesets

list nodesets = [np.ascontiguousarray(v, dtype=np.int32).reshape(-1) for v in nodesets] if nodesets is not None else None

◆ np

np = None

Number of vertices.

◆ nregions

nregions = None

Number of regions (maximum region index).

◆ r

r = np.ascontiguousarray(r, dtype=np.float64)

◆ reg

reg = np.ascontiguousarray(reg, dtype=np.int32).reshape(-1)

◆ tc_props

tc_props = dict(tc_props) if tc_props else {}

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