ADflow  v1.0
ADflow is a finite volume RANS solver tailored for gradient-based aerodynamic design optimization.
Functions/Subroutines | Variables
nksolver Module Reference

Functions/Subroutines

subroutine setupnksolver
 
subroutine linearresidualmonitor (myKSP, n, rnorm, dummy, ierr)
 
subroutine nkmatmult (A, vecX, vecY, ierr)
 
subroutine getfreestreamresidual (rhoRes, totalRRes)
 
subroutine getcurrentresidual (rhoRes, totalRRes)
 
subroutine formjacobiannk
 
subroutine formfunction_mf (ctx, wVec, rVec, ierr)
 
subroutine destroynksolver
 
subroutine nkstep (firstCall)
 
subroutine lscubic (x, f, g, y, w, fnorm, ynorm, gnorm, nfevals, flag, lambda)
 
subroutine lsnone (x, f, g, y, w, nfevals, flag, step)
 
subroutine lsnm (x, f, g, y, w, fnorm, ynorm, gnorm, nfevals, flag, step)
 
subroutine computeresidualnk (useUpdateIntermed)
 
subroutine applypc (in_vec, out_vec, ndof)
 
subroutine applyadjointpc (in_vec, out_vec, ndof)
 
subroutine setwvec (wVec)
 
subroutine setrvec (rVec, flowRes, turbRes, totalRes)
 
subroutine setw (wVec)
 
subroutine getstates (states, ndimw)
 
subroutine getres (res, ndimw)
 
subroutine setstates (states, ndimw)
 
subroutine getinfosize (iSize)
 
subroutine setinfo (info, iSize)
 
subroutine getinfo (info, iSize)
 
subroutine getewtol (norm, old_norm, rtol_last, rtol)
 

Variables

logical usenksolver
 
integer(kind=inttype) nk_jacobianlag
 
integer(kind=inttype) nk_subspace
 
integer(kind=inttype) nk_asmoverlap
 
integer(kind=inttype) nk_asmoverlapcoarse
 
integer(kind=inttype) nk_ilufill
 
integer(kind=inttype) nk_ilufillcoarse
 
integer(kind=inttype) nk_innerpreconits
 
integer(kind=inttype) nk_innerpreconitscoarse
 
integer(kind=inttype) nk_outerpreconits
 
integer(kind=inttype) nk_amglevels
 
integer(kind=inttype) nk_amgnsmooth
 
integer(kind=inttype) nk_ls
 
character(len=maxstringlen) nk_precondtype
 
logical nk_useew
 
logical nk_adpc
 
logical nk_viscpc
 
real(kind=realtype) nk_cfl0
 
real(kind=realtype) nk_switchtol
 
real(kind=realtype) nk_rtolinit
 
real(kind=realtype) nk_divtol = 10
 
real(kind=realtype) nk_fixedstep
 
logical nk_solversetup = .False.
 
integer(kind=inttype) nk_iter
 
integer(kind=inttype) ew_version
 
real(kind=realtype) ew_rtol_0
 
real(kind=realtype) ew_rtol_max
 
real(kind=realtype) ew_gamma
 
real(kind=realtype) ew_alpha
 
real(kind=realtype) ew_alpha2
 
real(kind=realtype) ew_threshold
 
real(kind=alwaysrealtype) rtollast
 
real(kind=alwaysrealtype) oldnorm
 
logical freestreamresset = .False.
 
real(kind=realtype) nk_cfl
 
real(kind=realtype), dimension(:), allocatable nklsfuncevals
 
integer(kind=inttype) mmax = 5
 
integer(kind=inttype) iter_k
 
integer(kind=inttype) iter_m
 
integer(kind=inttype) applypcsubspacesize
 

Function/Subroutine Documentation

◆ applyadjointpc()

subroutine nksolver::applyadjointpc ( real(kind=realtype), dimension(ndof), intent(in)  in_vec,
real(kind=realtype), dimension(ndof), intent(inout)  out_vec,
integer(kind=inttype)  ndof 
)

Definition at line 1169 of file NKSolvers.F90.

References inputadjoint::applyadjointpcsubspacesize, and utils::echk().

Here is the call graph for this function:

◆ applypc()

subroutine nksolver::applypc ( real(kind=realtype), dimension(ndof), intent(in)  in_vec,
real(kind=realtype), dimension(ndof), intent(inout)  out_vec,
integer(kind=inttype)  ndof 
)

Definition at line 1105 of file NKSolvers.F90.

