SPEC 3.20
Stepped Pressure Equilibrium Code
|
Functions/Subroutines | |
subroutine | matrix (lvol, mn, lrad) |
Constructs energy and helicity matrices that represent the Beltrami linear system.gauge conditions More... | |
subroutine | mtrxhs (lvol, mn, lrad, resultA, resultD, idx) |
Constructs matrices that represent the Beltrami linear system, matrix-free. More... | |
subroutine | spsmat (lvol, mn, lrad) |
Constructs matrices for the precondtioner. More... | |
subroutine matrix | ( | integer, intent(in) | lvol, |
integer, intent(in) | mn, | ||
integer, intent(in) | lrad | ||
) |
Constructs energy and helicity matrices that represent the Beltrami linear system.gauge conditions
\begin{eqnarray} {\bf \bar A}=\bar A_{s} \nabla s + \bar A_{\theta} \nabla \theta + \bar A_{\zeta} \nabla \zeta. \end{eqnarray}
\begin{eqnarray} \begin{array}{cccccccccccccccccccccccccccccccccccccc} \partial_s g( s,\theta,\zeta) & = & - & \bar A_{s }( s,\theta,\zeta) \\ \partial_\theta g(-1,\theta,\zeta) & = & - & \bar A_{\theta}(-1,\theta,\zeta) \\ \partial_\zeta g(-1, 0,\zeta) & = & - & \bar A_{\zeta }(-1, 0,\zeta). \end{array} \end{eqnarray}
\begin{eqnarray} A_{\theta}(-1,\theta,\zeta) &=& 0 \label{eq:At_matrixgauge_matrix} \\ A_{\zeta }(-1, 0,\zeta) &=& 0 \label{eq:Az_matrixgauge_matrix} \end{eqnarray}
boundary conditions
\begin{eqnarray} A_\zeta(-1,\theta,\zeta)=0. \end{eqnarray}
enclosed fluxes
\begin{eqnarray} \int_S {\bf B}\cdot{\bf ds}=\int_{\partial S}{\bf A}\cdot {\bf dl}. \end{eqnarray}
Fourier-Chebyshev representation
\begin{eqnarray} A_\theta(s,\theta,\zeta) &=& \sum_{i,l} {\color{red} A_{\theta,e,i,l}} \; {\overline T}_{l,i}(s) \cos\alpha_i + \sum_{i,l} {\color{Orange} A_{\theta,o,i,l}} \; {\overline T}_{l,i}(s) \sin\alpha_i, \label{eq:At_matrix} \\ A_\zeta( s,\theta,\zeta) &=& \sum_{i,l} {\color{blue}A_{\zeta, e,i,l}} \; {\overline T}_{l,i}(s) \cos\alpha_i + \sum_{i,l} {\color{Cerulean}A_{\zeta ,o,i,l}} \; {\overline T}_{l,i}(s) \sin\alpha_i, \label{eq:Az_matrix} \end{eqnarray}
where \({\overline T}_{l,i}(s) \) is the recombined Chebyshev polynomial in a volume without an axis, or modified Zernike polynomial in a volume with an axis (i.e. only in the innermost volume, and only in cylindrical and toroidal geometry.) , and \(\alpha_j \equiv m_j\theta-n_j\zeta\).\begin{eqnarray} \begin{array}{ccccrcrcrcrcccccccccccccccccccccccccccccccccccccccccccccccccccc} \sqrt g \, {\bf B} & = & {\bf e}_s & \sum_{i,l} [ ( & - m_i {\color{blue}A_{\zeta, e,i,l}} & - & n_i {\color{red} A_{\theta,e,i,l}} & ) {\overline T}_{l,i} \sin\alpha_i + ( & + m_i {\color{Cerulean}A_{\zeta ,o,i,l}} & + & n_i {\color{Orange} A_{\theta,o,i,l}} & ) {\overline T}_{l,i} \cos\alpha_i ] \\ & + & {\bf e}_\theta & \sum_{i,l} [ ( & & - & {\color{blue}A_{\zeta, e,i,l}} & ) {\overline T}_{l,i}^\prime \cos\alpha_i + ( & & - & {\color{Cerulean}A_{\zeta ,o,i,l}} & ) {\overline T}_{l,i}^\prime \sin\alpha_i ] \\ & + & {\bf e}_\zeta & \sum_{i,l} [ ( & {\color{red} A_{\theta,e,i,l}} & & & ) {\overline T}_{l,i}^\prime \cos\alpha_i + ( & {\color{Orange} A_{\theta,o,i,l}} & & & ) {\overline T}_{l,i}^\prime \sin\alpha_i ] \end{array} \end{eqnarray}
\begin{eqnarray} v_s (s,\theta,\zeta) &=& \sum_{i,l} {\color{red} v_{ s,e,i,l}} \; {\overline T}_{l,i}(s) \cos\alpha_i + \sum_{i,l} {\color{Orange} v_{ s,o,i,l}} \; {\overline T}_{l,i}(s) \sin\alpha_i, \\ v_\theta(s,\theta,\zeta) &=& \sum_{i,l} {\color{red} v_{\theta,e,i,l}} \; {\overline T}_{l,i}(s) \cos\alpha_i + \sum_{i,l} {\color{Orange} v_{\theta,o,i,l}} \; {\overline T}_{l,i}(s) \sin\alpha_i, \\ v_\zeta (s,\theta,\zeta) &=& \sum_{i,l} {\color{blue} v_{\zeta ,e,i,l}} \; {\overline T}_{l,i}(s) \cos\alpha_i + \sum_{i,l} {\color{Cerulean} v_{\zeta ,o,i,l}} \; {\overline T}_{l,i}(s) \sin\alpha_i. \end{eqnarray}
constrained energy functional
\begin{eqnarray} {\cal F} \equiv {\cal F}[{\color{red} A_{\theta,e,i,l}},{\color{blue}A_{\zeta, e,i,l}},{\color{Orange} A_{\theta,o,i,l}},{\color{Cerulean}A_{\zeta ,o,i,l}}, {\color{red} v_{s,e,i,l}},{\color{Orange} v_{s,o,i,l}},{\color{red} v_{\theta,e,i,l}},{\color{Orange} v_{\theta,o,i,l}},{\color{blue} v_{\zeta,e,i,l}},{\color{Cerulean} v_{\zeta,o,i,l}},\mu,a_i,b_i,c_i,d_i,e_i,f_i,g_1,h_1], \end{eqnarray}
and is given by:\begin{eqnarray} \begin{array}{cclcclcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc} {\cal F} & \equiv & \displaystyle \int {\bf B} \cdot {\bf B} \, dv + \int {\bf v} \cdot {\bf v} \, dv - \displaystyle \mu \left[ \int {\bf A} \cdot {\bf B} \, dv - K \right] \\ & + & & \displaystyle \sum_{i=1} & a_i & \displaystyle \left[ \sum_l {\color{red} A_{\theta,e,i,l}} T_l(-1) - 0 \right] \\ & + & & \displaystyle \sum_{i=1} & b_i & \displaystyle \left[ \sum_l {\color{blue} A_{\zeta, e,i,l}} T_l(-1) - 0 \right] \\ & + & & \displaystyle \sum_{i=2} & c_i & \displaystyle \left[ \sum_l {\color{Orange} A_{\theta,o,i,l}} T_l(-1) - 0 \right] \\ & + & & \displaystyle \sum_{i=2} & d_i & \displaystyle \left[ \sum_l {\color{Cerulean}A_{\zeta ,o,i,l}} T_l(-1) - 0 \right] \\ & + & & \displaystyle \sum_{i=2} & e_i & \displaystyle \left[ \sum_l \left( - m_i {\color{blue} A_{\zeta, e,i,l}} - n_i {\color{red} A_{\theta,e,i,l}} \right) T_l(+1) - b_{s,i} \right] \\ & + & & \displaystyle \sum_{i=2} & f_i & \displaystyle \left[ \sum_l \left( + m_i {\color{Cerulean}A_{\zeta ,o,i,l}} + n_i {\color{Orange} A_{\theta,o,i,l}} \right) T_l(+1) - b_{c,i} \right] \\ & + & & \displaystyle & g_1 & \displaystyle \left[ \sum_l {\color{red} A_{\theta,e,1,l}} T_l(+1) - \Delta \psi_t \right] \\ & + & & \displaystyle & h_1 & \displaystyle \left[ \sum_l {\color{blue} A_{\zeta, e,1,l}} T_l(+1) + \Delta \psi_p \right] \end{array} \end{eqnarray}
whereNote: in SPEC version >3.00, the basis recombination method is used to ensure the boundary condition on the inner side of an interface. The lagrange multipliers \(a_i, b_i, c_i, d_i\) are no longer used in volumes without a coordinate singularity. In a volume with a coordinate singularity, they are used only \(a_i, c_i\) with $m=0,1$ are excluded also due to Zernike basis recombination.
derivatives of magnetic energy integrals
\begin{eqnarray} \frac{\partial}{\partial {\color{red} A_{\theta,e,i,l}}} \int \!\! dv \; {\bf B} \cdot {\bf B} & = & 2 \int \!\! dv \; {\bf B} \cdot \frac{\partial {\bf B}}{\partial {\color{red} A_{\theta,e,i,l}}} = 2 \int \!\! dv \; {\bf B} \cdot \left[ - n_i {\overline T}_{l,i} \sin\alpha_i \, {\bf e}_s + {\overline T}_{l,i}^\prime \cos\alpha_i \, {\bf e}_\zeta \right] / \sqrt g \\ \frac{\partial}{\partial {\color{Orange} A_{\theta,o,i,l}}} \int \!\! dv \; {\bf B} \cdot {\bf B} & = & 2 \int \!\! dv \; {\bf B} \cdot \frac{\partial {\bf B}}{\partial {\color{Orange} A_{\theta,o,i,l}}} = 2 \int \!\! dv \; {\bf B} \cdot \left[ + n_i {\overline T}_{l,i} \cos\alpha_i \, {\bf e}_s + {\overline T}_{l,i}^\prime \sin\alpha_i \, {\bf e}_\zeta \right] / \sqrt g \\ \frac{\partial}{\partial {\color{blue}A_{\zeta, e,i,l}}} \int \!\! dv \; {\bf B} \cdot {\bf B} & = & 2 \int \!\! dv \; {\bf B} \cdot \frac{\partial {\bf B}}{\partial {\color{blue}A_{\zeta, e,i,l}}} = 2 \int \!\! dv \; {\bf B} \cdot \left[ - m_i {\overline T}_{l,i} \sin\alpha_i \, {\bf e}_s - {\overline T}_{l,i}^\prime \cos\alpha_i \, {\bf e}_\theta \right] / \sqrt g \\ \frac{\partial}{\partial {\color{Cerulean}A_{\zeta ,o,i,l}}} \int \!\! dv \; {\bf B} \cdot {\bf B} & = & 2 \int \!\! dv \; {\bf B} \cdot \frac{\partial {\bf B}}{\partial {\color{Cerulean}A_{\zeta ,o,i,l}}} = 2 \int \!\! dv \; {\bf B} \cdot \left[ + m_i {\overline T}_{l,i} \cos\alpha_i \, {\bf e}_s - {\overline T}_{l,i}^\prime \sin\alpha_i \, {\bf e}_\theta \right] / \sqrt g \end{eqnarray}
The second derivatives of \(\int \! dv \; {\bf B} \! \cdot \! {\bf B}\) with respect to \({\color{red} A_{\theta,e,i,l}}\), \({\color{Orange} A_{\theta,o,i,l}}\), \({\color{blue}A_{\zeta, e,i,l}}\) and \({\color{Cerulean}A_{\zeta ,o,i,l}}\) are
\begin{eqnarray} \!\!\!\!\!\!\!\!\! \frac{\partial}{\partial {\color{red} A_{\theta,e,j,p}}} \frac{\partial}{\partial {\color{red} A_{\theta,e,i,l}}} \! \int \!\! dv \; {\bf B} \! \cdot \! {\bf B} \!\!&\!\!=\!\!&\!\!2 \int \!\! dv \; ( + n_j n_i {\overline T}_{p,j} {\overline T}_{l,i} s_j s_i g_{ss} - n_j {\overline T}_{p,j} {\overline T}_{l,i}^\prime s_j c_i g_{s\zeta} - n_i {\overline T}_{l,i} {\overline T}_{p,j}^\prime s_i c_j g_{s\zeta} + {\overline T}_{p,j}^\prime {\overline T}_{l,i}^\prime c_j c_i g_{\zeta\zeta}) / \sqrt g^2\nonumber \\ \!\!\!\!\!\!\!\!\! \frac{\partial}{\partial {\color{Orange} A_{\theta,o,j,p}}} \frac{\partial}{\partial {\color{red} A_{\theta,e,i,l}}} \! \int \!\! dv \; {\bf B} \! \cdot \! {\bf B} \!\!&\!\!=\!\!&\!\!2 \int \!\! dv \; ( - n_j n_i {\overline T}_{p,j} {\overline T}_{l,i} c_j s_i g_{ss} + n_j {\overline T}_{p,j} {\overline T}_{l,i}^\prime c_j c_i g_{s\zeta} - n_i {\overline T}_{l,i} {\overline T}_{p,j}^\prime s_i s_j g_{s\zeta} + {\overline T}_{p,j}^\prime {\overline T}_{l,i}^\prime s_j c_i g_{\zeta\zeta}) / \sqrt g^2\nonumber \\ \!\!\!\!\!\!\!\!\! \frac{\partial}{\partial {\color{blue} A_{\zeta, e,j,p}}} \frac{\partial}{\partial {\color{red} A_{\theta,e,i,l}}} \! \int \!\! dv \; {\bf B} \! \cdot \! {\bf B} \!\!&\!\!=\!\!&\!\!2 \int \!\! dv \; ( + m_j n_i {\overline T}_{p,j} {\overline T}_{l,i} s_j s_i g_{ss} - m_j {\overline T}_{p,j} {\overline T}_{l,i}^\prime s_j c_i g_{s\zeta} + n_i {\overline T}_{l,i} {\overline T}_{p,j}^\prime s_i c_j g_{s\theta} - {\overline T}_{p,j}^\prime {\overline T}_{l,i}^\prime c_j c_i g_{\theta\zeta}) / \sqrt g^2\nonumber \\ \!\!\!\!\!\!\!\!\! \frac{\partial}{\partial {\color{Cerulean}A_{\zeta ,o,j,p}}} \frac{\partial}{\partial {\color{red} A_{\theta,e,i,l}}} \! \int \!\! dv \; {\bf B} \! \cdot \! {\bf B} \!\!&\!\!=\!\!&\!\!2 \int \!\! dv \; ( - m_j n_i {\overline T}_{p,j} {\overline T}_{l,i} c_j s_i g_{ss} + m_j {\overline T}_{p,j} {\overline T}_{l,i}^\prime c_j c_i g_{s\zeta} + n_i {\overline T}_{l,i} {\overline T}_{p,j}^\prime s_i s_j g_{s\theta} - {\overline T}_{p,j}^\prime {\overline T}_{l,i}^\prime s_j c_i g_{\theta\zeta}) / \sqrt g^2\nonumber \end{eqnarray}
\begin{eqnarray} \!\!\!\!\!\!\!\!\! \frac{\partial}{\partial {\color{red} A_{\theta,e,j,p}}} \frac{\partial}{\partial {\color{Orange} A_{\theta,o,i,l}}} \! \int \!\! dv \; {\bf B} \! \cdot \! {\bf B} \!\!&\!\!=\!\!&\!\!2 \int \!\! dv \; ( - n_j n_i {\overline T}_{p,j} {\overline T}_{l,i} s_j c_i g_{ss} - n_j {\overline T}_{p,j} {\overline T}_{l,i}^\prime s_j s_i g_{s\zeta} + n_i {\overline T}_{l,i} {\overline T}_{p,j}^\prime c_i c_j g_{s\zeta} + {\overline T}_{p,j}^\prime {\overline T}_{l,i}^\prime c_j s_i g_{\zeta\zeta}) / \sqrt g^2\nonumber \\ \!\!\!\!\!\!\!\!\! \frac{\partial}{\partial {\color{Orange} A_{\theta,o,j,p}}} \frac{\partial}{\partial {\color{Orange} A_{\theta,o,i,l}}} \! \int \!\! dv \; {\bf B} \! \cdot \! {\bf B} \!\!&\!\!=\!\!&\!\!2 \int \!\! dv \; ( + n_j n_i {\overline T}_{p,j} {\overline T}_{l,i} c_j c_i g_{ss} + n_j {\overline T}_{p,j} {\overline T}_{l,i}^\prime c_j s_i g_{s\zeta} + n_i {\overline T}_{l,i} {\overline T}_{p,j}^\prime c_i s_j g_{s\zeta} + {\overline T}_{p,j}^\prime {\overline T}_{l,i}^\prime s_j s_i g_{\zeta\zeta}) / \sqrt g^2\nonumber \\ \!\!\!\!\!\!\!\!\! \frac{\partial}{\partial {\color{blue} A_{\zeta, e,j,p}}} \frac{\partial}{\partial {\color{Orange} A_{\theta,o,i,l}}} \! \int \!\! dv \; {\bf B} \! \cdot \! {\bf B} \!\!&\!\!=\!\!&\!\!2 \int \!\! dv \; ( - m_j n_i {\overline T}_{p,j} {\overline T}_{l,i} s_j c_i g_{ss} - m_j {\overline T}_{p,j} {\overline T}_{l,i}^\prime s_j s_i g_{s\zeta} - n_i {\overline T}_{l,i} {\overline T}_{p,j}^\prime c_i c_j g_{s\theta} - {\overline T}_{p,j}^\prime {\overline T}_{l,i}^\prime c_j s_i g_{\theta\zeta}) / \sqrt g^2\nonumber \\ \!\!\!\!\!\!\!\!\! \frac{\partial}{\partial {\color{Cerulean}A_{\zeta ,o,j,p}}} \frac{\partial}{\partial {\color{Orange} A_{\theta,o,i,l}}} \! \int \!\! dv \; {\bf B} \! \cdot \! {\bf B} \!\!&\!\!=\!\!&\!\!2 \int \!\! dv \; ( + m_j n_i {\overline T}_{p,j} {\overline T}_{l,i} c_j c_i g_{ss} + m_j {\overline T}_{p,j} {\overline T}_{l,i}^\prime c_j s_i g_{s\zeta} - n_i {\overline T}_{l,i} {\overline T}_{p,j}^\prime c_i s_j g_{s\theta} - {\overline T}_{p,j}^\prime {\overline T}_{l,i}^\prime s_j s_i g_{\theta\zeta}) / \sqrt g^2\nonumber \end{eqnarray}
\begin{eqnarray} \!\!\!\!\!\!\!\!\! \frac{\partial}{\partial {\color{red} A_{\theta,e,j,p}}} \frac{\partial}{\partial {\color{blue}A_{\zeta, e,i,l}}} \! \int \!\! dv \; {\bf B} \! \cdot \! {\bf B} \!\!&\!\!=\!\!&\!\!2 \int \!\! dv \; ( + n_j m_i {\overline T}_{p,j} {\overline T}_{l,i} s_j s_i g_{ss} + n_j {\overline T}_{p,j} {\overline T}_{l,i}^\prime s_j c_i g_{s\theta} - m_i {\overline T}_{l,i} {\overline T}_{p,j}^\prime s_i c_j g_{s\zeta} - {\overline T}_{p,j}^\prime {\overline T}_{l,i}^\prime c_j c_i g_{\theta\zeta}) / \sqrt g^2\nonumber \\ \!\!\!\!\!\!\!\!\! \frac{\partial}{\partial {\color{Orange} A_{\theta,o,j,p}}} \frac{\partial}{\partial {\color{blue}A_{\zeta, e,i,l}}} \! \int \!\! dv \; {\bf B} \! \cdot \! {\bf B} \!\!&\!\!=\!\!&\!\!2 \int \!\! dv \; ( - n_j m_i {\overline T}_{p,j} {\overline T}_{l,i} c_j s_i g_{ss} - n_j {\overline T}_{p,j} {\overline T}_{l,i}^\prime c_j c_i g_{s\theta} - m_i {\overline T}_{l,i} {\overline T}_{p,j}^\prime s_i s_j g_{s\zeta} - {\overline T}_{p,j}^\prime {\overline T}_{l,i}^\prime s_j c_i g_{\theta\zeta}) / \sqrt g^2\nonumber \\ \!\!\!\!\!\!\!\!\! \frac{\partial}{\partial {\color{blue} A_{\zeta, e,j,p}}} \frac{\partial}{\partial {\color{blue}A_{\zeta, e,i,l}}} \! \int \!\! dv \; {\bf B} \! \cdot \! {\bf B} \!\!&\!\!=\!\!&\!\!2 \int \!\! dv \; ( + m_j m_i {\overline T}_{p,j} {\overline T}_{l,i} s_j s_i g_{ss} + m_j {\overline T}_{p,j} {\overline T}_{l,i}^\prime s_j c_i g_{s\theta} + m_i {\overline T}_{l,i} {\overline T}_{p,j}^\prime s_i c_j g_{s\theta} + {\overline T}_{p,j}^\prime {\overline T}_{l,i}^\prime c_j c_i g_{\theta\theta}) / \sqrt g^2\nonumber \\ \!\!\!\!\!\!\!\!\! \frac{\partial}{\partial {\color{Cerulean}A_{\zeta ,o,j,p}}} \frac{\partial}{\partial {\color{blue}A_{\zeta, e,i,l}}} \! \int \!\! dv \; {\bf B} \! \cdot \! {\bf B} \!\!&\!\!=\!\!&\!\!2 \int \!\! dv \; ( - m_j m_i {\overline T}_{p,j} {\overline T}_{l,i} c_j s_i g_{ss} - m_j {\overline T}_{p,j} {\overline T}_{l,i}^\prime c_j c_i g_{s\theta} + m_i {\overline T}_{l,i} {\overline T}_{p,j}^\prime s_i s_j g_{s\theta} + {\overline T}_{p,j}^\prime {\overline T}_{l,i}^\prime s_j c_i g_{\theta\theta}) / \sqrt g^2\nonumber \end{eqnarray}
\begin{eqnarray} \!\!\!\!\!\!\!\!\! \frac{\partial}{\partial {\color{red} A_{\theta,e,j,p}}} \frac{\partial}{\partial {\color{Cerulean}A_{\zeta ,o,i,l}}} \! \int \!\! dv \; {\bf B} \! \cdot \! {\bf B} \!\!&\!\!=\!\!&\!\!2 \int \!\! dv \; ( - n_j m_i {\overline T}_{p,j} {\overline T}_{l,i} s_j c_i g_{ss} + n_j {\overline T}_{p,j} {\overline T}_{l,i}^\prime s_j s_i g_{s\theta} + m_i {\overline T}_{l,i} {\overline T}_{p,j}^\prime c_i c_j g_{s\zeta} - {\overline T}_{p,j}^\prime {\overline T}_{l,i}^\prime c_j s_i g_{\theta\zeta}) / \sqrt g^2\nonumber \\ \!\!\!\!\!\!\!\!\! \frac{\partial}{\partial {\color{Orange} A_{\theta,o,j,p}}} \frac{\partial}{\partial {\color{Cerulean}A_{\zeta ,o,i,l}}} \! \int \!\! dv \; {\bf B} \! \cdot \! {\bf B} \!\!&\!\!=\!\!&\!\!2 \int \!\! dv \; ( + n_j m_i {\overline T}_{p,j} {\overline T}_{l,i} c_j c_i g_{ss} - n_j {\overline T}_{p,j} {\overline T}_{l,i}^\prime c_j s_i g_{s\theta} + m_i {\overline T}_{l,i} {\overline T}_{p,j}^\prime c_i s_j g_{s\zeta} - {\overline T}_{p,j}^\prime {\overline T}_{l,i}^\prime s_j s_i g_{\theta\zeta}) / \sqrt g^2\nonumber \\ \!\!\!\!\!\!\!\!\! \frac{\partial}{\partial {\color{blue} A_{\zeta, e,j,p}}} \frac{\partial}{\partial {\color{Cerulean}A_{\zeta ,o,i,l}}} \! \int \!\! dv \; {\bf B} \! \cdot \! {\bf B} \!\!&\!\!=\!\!&\!\!2 \int \!\! dv \; ( - m_j m_i {\overline T}_{p,j} {\overline T}_{l,i} s_j c_i g_{ss} + m_j {\overline T}_{p,j} {\overline T}_{l,i}^\prime s_j s_i g_{s\theta} - m_i {\overline T}_{l,i} {\overline T}_{p,j}^\prime c_i c_j g_{s\theta} + {\overline T}_{p,j}^\prime {\overline T}_{l,i}^\prime c_j s_i g_{\theta\theta}) / \sqrt g^2\nonumber \\ \!\!\!\!\!\!\!\!\! \frac{\partial}{\partial {\color{Cerulean}A_{\zeta ,o,j,p}}} \frac{\partial}{\partial {\color{Cerulean}A_{\zeta ,o,i,l}}} \! \int \!\! dv \; {\bf B} \! \cdot \! {\bf B} \!\!&\!\!=\!\!&\!\!2 \int \!\! dv \; ( + m_j m_i {\overline T}_{p,j} {\overline T}_{l,i} c_j c_i g_{ss} - m_j {\overline T}_{p,j} {\overline T}_{l,i}^\prime c_j s_i g_{s\theta} - m_i {\overline T}_{l,i} {\overline T}_{p,j}^\prime c_i s_j g_{s\theta} + {\overline T}_{p,j}^\prime {\overline T}_{l,i}^\prime s_j s_i g_{\theta\theta}) / \sqrt g^2\nonumber \end{eqnarray}
derivatives of helicity integrals
\begin{eqnarray} \frac{\partial}{\partial {\color{red} A_{\theta,e,i,l}}} \int \!\! dv \; {\bf A} \cdot {\bf B} & = & \int \!\! dv \; \left( \frac{\partial {\bf A}}{\partial {\color{red} A_{\theta,e,i,l}}} \cdot {\bf B} + {\bf A} \cdot \frac{\partial {\bf B}}{\partial {\color{red} A_{\theta,e,i,l}}} \right) = \int \!\! dv \; ( {\overline T}_{l,i} \cos\alpha_i \nabla \theta \cdot {\bf B} + {\bf A} \cdot {\overline T}_{l,i}^\prime \cos\alpha_i \, {\bf e}_\zeta / \sqrt g ) \\ \frac{\partial}{\partial {\color{Orange} A_{\theta,o,i,l}}} \int \!\! dv \; {\bf A} \cdot {\bf B} & = & \int \!\! dv \; \left( \frac{\partial {\bf A}}{\partial {\color{Orange} A_{\theta,o,i,l}}} \cdot {\bf B} + {\bf A} \cdot \frac{\partial {\bf B}}{\partial {\color{Orange} A_{\theta,o,i,l}}} \right) = \int \!\! dv \; ( {\overline T}_{l,i} \sin\alpha_i \nabla \theta \cdot {\bf B} + {\bf A} \cdot {\overline T}_{l,i}^\prime \sin\alpha_i \, {\bf e}_\zeta / \sqrt g ) \\ \frac{\partial}{\partial {\color{blue}A_{\zeta, e,i,l}}} \int \!\! dv \; {\bf A} \cdot {\bf B} & = & \int \!\! dv \; \left( \frac{\partial {\bf A}}{\partial {\color{blue}A_{\zeta, e,i,l}}} \cdot {\bf B} + {\bf A} \cdot \frac{\partial {\bf B}}{\partial {\color{blue}A_{\zeta, e,i,l}}} \right) = \int \!\! dv \; ( {\overline T}_{l,i} \cos\alpha_i \nabla \zeta \cdot {\bf B} - {\bf A} \cdot {\overline T}_{l,i}^\prime \cos\alpha_i \, {\bf e}_\theta / \sqrt g ) \\ \frac{\partial}{\partial {\color{Cerulean}A_{\zeta ,o,i,l}}} \int \!\! dv \; {\bf A} \cdot {\bf B} & = & \int \!\! dv \; \left( \frac{\partial {\bf A}}{\partial {\color{Cerulean}A_{\zeta ,o,i,l}}} \cdot {\bf B} + {\bf A} \cdot \frac{\partial {\bf B}}{\partial {\color{Cerulean}A_{\zeta ,o,i,l}}} \right) = \int \!\! dv \; ( {\overline T}_{l,i} \sin\alpha_i \nabla \zeta \cdot {\bf B} - {\bf A} \cdot {\overline T}_{l,i}^\prime \sin\alpha_i \, {\bf e}_\theta / \sqrt g ) \end{eqnarray}
\begin{eqnarray} \frac{\partial}{\partial {\color{red} A_{\theta,e,j,p}}} \frac{\partial}{\partial {\color{red} A_{\theta,e,i,l}}} \int \!\! dv \; {\bf A} \cdot {\bf B} & = & \int \!\! dv \; \left[ \cancel{ + {\overline T}_{l,i} \cos\alpha_i \nabla \theta \cdot {\overline T}_{p,j}^\prime \cos\alpha_j \, {\bf e}_\zeta} \cancel{ + {\overline T}_{p,j} \cos\alpha_j \nabla \theta \cdot {\overline T}_{l,i}^\prime \cos\alpha_i \, {\bf e}_\zeta} \right] / \sqrt g \\ \frac{\partial}{\partial {\color{Orange} A_{\theta,o,j,p}}} \frac{\partial}{\partial {\color{red} A_{\theta,e,i,l}}} \int \!\! dv \; {\bf A} \cdot {\bf B} & = & \int \!\! dv \; \left[ \cancel{ + {\overline T}_{l,i} \cos\alpha_i \nabla \theta \cdot {\overline T}_{p,j}^\prime \sin\alpha_j \, {\bf e}_\zeta} \cancel{ + {\overline T}_{p,j} \sin\alpha_j \nabla \theta \cdot {\overline T}_{l,i}^\prime \cos\alpha_i \, {\bf e}_\zeta} \right] / \sqrt g \\ \frac{\partial}{\partial {\color{blue} A_{\zeta, e,j,p}}} \frac{\partial}{\partial {\color{red} A_{\theta,e,i,l}}} \int \!\! dv \; {\bf A} \cdot {\bf B} & = & \int \!\! dv \; \left[ - {\overline T}_{l,i} \cos\alpha_i \nabla \theta \cdot {\overline T}_{p,j}^\prime \cos\alpha_j \, {\bf e}_\theta + {\overline T}_{p,j} \cos\alpha_j \nabla \zeta \cdot {\overline T}_{l,i}^\prime \cos\alpha_i \, {\bf e}_\zeta \right] / \sqrt g \\ \frac{\partial}{\partial {\color{Cerulean}A_{\zeta ,o,j,p}}} \frac{\partial}{\partial {\color{red} A_{\theta,e,i,l}}} \int \!\! dv \; {\bf A} \cdot {\bf B} & = & \int \!\! dv \; \left[ - {\overline T}_{l,i} \cos\alpha_i \nabla \theta \cdot {\overline T}_{p,j}^\prime \sin\alpha_j \, {\bf e}_\theta + {\overline T}_{p,j} \sin\alpha_j \nabla \zeta \cdot {\overline T}_{l,i}^\prime \cos\alpha_i \, {\bf e}_\zeta \right] / \sqrt g \\ \nonumber \\ \frac{\partial}{\partial {\color{red} A_{\theta,e,j,p}}} \frac{\partial}{\partial {\color{Orange} A_{\theta,o,i,l}}} \int \!\! dv \; {\bf A} \cdot {\bf B} & = & \int \!\! dv \; \left[ \cancel{ + {\overline T}_{l,i} \sin\alpha_i \nabla \theta \cdot {\overline T}_{p,j}^\prime \cos\alpha_j \, {\bf e}_\zeta} \cancel{ + {\overline T}_{p,j} \cos\alpha_j \nabla \theta \cdot {\overline T}_{l,i}^\prime \sin\alpha_i \, {\bf e}_\zeta} \right] / \sqrt g \\ \frac{\partial}{\partial {\color{Orange} A_{\theta,o,j,p}}} \frac{\partial}{\partial {\color{Orange} A_{\theta,o,i,l}}} \int \!\! dv \; {\bf A} \cdot {\bf B} & = & \int \!\! dv \; \left[ \cancel{ + {\overline T}_{l,i} \sin\alpha_i \nabla \theta \cdot {\overline T}_{p,j}^\prime \sin\alpha_j \, {\bf e}_\zeta} \cancel{ + {\overline T}_{p,j} \sin\alpha_j \nabla \theta \cdot {\overline T}_{l,i}^\prime \sin\alpha_i \, {\bf e}_\zeta} \right] / \sqrt g \\ \frac{\partial}{\partial {\color{blue} A_{\zeta, e,j,p}}} \frac{\partial}{\partial {\color{Orange} A_{\theta,o,i,l}}} \int \!\! dv \; {\bf A} \cdot {\bf B} & = & \int \!\! dv \; \left[ - {\overline T}_{l,i} \sin\alpha_i \nabla \theta \cdot {\overline T}_{p,j}^\prime \cos\alpha_j \, {\bf e}_\theta + {\overline T}_{p,j} \cos\alpha_j \nabla \zeta \cdot {\overline T}_{l,i}^\prime \sin\alpha_i \, {\bf e}_\zeta \right] / \sqrt g \\ \frac{\partial}{\partial {\color{Cerulean}A_{\zeta ,o,j,p}}} \frac{\partial}{\partial {\color{Orange} A_{\theta,o,i,l}}} \int \!\! dv \; {\bf A} \cdot {\bf B} & = & \int \!\! dv \; \left[ - {\overline T}_{l,i} \sin\alpha_i \nabla \theta \cdot {\overline T}_{p,j}^\prime \sin\alpha_j \, {\bf e}_\theta + {\overline T}_{p,j} \sin\alpha_j \nabla \zeta \cdot {\overline T}_{l,i}^\prime \sin\alpha_i \, {\bf e}_\zeta \right] / \sqrt g \\ \nonumber \\ \frac{\partial}{\partial {\color{red} A_{\theta,e,j,p}}} \frac{\partial}{\partial {\color{blue}A_{\zeta, e,i,l}}} \int \!\! dv \; {\bf A} \cdot {\bf B} & = & \int \!\! dv \; \left[ + {\overline T}_{l,i} \cos\alpha_i \nabla \zeta \cdot {\overline T}_{p,j}^\prime \cos\alpha_j \, {\bf e}_\zeta - {\overline T}_{p,j} \cos\alpha_j \nabla \theta \cdot {\overline T}_{l,i}^\prime \cos\alpha_i \, {\bf e}_\theta \right] / \sqrt g \\ \frac{\partial}{\partial {\color{Orange} A_{\theta,o,j,p}}} \frac{\partial}{\partial {\color{blue}A_{\zeta, e,i,l}}} \int \!\! dv \; {\bf A} \cdot {\bf B} & = & \int \!\! dv \; \left[ + {\overline T}_{l,i} \cos\alpha_i \nabla \zeta \cdot {\overline T}_{p,j}^\prime \sin\alpha_j \, {\bf e}_\zeta - {\overline T}_{p,j} \sin\alpha_j \nabla \theta \cdot {\overline T}_{l,i}^\prime \cos\alpha_i \, {\bf e}_\theta \right] / \sqrt g \\ \frac{\partial}{\partial {\color{blue} A_{\zeta, e,j,p}}} \frac{\partial}{\partial {\color{blue}A_{\zeta, e,i,l}}} \int \!\! dv \; {\bf A} \cdot {\bf B} & = & \int \!\! dv \; \left[ \cancel{ - {\overline T}_{l,i} \cos\alpha_i \nabla \zeta \cdot {\overline T}_{p,j}^\prime \cos\alpha_j \, {\bf e}_\theta} \cancel{ - {\overline T}_{p,j} \cos\alpha_j \nabla \zeta \cdot {\overline T}_{l,i}^\prime \cos\alpha_i \, {\bf e}_\theta} \right] / \sqrt g \\ \frac{\partial}{\partial {\color{Cerulean}A_{\zeta ,o,j,p}}} \frac{\partial}{\partial {\color{blue}A_{\zeta, e,i,l}}} \int \!\! dv \; {\bf A} \cdot {\bf B} & = & \int \!\! dv \; \left[ \cancel{ - {\overline T}_{l,i} \cos\alpha_i \nabla \zeta \cdot {\overline T}_{p,j}^\prime \sin\alpha_j \, {\bf e}_\theta} \cancel{ - {\overline T}_{p,j} \sin\alpha_j \nabla \zeta \cdot {\overline T}_{l,i}^\prime \cos\alpha_i \, {\bf e}_\theta} \right] / \sqrt g \\ \nonumber \\ \frac{\partial}{\partial {\color{red} A_{\theta,e,j,p}}} \frac{\partial}{\partial {\color{Cerulean}A_{\zeta ,o,i,l}}} \int \!\! dv \; {\bf A} \cdot {\bf B} & = & \int \!\! dv \; \left[ + {\overline T}_{l,i} \sin\alpha_i \nabla \zeta \cdot {\overline T}_{p,j}^\prime \cos\alpha_j \, {\bf e}_\zeta - {\overline T}_{p,j} \cos\alpha_j \nabla \theta \cdot {\overline T}_{l,i}^\prime \sin\alpha_i \, {\bf e}_\theta \right] / \sqrt g \\ \frac{\partial}{\partial {\color{Orange} A_{\theta,o,j,p}}} \frac{\partial}{\partial {\color{Cerulean}A_{\zeta ,o,i,l}}} \int \!\! dv \; {\bf A} \cdot {\bf B} & = & \int \!\! dv \; \left[ + {\overline T}_{l,i} \sin\alpha_i \nabla \zeta \cdot {\overline T}_{p,j}^\prime \sin\alpha_j \, {\bf e}_\zeta - {\overline T}_{p,j} \sin\alpha_j \nabla \theta \cdot {\overline T}_{l,i}^\prime \sin\alpha_i \, {\bf e}_\theta \right] / \sqrt g \\ \frac{\partial}{\partial {\color{blue} A_{\zeta, e,j,p}}} \frac{\partial}{\partial {\color{Cerulean}A_{\zeta ,o,i,l}}} \int \!\! dv \; {\bf A} \cdot {\bf B} & = & \int \!\! dv \; \left[ \cancel{ - {\overline T}_{l,i} \sin\alpha_i \nabla \zeta \cdot {\overline T}_{p,j}^\prime \cos\alpha_j \, {\bf e}_\theta} \cancel{ - {\overline T}_{p,j} \cos\alpha_j \nabla \zeta \cdot {\overline T}_{l,i}^\prime \sin\alpha_i \, {\bf e}_\theta} \right] / \sqrt g \\ \frac{\partial}{\partial {\color{Cerulean}A_{\zeta ,o,j,p}}} \frac{\partial}{\partial {\color{Cerulean}A_{\zeta ,o,i,l}}} \int \!\! dv \; {\bf A} \cdot {\bf B} & = & \int \!\! dv \; \left[ \cancel{ - {\overline T}_{l,i} \sin\alpha_i \nabla \zeta \cdot {\overline T}_{p,j}^\prime \sin\alpha_j \, {\bf e}_\theta} \cancel{ - {\overline T}_{p,j} \sin\alpha_j \nabla \zeta \cdot {\overline T}_{l,i}^\prime \sin\alpha_i \, {\bf e}_\theta} \right] / \sqrt g \end{eqnarray}
derivatives of kinetic energy integrals
\begin{eqnarray} \frac{\partial}{\partial {\color{red} v_{ s,e,i,l}}} \int \!\! dv \; {\bf v} \cdot {\bf v} & = & 2 \int \!\! dv \; {\bf v} \cdot {\overline T}_{l,i} \cos\alpha_i \nabla s \\ \frac{\partial}{\partial {\color{Orange} v_{ s,o,i,l}}} \int \!\! dv \; {\bf v} \cdot {\bf v} & = & 2 \int \!\! dv \; {\bf v} \cdot {\overline T}_{l,i} \sin\alpha_i \nabla s \\ \frac{\partial}{\partial {\color{red} v_{\theta,e,i,l}}} \int \!\! dv \; {\bf v} \cdot {\bf v} & = & 2 \int \!\! dv \; {\bf v} \cdot {\overline T}_{l,i} \cos\alpha_i \nabla \theta \\ \frac{\partial}{\partial {\color{Orange} v_{\theta,o,i,l}}} \int \!\! dv \; {\bf v} \cdot {\bf v} & = & 2 \int \!\! dv \; {\bf v} \cdot {\overline T}_{l,i} \sin\alpha_i \nabla \theta \\ \frac{\partial}{\partial {\color{blue} v_{\zeta ,e,i,l}}} \int \!\! dv \; {\bf v} \cdot {\bf v} & = & 2 \int \!\! dv \; {\bf v} \cdot {\overline T}_{l,i} \cos\alpha_i \nabla \zeta \\ \frac{\partial}{\partial {\color{Cerulean} v_{\zeta ,o,i,l}}} \int \!\! dv \; {\bf v} \cdot {\bf v} & = & 2 \int \!\! dv \; {\bf v} \cdot {\overline T}_{l,i} \sin\alpha_i \nabla \zeta \\ \end{eqnarray}
calculation of volume-integrated basis-function-weighted metric information
[in] | lvol | |
[in] | mn | |
[in] | lrad |
References allglobal::ate, allglobal::ato, allglobal::aze, allglobal::azo, allglobal::cpus, allglobal::dbdx, allglobal::ddttcc, allglobal::ddttcs, allglobal::ddttsc, allglobal::ddttss, allglobal::ddtzcc, allglobal::ddtzcs, allglobal::ddtzsc, allglobal::ddtzss, allglobal::ddzzcc, allglobal::ddzzcs, allglobal::ddzzsc, allglobal::ddzzss, allglobal::dma, allglobal::dmb, allglobal::dmd, allglobal::dmg, allglobal::dtoocc, allglobal::dtoocs, allglobal::dtoosc, allglobal::dtooss, allglobal::ibnc, allglobal::ibns, allglobal::im, allglobal::in, allglobal::ivnc, allglobal::ivns, allglobal::lcoordinatesingularity, allglobal::lma, allglobal::lmb, allglobal::lmc, allglobal::lmd, allglobal::lme, allglobal::lmf, allglobal::lmg, allglobal::lmh, matrix(), allglobal::mpi_comm_spec, inputlist::mpol, allglobal::myid, allglobal::nadof, allglobal::ncpu, allglobal::notstellsym, constants::one, fileunits::ounit, allglobal::rtm, allglobal::rtt, numerical::small, allglobal::tdstcc, allglobal::tdstcs, allglobal::tdstsc, allglobal::tdstss, allglobal::tdszcc, allglobal::tdszcs, allglobal::tdszsc, allglobal::tdszss, allglobal::tt, allglobal::ttsscc, allglobal::ttsscs, allglobal::ttsssc, allglobal::ttssss, constants::two, inputlist::wmacros, allglobal::yesstellsym, and constants::zero.
Referenced by dfp100(), get_lu_beltrami_matrices(), matrix(), preset(), and writereadgf().
subroutine mtrxhs | ( | integer, intent(in) | lvol, |
integer, intent(in) | mn, | ||
integer, intent(in) | lrad, | ||
real, dimension(0:nadof(lvol)), intent(out) | resultA, | ||
real, dimension(0:nadof(lvol)), intent(out) | resultD, | ||
integer, intent(in) | idx | ||
) |
Constructs matrices that represent the Beltrami linear system, matrix-free.
lvol | |
mn | |
lrad | |
resultA | |
resultD | |
idx |
References allglobal::ate, allglobal::ato, allglobal::aze, allglobal::azo, allglobal::cpus, allglobal::dbdx, allglobal::dtc, allglobal::dts, allglobal::dzc, allglobal::dzs, constants::half, allglobal::im, allglobal::in, allglobal::lcoordinatesingularity, allglobal::lma, allglobal::lmavalue, allglobal::lmb, allglobal::lmbvalue, allglobal::lmc, allglobal::lmcvalue, allglobal::lmd, allglobal::lmdvalue, allglobal::lme, allglobal::lmevalue, allglobal::lmf, allglobal::lmfvalue, allglobal::lmg, allglobal::lmgvalue, allglobal::lmh, allglobal::lmhvalue, allglobal::mpi_comm_spec, inputlist::mpol, mtrxhs(), allglobal::myid, allglobal::nadof, allglobal::ncpu, allglobal::notstellsym, constants::one, fileunits::ounit, allglobal::rtm, allglobal::rtt, numerical::small, allglobal::tsc, allglobal::tss, allglobal::tt, allglobal::ttc, allglobal::tts, constants::two, allglobal::tzc, allglobal::tzs, inputlist::wmacros, allglobal::yesstellsym, and constants::zero.
Referenced by get_perturbed_solution(), matvec(), mp00ac(), and mtrxhs().
subroutine spsmat | ( | integer, intent(in) | lvol, |
integer, intent(in) | mn, | ||
integer, intent(in) | lrad | ||
) |
Constructs matrices for the precondtioner.
Preconditioner
GMRES iteratively looks for \(\mathbf{a}_n \) that minimises the residual \(\epsilon_{\mbox{GMRES}}=\|\hat{\mathcal{A}} \cdot \mathbf{a}_n - \mathbf{b}\|\), where \(\|.\|\) is the Euclidean norm. Instead of solving the original problem which is usually ill-conditioned, a left preconditioner matrix \(\mathcal{M}\) is applied on both side of \(\mathcal{A} \cdot \mathbf{a} = \mathbf{b}\) so that the transformed problem is well conditioned. The convergence speed of (the preconditioned) GMRES depends highly on the quality of \(\mathcal{M}\). A good preconditioner will require the matrix product \(\mathcal{M}^{-1} \hat{\mathcal{A}}\) to be as close as possible to an identity matrix. Also, inverting the preconditioner \(\mathcal{M}\) should be considerably cheaper than inverting \(\hat{\mathcal{A}}\) itself.
If the \(i\)-th and \(j\)-th unknowns in \(\mathbf{a}\) correspond to \(A_{\theta,m_i,n_i,l_i}\) and \(A_{\theta,m_j,n_j,l_j}\), respectively, then the matrix element \(\hat{\mathcal{A}}_{i,j}\) describes the coupling strength between harmonics \((m_i, n_i)\) and \((m_j, n_j)\). Noting that if the Fourier series of the boundary \(R_{m,n}\) and \(Z_{m,n}\) have spectral convergence, then the coupling terms between \(A_{\theta,m_i,n_i,l_i}\) and \(A_{\theta,m_j,n_j,l_j}\), formed by the \((|m_i-m_j|, |n_i-n_j|)\) harmonics of the coordinate metrics, should also decay exponentially with \(|m_i-m_j|\) and \(|n_i-n_j|\) and are thus small compared to the `‘diagonals’' \(m_i=m_j\) and \(n_i=n_j\). Therefore, we can construct \(\mathcal{M}\) from the elements of \(\hat{\mathcal{A}}\) by eliminating all the coupling terms with \(m_i \neq m_j\) or \(n_i \neq n_j\), and keeping the rest (`‘diagonals’' and terms related to Lagrange mulitpliers). Physically, the matrix \(\mathcal{M}\) is equivalent to the \(\hat{\mathcal{A}}\) matrix of a tokamak with similar major radius and minor radius to the stellarator we are solving for. The preconditioning matrix \(\mathcal{M}\) is sparse, with the number of nonzero elements \(\sim O(MNL^2)\), while the total number of elements in \(\mathcal{M}\) is \(O(M^2 N^2 L^2)\). After the construction of \(\mathcal{M}\), the approximate inverse \(\mathcal{M}\) is computed by an incomplete LU factorisation.
This subroutine constructs such a preconditioner matrix \(\mathcal{M}\) and store it inside a sparse matrix. The matrix elements are the same as matrix.f90, however, only the aforementioned terms are kept. The sparse matrix uses the storage structure of Compact Sparse Row (CSR).
lvol | |
mn | |
lrad |
References addline(), allglobal::ate, allglobal::ato, allglobal::aze, allglobal::azo, clean_queue(), allglobal::cpus, allglobal::ddttcc, allglobal::ddttcs, allglobal::ddttsc, allglobal::ddttss, allglobal::ddtzcc, allglobal::ddtzcs, allglobal::ddtzsc, allglobal::ddtzss, allglobal::ddzzcc, allglobal::ddzzcs, allglobal::ddzzsc, allglobal::ddzzss, allglobal::dma, allglobal::dmas, allglobal::dmb, allglobal::dmd, allglobal::dmds, allglobal::dmg, allglobal::dtoocc, allglobal::dtoocs, allglobal::dtoosc, allglobal::dtooss, allglobal::ibnc, allglobal::ibns, allglobal::idmas, allglobal::im, allglobal::in, allglobal::ivnc, allglobal::ivns, allglobal::jdmas, allglobal::lcoordinatesingularity, allglobal::liluprecond, allglobal::lma, allglobal::lmb, allglobal::lmc, allglobal::lmd, allglobal::lme, allglobal::lmf, allglobal::lmg, allglobal::lmh, allglobal::mpi_comm_spec, inputlist::mpol, allglobal::myid, allglobal::nadof, allglobal::ncpu, allglobal::ndmas, allglobal::ndmasmax, allglobal::notstellsym, constants::one, fileunits::ounit, push_back(), allglobal::rtm, allglobal::rtt, numerical::small, spsmat(), allglobal::tdstcc, allglobal::tdstcs, allglobal::tdstsc, allglobal::tdstss, allglobal::tdszcc, allglobal::tdszcs, allglobal::tdszsc, allglobal::tdszss, allglobal::tt, allglobal::ttsscc, allglobal::ttsscs, allglobal::ttsssc, allglobal::ttssss, constants::two, inputlist::wmacros, allglobal::yesstellsym, and constants::zero.
Referenced by dfp100(), and spsmat().