max_residual_lvl Function

private function max_residual_lvl(mg, lvl)

Arguments

Type IntentOptional Attributes Name
type(mg_t), intent(inout) :: mg
integer, intent(in) :: lvl

Return Value real(kind=dp)


Calls

proc~~max_residual_lvl~2~~CallsGraph proc~max_residual_lvl~2 max_residual_lvl proc~residual_box~2 residual_box proc~max_residual_lvl~2->proc~residual_box~2

Called by

proc~~max_residual_lvl~2~~CalledByGraph proc~max_residual_lvl~2 max_residual_lvl proc~mg_fas_vcycle~2 mg_fas_vcycle proc~mg_fas_vcycle~2->proc~max_residual_lvl~2 proc~diffusion_solve_acoeff~2 diffusion_solve_acoeff proc~diffusion_solve_acoeff~2->proc~mg_fas_vcycle~2 proc~mg_fas_fmg~2 mg_fas_fmg proc~diffusion_solve_acoeff~2->proc~mg_fas_fmg~2 proc~diffusion_solve_vcoeff~2 diffusion_solve_vcoeff proc~diffusion_solve_vcoeff~2->proc~mg_fas_vcycle~2 proc~diffusion_solve_vcoeff~2->proc~mg_fas_fmg~2 proc~diffusion_solve~2 diffusion_solve proc~diffusion_solve~2->proc~mg_fas_vcycle~2 proc~diffusion_solve~2->proc~mg_fas_fmg~2 proc~mg_fas_fmg~2->proc~mg_fas_vcycle~2

Source Code

  real(dp) function max_residual_lvl(mg, lvl)
    type(mg_t), intent(inout) :: mg
    integer, intent(in)       :: lvl
    integer                   :: i, id, nc
    real(dp)                  :: res

    nc           = mg%box_size_lvl(lvl)
    max_residual_lvl = 0.0_dp

    do i = 1, size(mg%lvls(lvl)%my_ids)
       id = mg%lvls(lvl)%my_ids(i)
       call residual_box(mg, id, nc)
       res = maxval(abs(mg%boxes(id)%cc(1:nc, mg_ires)))
       max_residual_lvl = max(max_residual_lvl, res)
    end do
  end function max_residual_lvl