The Open FUSION Toolkit 1.0.0-beta6
Modeling tools for plasma and fusion research and engineering
Loading...
Searching...
No Matches
tokamaker_f Module Reference

Detailed Description

Fortran part of Python wrapper for Grad-Shafranov functionality.

Authors
Chris Hansen
Date
May 2023

Data Types

type  tokamaker_instance
 Needs docs. More...
type  tokamaker_recon_settings_type
 Needs docs. More...
type  tokamaker_settings_type
 Needs docs. More...

Functions/Subroutines

subroutine tokamaker_alloc (tmaker_ptr, mesh_ptr, error_str)
 Needs docs.
subroutine tokamaker_apply_field_eval (tmaker_ptr, int_obj, int_type, pt, fbary_tol, cell, dim, field)
 Evaluate a TokaMaker field with an interpolation object created by tokamaker_get_field_eval.
subroutine tokamaker_area_int (tmaker_ptr, vec_vals, reg_ind, result, error_str)
 Needs docs.
logical function tokamaker_ccast (tmaker_cptr, tmaker_obj, error_str)
 Needs docs.
subroutine tokamaker_destroy (tmaker_ptr, error_str)
 Needs docs.
subroutine tokamaker_eig_td (tmaker_ptr, omega, neigs, eigs, eig_vecs, include_bounds, eta_plasma, pm, error_str)
 Needs docs.
subroutine tokamaker_eig_wall (tmaker_ptr, neigs, eigs, eig_vecs, pm, error_str)
 Needs docs.
subroutine tokamaker_eval_green (n, r, z, rc, zc, vals)
 Needs docs.
subroutine tokamaker_flux_int (tmaker_ptr, psi_vals, field_vals, nvals, result, error_str)
 Needs docs.
subroutine tokamaker_get_coil_currents (tmaker_ptr, currents, reg_currents, error_str)
 Needs docs.
subroutine tokamaker_get_coil_lmat (tmaker_ptr, lmat, error_str)
 Needs docs.
subroutine tokamaker_get_dels_curr (tmaker_ptr, psi_vals, error_str)
 Needs docs.
subroutine tokamaker_get_field_eval (tmaker_ptr, imode, int_obj, error_str)
 Create an interpolation object for tokamaker fields.
subroutine tokamaker_get_globals (tmaker_ptr, itor, centroid, vol, pvol, dflux, tflux, bp_vol, error_str)
 Needs docs.
subroutine tokamaker_get_jtor (tmaker_ptr, jtor, error_str)
 Needs docs.
subroutine tokamaker_get_limiter (tmaker_ptr, np, r_loc, nloops, loop_ptr, error_str)
 Needs docs.
subroutine tokamaker_get_mesh (tmaker_ptr, np, r_loc, nc, lc_loc, reg_loc, error_str)
 Needs docs.
subroutine tokamaker_get_profs (tmaker_ptr, npsi, psi_in, f, fp, p, pp, error_str)
 Needs docs.
subroutine tokamaker_get_psi (tmaker_ptr, psi_vals, psi_lim, psi_max, error_str)
 Needs docs.
subroutine tokamaker_get_q (tmaker_ptr, npsi, psi_q, qvals, ravgs, dl, rbounds, zbounds, error_str)
 Needs docs.
subroutine tokamaker_get_refs (tmaker_ptr, o_point, lim_point, x_points, diverted, plasma_bounds, alam, pnorm, error_str)
 Needs docs.
subroutine tokamaker_get_vfixed (tmaker_ptr, npts, pts, fluxes, error_str)
 Needs docs.
subroutine tokamaker_gs_calc_vloop (tmaker_ptr, vloop, error_str)
 Needs docs.
subroutine tokamaker_init_psi (tmaker_ptr, r0, z0, a, kappa, delta, rhs_source, error_str)
 Needs docs.
subroutine tokamaker_load_profiles (tmaker_ptr, f_file, f_offset, p_file, eta_file, f_ni_file, error_str)
 Needs docs.
subroutine tokamaker_recon_run (tmaker_ptr, vacuum, settings, error_flag)
 Needs docs.
subroutine tokamaker_sauter_fc (tmaker_ptr, npsi, psi_saut, fc, r_avgs, modb_avgs, error_str)
 Needs docs.
