4. Hypnotoad classes¶
This section gives a brief overview of the classes defined by hypnotoad.
For illustration in the figures we use a connected double null equilibrium:
A coarse grid for a connected double null case. Thin gray lines are flux surfaces, the thick black line is the wall.¶
- class hypnotoad.core.equilibrium.PsiContour
A piece of a flux surface (on the R-Z plane), i.e. a contour at constant poloidal magnetic flux function \(\psi\).
Contains a set of points lying on the contour. These will represent points belonging to the generated grid.
The points in an example PsiContour. This one is in the outer lower
divertor leg.¶
- class hypnotoad.core.equilibrium.FineContour
High-resolution representation of a contour of constant \(\psi\).
Each
FineContourbelongs to aPsiContourand provides a high resolution representation of the contour, which does not depend on the grid settings: points in a FineContour are uniformly spaced in poloidal distance along the contour; and the number of points is set by thefinecontour_Nfinesetting, which should be significantly higher than the number of points in the y-direction in any region of the grid.The
FineContourprovides a robust calculation of the poloidal distance along a contour, and provides accurate interpolation functions so that points belonging to the parentPsiContourcan be placed at specified poloidal locations along the contour.
The points in an example FineContour (blue dots, each dot is a point on
the FineContour). Also shown is the associated PsiContour (red
crosses).¶
- class hypnotoad.core.equilibrium.EquilibriumRegion
One part of the poloidal split of the equilibrium into distinct regions.
Inherits from PsiContour as it represents a line on the R-Z plane, normally a part of a separatrix). In diverted tokamak configurations one or both ends are at an X-point.
Contains the connections to other
EquilibriumRegionobjects of different radial segments of the region.Used as the starting point to generate the
PsiContoursthat eventually fill the region as part ofMeshRegionobjects.
The points in an example EquilibriumRegion. This one represents the
outer core.¶
- class hypnotoad.core.equilibrium.Equilibrium
The magnetic equilibrium and topology.
Provides functions (usually created by interpolating) that give the poloidal magnetic flux function \(\psi\), components of the magnetic field, etc. at any point.
Contains information about the topology (e.g. position of X-points), and the regions to be gridded (as an
OrderedDictofEquilibriumRegionobjects).Developers, see Equilibrium implementations.
An Equilibrium contains a set of EquilibriumRegion objects.¶
- class hypnotoad.cases.tokamak.TokamakEquilibrium
Axisymmetric tokamak equilibrium
Implements
Equilibrium.Finds the central O-point of the equilibrium, and the X-points. Creates
EquilibriumRegionobjects for the core (separate outer and inner for double null configurations) and divertor legs.
- class hypnotoad.core.mesh.MeshRegion
Collection of
PsiContourobjects representing a logically rectangular sub-region of the grid.Each side of the
MeshRegionis either a grid boundary or connects to one otherMeshRegion. TheMeshRegionincludes points on the boundary, whose positions are shared with the boundary points of the neighbouringMeshRegion, if there is one.Includes methods for calculating R-Z positions, magnetic field, and geometric quantities (for the standard BOUT++ locally field aligned coordinate system) on the points in the
MeshRegion.Developers, see MeshRegion notes.
The points in an example MeshRegion. This one represents the
inner core inside the separatrix.¶
- class hypnotoad.core.mesh.Mesh
Collection of MeshRegion objects representing the entire grid.
The Mesh is a collection of MeshRegion objects.¶
- class hypnotoad.core.mesh.BoutMesh
Implementation of
Meshfor BOUT++ grids.Handles writing of the grid file in the format expected by BOUT++, including creation of global arrays collected from the sub-regions contained in the
MeshRegionobjects.BoutMeshrequires that the MeshRegion members fit together into a global logically-rectangular Mesh, with one of the topologies supported by BOUT++ (slab, limiter, single null, connected double null, or disconnected double null).