References applypcsubspacesize, utils::echk(), formfunction_mf(), formjacobiannk(), nk_iter, nk_jacobianlag, nk_solversetup, setupnksolver(), and setwvec().

Here is the call graph for this function:

◆ computeresidualnk()

subroutine nksolver::computeresidualnk ( logical, intent(in), optional  useUpdateIntermed)

Definition at line 1084 of file NKSolvers.F90.

References blockette::blocketteres().

Referenced by formfunction_mf(), getfreestreamresidual(), getres(), lscubic(), lsnm(), lsnone(), nkstep(), and solvers::solvestate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ destroynksolver()

subroutine nksolver::destroynksolver

Definition at line 463 of file NKSolvers.F90.

References amg::destroyamg(), utils::echk(), and nk_solversetup.

Referenced by anksolver::setupanksolver().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ formfunction_mf()

subroutine nksolver::formfunction_mf (   ctx,
  wVec,
  rVec,
integer(kind=inttype)  ierr 
)

Definition at line 437 of file NKSolvers.F90.

References computeresidualnk(), setrvec(), and setw().

Referenced by applypc(), nkstep(), and setupnksolver().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ formjacobiannk()

subroutine nksolver::formjacobiannk

◆ getcurrentresidual()

subroutine nksolver::getcurrentresidual ( real(kind=realtype), intent(out)  rhoRes,
real(kind=realtype), intent(out)  totalRRes 
)

◆ getewtol()

subroutine nksolver::getewtol ( real(kind=alwaysrealtype), intent(in)  norm,
real(kind=alwaysrealtype), intent(in)  old_norm,
real(kind=alwaysrealtype), intent(in)  rtol_last,
real(kind=alwaysrealtype), intent(out)  rtol 
)

Definition at line 1606 of file NKSolvers.F90.

References constants::five.

Referenced by anksolver::ankstep(), anksolver::ankturbsolveksp(), and nkstep().

Here is the caller graph for this function:

◆ getfreestreamresidual()

subroutine nksolver::getfreestreamresidual ( real(kind=realtype), intent(out)  rhoRes,
real(kind=realtype), intent(out)  totalRRes 
)

◆ getinfo()

subroutine nksolver::getinfo ( real(kind=realtype), dimension(isize), intent(out)  info,
integer(kind=inttype), intent(in)  iSize 
)

◆ getinfosize()

subroutine nksolver::getinfosize ( integer(kind=inttype), intent(out)  iSize)

Definition at line 1487 of file NKSolvers.F90.

References flowvarrefstate::eddymodel, blockpointers::ib, blockpointers::jb, blockpointers::kb, inputtimespectral::ntimeintervalsspectral, flowvarrefstate::nw, utils::setpointers(), and flowvarrefstate::viscous.

Referenced by getfreestreamresidual().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getres()

subroutine nksolver::getres ( real(kind=realtype), dimension(ndimw), intent(inout)  res,
integer(kind=inttype), intent(in)  ndimw 
)

◆ getstates()

subroutine nksolver::getstates ( real(kind=realtype), dimension(ndimw), intent(out)  states,
integer(kind=inttype), intent(in)  ndimw 
)

◆ linearresidualmonitor()

subroutine nksolver::linearresidualmonitor (   myKSP,
integer(kind=inttype)  n,
real(kind=alwaysrealtype)  rnorm,
integer(kind=inttype)  dummy,
integer(kind=inttype)  ierr 
)

Definition at line 221 of file NKSolvers.F90.

References communication::myid.

Referenced by anksolver::setupanksolver(), and setupnksolver().

Here is the caller graph for this function:

◆ lscubic()

subroutine nksolver::lscubic (   x,
  f,
  g,
  y,
  w,
real(kind=alwaysrealtype)  fnorm,
real(kind=alwaysrealtype)  ynorm,
real(kind=alwaysrealtype)  gnorm,
integer(kind=inttype)  nfevals,
logical  flag,
real(kind=alwaysrealtype)  lambda 
)

Definition at line 681 of file NKSolvers.F90.

References computeresidualnk(), utils::echk(), communication::myid, nk_switchtol, setrvec(), initializeflow::setuniformflow(), setw(), constants::three, iteration::totalr0, and constants::zero.

Referenced by nkstep().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lsnm()

subroutine nksolver::lsnm (   x,
  f,
  g,
  y,
  w,
real(kind=alwaysrealtype)  fnorm,
real(kind=alwaysrealtype)  ynorm,
real(kind=alwaysrealtype)  gnorm,
integer(kind=inttype)  nfevals,
logical  flag,
real(kind=alwaysrealtype)  step 
)

