Neko  0.8.99
A portable framework for high-order spectral element flow simulations
scalar_aux.f90
Go to the documentation of this file.
1 
2 module scalar_aux
3  use logger
4  use num_types
5  use krylov, only : ksp_monitor_t
6  use, intrinsic :: ieee_arithmetic, only: ieee_is_nan
7  implicit none
8 
9 contains
10 
13  subroutine scalar_step_info(step, t, dt, ksp_results)
14  type(ksp_monitor_t), intent(in) :: ksp_results(1)
15  integer, intent(in) :: step
16  real(kind=rp), intent(in) :: t, dt
17  character(len=LOG_SIZE) :: log_buf
18  integer :: i
19 
20 
21  call neko_log%message('Scalar')
22 
23  write(log_buf, '(A,A,A)') 'Iterations: ',&
24  'Start residual: ', 'Final residual:'
25  call neko_log%message(log_buf)
26  write(log_buf, '(I11,3x, E15.7,5x, E15.7)') ksp_results(1)%iter, &
27  ksp_results(1)%res_start, ksp_results(1)%res_final
28  call neko_log%message(log_buf)
29 
30  ! Check for divergence
31  do i = 1, 1
32  if (ieee_is_nan(ksp_results(i)%res_final)) then
33  call neko_log%error("Scalar solver diverged")
34  stop
35  end if
36  end do
37 
38  end subroutine scalar_step_info
39 
40 
41 end module scalar_aux
Implements the base abstract type for Krylov solvers plus helper types.
Definition: krylov.f90:34
Logging routines.
Definition: log.f90:34
type(log_t), public neko_log
Global log stream.
Definition: log.f90:61
integer, parameter, public rp
Global precision used in computations.
Definition: num_types.f90:12
Auxiliary routines for fluid solvers.
Definition: scalar_aux.f90:2
subroutine scalar_step_info(step, t, dt, ksp_results)
Prints for prs, velx, vely, velz the following: Number of iterations, start residual,...
Definition: scalar_aux.f90:14
Type for storing initial and final residuals in a Krylov solver.
Definition: krylov.f90:56