![]() |
SPEC 3.20
Stepped Pressure Equilibrium Code
|
Functions/Subroutines | |
subroutine | dforce (NGdof, position, force, LComputeDerivatives, LComputeAxis) |
Calculates \({\bf F}({\bf x})\), where \({\bf x} \equiv \{\mbox{geometry}\} \equiv \{ R_{i,v}, Z_{i,v}\}\) and \({\bf F}\equiv[[p+B^2/2]] + \{\mbox{spectral constraints}\} \), and \(\nabla {\bf F}\). More... | |
subroutine dforce | ( | integer, intent(in) | NGdof, |
real, dimension(0:ngdof), intent(in) | position, | ||
real, dimension(0:ngdof), intent(out) | force, | ||
logical, intent(in) | LComputeDerivatives, | ||
logical | LComputeAxis | ||
) |
Calculates \({\bf F}({\bf x})\), where \({\bf x} \equiv \{\mbox{geometry}\} \equiv \{ R_{i,v}, Z_{i,v}\}\) and \({\bf F}\equiv[[p+B^2/2]] + \{\mbox{spectral constraints}\} \), and \(\nabla {\bf F}\).
unpacking
mn
labels the Fourier harmonic and \(v=1,\) Mvol
\(-1\) is the interface label. This vector is "unpacked" using packxi(). (Note that packxi() also sets the coordinate axis, i.e. the \(R_{i,0}\) and \(Z_{i,0}\).) Matrices computation
DToocc
, etc. are evaluated in each volume by calling ma00aa() dMA(0:NN,0:NN)
, dMB(0:NN,0:2)
, etc. are evaluated in each volume by calling matrix() parallelization over volumes
Two different cases emerge: either a local constraint or a global constraint is considered. This condition is determined by the flag LocalConstraint
.
vvol=1
,Mvol , ImagneticOK(vvol)
is set to
.false. LComputeDerivatives=1
. iflag=5
. broadcasting
construction of force
\begin{eqnarray} F_{i,v} \equiv \left[ ( p_{v+1}+B^2_{i,v+1}/2 ) - ( p_v + B^2_{i,v}/2 ) \right] \times \texttt{BBweight}_i, \end{eqnarray}
whereBBweight_i
is defined in preset() ; and the spectral condensation constraints, \begin{eqnarray} F_{i,v} \equiv I_{i,v} \times \texttt{epsilon} + S_{i,v,1} \times \texttt{sweight}_v - S_{i,v+1,0} \times \texttt{sweight}_{v+1}, \end{eqnarray}
where the spectral condensation constraints, \(I_{i,v}\), and the "star-like" poloidal angle constraints, \(S_{i,v,\pm 1}\), are calculated and defined in lforce() ; and thesweight
\(_v\) are defined in preset(). All quantities local to a volume are computed in dfp200(), information is then broadcasted to the MPI node \(0\) in dforce() and the global force is evaluated. prints out the force gradient matrix .hessian
construct derivatives of matrix equation
[in] | NGdof | number of global degrees of freedom |
[in] | position | degrees-of-freedom = internal geometry (packed by packxi) |
[out] | force | output: Fourier harmonics of B_mn^2 and spectral constraint forces |
[in] | LComputeDerivatives | indicates whether derivatives are to be calculated; 0: no derivatives, 1: |
[in,out] | LComputeAxis |
References inputlist::adiabatic, allglobal::ate, allglobal::ato, allglobal::aze, allglobal::azo, allglobal::bbe, allglobal::bbo, allglobal::bbweight, allglobal::bemn, allglobal::betatotal, allglobal::bomn, brcast(), allglobal::cpus, allglobal::dbbdmp, allglobal::dbdx, allglobal::denergydrr, allglobal::denergydrz, allglobal::denergydzr, allglobal::denergydzz, allglobal::dessian, allglobal::dessian2d, allglobal::dessian3d, allglobal::dffdrz, dforce(), dfp100(), dfp200(), allglobal::diotadxup, allglobal::ditgpdxtp, allglobal::dmupfdx, allglobal::dpflux, inputlist::drz, allglobal::dtflux, allglobal::energy, inputlist::epsilon, allglobal::forceerr, inputlist::gamma, constants::half, allglobal::hdffdrz, allglobal::hessian, allglobal::hessian2d, allglobal::hessian3d, allglobal::iemn, inputlist::igeometry, allglobal::iie, allglobal::iio, allglobal::im, allglobal::imagneticok, allglobal::in, allglobal::iomn, allglobal::ipdtdpf, allglobal::iquad, allglobal::irbc, allglobal::irbs, allglobal::ismyvolume(), allglobal::ismyvolumevalue, allglobal::izbc, allglobal::izbs, allglobal::lbbintegral, inputlist::lcheck, inputlist::lconstraint, allglobal::lcoordinatesingularity, inputlist::lextrap, inputlist::lfreebound, allglobal::lgdof, allglobal::lhessian2dallocated, allglobal::lhessian3dallocated, allglobal::lhessianallocated, inputlist::lhmatrix, allglobal::localconstraint, numerical::logtolerance, allglobal::lplasmaregion, inputlist::lrad, allglobal::lvacuumregion, allglobal::mn, allglobal::mpi_comm_spec, inputlist::mu, fileunits::munit, inputlist::mupftol, allglobal::mvol, allglobal::myid, allglobal::nadof, allglobal::ncpu, allglobal::notstellsym, inputlist::ntor, inputlist::nvol, constants::one, fileunits::ounit, packab(), packxi(), constants::pi, constants::pi2, inputlist::pscale, allglobal::psifactor, allglobal::semn, allglobal::solution, allglobal::somn, spec(), allglobal::sweight, constants::two, volume(), allglobal::vvolume, allglobal::whichcpuid(), inputlist::wmacros, allglobal::xoffset, allglobal::yesstellsym, and constants::zero.
Referenced by allglobal::check_inputs(), dforce(), fcn1(), fcn2(), get_lu_beltrami_matrices(), hesian(), newton(), pc00ab(), and spec().