SPECreader.jl

Reading in data

SPECreader.SPECEquilibriumType
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_RZMethod
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_axisMethod
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_boundaryFunction
get_boundary(SpecVol::SPECEquilibrium, lvol=SpecVol.NumberofVolumes)

Pull the outer boundary from a spec equlibrium data structure.

source

Fields

SPECreader.field_line!Function
field_line!(ẋ, t, x, SpecVol::SPECEquilibrium,lvol::Int=1)

In place field line tracing function given a lvol

TODO: Implement for multi-volume spec equilibria

source
SPECreader.get_BfieldMethod
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