Stellarator-Tools
shared_functions Module Reference

Subroutines and functions updating MHD forces and Wmhd. More...

Functions/Subroutines

subroutine funct_island
 Compute forces for the perturbed state.
 
real(dp) function getfsq (nsmin, nsmax)
 Computes the force residul. More...
 
real(dp) function getwmhd (p)
 Get the perturbed MHD and Kinetic energy. More...
 
subroutine linesearch (xcmin, fsq_min)
 Perform line search along xc vector for minimum force residul. More...
 
subroutine init_ptrs (xtarget, s_ptr_sym, u_ptr_sym, v_ptr_sym,
 Initializes pointers for xc (displacement variable) and gc (force) residules. More...
 

Detailed Description

Subroutines and functions updating MHD forces and Wmhd.

Function/Subroutine Documentation

◆ getfsq()

real (dp) function shared_functions::getfsq ( integer, intent(in)  nsmin,
integer, intent(in)  nsmax 
)

Computes the force residul.

The force residul is found by

|F^2| = Fsub.Fsup = f_s*f^s + f_u*f^u + f_v*f^v (3)

Parameters
[in]nsminMinimum radial index.
[in]nsmaxMaximum radial index.
Returns
|F^2|

◆ getwmhd()

real (dp) function shared_functions::getwmhd ( real (dp), dimension(:), intent(in)  p)

Get the perturbed MHD and Kinetic energy.

Parameters
[in]pDisplacement vector.
Returns
The total stored energy.

◆ init_ptrs()

subroutine shared_functions::init_ptrs (   xtarget,
  s_ptr_sym,
  u_ptr_sym,
  v_ptr_sym 
)

Initializes pointers for xc (displacement variable) and gc (force) residules.

Parameters
[in]xtargetState array to point to.
[out]s_ptr_symStellarator symmetric term for the s component.
[out]u_ptr_symStellarator symmetric term for the u component.
[out]v_ptr_symStellarator symmetric term for the v component.
[out]s_ptr_asymStellarator asymmetric term for the s component.
[out]u_ptr_asymStellarator asymmetric term for the u component.
[out]v_ptr_asymStellarator asymmetric term for the v component.

◆ linesearch()

subroutine shared_functions::linesearch ( real(dp), dimension(neqs), intent(inout)  xcmin,
real(dp), intent(out)  fsq_min 
)

Perform line search along xc vector for minimum force residul.

Parameters
[in,out]xcminScaled displacement vector.
[out]fsq_minResdule at the minimum.