The Open FUSION Toolkit 1.0.0-beta5
Modeling tools for plasma and fusion research and engineering
Loading...
Searching...
No Matches
Data Types | Functions/Subroutines | Variables
oft_gs Module Reference

Detailed Description

Grad-Shafranov implementation for TokaMaker.

Authors
Chris Hansen
Date
August 2011

Data Types

type  circular_curr
 Interpolation class for an axisymmetric gaussian source in toroidal geometry. More...
 
type  coil_region
 Internal coil region structure. More...
 
type  cond_region
 Internal wall region structure. More...
 
interface  flux_cofs_get
 Needs Docs. More...
 
interface  flux_cofs_set
 Needs Docs. More...
 
type  flux_func
 Abstract flux function prototype. More...
 
interface  flux_func_eval
 Needs Docs. More...
 
interface  flux_func_update
 Needs Docs. More...
 
type  gs_b_interp
 Interpolate a Lagrange field. More...
 
type  gs_eq
 Grad-Shafranov equilibrium object. More...
 
type  gs_prof_interp
 Interpolate G-S profiles at a specific point in space. More...
 
type  gs_region_info
 Needs docs. More...
 
type  gsinv_interp
 Need docs. More...
 
interface  region_eta_set
 Needs Docs. More...
 

Functions/Subroutines

subroutine build_dels (mat, self, bc, dt, scale)
 Construct laplacian matrix for Lagrange scalar representation.
 
subroutine build_mrop (mat, bc)
 Construct mass matrix for a boundary Lagrange scalar representation.
 
subroutine circle_interp (self, cell, f, gop, val)
 Evaluate torus source.
 
subroutine compute_bcmat (self)
 Needs Docs.
 
real(r8) function dummy_fpp (self, psi)
 
subroutine get_olbp (olbp)
 
subroutine gs_analyze_saddles (self, o_point, o_psi, x_point, x_psi)
 Needs Docs.
 
subroutine gs_b_interp_apply (self, cell, f, gop, val)
 Reconstruct a Grad-Shafranov field.
 
real(8) function, dimension(3) gs_beta (self, beta_mr)
 Compute plasma Beta.
 
subroutine gs_coil_mutual (self, icoil, b, mutual)
 Compute inductance between coil and given poloidal flux.
 
subroutine gs_coil_source (self, icoil, b)
 Needs Docs.
 
subroutine gs_cond_source (self, icond, imode, b)
 Needs Docs.
 
subroutine gs_delete (self)
 Cleanup Grad-Shafranov object internal storage.
 
subroutine gs_destroy (self)
 Initialize Grad-Shafranov solution with the Taylor state.
 
real(8) function gs_dflux (self)
 Compute diamagentic flux.
 
subroutine gs_epar (self, psi_lim, epar)
 Needs Docs.
 
character(len=40) function gs_err_reason (ierr)
 Compute Grad-Shafranov solution for current flux definitions.
 
real(8) function gs_estored (self)
 Compute plasma stored energy.
 
real(8) function gs_eta_spitzer (t, lambda)
 Needs Docs.
 
subroutine gs_find_saddle (self, psi_scale_len, psi_x, pt, stype)
 Needs Docs.
 
subroutine gs_find_xpoint (self, psi_x, r, z)
 Needs Docs.
 
subroutine gs_fit_isoflux (self, psi_full, ierr)
 Compute Grad-Shafranov solution for current flux definitions.
 
subroutine gs_fit_walleigs (self, ierr)
 Compute Grad-Shafranov solution for current flux definitions.
 
subroutine gs_fixed_vflux (self, pts, fluxes)
 Compute required vacuum flux for fixed boundary equilibrium.
 
subroutine gs_gen_source (self, source_fun, b)
 Needs Docs.
 
subroutine gs_get_chi (self)
 Compute flux potential from Grad-Shafranov solution.
 
subroutine gs_get_cond_scales (self, vals, skip_fixed)
 Needs Docs.
 
subroutine gs_get_cond_source (self, cond_fac)
 Needs Docs.
 
subroutine gs_get_cond_weights (self, vals, skip_fixed)
 Needs Docs.
 
subroutine gs_get_qprof (gseq, nr, psi_q, prof, dl, rbounds, zbounds, ravgs)
 
subroutine gs_helicity (self, ener, helic)
 Compute the magnetic energy and helicity of a fixed boundary equilibrium.
 
