Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow user to terminate by TEQUILA by tolerance #363

Merged
merged 1 commit into from
Jun 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/actors/equilibrium/tequila_actor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ Base.@kwdef mutable struct FUSEparameters__ActorTEQUILA{T} <: ParametersActor wh
number_of_radial_grid_points::Entry{Int} = Entry{Int}("-", "Number of TEQUILA radial grid points"; default=20)
number_of_fourier_modes::Entry{Int} = Entry{Int}("-", "Number of modes for Fourier decomposition"; default=20)
number_of_MXH_harmonics::Entry{Int} = Entry{Int}("-", "Number of Fourier harmonics in MXH representation of flux surfaces"; default=10)
number_of_iterations::Entry{Int} = Entry{Int}("-", "Number of TEQUILA iterations"; default=5)
number_of_iterations::Entry{Int} = Entry{Int}("-", "Number of TEQUILA iterations"; default=20)
tolerance::Entry{Float64} = Entry{Float64}("-", "Tolerance for terminating iterations"; default=1e-6)
psi_norm_boundary_cutoff::Entry{Float64} = Entry{Float64}("-", "Cutoff psi_norm for determining boundary"; default=0.999)
do_plot::Entry{Bool} = Entry{Bool}("-", "Plot before and after actor"; default=false)
debug::Entry{Bool} = Entry{Bool}("-", "Print debug information withing TEQUILA solve"; default=false)
Expand Down Expand Up @@ -80,7 +81,7 @@ function _step(actor::ActorTEQUILA)
# TEQUILA shot
shot = TEQUILA.Shot(par.number_of_radial_grid_points, par.number_of_fourier_modes, mxh;
P, Jt, Pbnd, Fbnd, Ip_target=Ip)
actor.shot = TEQUILA.solve(shot, par.number_of_iterations; debug=par.debug)
actor.shot = TEQUILA.solve(shot, par.number_of_iterations; tol=par.tolerance, debug=par.debug)

if par.do_plot
for (idx, s) in enumerate(eachcol(actor.shot.surfaces[:, 2:end]))
Expand Down