Neko 1.99.1
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
fluid_aux.f90
Go to the documentation of this file.
1
3 use, intrinsic :: ieee_arithmetic, only: ieee_is_nan
4 use krylov, only : ksp_monitor_t
5 use logger, only : log_size
6 use utils, only : neko_error, neko_warning
7 use time_state, only : time_state_t
8 implicit none
9 private
10
11 public :: fluid_step_info
12
13contains
14
17 subroutine fluid_step_info(time, ksp_results, full_stress_formulation, &
18 strict_convergence)
19 type(ksp_monitor_t), dimension(:), intent(in) :: ksp_results
20 type(time_state_t), intent(in) :: time
21 logical, intent(in) :: full_stress_formulation
22 logical, intent(in), optional :: strict_convergence
23 character(len=LOG_SIZE) :: log_buf
24 integer :: i, n
25
26 n = size(ksp_results)
27 if (full_stress_formulation) n = 2
28
29 ! Do the printing
30 call ksp_results(1)%print_header()
31 do i = 1, n
32 call ksp_results(i)%print_result(time%tstep)
33 end do
34
35 ! Check for convergence
36 do i = 1, n
37 if (ieee_is_nan(ksp_results(i)%res_final)) then
38 call neko_error("Fluid solver diverged for " // &
39 trim(ksp_results(i)%name))
40 end if
41
42 if (present(strict_convergence)) then
43
44 if (.not. ksp_results(i)%converged) then
45 log_buf = 'Fluid solver did not converge for ' &
46 // trim(ksp_results(i)%name)
47
48 if (strict_convergence) then
49 call neko_error(log_buf)
50 else
51 call neko_warning(log_buf)
52 end if
53 end if
54 end if
55 end do
56
57 end subroutine fluid_step_info
58
59end module fluid_aux
Auxiliary routines for fluid solvers.
Definition fluid_aux.f90:2
subroutine, public fluid_step_info(time, ksp_results, full_stress_formulation, strict_convergence)
Prints for prs, velx, vely, velz the following: Number of iterations, start residual,...
Definition fluid_aux.f90:19
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
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.