SPECreader.jl

Index

SPECReader.SPECEquilibrium — Type
SPECEquilibrium{TT, ATT<:Array{TT}, TSA}

All components needed to reconstruct a SPEC equilibrium.

eqname = "testing/data/G3V01L0Fi.002.sp.h5"
speceq = SPECEquilibrium(eqname)
source

Geometry

SPECReader.find_sθζ — Function
find_sθζ(X,ζ,SpecVol::SPECEquilibrium,lvol::Integer,max_attempts=100)

Find the $(s,\theta,\zeta)$ point corresponding to a given $(R,Z)$ point for a fixed $\zeta$. It is possible that the starting location is bad and the located point is outside of the computational domain, in which case we generate random initial conditions until it ends up inside the domain. The point is first approached using the optimize function from Optim.jl, then NonlinearSolve is used to hopefully finish pushing the point as close as possible.

source
SPECReader.get_RZ — Method
get_RZ(s::TT,θ,ζ,SpecVol::SPECEquilibrium,lvol::Integer) where TT

Get the $(R,Z)$ coordinates from $(s,\theta,\zeta,l_{vol})\in[-1,1]\times[0,2\pi)\times[0,2\pi)\times[1,N_{vol}]$ logical coordinates.

source
SPECReader.get_axis — Method
get_axis(SpecVol)

Get the Fourier modes of the magnetic axis of a SPEC equilibrium and output a named tuple axis.R and axis.Z.

source
SPECReader.get_boundary — Function
get_boundary(SpecVol::SPECEquilibrium, lvol=SpecVol.NumberofVolumes)

Pull the outer boundary from a spec equlibrium data structure.

source

Fields

SPECReader.get_Bfield — Method
get_Bfield(s::TT, θ::TT, ζ::TT, SpecVol::SPECEquilibrium{TT,ATT,TSA},lvol::Int=1) where {TT,ATT,TSA}

Take a point in $(s,\theta,\zeta)$ and return the covarient (cotangent) components of the magnetic field.

source