Definition at line 987 of file NKSolvers.F90.

References computeresidualnk(), utils::echk(), iter_k, iter_m, nklsfuncevals, setrvec(), and setw().

Referenced by nkstep().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lsnone()

subroutine nksolver::lsnone (   x,
  f,
  g,
  y,
  w,
integer(kind=inttype)  nfevals,
logical  flag,
real(kind=alwaysrealtype)  step 
)

Definition at line 950 of file NKSolvers.F90.

References computeresidualnk(), utils::echk(), nk_fixedstep, setrvec(), and setw().

Referenced by nkstep().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nkmatmult()

subroutine nksolver::nkmatmult (   A,
  vecX,
  vecY,
integer(kind=inttype)  ierr 
)

Definition at line 244 of file NKSolvers.F90.

References utils::echk(), nk_cfl, and constants::one.

Referenced by setupnksolver().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nkstep()

subroutine nksolver::nkstep ( logical, intent(in)  firstCall)

◆ setinfo()

subroutine nksolver::setinfo ( real(kind=realtype), dimension(isize), intent(in)  info,
integer(kind=inttype), intent(in)  iSize 
)

◆ setrvec()

subroutine nksolver::setrvec (   rVec,
real(kind=alwaysrealtype), intent(out), optional  flowRes,
real(kind=alwaysrealtype), intent(out), optional  turbRes,
real(kind=alwaysrealtype), intent(out), optional  totalRes 
)

◆ setstates()

subroutine nksolver::setstates ( real(kind=realtype), dimension(ndimw), intent(in)  states,
integer(kind=inttype), intent(in)  ndimw 
)

◆ setupnksolver()

subroutine nksolver::setupnksolver

◆ setw()

subroutine nksolver::setw (   wVec)

◆ setwvec()

subroutine nksolver::setwvec (   wVec)

Definition at line 1222 of file NKSolvers.F90.

References utils::echk(), blockpointers::il, blockpointers::jl, blockpointers::kl, inputtimespectral::ntimeintervalsspectral, flowvarrefstate::nw, utils::setpointers(), and blockpointers::w.

Referenced by applypc(), and nkstep().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ applypcsubspacesize

integer(kind=inttype) nksolver::applypcsubspacesize

Definition at line 80 of file NKSolvers.F90.

Referenced by applypc().

◆ ew_alpha

real(kind=realtype) nksolver::ew_alpha

Definition at line 64 of file NKSolvers.F90.

◆ ew_alpha2

real(kind=realtype) nksolver::ew_alpha2

Definition at line 65 of file NKSolvers.F90.

◆ ew_gamma

real(kind=realtype) nksolver::ew_gamma

Definition at line 63 of file NKSolvers.F90.

◆ ew_rtol_0

real(kind=realtype) nksolver::ew_rtol_0

Definition at line 61 of file NKSolvers.F90.

◆ ew_rtol_max

real(kind=realtype) nksolver::ew_rtol_max

Definition at line 62 of file NKSolvers.F90.

◆ ew_threshold

real(kind=realtype) nksolver::ew_threshold

Definition at line 66 of file NKSolvers.F90.

◆ ew_version

integer(kind=inttype) nksolver::ew_version

Definition at line 60 of file NKSolvers.F90.

◆ freestreamresset

logical nksolver::freestreamresset = .False.

Definition at line 70 of file NKSolvers.F90.

Referenced by solvers::solvestate().

◆ iter_k

integer(kind=inttype) nksolver::iter_k

Definition at line 76 of file NKSolvers.F90.

Referenced by lsnm(), and nkstep().

◆ iter_m

integer(kind=inttype) nksolver::iter_m

Definition at line 77 of file NKSolvers.F90.

Referenced by lsnm(), and nkstep().

◆ mmax

integer(kind=inttype) nksolver::mmax = 5

Definition at line 75 of file NKSolvers.F90.

Referenced by nkstep().

◆ nk_adpc

logical nksolver::nk_adpc

Definition at line 47 of file NKSolvers.F90.

Referenced by formjacobiannk().

◆ nk_amglevels

integer(kind=inttype) nksolver::nk_amglevels

Definition at line 42 of file NKSolvers.F90.

Referenced by setupnksolver().

◆ nk_amgnsmooth

integer(kind=inttype) nksolver::nk_amgnsmooth

Definition at line 43 of file NKSolvers.F90.

Referenced by setupnksolver().

