SPEC 3.20
Stepped Pressure Equilibrium Code
|
Functions/Subroutines | |
subroutine | newton (NGdof, position, ihybrd) |
Employs Newton method to find \({\bf F}({\bf x})=0\), where \({\bf x}\equiv\{\mathrm{geometry}\}\) and \({\bf F}\) is defined in dforce() . More... | |
subroutine | writereadgf (readorwrite, NGdof, ireadhessian) |
read or write force-derivative matrix More... | |
subroutine | fcn1 (NGdof, xx, fvec, irevcm) |
Objective to be given to the Newton solver, using only function values. More... | |
subroutine | fcn2 (NGdof, xx, fvec, fjac, Ldfjac, irevcm) |
Objective to be given to the Newton solver, using function values and derivatives. More... | |
subroutine newton | ( | integer, intent(in) | NGdof, |
real, dimension(0:ngdof), intent(inout) | position, | ||
integer, intent(out) | ihybrd | ||
) |
Employs Newton method to find \({\bf F}({\bf x})=0\), where \({\bf x}\equiv\{\mathrm{geometry}\}\) and \({\bf F}\) is defined in dforce() .
Solves \({\bf F}({\bf \xi})=0\), where \({\bf F} \equiv \{ [[p+B^2/2]]_{i,l}, I_{i,l} \}\) and \({\bf \xi} \equiv \{ R_{i,l},Z_{i,l} \}\).
iterative, reverse communication loop
C05NDF
if Lfindzero=1
, which only uses function values; or C05PDF
if Lfindzero=2
, which uses user-provided derivatives. c05xtol
of the true solution (see NAG documentation). c05factor
is provided to determine the initial step bound (see NAG documentation). logic, writing/reading from file
forcetol
then the iterative search will not be performed. Lfindzero=2
, and if LreadGF=T
then the derivative matrix will initially be read from
.ext.sp.DF , if it exists, or from
.sp.DF .
.ext.sp.DF . [in] | NGdof | |
[in,out] | position | |
[out] | ihybrd |
References allglobal::bbe, allglobal::bbo, inputlist::c05factor, inputlist::c05xmax, inputlist::c05xtol, allglobal::cpus, allglobal::dbbdmp, allglobal::dessian, allglobal::dffdrz, dforce(), allglobal::dmupfdx, allglobal::energy, fcn1(), fcn2(), allglobal::forceerr, inputlist::forcetol, allglobal::hessian, inputlist::igeometry, allglobal::iie, allglobal::iio, allglobal::im, allglobal::in, allglobal::irbc, allglobal::irbs, allglobal::izbc, allglobal::izbs, newtontime::lastcpu, inputlist::lcheck, inputlist::lfindzero, allglobal::lgdof, allglobal::lhessian2dallocated, allglobal::lhessian3dallocated, allglobal::lhessianallocated, allglobal::localconstraint, inputlist::lreadgf, allglobal::mn, allglobal::mpi_comm_spec, allglobal::myid, allglobal::ncpu, newtontime::ndcalls, newton(), newtontime::nfcalls, allglobal::nfreeboundaryiterations, allglobal::notstellsym, inputlist::nvol, constants::one, fileunits::ounit, numerical::sqrtmachprec, constants::ten, constants::two, inputlist::wmacros, writereadgf(), and constants::zero.
Referenced by fcn1(), fcn2(), newton(), spec(), and writereadgf().
subroutine writereadgf | ( | character, intent(in) | readorwrite, |
integer, intent(in) | NGdof, | ||
integer, intent(out) | ireadhessian | ||
) |
read or write force-derivative matrix
[in] | readorwrite | |
[in] | NGdof | |
[out] | ireadhessian |
References allglobal::cpus, fileunits::dunit, allglobal::hessian, inputlist::igeometry, allglobal::im, allglobal::in, inputlist::istellsym, inputlist::lfreebound, allglobal::lhessianallocated, matrix(), allglobal::mn, allglobal::mpi_comm_spec, inputlist::mpol, allglobal::myid, newton(), inputlist::ntor, inputlist::nvol, fileunits::ounit, and constants::zero.
Referenced by fcn2(), and newton().
subroutine fcn1 | ( | integer, intent(in) | NGdof, |
real, dimension(1:ngdof), intent(in) | xx, | ||
real, dimension(1:ngdof), intent(out) | fvec, | ||
integer, intent(in) | irevcm | ||
) |
Objective to be given to the Newton solver, using only function values.
[in] | NGdof | |
[in] | xx | |
[out] | fvec | |
[in] | irevcm |
References allglobal::bbe, allglobal::bbo, inputlist::c05factor, inputlist::c05xmax, inputlist::c05xtol, allglobal::cpus, allglobal::dbbdmp, allglobal::dessian, allglobal::dffdrz, dforce(), allglobal::dmupfdx, allglobal::energy, fcn1(), allglobal::forceerr, inputlist::forcetol, allglobal::hessian, inputlist::igeometry, allglobal::iie, allglobal::iio, allglobal::im, allglobal::in, allglobal::irbc, allglobal::irbs, allglobal::izbc, allglobal::izbs, newtontime::lastcpu, inputlist::lcheck, inputlist::lfindzero, allglobal::lgdof, allglobal::lhessianallocated, inputlist::lreadgf, allglobal::mn, allglobal::mpi_comm_spec, allglobal::myid, allglobal::ncpu, newtontime::ndcalls, newton(), newtontime::nfcalls, allglobal::nfreeboundaryiterations, allglobal::notstellsym, inputlist::nvol, constants::one, fileunits::ounit, packxi(), numerical::sqrtmachprec, constants::ten, constants::two, inputlist::wmacros, sphdf5::write_convergence_output(), allglobal::wrtend(), and constants::zero.
Referenced by fcn1(), and newton().
subroutine fcn2 | ( | integer, intent(in) | NGdof, |
real, dimension(1:ngdof), intent(in) | xx, | ||
real, dimension(1:ngdof), intent(out) | fvec, | ||
real, dimension(1:ldfjac,1:ngdof), intent(out) | fjac, | ||
integer, intent(in) | Ldfjac, | ||
integer, intent(in) | irevcm | ||
) |
Objective to be given to the Newton solver, using function values and derivatives.
[in] | NGdof | |
[in] | xx | |
[out] | fvec | |
[out] | fjac | |
[in] | Ldfjac | |
[in] | irevcm | indicator for reverse communication; provided by solver to tell this method what to compute |
References allglobal::bbe, allglobal::bbo, inputlist::c05factor, inputlist::c05xmax, inputlist::c05xtol, allglobal::cpus, allglobal::dbbdmp, allglobal::dessian, allglobal::dffdrz, dforce(), allglobal::dmupfdx, allglobal::energy, fcn2(), allglobal::forceerr, inputlist::forcetol, allglobal::hessian, inputlist::igeometry, allglobal::iie, allglobal::iio, allglobal::im, allglobal::in, allglobal::irbc, allglobal::irbs, allglobal::izbc, allglobal::izbs, newtontime::lastcpu, inputlist::lcheck, inputlist::lfindzero, allglobal::lgdof, allglobal::lhessianallocated, inputlist::lreadgf, allglobal::mn, allglobal::mpi_comm_spec, allglobal::myid, allglobal::ncpu, newtontime::ndcalls, newton(), newtontime::nfcalls, allglobal::nfreeboundaryiterations, allglobal::notstellsym, inputlist::nvol, constants::one, fileunits::ounit, packxi(), numerical::sqrtmachprec, constants::ten, constants::two, volume(), inputlist::wmacros, sphdf5::write_convergence_output(), writereadgf(), allglobal::wrtend(), and constants::zero.
Referenced by fcn2(), and newton().