The Open FUSION Toolkit 26.6
An open-source framework for fusion and plasma science and engineering
Loading...
Searching...
No Matches
tokamaker_f.F90 File Reference
#include "local.h"

Data Types

type  tokamaker_instance
 TokaMaker wrapper object for Python API. More...
type  tokamaker_recon_settings_type
 TokaMaker reconstruction settings structure for passing settings between Python to Fortran. More...
type  tokamaker_settings_type
 TokaMaker settings structure for passing settings between Python to Fortran. More...

Modules

module  tokamaker_f
 Fortran part of Python wrapper for Grad-Shafranov functionality.

Functions/Subroutines

subroutine tokamaker_alloc (tmaker_ptr, mesh_ptr, error_str)
 Allocate TokaMaker wrapper object and initialize with mesh information.
subroutine tokamaker_apply_field_eval (tmaker_equil_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)
 Compute area integral of a scalar field over a specified region.
logical function tokamaker_ccast (tmaker_cptr, tmaker_obj, error_str)
 Cast C pointer to TokaMaker wrapper object.
subroutine tokamaker_destroy (tmaker_ptr, error_str)
 Destroy TokaMaker wrapper object and associated device object.
subroutine tokamaker_eig_td (tmaker_equil_ptr, omega, neigs, eigs, eig_vecs, include_bounds, eta_plasma, pm, error_str)
 Compute eigenvalues/eigenvectors of linearized plasma-conductor system.
subroutine tokamaker_eig_wall (tmaker_ptr, neigs, eigs, eig_vecs, pm, error_str)
 Compute eigenvalues/eigenvectors of conductor (wall) system.
logical function tokamaker_equil_ccast (tmaker_equil_cptr, tmaker_equil_obj, error_str)
 Cast C pointer to TokaMaker equilibrium object.
subroutine tokamaker_equil_copy (tmaker_ptr, old_equil_ptr, new_equil_ptr, error_str)
 Copy TokaMaker equilibrium object.
subroutine tokamaker_equil_destroy (tmaker_equil_ptr, error_str)
 Destroy TokaMaker equilibrium object.
subroutine tokamaker_equil_set (tmaker_ptr, new_equil_ptr, error_str)
 Set TokaMaker equilibrium object for use in TokaMaker wrapper object.
subroutine tokamaker_eval_green (n, r, z, rc, zc, vals)
 Evaluate Green's function for axisymmetric toroidal current loop.
subroutine tokamaker_flux_int (tmaker_equil_ptr, psi_vals, field_vals, nvals, result, error_str)
 Compute the area integral of a flux function over the plasma region.
subroutine tokamaker_get_coil_currents (tmaker_equil_ptr, currents, reg_currents, error_str)
 Get coil currents.
subroutine tokamaker_get_dels_curr (tmaker_equil_ptr, psi_vals, error_str)
 Compute current density from \( \psi \) using \( \Delta^* \psi \) operator.
subroutine tokamaker_get_field_eval (tmaker_equil_ptr, imode, int_obj, error_str)
 Create an interpolation object for tokamaker fields.
subroutine tokamaker_get_globals (tmaker_equil_ptr, itor, centroid, vol, pvol, dflux, tflux, bp_vol, error_str)
 Compute various global quantities for Grad-Shafranov equilibrium.
subroutine tokamaker_get_jtor (tmaker_equil_ptr, jtor, error_str)
 Compute plasma toroidal current density using G-S RHS source.
subroutine tokamaker_get_limiter (tmaker_ptr, np, r_loc, nloops, loop_ptr, error_str)
 Get limiter geometry information.
subroutine tokamaker_get_mesh (tmaker_ptr, np, r_loc, nc, lc_loc, reg_loc, error_str)
 Build tessellated plotting mesh and return pointers to mesh information.
subroutine tokamaker_get_plasma_lmat (tmaker_equil_ptr, lmat, error_str)
 Get mutual inductance matrix for coils and plasma.
subroutine tokamaker_get_profile_dofs (tmaker_equil_ptr, prof_type, dofs, error_str)
 Retrieve degrees of freedom for desired flux profile.
