verif_solution Subroutine

subroutine verif_solution(slv_struct, a_elt, b, error)


Arguments

Type IntentOptional AttributesName
type(MAT_SOLV), intent(in) :: slv_struct
real(kind=R8), intent(in), dimension(:):: a_elt
real(kind=R8), intent(in), dimension(:):: b
real(kind=R8), intent(out) :: error

Calls

proc~~verif_solution~~CallsGraph proc~verif_solution verif_solution proc~prod_elemental_x prod_elemental_x proc~verif_solution->proc~prod_elemental_x proc~prod_a_x prod_a_x proc~verif_solution->proc~prod_a_x

Called by

proc~~verif_solution~~CalledByGraph proc~verif_solution verif_solution program~test_solvers test_solvers program~test_solvers->proc~verif_solution

Contents

Source Code


Source Code

   subroutine verif_solution(slv_struct, a_elt, b, error)
   implicit none
   type(MAT_SOLV), intent(in) :: slv_struct
   real(kind=R8), dimension(:), intent(in) :: a_elt
   real(kind=R8), dimension(:), intent(in) :: b
   real(kind=R8), intent(out) :: error
      real(kind=R8), dimension(slv_struct%nn) :: y
      ! to assess the accuracy, the solution is applied to the
      ! system matrix and compared to the rhs.
      if (slv_struct%slv_t==MUMP) then
         call prod_elemental_x(n      = slv_struct%nn,      &
                               nz     = slv_struct%nt,      &
                               nelt   = slv_struct%ne,      &
                               nvar   = slv_struct%nvar,    &
                               x      = slv_struct%x,       &
                               y      = y,                  &
                               a_elt  = a_elt,              &
                               eltptr = slv_struct%eltptr,  &
                               eltvar = slv_struct%eltvar)
      else
         call prod_a_x(n  = slv_struct%nn,         &
                       nz = slv_struct%nz,         &
                       x  = slv_struct%x,          &
                       y  = y,                     &
                       a_elt = a_elt,              &
                       irow  = slv_struct%irow,    &
                       jptr  = slv_struct%jptr,    &
                       slvt  = slv_struct%slv_t)
      endif

      error = 100*maxval( abs(y(1:slv_struct%nn) -b(1:slv_struct%nn)) )/ &
                  maxval( abs(y(1:slv_struct%nn) +b(1:slv_struct%nn)) )
   return
   endsubroutine verif_solution