subroutine gs_init (self)
 Initialize Grad-Shafranov solution with the Taylor state.
 
subroutine gs_init_psi (self, ierr, r0, a, kappa, delta, curr_source)
 Initialize Grad-Shafranov solution with the Taylor state.
 
real(8) function gs_itor (self, psi_vec)
 Compute toroidal current for Grad-Shafranov equilibrium.
 
subroutine gs_itor_nl (self, itor, centroid)
 Compute toroidal current for Grad-Shafranov equilibrium.
 
subroutine gs_li (self, psi_lim, li)
 Needs Docs.
 
subroutine gs_lin_solve (self, adjust_r0, ierr)
 Compute Grad-Shafranov solution for current flux definitions.
 
subroutine gs_load_coils (self, ignore_inmesh)
 Needs Docs.
 
subroutine gs_load_limiters (self)
 Needs Docs.
 
subroutine gs_load_regions (self)
 Needs Docs.
 
subroutine gs_mat_create (new)
 
subroutine gs_plasma_mutual (self, b, mutual, itor)
 Compute inductance between plasma current and given poloidal flux.
 
subroutine gs_prof_interp_apply (self, cell, f, gop, val)
 Reconstruct a Grad-Shafranov field.
 
subroutine gs_prof_interp_delete (self)
 
subroutine gs_prof_interp_setup (self)
 
subroutine gs_psi2pt (self, psi_target, pt, pt_con, vec)
 Find position of psi along a radial chord.
 
subroutine gs_psi2r (self, psi_target, pt)
 Find position of psi along a radial chord.
 
subroutine gs_psimax (self, psi_max, r, z)
 Needs Docs.
 
subroutine gs_save_fgrid (self, filename)
 Needs Docs.
 
subroutine gs_save_fields (self, pts, npts, filename)
 Compute magnetic fields from Grad-Shafranov equilibrium.
 
subroutine gs_save_prof (self, filename, mpsi_sample)
 Needs Docs.
 
subroutine gs_set_cond_weights (self, vals, skip_fixed)
 Needs Docs.
 
subroutine gs_setup_walls (self, skip_load, make_plot)
 Needs Docs.
 
subroutine gs_solve (self, ierr)
 Compute Grad-Shafranov solution for current flux definitions.
 
subroutine gs_source (self, a, b, b2, b3, itor_alam, itor_press, estore)
 Needs Docs.
 
logical function gs_test_bounds (self, pt)
 Test whether a point is inside the LCFS.
 
real(8) function gs_tflux (self)
 Compute total enclosed toroidal flux.
 
subroutine gs_trace_surf (gseq, psi_in, points, npoints)
 
subroutine gs_update_bounds (self, track_opoint)
 Needs Docs.
 
subroutine gs_vac_solve (self, psi_sol, rhs_source, ierr)
 Compute Grad-Shafranov solution for vacuum (no plasma)
 
subroutine gs_vacuum_solve (self, pol_flux, source, ierr)
 Compute Grad-Shafranov solution for current flux definitions.
 
subroutine gs_wall_source (self, dpsi_dt, b)
 Needs Docs.
 
subroutine gs_zerob (a)
 Zero a surface Lagrange scalar field at all edge nodes.
 
subroutine gsinv_apply (self, cell, f, gop, val)
 Needs Docs.
 
subroutine gsinv_destroy (self)
 Needs Docs.
 
subroutine gsinv_setup (self)
 Needs Docs.
 
subroutine psi2pt_error (m, n, cofs, err, iflag)
 
subroutine psimax_error (m, n, cofs, err, iflag)
 
subroutine psimax_error_grad (m, n, cofs, err, jac_mat, ldjac_mat, iflag)
 
subroutine set_bcmat (self, mat)
 Needs Docs.
 

Variables