subroutine tokamaker_save_eqdsk (tmaker_ptr, filename, nr, nz, rbounds, zbounds, run_info, psi_pad, rcentr, trunc_eq, lim_filename, lcfs_press, error_str)
 Needs docs.
subroutine tokamaker_save_ifile (tmaker_ptr, filename, npsi, ntheta, psi_pad, lcfs_press, pack_lcfs, single_prec, error_str)
 Needs docs.
subroutine tokamaker_save_mug (tmaker_ptr, filename, error_str)
 Needs docs.
subroutine tokamaker_set_coil_bounds (tmaker_ptr, coil_bounds, error_str)
 Needs docs.
subroutine tokamaker_set_coil_current_dist (tmaker_ptr, icoil, curr_dist, error_str)
 Overwrites default coil flux contribution to non-uniform current distribution.
subroutine tokamaker_set_coil_currents (tmaker_ptr, currents, error_str)
 Needs docs.
subroutine tokamaker_set_coil_regmat (tmaker_ptr, nregularize, coil_reg_mat, coil_reg_targets, coil_reg_weights, error_str)
 Needs docs.
subroutine tokamaker_set_coil_vsc (tmaker_ptr, coil_gains, error_str)
 Needs docs.
subroutine tokamaker_set_dipole_a (tmaker_ptr, dipole_a, error_str)
 Needs docs.
subroutine tokamaker_set_flux (tmaker_ptr, locations, targets, weights, ntargets, grad_wt_lim, error_str)
 Needs docs.
subroutine tokamaker_set_isoflux (tmaker_ptr, targets, ref_points, weights, ntargets, grad_wt_lim, error_str)
 Needs docs.
subroutine tokamaker_set_psi (tmaker_ptr, psi_vals, error_str)
 Needs docs.
subroutine tokamaker_set_psi_dt (tmaker_ptr, psi_vals, dt, error_str)
 Needs docs.
subroutine tokamaker_set_saddles (tmaker_ptr, targets, weights, ntargets, error_str)
 Needs docs.
subroutine tokamaker_set_settings (tmaker_ptr, settings, error_str)
 Needs docs.
subroutine tokamaker_set_targets (tmaker_ptr, ip_target, ip_ratio_target, pax_target, estore_target, r0_target, v0_target, error_str)
 Needs docs.
subroutine tokamaker_setup (tmaker_ptr, order, full_domain, ncoils, error_str)
 Needs docs.
subroutine tokamaker_setup_regions (tmaker_ptr, coil_file, reg_eta, contig_flag, xpoint_mask, coil_nturns, ncoils, error_str)
 Needs docs.
subroutine tokamaker_setup_td (tmaker_ptr, dt, lin_tol, nl_tol, pre_plasma, error_str)
 Needs docs.
subroutine tokamaker_solve (tmaker_ptr, error_str)
 Needs docs.
subroutine tokamaker_step_td (tmaker_ptr, time, dt, nl_its, lin_its, nretry, error_str)
 Needs docs.
subroutine tokamaker_trace_surf (tmaker_ptr, psi_surf, points, npoints, error_str)
 Needs docs.
subroutine tokamaker_vac_solve (tmaker_ptr, psi_in, rhs_source, error_str)
 Needs docs.

Function/Subroutine Documentation

◆ tokamaker_alloc()

subroutine tokamaker_alloc ( type(c_ptr), intent(out) tmaker_ptr,
type(c_ptr), intent(in), value mesh_ptr,
character(kind=c_char), dimension(oft_error_slen), intent(out), optional error_str )

Needs docs.

Parameters
[out]tmaker_ptrPointer to TokaMaker object
[in]mesh_ptrNeeds docs
[out]error_strError string (empty if no error)

◆ tokamaker_apply_field_eval()

subroutine tokamaker_apply_field_eval ( type(c_ptr), intent(in), value tmaker_ptr,
type(c_ptr), intent(in), value int_obj,
integer(c_int), intent(in), value int_type,
real(c_double), dimension(3), intent(in) pt,
real(c_double), intent(in), value fbary_tol,
integer(c_int), intent(inout) cell,
integer(c_int), intent(in), value dim,
real(c_double), dimension(dim), intent(out) field )

Evaluate a TokaMaker field with an interpolation object created by tokamaker_get_field_eval.