subroutine tokamaker_get_profile_ndofs (tmaker_equil_ptr, prof_type, ndofs, error_str)
 Retrieve degrees of freedom for desired flux profile.
subroutine tokamaker_get_profs (tmaker_equil_ptr, npsi, psi_in, f, fp, p, pp, error_str)
 Retrieve F and P profiles and their derivatives.
subroutine tokamaker_get_psi (tmaker_equil_ptr, psi_vals, psi_lim, psi_max, error_str)
 Get \( \psi \) values for equilibrium.
subroutine tokamaker_get_q (tmaker_equil_ptr, npsi, psi_q, qvals, ravgs, dl, rbounds, zbounds, error_str)
 Compute q profile and related quantities.
subroutine tokamaker_get_refs (tmaker_equil_ptr, o_point, lim_point, x_points, diverted, plasma_bounds, ffp_scale, p_scale, has_plasma, error_str)
 Get references to internal variables for direct access from Python.
subroutine tokamaker_get_vfixed (tmaker_equil_ptr, npts, pts, fluxes, error_str)
 Compute external flux needed to reproduce fixed boundary equilibrium at domain boundary.
subroutine tokamaker_gs_calc_vloop (tmaker_equil_ptr, vloop, error_str)
 Compute loop voltage required to maintain Grad-Shafranov equilibrium.
subroutine tokamaker_init_psi (tmaker_ptr, r0, z0, a, kappa, delta, rhs_source, error_str)
 Initialize \( \psi \) using a uniform or specified current source.
subroutine tokamaker_load_profiles (tmaker_equil_ptr, f_file, f_offset, p_file, eta_file, f_ni_file, error_str)
 Load profile specification files.
subroutine tokamaker_load_tokamaker (tmaker_equil_ptr, filename, error_str)
 Load equilibrium from native TokaMaker format.
subroutine tokamaker_recon_destroy (tmaker_ptr, error_flag)
 Perform an equilibrium reconstruction using TokaMaker.
subroutine tokamaker_recon_err (tmaker_ptr, vacuum, settings, error_mat, error_flag)
 Perform an equilibrium reconstruction using TokaMaker.
subroutine tokamaker_recon_run (tmaker_ptr, vacuum, settings, error_flag)
 Perform an equilibrium reconstruction using TokaMaker.
subroutine tokamaker_recon_setup (tmaker_ptr, settings, ncons, error_flag)
 Perform an equilibrium reconstruction using TokaMaker.
logical function tokamaker_require_equil (tmaker_obj, error_str)
 Require TokaMaker wrapper object to have TokaMaker equilibrium object allocated.
logical function tokamaker_require_td (tmaker_obj, error_str)
 Require TokaMaker wrapper object to have TokaMaker time-dependent solver object allocated.
subroutine tokamaker_sauter_fc (tmaker_equil_ptr, npsi, psi_saut, fc, r_avgs, modb_avgs, error_str)
 Evaluate Sauter trapped particle fraction and related quantities.
subroutine tokamaker_save_eqdsk (tmaker_equil_ptr, filename, nr, nz, rbounds, zbounds, run_info, psi_pad, rcentr, trunc_eq, lim_filename, lcfs_press, cocos, error_str)
 Save current equilibrium in gEQDSK format.
subroutine tokamaker_save_ifile (tmaker_equil_ptr, filename, npsi, ntheta, psi_pad, lcfs_press, pack_lcfs, single_prec, error_str)
 Save current equilibrium to iFile format.
subroutine tokamaker_save_mug (tmaker_equil_ptr, filename, error_str)
 Save current equilibrium in MUG transfer format.
subroutine tokamaker_save_tokamaker (tmaker_equil_ptr, filename, error_str)
 Save current equilibrium in native TokaMaker format (eg. for restarting).
subroutine tokamaker_set_coil_bounds (tmaker_ptr, coil_bounds, error_str)
 Set hard bounds on coil currents for a TokaMaker instance.
subroutine tokamaker_set_coil_current_dist (tmaker_ptr, icoil, curr_dist, dist_pointer, normalize, error_str)
 Overwrites default coil flux contribution to non-uniform current distribution.
