This routine applies the inverse of a product preconditioner matrix to the vector in
the array b
. Depending on the flag jpre
, this involves a call to gauss_seidel
,
for the inverse of the spatial factor, and/or a call to psol_rbdpre or
psol_rbgpre for the inverse of the reaction-based factor .
If jbg == 0
, the latter factor does not use block-grouping and pjac_rbdpre is
called. Otherwise, if jbg == 1
, block-grouping is used and pjac_rbgpre is called.
The array b
is overwritten with the solution.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | neq | |||
real(kind=rk), | intent(in) | :: | t | |||
real(kind=rk), | intent(in) | :: | c(*) | |||
real(kind=rk), | intent(in) | :: | cdot(*) | |||
real(kind=rk), | intent(in) | :: | savr(*) | |||
real(kind=rk), | intent(inout) | :: | wk(*) | |||
real(kind=rk), | intent(in) | :: | cj | |||
real(kind=rk), | intent(in) | :: | wght(*) | |||
real(kind=rk), | intent(inout) | :: | rwp(*) | |||
integer, | intent(inout) | :: | iwp(*) | |||
real(kind=rk), | intent(inout) | :: | b(*) | |||
real(kind=rk), | intent(in) | :: | epslin | |||
integer, | intent(inout) | :: | ierr | |||
real(kind=rk), | intent(inout) | :: | rpar(*) | |||
integer, | intent(inout) | :: | ipar(*) |
subroutine psol( & neq, t, c, cdot, savr, wk, cj, wght, rwp, iwp, b, epslin, ierr, rpar, ipar) !! This routine applies the inverse of a product preconditioner matrix to the vector in !! the array `b`. Depending on the flag `jpre`, this involves a call to `gauss_seidel`, !! for the inverse of the spatial factor, and/or a call to [[psol_rbdpre]] or !! [[psol_rbgpre]] for the inverse of the reaction-based factor \(c_J I_d - \partial R / \partial y \). !! If `jbg == 0`, the latter factor does not use block-grouping and [[pjac_rbdpre]] is !! called. Otherwise, if `jbg == 1`, block-grouping is used and [[pjac_rbgpre]] is called. !! The array `b` is overwritten with the solution. use daskr_rbdpre, only: psol_rbdpre use daskr_rbgpre, only: psol_rbgpre integer, intent(in) :: neq real(rk), intent(in) :: t real(rk), intent(in) :: c(*) real(rk), intent(in) :: cdot(*) real(rk), intent(in) :: savr(*) real(rk), intent(inout) :: wk(*) real(rk), intent(in) :: cj real(rk), intent(in) :: wght(*) real(rk), intent(inout) :: rwp(*) integer, intent(inout) :: iwp(*) real(rk), intent(inout) :: b(*) real(rk), intent(in) :: epslin integer, intent(inout) :: ierr real(rk), intent(inout) :: rpar(*) integer, intent(inout) :: ipar(*) integer :: jbg, jpre real(rk) :: hl0 jpre = ipar(1) jbg = ipar(2) ierr = 0 hl0 = one/cj if (jpre == 2 .or. jpre == 3) call gauss_seidel(neq, hl0, b, wk) if (jpre /= 2) then if (jbg == 0) call psol_rbdpre(b, rwp, iwp) if (jbg == 1) call psol_rbgpre(b, rwp, iwp) end if if (jpre == 4) call gauss_seidel(neq, hl0, b, wk) end subroutine psol