integer(i4cell_active = 0
 
real(r8), parameter gs_epsilon = 1.d-12
 
integer(4), parameter max_xpoints = 20
 
logical, dimension(:), allocatable node_flag
 
type(oft_lag_brinterp), pointer psi_eval_active => NULL()
 
type(oft_lag_bg2interp), pointer psi_g2eval_active => NULL()
 
type(oft_lag_bginterp), pointer psi_geval_active => NULL()
 
real(r8psi_target_active = 0.d0
 
real(r8), dimension(2) pt_con_active = [0.d0,0.d0]
 
real(r8qp_int_tol = 1.d-12
 
real(r8), dimension(2) vec_con_active = [0.d0,0.d0]
 

Function/Subroutine Documentation

◆ build_dels()

subroutine build_dels ( class(oft_matrix), intent(inout), pointer  mat,
class(gs_eq), intent(inout)  self,
character(len=*), intent(in)  bc,
real(8), intent(in), optional  dt,
real(8), intent(in), optional  scale 
)

Construct laplacian matrix for Lagrange scalar representation.

Supported boundary conditions

  • 'none' Full matrix
  • 'zerob' Dirichlet for all boundary DOF
  • 'grnd' Dirichlet for only groundin point
Parameters
[in,out]matMatrix object
[in]bcBoundary condition

◆ build_mrop()

subroutine build_mrop ( class(oft_matrix), intent(inout), pointer  mat,
character(len=*), intent(in)  bc 
)

Construct mass matrix for a boundary Lagrange scalar representation.

Supported boundary conditions

  • 'none' Full matrix
  • 'zerob' Dirichlet for all boundary DOF
Parameters
[in,out]matMatrix object
[in]bcBoundary condition

◆ circle_interp()

subroutine circle_interp ( class(circular_curr), intent(inout)  self,
integer(i4), intent(in)  cell,
real(r8), dimension(:), intent(in)  f,
real(r8), dimension(3,3), intent(in)  gop,
real(r8), dimension(:), intent(out)  val 
)

Evaluate torus source.

Parameters
[in]cellCell for interpolation
[in]fPossition in cell in logical coord [4]
[in]gopLogical gradient vectors at f [3,4]
[out]valReconstructed field at f [1]

◆ compute_bcmat()

subroutine compute_bcmat ( class(gs_eq), intent(inout)  self)

Needs Docs.

Parameters
[in,out]selfG-S object
[in,out]aPsi field
[in,out]bSource field

◆ dummy_fpp()

real(r8) function dummy_fpp ( class(flux_func), intent(inout)  self,
real(r8), intent(in)  psi 
)

◆ get_olbp()

subroutine get_olbp ( integer(4), dimension(:), intent(out)  olbp)

◆ gs_analyze_saddles()

subroutine gs_analyze_saddles ( class(gs_eq), intent(inout)  self,
real(8), dimension(2), intent(inout)  o_point,
real(8), intent(out)  o_psi,
real(8), dimension(2,max_xpoints), intent(out)  x_point,
real(8), dimension(max_xpoints), intent(out)  x_psi 
)

Needs Docs.

◆ gs_b_interp_apply()

subroutine gs_b_interp_apply ( class(gs_b_interp), intent(inout)  self,
integer(4), intent(in)  cell,
real(8), dimension(:), intent(in)  f,
real(8), dimension(3,3), intent(in)  gop,
real(8), dimension(:), intent(out)  val 
)

Reconstruct a Grad-Shafranov field.

Parameters
[in]cellCell for interpolation
[in]fPossition in cell in logical coord [4]
[in]gopLogical gradient vectors at f [3,4]
[out]valReconstructed field at f [1]

◆ gs_beta()

real(8) function, dimension(3) gs_beta ( class(gs_eq), intent(inout)  self,
real(8), intent(in), optional  beta_mr 
)

Compute plasma Beta.

Parameters
[in]beta_mrMinor radius for optional calculations
Returns
Beta by several different metrics

◆ gs_coil_mutual()

subroutine gs_coil_mutual ( class(gs_eq), intent(inout)  self,
integer(4), intent(in)  icoil,
class(oft_vector), intent(inout)  b,
real(8), intent(out)  mutual 
)

Compute inductance between coil and given poloidal flux.

Parameters
[in,out]selfG-S solver object
[in]icoilCoil index for mutual calculation
[in,out]b\( \psi \) for mutual calculation
[out]mutualMutual inductance \( \int I_C \psi dV / I_C \)

◆ gs_coil_source()

subroutine gs_coil_source ( class(gs_eq), intent(inout)  self,
integer(4), intent(in)  icoil,
class(oft_vector), intent(inout)  b 
)

Needs Docs.

Parameters
[in,out]selfG-S object
[in,out]aPsi field
[in,out]bSource field

◆ gs_cond_source()

subroutine gs_cond_source ( class(gs_eq), intent(inout)  self,
integer(4), intent(in)  icond,
integer(4), intent(in)  imode,
class(oft_vector), intent(inout)  b 
)

Needs Docs.

Parameters
[in,out]selfG-S object
[in,out]aPsi field
[in,out]bSource field

◆ gs_delete()

subroutine gs_delete ( class(gs_eq), intent(inout)  self)

Cleanup Grad-Shafranov object internal storage.

Parameters
[in,out]selfG-S object

◆ gs_destroy()

subroutine gs_destroy ( class(gs_eq), intent(inout)  self)

Initialize Grad-Shafranov solution with the Taylor state.

Parameters
[in,out]selfG-S object

◆ gs_dflux()

real(8) function gs_dflux ( class(gs_eq), intent(inout)  self)

Compute diamagentic flux.

Returns
Toroidal flux increment due to plasma

◆ gs_epar()

subroutine gs_epar ( class(gs_eq), intent(inout)  self,
real(8), intent(in)  psi_lim,
real(8), intent(inout)  epar 
)

Needs Docs.

◆ gs_err_reason()

character(len=40) function gs_err_reason ( integer(4), intent(in)  ierr)

Compute Grad-Shafranov solution for current flux definitions.

Parameters
[in,out]selfG-S object
[out]ierrError flag

◆ gs_estored()

real(8) function gs_estored ( class(gs_eq), intent(inout)  self)

Compute plasma stored energy.

Returns
Plasma stored energy \( \int P dV \) [J]

◆ gs_eta_spitzer()

real(8) function gs_eta_spitzer ( real(8), intent(in)  t,
real(8), intent(in), optional  lambda 
)

Needs Docs.

◆ gs_find_saddle()

subroutine gs_find_saddle ( class(gs_eq), intent(inout)  self,
real(8), intent(in)  psi_scale_len,
real(8), intent(inout)  psi_x,
real(8), dimension(2), intent(inout)  pt,
integer(4), intent(out)  stype 
)

Needs Docs.

◆ gs_find_xpoint()

subroutine gs_find_xpoint ( class(gs_eq), intent(inout)  self,
real(8), intent(inout)  psi_x,
real(8), intent(inout)  r,
real(8), intent(inout)  z 
)

Needs Docs.

◆ gs_fit_isoflux()

subroutine gs_fit_isoflux ( class(gs_eq), intent(inout)  self,
class(oft_vector), intent(inout), target  psi_full,
integer(4), intent(out)  ierr 
)

Compute Grad-Shafranov solution for current flux definitions.

Parameters
[in,out]selfG-S object
[out]ierrError flag

◆ gs_fit_walleigs()

subroutine gs_fit_walleigs ( class(gs_eq), intent(inout)  self,
integer(4), intent(out)  ierr 
)

Compute Grad-Shafranov solution for current flux definitions.

Parameters
[in,out]selfG-S object
[out]ierrError flag

◆ gs_fixed_vflux()

subroutine gs_fixed_vflux ( class(gs_eq), intent(inout)  self,
real(8), dimension(:,:), intent(inout), pointer  pts,
real(8), dimension(:), intent(inout), pointer  fluxes 
)

Compute required vacuum flux for fixed boundary equilibrium.

Parameters
[in,out]selfG-S object

◆ gs_gen_source()

subroutine gs_gen_source ( class(gs_eq), intent(inout)  self,
class(bfem_interp), intent(inout)  source_fun,
class(oft_vector), intent(inout)  b 
)

Needs Docs.

Parameters
[in,out]selfG-S object
[in,out]aPsi field
[in,out]bSource field

◆ gs_get_chi()

subroutine gs_get_chi ( class(gs_eq), intent(inout)  self)

Compute flux potential from Grad-Shafranov solution.

Parameters
[in,out]selfG-S object

◆ gs_get_cond_scales()

subroutine gs_get_cond_scales ( class(gs_eq), intent(inout)  self,
real(8), dimension(:), intent(inout)  vals,
logical, intent(in)  skip_fixed 
)

Needs Docs.

◆ gs_get_cond_source()

subroutine gs_get_cond_source ( class(gs_eq), intent(inout)  self,
real(8), dimension(:), intent(inout)  cond_fac 
)

Needs Docs.

Parameters
[in,out]selfG-S object
[in,out]aPsi field
[in,out]bSource field

◆ gs_get_cond_weights()

subroutine gs_get_cond_weights ( class(gs_eq), intent(inout)  self,
real(8), dimension(:), intent(inout)  vals,
logical, intent(in)  skip_fixed 
)

Needs Docs.

◆ gs_get_qprof()

subroutine gs_get_qprof ( class(gs_eq), intent(inout)  gseq,
integer(4), intent(in)  nr,
real(8), dimension(nr), intent(in)  psi_q,
real(8), dimension(nr), intent(out)  prof,
real(8), intent(out)  dl,
real(8), dimension(2,2), intent(out)  rbounds,
real(8), dimension(2,2), intent(out)  zbounds,
real(8), dimension(nr,2), intent(out), optional  ravgs 
)

◆ gs_helicity()

subroutine gs_helicity ( class(gs_eq), intent(inout)  self,
real(8), intent(out)  ener,
real(8), intent(out)  helic 
)

Compute the magnetic energy and helicity of a fixed boundary equilibrium.

Note
Helicity computed by this subroutine is only valid for equilibria with no normal field on the boundary.
Parameters
[out]enerTotal magnetic energy
[out]helicTotal magnetic helicity

◆ gs_init()

subroutine gs_init ( class(gs_eq), intent(inout)  self)

Initialize Grad-Shafranov solution with the Taylor state.

Parameters
[in,out]selfG-S object

◆ gs_init_psi()

subroutine gs_init_psi ( class(gs_eq), intent(inout)  self,
integer(4), intent(out)  ierr,
real(8), dimension(2), intent(in), optional  r0,
real(8), intent(in), optional  a,
real(8), intent(in), optional  kappa,
real(8), intent(in), optional  delta,
real(8), dimension(:), intent(in), optional  curr_source 
)

Initialize Grad-Shafranov solution with the Taylor state.

Parameters
[in,out]selfG-S object

◆ gs_itor()

real(8) function gs_itor ( class(gs_eq), intent(inout)  self,
class(oft_vector), intent(inout), optional  psi_vec 
)

Compute toroidal current for Grad-Shafranov equilibrium.

Parameters
[in,out]selfG-S object
Returns
itor Toroidal current

◆ gs_itor_nl()

subroutine gs_itor_nl ( class(gs_eq), intent(inout)  self,
real(8), intent(out)  itor,
real(8), dimension(2), intent(out), optional  centroid 
)

Compute toroidal current for Grad-Shafranov equilibrium.

Parameters
[in,out]selfG-S object
[out]itorToroidal current
[out]centroidCurrent centroid (optional) [2]

◆ gs_li()

subroutine gs_li ( class(gs_eq), intent(inout)  self,
real(8), intent(in)  psi_lim,
real(8), intent(inout)  li 
)

Needs Docs.

◆ gs_lin_solve()

subroutine gs_lin_solve ( class(gs_eq), intent(inout)  self,
logical, intent(in)  adjust_r0,
integer(4), intent(out), optional  ierr 
)

Compute Grad-Shafranov solution for current flux definitions.

Parameters
[in,out]selfG-S object
[out]ierrError flag

◆ gs_load_coils()

subroutine gs_load_coils ( class(gs_eq), intent(inout)  self,
logical, intent(in), optional  ignore_inmesh 
)

Needs Docs.

Parameters
[in,out]selfG-S object

◆ gs_load_limiters()

subroutine gs_load_limiters ( class(gs_eq), intent(inout)  self)

Needs Docs.

Parameters
[in,out]selfG-S object

◆ gs_load_regions()

subroutine gs_load_regions ( class(gs_eq), intent(inout)  self)

Needs Docs.

Parameters
[in,out]selfG-S object

◆ gs_mat_create()

subroutine gs_mat_create ( class(oft_matrix), intent(out), pointer  new)

◆ gs_plasma_mutual()

subroutine gs_plasma_mutual ( class(gs_eq), intent(inout)  self,
class(oft_vector), intent(inout)  b,
real(8), intent(out)  mutual,
real(8), intent(out)  itor 
)

Compute inductance between plasma current and given poloidal flux.

Parameters
[in,out]selfG-S solver object
[in,out]b\( \psi \) for mutual calculation
[out]mutualMutual inductance \( \int J_p \psi dV / I_p \)
[out]itorPlasma toroidal current

◆ gs_prof_interp_apply()

subroutine gs_prof_interp_apply ( class(gs_prof_interp), intent(inout)  self,
integer(4), intent(in)  cell,
real(8), dimension(:), intent(in)  f,
real(8), dimension(3,3), intent(in)  gop,
real(8), dimension(:), intent(out)  val 
)

Reconstruct a Grad-Shafranov field.

Parameters
[in]cellCell for interpolation
[in]fPossition in cell in logical coord [4]
[in]gopLogical gradient vectors at f [3,4]
[out]valReconstructed field at f [1]

◆ gs_prof_interp_delete()

subroutine gs_prof_interp_delete ( class(gs_prof_interp), intent(inout)  self)

◆ gs_prof_interp_setup()

subroutine gs_prof_interp_setup ( class(gs_prof_interp), intent(inout)  self)

◆ gs_psi2pt()

subroutine gs_psi2pt ( class(gs_eq), intent(inout)  self,
real(8), intent(in)  psi_target,
real(8), dimension(2), intent(inout)  pt,
real(8), dimension(2), intent(in)  pt_con,
real(8), dimension(2), intent(in)  vec 
)

Find position of psi along a radial chord.

Parameters
[in,out]selfG-S object
[in]psi_target
[in,out]r
[in]z

◆ gs_psi2r()

subroutine gs_psi2r ( class(gs_eq), intent(inout)  self,
real(8), intent(in)  psi_target,
real(8), dimension(2), intent(inout)  pt 
)

Find position of psi along a radial chord.

Parameters
[in,out]selfG-S object
[in]psi_target
[in,out]r
[in]z

◆ gs_psimax()

subroutine gs_psimax ( class(gs_eq), intent(inout)  self,
real(8), intent(inout)  psi_max,
real(8), intent(inout)  r,
real(8), intent(inout)  z 
)

Needs Docs.

◆ gs_save_fgrid()

subroutine gs_save_fgrid ( class(gs_eq), intent(inout), target  self,
character(len=*), intent(in), optional  filename 
)

Needs Docs.

◆ gs_save_fields()

subroutine gs_save_fields ( class(gs_eq), intent(inout)  self,
real(8), dimension(2,npts), intent(in)  pts,
integer(4), intent(in)  npts,
character(len=*), intent(in)  filename 
)

Compute magnetic fields from Grad-Shafranov equilibrium.

Parameters
[in,out]selfG-S object
[in]ptsSampling locations [2,npts]
[in]nptsNumber of points to sample
[in]filenameOutput file for field data

◆ gs_save_prof()

subroutine gs_save_prof ( class(gs_eq), intent(inout), target  self,
character(len=*), intent(in)  filename,
integer(4), intent(in), optional  mpsi_sample 
)

Needs Docs.

◆ gs_set_cond_weights()

subroutine gs_set_cond_weights ( class(gs_eq), intent(inout)  self,
real(8), dimension(:), intent(in)  vals,
logical, intent(in)  skip_fixed 
)

Needs Docs.

◆ gs_setup_walls()

subroutine gs_setup_walls ( class(gs_eq), intent(inout)  self,
logical, intent(in), optional  skip_load,
logical, intent(in), optional  make_plot 
)

Needs Docs.

Parameters
[in,out]selfG-S object

◆ gs_solve()

subroutine gs_solve ( class(gs_eq), intent(inout)  self,
integer(4), intent(out), optional  ierr 
)

Compute Grad-Shafranov solution for current flux definitions.

Parameters
[in,out]selfG-S object
[out]ierrError flag

◆ gs_source()

subroutine gs_source ( class(gs_eq), intent(inout)  self,
class(oft_vector), intent(inout), target  a,
class(oft_vector), intent(inout)  b,
class(oft_vector), intent(inout)  b2,
class(oft_vector), intent(inout)  b3,
real(8), intent(out)  itor_alam,
real(8), intent(out)  itor_press,
real(8), intent(out)  estore 
)

Needs Docs.

Parameters
[in,out]selfG-S object
[in,out]aPsi field
[in,out]bSource field

◆ gs_test_bounds()

logical function gs_test_bounds ( class(gs_eq), intent(inout)  self,
real(8), dimension(2), intent(in)  pt 
)

Test whether a point is inside the LCFS.

Parameters
[in,out]selfG-S object
[in]ptLocation to test in/out of plasma

◆ gs_tflux()

real(8) function gs_tflux ( class(gs_eq), intent(inout)  self)

Compute total enclosed toroidal flux.

Returns
Toroidal flux enclosed by LCFS

◆ gs_trace_surf()

subroutine gs_trace_surf ( class(gs_eq), intent(inout)  gseq,
real(8), intent(in)  psi_in,
real(8), dimension(:,:), intent(out), pointer  points,
integer(4), intent(out)  npoints 
)

◆ gs_update_bounds()

subroutine gs_update_bounds ( class(gs_eq), intent(inout)  self,
logical, intent(in), optional  track_opoint 
)

Needs Docs.

◆ gs_vac_solve()

subroutine gs_vac_solve ( class(gs_eq), intent(inout)  self,
class(oft_vector), intent(inout)  psi_sol,
class(bfem_interp), intent(inout), optional  rhs_source,
integer(4), intent(out), optional  ierr 
)

Compute Grad-Shafranov solution for vacuum (no plasma)

Parameters
[in,out]selfG-S object
[in,out]psi_solInput: BCs for \( \psi \), Output: solution
[in,out]rhs_sourceSpecified current source (optional)
[out]ierrError flag

◆ gs_vacuum_solve()

subroutine gs_vacuum_solve ( class(gs_eq), intent(inout)  self,
class(oft_vector), intent(inout)  pol_flux,
class(oft_vector), intent(inout)  source,
integer(4), intent(out), optional  ierr 
)

Compute Grad-Shafranov solution for current flux definitions.

Parameters
[in,out]selfG-S object
[out]ierrError flag

◆ gs_wall_source()

subroutine gs_wall_source ( class(gs_eq), intent(inout)  self,
class(oft_vector), intent(inout)  dpsi_dt,
class(oft_vector), intent(inout)  b 
)

Needs Docs.

Parameters
[in,out]selfG-S object

◆ gs_zerob()

subroutine gs_zerob ( class(oft_vector), intent(inout)  a)

Zero a surface Lagrange scalar field at all edge nodes.

Parameters
[in,out]aField to be zeroed

◆ gsinv_apply()

subroutine gsinv_apply ( class(gsinv_interp), intent(inout)  self,
integer(4), intent(in)  cell,
real(8), dimension(:), intent(in)  f,
real(8), dimension(3,3), intent(in)  gop,
real(8), dimension(:), intent(out)  val 
)

Needs Docs.

◆ gsinv_destroy()

subroutine gsinv_destroy ( class(gsinv_interp), intent(inout)  self)

Needs Docs.

◆ gsinv_setup()

subroutine gsinv_setup ( class(gsinv_interp), intent(inout)  self)

Needs Docs.

◆ psi2pt_error()

subroutine psi2pt_error ( integer(4), intent(in)  m,
integer(4), intent(in)  n,
real(8), dimension(n), intent(in)  cofs,
real(8), dimension(m), intent(out)  err,
integer(4), intent(inout)  iflag 
)

◆ psimax_error()

subroutine psimax_error ( integer(4), intent(in)  m,
integer(4), intent(in)  n,
real(8), dimension(n), intent(in)  cofs,
real(8), dimension(m), intent(out)  err,
integer(4), intent(inout)  iflag 
)

◆ psimax_error_grad()

subroutine psimax_error_grad ( integer(4), intent(in)  m,
integer(4), intent(in)  n,
real(8), dimension(n), intent(in)  cofs,
real(8), dimension(m), intent(out)  err,
real(8), dimension(ldjac_mat,n), intent(out)  jac_mat,
integer(4), intent(in)  ldjac_mat,
integer(4), intent(in)  iflag 
)

◆ set_bcmat()

subroutine set_bcmat ( class(gs_eq), intent(inout)  self,
class(oft_matrix), intent(inout)  mat 
)

Needs Docs.

Parameters
[in,out]selfG-S object
[in,out]aPsi field
[in,out]bSource field

Variable Documentation

◆ cell_active

integer(i4) cell_active = 0

◆ gs_epsilon

real(r8), parameter gs_epsilon = 1.d-12

◆ max_xpoints

integer(4), parameter max_xpoints = 20

◆ node_flag

logical, dimension(:), allocatable node_flag

◆ psi_eval_active

type(oft_lag_brinterp), pointer psi_eval_active => NULL()

◆ psi_g2eval_active

type(oft_lag_bg2interp), pointer psi_g2eval_active => NULL()

◆ psi_geval_active

type(oft_lag_bginterp), pointer psi_geval_active => NULL()

◆ psi_target_active

real(r8) psi_target_active = 0.d0

◆ pt_con_active

real(r8), dimension(2) pt_con_active = [0.d0,0.d0]

◆ qp_int_tol

real(r8) qp_int_tol = 1.d-12

◆ vec_con_active

real(r8), dimension(2) vec_con_active = [0.d0,0.d0]