Neko 1.99.1
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
scalar_aux.f90
Go to the documentation of this file.
1
3 use logger, only: log_size
4 use krylov, only : ksp_monitor_t
5 use time_state, only : time_state_t
6 use utils, only : neko_error, neko_warning
7 use, intrinsic :: ieee_arithmetic, only: ieee_is_nan
8 implicit none
9
10contains
11
14 subroutine scalar_step_info(time, ksp_results, strict_convergence)
15 type(ksp_monitor_t), dimension(:), intent(in) :: ksp_results
16 type(time_state_t), intent(in) :: time
17 logical, intent(in), optional :: strict_convergence
18 character(len=LOG_SIZE) :: log_buf
19 integer :: i
20
21 ! Do the printing
22 call ksp_results(1)%print_header()
23 do i = 1, size(ksp_results)
24 call ksp_results(i)%print_result(time%tstep)
25 end do
26
27 ! Check for convergence
28 do i = 1, size(ksp_results)
29 if (ieee_is_nan(ksp_results(i)%res_final)) then
30 call neko_error("Scalar solver diverged for " // &
31 trim(ksp_results(i)%name))
32 end if
33
34 if (present(strict_convergence)) then
35 if (.not. ksp_results(i)%converged) then
36 log_buf = 'Scalar solver did not converge for ' &
37 // trim(ksp_results(i)%name)
38
39 if (strict_convergence) then
40 call neko_error(log_buf)
41 else
42 call neko_warning(log_buf)
43 end if
44 end if
45 end if
46 end do
47
48 end subroutine scalar_step_info
49end module scalar_aux
Implements the base abstract type for Krylov solvers plus helper types.
Definition krylov.f90:34
Logging routines.
Definition log.f90:34
integer, parameter, public log_size
Definition log.f90:46
Auxiliary routines for fluid solvers.
Definition scalar_aux.f90:2
subroutine scalar_step_info(time, ksp_results, strict_convergence)
Prints for prs, velx, vely, velz the following: Number of iterations, start residual,...
Module with things related to the simulation time.
Utilities.
Definition utils.f90:35
subroutine, public neko_warning(warning_msg)
Reports a warning to standard output.
Definition utils.f90:284
Type for storing initial and final residuals in a Krylov solver.
Definition krylov.f90:56
A struct that contains all info about the time, expand as needed.