API Reference

TJLF

TJLF.gauss_hermiteFunction
gauss_hermite(inputs::InputTJLF{T}) where T<:Real

parameters: inputs::InputTJLF{T} - InputTJLF struct constructed in tjlfreadinput.jl

outputs: OutputHermite(x,wx,h) - OutputHermite struct

description: computes abscisca's and weights for Gauss- Hermite integration adapted from Numerical Recipes in Fortran Pg.147 reversed order of roots so that x(m) is largest and x(1) is smallest only the positive roots are found and stored #————————————————————– initializes the hermite basis functions and ten point Gauss-Hermite integration with absissas x and weights w.

source
TJLF.get_ky_spectrumFunction
get_ky_spectrum(inputs::InputTJLF{T}, grad_r0::T)::Vector{T} where T<:Real

parameters: inputs::InputTJLF{T} - InputTJLF struct constructed in tjlfreadinput.jl gradr0::T - value from SaturationParameters struct from tjlfgeometry.jl

outputs: ky_spectrum::Vector{T} - array of floats that form the ky grid

description: the input file provides the type of kygrid to create (values 1 to 5) and this function creates it accordingly

source
TJLF.get_ky_spectrum_sizeFunction
get_ky_spectrum_size(nky::Int,kygrid_model::Int)::Int

parameters: nky::Int - nky from input file kygridmodel::Int - kygridmodel from input file

outputs: size of the ky_spectrum array

description: called before creation of InputTJLF struct to get the size of ky_spectrum

source
TJLF.get_sat_paramsFunction
get_sat_params(inputs::InputTJLF{T}; ms::Int=128) where T<:Real

parameters: inputs::InputTJLF{T} - InputTJLF struct constructed in tjlfreadinput.jl

outputs: SaturationParameters{Float64}() - SaturationParameters struct calculated

description: compute the geometric coefficients on the x-grid

location: tjlf_geometry.jl

source
TJLF.get_wavefunctionFunction
get_wavefunction(inputs::InputTJLF, satParams::SaturationParameters, field_weight_out::Array{ComplexF64,3})

Reconstruct the linear mode structure (wavefunction) along the extended ballooning angle from the Hermite-basis field weights produced by run (its field_weight_out).

parameters: inputs::InputTJLF - the input used for the run satParams::SaturationParameters - saturation/geometry params (get_sat_params) fieldweightout::Array{ComplexF64,3} - mode field weights [field, basis, mode] from run

outputs: plotfieldout - fields on the angle grid [mode, field, point] plotangleout - ballooning angle θ per grid point maxplot - number of angle-grid points nmodesout - number of modes returned

description: Sums the basis-j Hermite functions weighted by field_weight_out onto a fixed extended-angle grid, for each mode and each active field (electrostatic, plus USE_BPER/USE_BPAR magnetic components). Useful for inspecting mode localization and parity.

source
TJLF.pick_deviceFunction
pick_device(mode::Symbol)

parameters: mode::Symbol - :cpu, :gpu, or :auto

outputs: device::Symbol - :cpu or :gpu

description: Determines the device to use based on the mode and CUDA availability.

source
Missing docstring.

Missing docstring for readInput. Check Documenter's build log for details.

Missing docstring.

Missing docstring for run. Check Documenter's build log for details.

TJLF.sum_ky_spectrumFunction
sum_ky_spectrum(inputs::InputTJLF{T},satParams::SaturationParameters{T},gamma_matrix::Matrix{T},QL::Array{T,5})where T <: Real

parameters: inputs - InputTJLF struct constructed using the input.TGLF file gammamatrix - matrix of gamma (mode, ky) QLweights - split into separate types of QL weights (field, species, mode, ky, type) type: (particle, energy, torodial stress, parallel stress, exchange) (optional) - a lot of optional parameters that I don't use -DSUN

outputs: QLfluxout - flux integral of the QL weights (field, species, type)

takes in the input.tglf file, ky values, gammas, quasilinear weights, calls
intensity_sat() which returns the QL intensity values, then calls
flux_integrals() which numerically integrates the fluxes
source
TJLF.tjlf_TMFunction
tjlf_TM(inputs::InputTJLF{T},satParams::SaturationParameters{T},outputHermite::OutputHermite{T}) where T<:Real

parameters: inputs::InputTJLF{T} - InputTJLF struct constructed in tjlfreadinput.jl satParams::SaturationParameters{T} - SaturationParameters struct constructed in tjlfgeometry.jl outputHermite::OutputHermite{T} - OutputHermite struct constructed in tjlfhermite.jl

outputs (named tuple): QLweights - 5d array of QL weights (field, species, mode, ky, type), type: (particle, energy, torodial stress, parallel stress, exchange) firstPasseigenvalue - 3d array of eigenvalues (mode, ky, type), type: (gamma, frequency) secondPasseigenvalue - 3d array of second pass eigenvalues (mode, ky, type), type: (gamma, frequency) fieldweightout - 4d array of field weights (field, basis, mode, ky) phibarmatrix - 2d array of phibar values (mode, ky), only meaningful for SAT_RULE=0

description: Main transport model function. Calls linear TGLF over a spectrum of ky's and computes spectral integrals of field, intensity, and fluxes.

source
TJLF.xgrid_functions_geoFunction
xgrid_functions_geo(inputs::InputTJLF{T}, satParams::SaturationParameters{T}, gamma_matrix::Matrix{T};small::T=0.00000001)

parameters: inputs::InputTJLF{T} - InputTJLF struct constructed in tjlfreadinput.jl satParams::SaturationParameters{T} - SaturationParameters struct constructed in tjlfgeometry.jl gammamatrix::Vector{T} - growth rate eigenvalues for each mode

outputs: kx0e - value of kx0e for tge given gamma value

description: calculate kx0_e (spectral shift) given the growthrate used for the second pass of TM

location: tjlf_geometry.jl

source
xgrid_functions_geo(inputs::InputTJLF{T}, satParams::SaturationParameters{T}, outHermite::OutputHermite{T}, ky::T, ky_index::Int; kx0_e::T=NaN, ms::Int=128)

parameters: inputs::InputTJLF{T} - InputTJLF struct constructed in tjlfreadinput.jl satParams::SaturationParameters{T} - SaturationParameters struct constructed in tjlfgeometry.jl outputHermite::OutputHermite{T} - OutputHermite struct constructed in tjlfhermite.jl ky::T - ky value kyindex::Int - index used for multithreading kx0e::T=NaN - spectral shift provided for second pass

outputs: OutputGeometry{Float64}() - OutputGeometry struct for different WIDTHS value

description: create the OutputGeometry struct for the specific WIDTHS value used to calculate Ave structs (tjlf_matrix.jl) used in eigenmatrix population

location: tjlf_geometry.jl

source