◆ nk_asmoverlap

integer(kind=inttype) nksolver::nk_asmoverlap

Definition at line 35 of file NKSolvers.F90.

Referenced by formjacobiannk().

◆ nk_asmoverlapcoarse

integer(kind=inttype) nksolver::nk_asmoverlapcoarse

Definition at line 36 of file NKSolvers.F90.

Referenced by formjacobiannk().

◆ nk_cfl

real(kind=realtype) nksolver::nk_cfl

Definition at line 71 of file NKSolvers.F90.

Referenced by nkmatmult(), nkstep(), and solvers::solvestate().

◆ nk_cfl0

real(kind=realtype) nksolver::nk_cfl0

Definition at line 49 of file NKSolvers.F90.

Referenced by nkstep().

◆ nk_divtol

real(kind=realtype) nksolver::nk_divtol = 10

Definition at line 52 of file NKSolvers.F90.

◆ nk_fixedstep

real(kind=realtype) nksolver::nk_fixedstep

Definition at line 53 of file NKSolvers.F90.

Referenced by lsnone().

◆ nk_ilufill

integer(kind=inttype) nksolver::nk_ilufill

Definition at line 37 of file NKSolvers.F90.

Referenced by formjacobiannk().

◆ nk_ilufillcoarse

integer(kind=inttype) nksolver::nk_ilufillcoarse

Definition at line 38 of file NKSolvers.F90.

Referenced by formjacobiannk().

◆ nk_innerpreconits

integer(kind=inttype) nksolver::nk_innerpreconits

Definition at line 39 of file NKSolvers.F90.

Referenced by formjacobiannk().

◆ nk_innerpreconitscoarse

integer(kind=inttype) nksolver::nk_innerpreconitscoarse

Definition at line 40 of file NKSolvers.F90.

Referenced by formjacobiannk().

◆ nk_iter

integer(kind=inttype) nksolver::nk_iter

Definition at line 57 of file NKSolvers.F90.

Referenced by applypc(), nkstep(), and setupnksolver().

◆ nk_jacobianlag

integer(kind=inttype) nksolver::nk_jacobianlag

Definition at line 33 of file NKSolvers.F90.

Referenced by applypc(), and nkstep().

◆ nk_ls

integer(kind=inttype) nksolver::nk_ls

Definition at line 44 of file NKSolvers.F90.

Referenced by nkstep(), and solvers::solvestate().

◆ nk_outerpreconits

integer(kind=inttype) nksolver::nk_outerpreconits

Definition at line 41 of file NKSolvers.F90.

Referenced by formjacobiannk().

◆ nk_precondtype

character(len=maxstringlen) nksolver::nk_precondtype

Definition at line 45 of file NKSolvers.F90.

Referenced by formjacobiannk(), and setupnksolver().

◆ nk_rtolinit

real(kind=realtype) nksolver::nk_rtolinit

Definition at line 51 of file NKSolvers.F90.

Referenced by nkstep().

◆ nk_solversetup

logical nksolver::nk_solversetup = .False.

Definition at line 56 of file NKSolvers.F90.

Referenced by applypc(), destroynksolver(), and setupnksolver().

◆ nk_subspace

integer(kind=inttype) nksolver::nk_subspace

Definition at line 34 of file NKSolvers.F90.

Referenced by formjacobiannk(), and nkstep().

◆ nk_switchtol

real(kind=realtype) nksolver::nk_switchtol

Definition at line 50 of file NKSolvers.F90.

Referenced by lscubic(), and solvers::solvestate().

◆ nk_useew

logical nksolver::nk_useew

Definition at line 46 of file NKSolvers.F90.

Referenced by nkstep().

◆ nk_viscpc

logical nksolver::nk_viscpc

Definition at line 48 of file NKSolvers.F90.

Referenced by formjacobiannk(), and setupnksolver().

◆ nklsfuncevals

real(kind=realtype), dimension(:), allocatable nksolver::nklsfuncevals

Definition at line 74 of file NKSolvers.F90.

Referenced by lsnm(), and solvers::solvestate().

◆ oldnorm

real(kind=alwaysrealtype) nksolver::oldnorm

Definition at line 67 of file NKSolvers.F90.

Referenced by nkstep().

◆ rtollast

real(kind=alwaysrealtype) nksolver::rtollast

Definition at line 67 of file NKSolvers.F90.

Referenced by nkstep().

◆ usenksolver

logical nksolver::usenksolver

Definition at line 32 of file NKSolvers.F90.

Referenced by solvers::solvestate().