Parameters
[in]tmaker_ptrTokaMaker instance
[in]int_objPointer to interpolation object
[in]int_typeField type (negative to destroy)
[in]ptLocation for evaluation [R,Z,0]
[in]fbary_tolTolerance for physical to logical mapping
[in,out]cellCell containing pt (starting guess on input)
[in]dimDimension of field
[out]fieldField at pt

◆ tokamaker_area_int()

subroutine tokamaker_area_int ( type(c_ptr), intent(in), value tmaker_ptr,
type(c_ptr), intent(in), value vec_vals,
integer(c_int), intent(in), value reg_ind,
real(c_double), intent(out) result,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrPointer to TokaMaker object
[in]vec_valsNeeds docs
[in]reg_indNeeds docs
[out]resultNeeds docs
[out]error_strError string (empty if no error)

◆ tokamaker_ccast()

logical function tokamaker_ccast ( type(c_ptr), intent(in) tmaker_cptr,
type(tokamaker_instance), intent(out), pointer tmaker_obj,
character(kind=c_char), dimension(oft_error_slen), intent(out), optional error_str )

Needs docs.

Parameters
[in]tmaker_cptrC pointer to TokaMaker object
[out]error_strError string (empty if no error)

◆ tokamaker_destroy()

subroutine tokamaker_destroy ( type(c_ptr), intent(in), value tmaker_ptr,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrPointer to TokaMaker object
[out]error_strError string (empty if no error)

◆ tokamaker_eig_td()

subroutine tokamaker_eig_td ( type(c_ptr), intent(in), value tmaker_ptr,
real(c_double), intent(in), value omega,
integer(c_int), intent(in), value neigs,
type(c_ptr), intent(in), value eigs,
type(c_ptr), intent(in), value eig_vecs,
logical(c_bool), intent(in), value include_bounds,
real(c_double), intent(in), value eta_plasma,
logical(c_bool), intent(in), value pm,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrPointer to TokaMaker object
[in]omegaNeeds docs
[in]neigsNeeds docs
[in]eigsNeeds docs
[in]eig_vecsNeeds docs
[in]include_boundsNeeds docs
[in]eta_plasmaNeeds docs
[in]pmNeeds docs
[out]error_strError string (empty if no error)

◆ tokamaker_eig_wall()

subroutine tokamaker_eig_wall ( type(c_ptr), intent(in), value tmaker_ptr,
integer(c_int), intent(in), value neigs,
type(c_ptr), intent(in), value eigs,
type(c_ptr), intent(in), value eig_vecs,
logical(c_bool), intent(in), value pm,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrPointer to TokaMaker object
[in]neigsNeeds docs
[in]eigsNeeds docs
[in]eig_vecsNeeds docs
[in]pmNeeds docs
[out]error_strError string (empty if no error)

◆ tokamaker_eval_green()

subroutine tokamaker_eval_green ( integer(c_int), intent(in), value n,
type(c_ptr), intent(in), value r,
type(c_ptr), intent(in), value z,
real(c_double), intent(in), value rc,
real(c_double), intent(in), value zc,
type(c_ptr), intent(in), value vals )

Needs docs.

Parameters
[in]nNeeds docs
[in]rcNeeds docs
[in]zcNeeds docs
[in]rNeeds docs
[in]zNeeds docs
[in]valsNeeds docs

◆ tokamaker_flux_int()

subroutine tokamaker_flux_int ( type(c_ptr), intent(in), value tmaker_ptr,
type(c_ptr), intent(in), value psi_vals,
type(c_ptr), intent(in), value field_vals,
integer(c_int), intent(in), value nvals,
real(c_double), intent(out) result,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrPointer to TokaMaker object
[in]psi_valsNeeds docs
[in]field_valsNeeds docs
[out]resultNeeds docs
[out]error_strError string (empty if no error)

◆ tokamaker_get_coil_currents()

subroutine tokamaker_get_coil_currents ( type(c_ptr), intent(in), value tmaker_ptr,
type(c_ptr), intent(in), value currents,
type(c_ptr), intent(in), value reg_currents,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrPointer to TokaMaker object
[in]currentsNeeds docs
[in]reg_currentsNeeds docs
[out]error_strError string (empty if no error)

◆ tokamaker_get_coil_lmat()

subroutine tokamaker_get_coil_lmat ( type(c_ptr), intent(in), value tmaker_ptr,
type(c_ptr), intent(in), value lmat,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrPointer to TokaMaker object
[in]lmatNeeds docs
[out]error_strError string (empty if no error)

◆ tokamaker_get_dels_curr()

subroutine tokamaker_get_dels_curr ( type(c_ptr), intent(in), value tmaker_ptr,
type(c_ptr), intent(in), value psi_vals,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrPointer to TokaMaker object
[in]psi_valsNeeds docs
[out]error_strError string (empty if no error)

◆ tokamaker_get_field_eval()

subroutine tokamaker_get_field_eval ( type(c_ptr), intent(in), value tmaker_ptr,
integer(kind=c_int), intent(in), value imode,
type(c_ptr), intent(out) int_obj,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Create an interpolation object for tokamaker fields.

Parameters
[in]tmaker_ptrPointer to TokaMaker object
[in]imodeField type
[out]int_objPointer to interpolation object
[out]error_strError string (empty if no error)

◆ tokamaker_get_globals()

subroutine tokamaker_get_globals ( type(c_ptr), intent(in), value tmaker_ptr,
real(c_double), intent(out) itor,
real(c_double), dimension(2), intent(out) centroid,
real(c_double), intent(out) vol,
real(c_double), intent(out) pvol,
real(c_double), intent(out) dflux,
real(c_double), intent(out) tflux,
real(c_double), intent(out) bp_vol,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrPointer to TokaMaker object
[out]itorNeeds docs
[out]centroidNeeds docs
[out]volNeeds docs
[out]pvolNeeds docs
[out]dfluxNeeds docs
[out]tfluxNeeds docs
[out]bp_volNeeds docs
[out]error_strError string (empty if no error)

◆ tokamaker_get_jtor()

subroutine tokamaker_get_jtor ( type(c_ptr), intent(in), value tmaker_ptr,
type(c_ptr), intent(in), value jtor,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrPointer to TokaMaker object
[in]jtorNeeds docs
[out]error_strError string (empty if no error)

◆ tokamaker_get_limiter()

subroutine tokamaker_get_limiter ( type(c_ptr), intent(in), value tmaker_ptr,
integer(c_int), intent(out) np,
type(c_ptr), intent(out) r_loc,
integer(c_int), intent(out) nloops,
type(c_ptr), intent(out) loop_ptr,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrPointer to TokaMaker object
[out]r_locNeeds docs
[out]loop_ptrNeeds docs
[out]npNeeds docs
[out]nloopsNeeds docs
[out]error_strError string (empty if no error)

◆ tokamaker_get_mesh()

subroutine tokamaker_get_mesh ( type(c_ptr), intent(in), value tmaker_ptr,
integer(c_int), intent(out) np,
type(c_ptr), intent(out) r_loc,
integer(c_int), intent(out) nc,
type(c_ptr), intent(out) lc_loc,
type(c_ptr), intent(out) reg_loc,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrPointer to TokaMaker object
[out]lc_locNeeds docs
[out]r_locNeeds docs
[out]reg_locNeeds docs
[out]npNeeds docs
[out]ncNeeds docs
[out]error_strError string (empty if no error)

◆ tokamaker_get_profs()

subroutine tokamaker_get_profs ( type(c_ptr), intent(in), value tmaker_ptr,
integer(c_int), intent(in), value npsi,
real(c_double), dimension(npsi), intent(in) psi_in,
real(c_double), dimension(npsi), intent(out) f,
real(c_double), dimension(npsi), intent(out) fp,
real(c_double), dimension(npsi), intent(out) p,
real(c_double), dimension(npsi), intent(out) pp,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrPointer to TokaMaker object
[in]npsiNeeds docs
[in]psi_inNeeds docs
[out]fNeeds docs
[out]fpNeeds docs
[out]pNeeds docs
[out]ppNeeds docs
[out]error_strError string (empty if no error)

◆ tokamaker_get_psi()

subroutine tokamaker_get_psi ( type(c_ptr), intent(in), value tmaker_ptr,
type(c_ptr), intent(in), value psi_vals,
real(c_double), intent(out) psi_lim,
real(c_double), intent(out) psi_max,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrPointer to TokaMaker object
[in]psi_valsNeeds docs
[out]psi_limNeeds docs
[out]psi_maxNeeds docs
[out]error_strError string (empty if no error)

◆ tokamaker_get_q()

subroutine tokamaker_get_q ( type(c_ptr), intent(in), value tmaker_ptr,
integer(c_int), intent(in), value npsi,
real(c_double), dimension(npsi), intent(in) psi_q,
real(c_double), dimension(npsi), intent(out) qvals,
real(c_double), dimension(npsi,3), intent(out) ravgs,
real(c_double), intent(inout) dl,
real(c_double), dimension(2,2), intent(out) rbounds,
real(c_double), dimension(2,2), intent(out) zbounds,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrPointer to TokaMaker object
[in]npsiNeeds docs
[in]psi_qNeeds docs
[out]qvalsNeeds docs
[out]ravgsNeeds docs
[in,out]dlNeeds docs
[out]rboundsNeeds docs
[out]zboundsNeeds docs
[out]error_strError string (empty if no error)

◆ tokamaker_get_refs()

subroutine tokamaker_get_refs ( type(c_ptr), intent(in), value tmaker_ptr,
type(c_ptr), intent(out) o_point,
type(c_ptr), intent(out) lim_point,
type(c_ptr), intent(out) x_points,
type(c_ptr), intent(out) diverted,
type(c_ptr), intent(out) plasma_bounds,
type(c_ptr), intent(out) alam,
type(c_ptr), intent(out) pnorm,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrPointer to TokaMaker object
[out]o_pointNeeds docs
[out]lim_pointNeeds docs
[out]x_pointsNeeds docs
[out]divertedNeeds docs
[out]plasma_boundsNeeds docs
[out]alamNeeds docs
[out]pnormNeeds docs
[out]error_strError string (empty if no error)

◆ tokamaker_get_vfixed()

subroutine tokamaker_get_vfixed ( type(c_ptr), intent(in), value tmaker_ptr,
integer(c_int), intent(out) npts,
type(c_ptr), intent(out) pts,
type(c_ptr), intent(out) fluxes,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrPointer to TokaMaker object
[out]nptsNeeds docs
[out]ptsNeeds docs
[out]fluxesNeeds docs
[out]error_strError string (empty if no error)

◆ tokamaker_gs_calc_vloop()

subroutine tokamaker_gs_calc_vloop ( type(c_ptr), intent(in), value tmaker_ptr,
real(c_double), intent(out) vloop,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrPointer to TokaMaker object
[out]error_strError string (empty if no error)

◆ tokamaker_init_psi()

subroutine tokamaker_init_psi ( type(c_ptr), intent(in), value tmaker_ptr,
real(c_double), intent(in), value r0,
real(c_double), intent(in), value z0,
real(c_double), intent(in), value a,
real(c_double), intent(in), value kappa,
real(c_double), intent(in), value delta,
type(c_ptr), intent(in), value rhs_source,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrPointer to TokaMaker object
[in]r0Needs docs
[in]z0Needs docs
[in]aNeeds docs
[in]kappaNeeds docs
[in]deltaNeeds docs
[in]rhs_sourceCurrent source term (optional)
[out]error_strError string (empty if no error)

◆ tokamaker_load_profiles()

subroutine tokamaker_load_profiles ( type(c_ptr), intent(in), value tmaker_ptr,
character(kind=c_char), dimension(oft_path_slen), intent(in) f_file,
real(c_double), intent(in), value f_offset,
character(kind=c_char), dimension(oft_path_slen), intent(in) p_file,
character(kind=c_char), dimension(oft_path_slen), intent(in) eta_file,
character(kind=c_char), dimension(oft_path_slen), intent(in) f_ni_file,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrPointer to TokaMaker object
[in]f_fileF*F' prof.in file
[in]p_fileP' prof.in file
[in]f_offsetVacuum F_0 value (must be > -1E98 to update)
[in]eta_fileResistivity (eta) prof.in file
[in]f_ni_fileNon-inductive F*F' prof.in file
[out]error_strError string (empty if no error)

◆ tokamaker_recon_run()

subroutine tokamaker_recon_run ( type(c_ptr), intent(in), value tmaker_ptr,
logical(c_bool), intent(in), value vacuum,
type(tokamaker_recon_settings_type), intent(in) settings,
integer(c_int), intent(out) error_flag )

Needs docs.

Parameters
[in]tmaker_ptrPointer to TokaMaker object
[in]vacuumNeeds docs
[in]settingsNeeds docs
[out]error_flagNeeds docs

◆ tokamaker_sauter_fc()

subroutine tokamaker_sauter_fc ( type(c_ptr), intent(in), value tmaker_ptr,
integer(c_int), intent(in), value npsi,
real(c_double), dimension(npsi), intent(in) psi_saut,
real(c_double), dimension(npsi), intent(out) fc,
real(c_double), dimension(npsi,3), intent(out) r_avgs,
real(c_double), dimension(npsi,2), intent(out) modb_avgs,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrPointer to TokaMaker object
[in]npsiNeeds docs
[in]psi_sautNeeds docs
[out]fcNeeds docs
[out]r_avgsNeeds docs
[out]modb_avgsNeeds docs
[out]error_strError string (empty if no error)

◆ tokamaker_save_eqdsk()

subroutine tokamaker_save_eqdsk ( type(c_ptr), intent(in), value tmaker_ptr,
character(kind=c_char), dimension(oft_path_slen), intent(in) filename,
integer(c_int), intent(in), value nr,
integer(c_int), intent(in), value nz,
real(c_double), dimension(2), intent(in) rbounds,
real(c_double), dimension(2), intent(in) zbounds,
character(kind=c_char), dimension(40), intent(in) run_info,
real(c_double), intent(in), value psi_pad,
real(c_double), intent(in), value rcentr,
logical(c_bool), intent(in), value trunc_eq,
character(kind=c_char), dimension(oft_path_slen), intent(in) lim_filename,
real(c_double), intent(in), value lcfs_press,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrTokaMaker instance
[in]filenameNeeds docs
[in]run_infoNeeds docs
[in]nrNeeds docs
[in]nzNeeds docs
[in]rboundsNeeds docs
[in]zboundsNeeds docs
[in]psi_padNeeds docs
[in]rcentrNeeds docs
[in]trunc_eqNeeds docs
[in]lim_filenameNeeds docs
[in]lcfs_pressNeeds docs
[out]error_strError string (empty if no error)

◆ tokamaker_save_ifile()

subroutine tokamaker_save_ifile ( type(c_ptr), intent(in), value tmaker_ptr,
character(kind=c_char), dimension(oft_path_slen), intent(in) filename,
integer(c_int), intent(in), value npsi,
integer(c_int), intent(in), value ntheta,
real(c_double), intent(in), value psi_pad,
real(c_double), intent(in), value lcfs_press,
logical(c_bool), intent(in), value pack_lcfs,
logical(c_bool), intent(in), value single_prec,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrTokaMaker instance
[in]filenameNeeds docs
[in]npsiNeeds docs
[in]nthetaNeeds docs
[in]psi_padNeeds docs
[in]lcfs_pressNeeds docs
[in]pack_lcfsNeeds docs
[in]single_precNeeds docs
[out]error_strNeeds docs

◆ tokamaker_save_mug()

subroutine tokamaker_save_mug ( type(c_ptr), intent(in), value tmaker_ptr,
character(kind=c_char), dimension(oft_path_slen), intent(in) filename,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrTokaMaker instance
[in]filenameNeeds docs
[out]error_strNeeds docs

◆ tokamaker_set_coil_bounds()

subroutine tokamaker_set_coil_bounds ( type(c_ptr), intent(in), value tmaker_ptr,
type(c_ptr), intent(in), value coil_bounds,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrTokaMaker instance
[in]coil_boundsNeeds docs
[out]error_strError information

◆ tokamaker_set_coil_current_dist()

subroutine tokamaker_set_coil_current_dist ( type(c_ptr), intent(in), value tmaker_ptr,
integer(c_int), intent(in), value icoil,
type(c_ptr), intent(in), value curr_dist,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Overwrites default coil flux contribution to non-uniform current distribution.

Parameters
[in]tmaker_ptrTokaMaker instance
[out]error_strError string (empty if no error)

◆ tokamaker_set_coil_currents()

subroutine tokamaker_set_coil_currents ( type(c_ptr), intent(in), value tmaker_ptr,
type(c_ptr), intent(in), value currents,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrTokaMaker instance
[in]currentsNeeds docs
[out]error_strError information

◆ tokamaker_set_coil_regmat()

subroutine tokamaker_set_coil_regmat ( type(c_ptr), intent(in), value tmaker_ptr,
integer(c_int), intent(in), value nregularize,
type(c_ptr), intent(in), value coil_reg_mat,
type(c_ptr), intent(in), value coil_reg_targets,
type(c_ptr), intent(in), value coil_reg_weights,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrTokaMaker instance
[in]nregularizeNeeds docs
[in]coil_reg_matNeeds docs
[in]coil_reg_targetsNeeds docs
[in]coil_reg_weightsNeeds docs
[out]error_strError information

◆ tokamaker_set_coil_vsc()

subroutine tokamaker_set_coil_vsc ( type(c_ptr), intent(in), value tmaker_ptr,
type(c_ptr), intent(in), value coil_gains,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrTokaMaker instance
[in]coil_gainsNeeds docs
[out]error_strError string (empty if no error)

◆ tokamaker_set_dipole_a()

subroutine tokamaker_set_dipole_a ( type(c_ptr), intent(in), value tmaker_ptr,
real(c_double), intent(in), value dipole_a,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrTokaMaker instance
[in]dipole_aNew value for dipole_a
[out]error_strError string (empty if no error)

◆ tokamaker_set_flux()

subroutine tokamaker_set_flux ( type(c_ptr), intent(in), value tmaker_ptr,
real(c_double), dimension(2,ntargets), intent(in) locations,
real(c_double), dimension(ntargets), intent(in) targets,
real(c_double), dimension(ntargets), intent(in) weights,
integer(c_int), intent(in), value ntargets,
real(c_double), intent(in), value grad_wt_lim,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrTokaMaker instance
[in]locationsNeeds docs
[in]targetsNeeds docs
[in]weightsNeeds docs
[in]ntargetsNeeds docs
[in]grad_wt_limNeeds docs
[out]error_strError string (empty if no error)

◆ tokamaker_set_isoflux()

subroutine tokamaker_set_isoflux ( type(c_ptr), intent(in), value tmaker_ptr,
real(c_double), dimension(2,ntargets), intent(in) targets,
real(c_double), dimension(2,ntargets), intent(in) ref_points,
real(c_double), dimension(ntargets), intent(in) weights,
integer(c_int), intent(in), value ntargets,
real(c_double), intent(in), value grad_wt_lim,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrTokaMaker instance
[in]targetsNeeds docs
[in]ref_pointsNeeds docs
[in]weightsNeeds docs
[in]ntargetsNeeds docs
[in]grad_wt_limNeeds docs
[out]error_strError string (empty if no error)

◆ tokamaker_set_psi()

subroutine tokamaker_set_psi ( type(c_ptr), intent(in), value tmaker_ptr,
type(c_ptr), intent(in), value psi_vals,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrTokaMaker instance
[in]psi_valsNeeds docs
[out]error_strError string (empty if no error)

◆ tokamaker_set_psi_dt()

subroutine tokamaker_set_psi_dt ( type(c_ptr), intent(in), value tmaker_ptr,
type(c_ptr), intent(in), value psi_vals,
real(c_double), intent(in), value dt,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrTokaMaker instance
[in]psi_valsNeeds docs
[in]dtNeeds docs
[out]error_strError string (empty if no error)

◆ tokamaker_set_saddles()

subroutine tokamaker_set_saddles ( type(c_ptr), intent(in), value tmaker_ptr,
real(c_double), dimension(2,ntargets), intent(in) targets,
real(c_double), dimension(ntargets), intent(in) weights,
integer(c_int), intent(in), value ntargets,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrTokaMaker instance
[in]targetsNeeds docs
[in]weightsNeeds docs
[in]ntargetsNeeds docs
[out]error_strError information

◆ tokamaker_set_settings()

subroutine tokamaker_set_settings ( type(c_ptr), intent(in), value tmaker_ptr,
type(tokamaker_settings_type), intent(in) settings,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrTokaMaker instance
[in]settingsNeeds docs
[out]error_strError string (empty if no error)

◆ tokamaker_set_targets()

subroutine tokamaker_set_targets ( type(c_ptr), intent(in), value tmaker_ptr,
real(c_double), intent(in), value ip_target,
real(c_double), intent(in), value ip_ratio_target,
real(c_double), intent(in), value pax_target,
real(c_double), intent(in), value estore_target,
real(c_double), intent(in), value r0_target,
real(c_double), intent(in), value v0_target,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrTokaMaker instance
[in]ip_targetNeeds docs
[in]ip_ratio_targetNeeds docs
[in]pax_targetNeeds docs
[in]estore_targetNeeds docs
[in]r0_targetNeeds docs
[in]v0_targetNeeds docs
[out]error_strError string (empty if no error)

◆ tokamaker_setup()

subroutine tokamaker_setup ( type(c_ptr), intent(in), value tmaker_ptr,
integer(kind=c_int), intent(in), value order,
logical(kind=c_bool), intent(in), value full_domain,
integer(kind=c_int), intent(out) ncoils,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrPointer to TokaMaker object
[in]orderNeeds docs
[in]full_domainNeeds docs
[out]ncoilsNeeds docs
[out]error_strError string (empty if no error)

◆ tokamaker_setup_regions()

subroutine tokamaker_setup_regions ( type(c_ptr), intent(in), value tmaker_ptr,
character(kind=c_char), dimension(oft_path_slen), intent(in) coil_file,
type(c_ptr), intent(in), value reg_eta,
type(c_ptr), intent(in), value contig_flag,
type(c_ptr), intent(in), value xpoint_mask,
type(c_ptr), intent(in), value coil_nturns,
integer(c_int), intent(in), value ncoils,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrPointer to TokaMaker object
[in]coil_fileNeeds docs
[in]reg_etaNeeds docs
[in]contig_flagNeeds docs
[in]xpoint_maskNeeds docs
[in]coil_nturnsNeeds docs
[in]ncoilsNeeds docs
[out]error_strError string (empty if no error)

◆ tokamaker_setup_td()

subroutine tokamaker_setup_td ( type(c_ptr), intent(in), value tmaker_ptr,
real(c_double), intent(in), value dt,
real(c_double), intent(in), value lin_tol,
real(c_double), intent(in), value nl_tol,
logical(c_bool), intent(in), value pre_plasma,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrPointer to TokaMaker object
[in]dtNeeds docs
[in]lin_tolNeeds docs
[in]nl_tolNeeds docs
[in]pre_plasmaNeeds docs
[out]error_strError string (empty if no error)

◆ tokamaker_solve()

subroutine tokamaker_solve ( type(c_ptr), intent(in), value tmaker_ptr,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrPointer to TokaMaker object
[out]error_strError string (empty if no error)

◆ tokamaker_step_td()

subroutine tokamaker_step_td ( type(c_ptr), intent(in), value tmaker_ptr,
real(c_double), intent(inout) time,
real(c_double), intent(inout) dt,
integer(c_int), intent(out) nl_its,
integer(c_int), intent(out) lin_its,
integer(c_int), intent(out) nretry,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrPointer to TokaMaker object
[in,out]timeNeeds docs
[in,out]dtNeeds docs
[out]nl_itsNeeds docs
[out]lin_itsNeeds docs
[out]nretryNeeds docs
[out]error_strError string (empty if no error)

◆ tokamaker_trace_surf()

subroutine tokamaker_trace_surf ( type(c_ptr), intent(in), value tmaker_ptr,
real(c_double), intent(in), value psi_surf,
type(c_ptr), intent(out) points,
integer(c_int), intent(out) npoints,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrPointer to TokaMaker object
[in]psi_surfNeeds docs
[out]pointsNeeds docs
[out]npointsNeeds docs
[out]error_strError string (empty if no error)

◆ tokamaker_vac_solve()

subroutine tokamaker_vac_solve ( type(c_ptr), intent(in), value tmaker_ptr,
type(c_ptr), intent(in), value psi_in,
type(c_ptr), intent(in), value rhs_source,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Needs docs.

Parameters
[in]tmaker_ptrPointer to TokaMaker object
[in]psi_inInput: BCs for \( \psi \), Output: solution
[in]rhs_sourceCurrent source term (optional)
[out]error_strError string (empty if no error)