subroutine tokamaker_set_coil_currents (tmaker_ptr, currents, error_str)
 Set coil currents for a TokaMaker instance.
subroutine tokamaker_set_coil_regmat (tmaker_ptr, nregularize, coil_reg_mat, coil_reg_targets, coil_reg_weights, error_str)
 Sets the regularization matrix for coil currents in a TokaMaker instance.
subroutine tokamaker_set_coil_vsc (tmaker_ptr, coil_gains, error_str)
 Define virtual VSC coil for a TokaMaker instance as a weighted sum of physical coils.
subroutine tokamaker_set_dipole_a (tmaker_ptr, dipole_a, error_str)
 Set parameters for dipole anisotropic pressure profile.
subroutine tokamaker_set_flux (tmaker_ptr, locations, targets, weights, ntargets, grad_wt_lim, error_str)
 Sets the flux targets for a TokaMaker instance.
subroutine tokamaker_set_isoflux (tmaker_ptr, targets, ref_points, weights, ntargets, grad_wt_lim, error_str)
 Sets isoflux targets for a TokaMaker instance.
subroutine tokamaker_set_mirnov (tmaker_ptr, locations, norms, targets, weights, ntargets, error_str)
 Sets the mirnov targets for a TokaMaker instance.
subroutine tokamaker_set_mirror_slosh (tmaker_ptr, mirror_n, mirror_bturn, mirror_zthroat, error_str)
 Set parameters for mirror anisotropic pressure profile.
subroutine tokamaker_set_profile_dofs (tmaker_equil_ptr, prof_type, dofs, error_str)
 Set degrees of freedom for desired flux profile.
subroutine tokamaker_set_psi (tmaker_equil_ptr, psi_vals, update_bounds, error_str)
 Set \( \psi \) values in TokaMaker equilibrium object.
subroutine tokamaker_set_psi_dt (tmaker_ptr, psi_vals, icoils, vcoils, dt, error_str)
 Set flux/coil current at previous time and coil voltage for quasi-static solve.
subroutine tokamaker_set_saddles (tmaker_ptr, targets, weights, ntargets, error_str)
 Sets the saddle point targets for a TokaMaker instance.
subroutine tokamaker_set_settings (tmaker_ptr, settings, error_str)
 Update TokaMaker settings.
subroutine tokamaker_set_targets (tmaker_ptr, ip_target, ip_ratio_target, pax_target, estore_target, dflux_target, r0_target, z0_target, error_str)
 Set global target values for equilibrium solve.
subroutine tokamaker_set_vcoil (tmaker_ptr, rcoils, error_str)
 Set Vcoils by defining non-zero resistance of coils.
subroutine tokamaker_setup (tmaker_ptr, order, full_domain, ncoils, coil_lmat, error_str)
 Complete setup of TokaMaker device/wrapper object and build FE representation.
subroutine tokamaker_setup_regions (tmaker_ptr, coil_file, reg_eta, contig_flag, xpoint_mask, coil_nturns, ncoils, error_str)
 Setup TokaMaker region representations based on coil, conductor, and other information.
subroutine tokamaker_setup_td (tmaker_ptr, dt, lin_tol, nl_tol, pre_plasma, error_str)
 Setup nonlinear time-dependent solver.
subroutine tokamaker_solve (tmaker_ptr, vacuum, nl_its, error_str)
 Perform nonlinear solve to find equilibrium solution for given profiles, targets, etc.
subroutine tokamaker_step_td (tmaker_ptr, curr_ptr, volt_ptr, time, dt, nl_its, lin_its, nretry, error_str)
 Advance the time-dependent solver by one time step.
subroutine tokamaker_trace_surf (tmaker_equil_ptr, psi_surf, points, npoints, error_str)
 Trace a flux surface at specified \( \psi \) value and return points defining the surface.
subroutine tokamaker_vac_solve (tmaker_ptr, psi_in, rhs_source, error_str)
 Perform linear solve to find vacuum solution for given BCs and current sources.