SolverPerformance< Type > Class Template Reference

SolverPerformance is the class returned by the LduMatrix solver containing performance statistics. More...

Public Member Functions

 ClassName ("SolverPerformance")
 
 SolverPerformance ()
 
 SolverPerformance (const word &solverName, const word &fieldName, const Type &iRes=pTraits< Type >::zero, const Type &fRes=pTraits< Type >::zero, const labelType &nIter=pTraits< labelType >::zero, const bool converged=false, const bool singular=false)
 
const wordsolverName () const noexcept
 Return solver name. More...
 
wordsolverName () noexcept
 Return solver name. More...
 
const wordfieldName () const noexcept
 Return field name. More...
 
const Type & initialResidual () const noexcept
 Return initial residual. More...
 
Type & initialResidual () noexcept
 Return initial residual. More...
 
const Type & finalResidual () const noexcept
 Return final residual. More...
 
Type & finalResidual () noexcept
 Return final residual. More...
 
const labelType & nIterations () const noexcept
 Return number of iterations. More...
 
labelType & nIterations () noexcept
 Return number of iterations. More...
 
bool converged () const noexcept
 Has the solver converged? More...
 
bool singular () const
 Is the matrix singular? More...
 
bool checkConvergence (const Type &tolerance, const Type &relTolerance, const int logLevel=0)
 Check, store and return convergence. More...
 
bool checkSingularity (const Type &residual)
 Singularity test. More...
 
void print (Ostream &os) const
 Print summary of solver performance to the given stream. More...
 
void replace (const label cmpt, const SolverPerformance< typename pTraits< Type >::cmptType > &sp)
 Replace component based on the minimal SolverPerformance. More...
 
SolverPerformance< typename pTraits< Type >::cmptType > max ()
 Return the summary maximum of SolverPerformance<Type> More...
 
bool operator!= (const SolverPerformance< Type > &) const
 
Foam::SolverPerformance< Foam::scalar > max ()
 
SolverPerformance< scalar > max ()
 

Static Public Attributes

static const scalar great_
 Large Type for the use in solvers. More...
 
static const scalar small_
 Small Type for the use in solvers. More...
 
static const scalar vsmall_
 Very small Type for the use in solvers. More...
 

Friends

SolverPerformance< Type > Foam::max (const SolverPerformance< Type > &, const SolverPerformance< Type > &)
 Return the element-wise maximum of two SolverPerformance<Type>s. More...
 
Istreamoperator>> (Istream &, SolverPerformance< Type > &)
 
Ostreamoperator (Ostream &, const SolverPerformance< Type > &)
 

Detailed Description

template<class Type>
class Foam::SolverPerformance< Type >

SolverPerformance is the class returned by the LduMatrix solver containing performance statistics.

Source files

Definition at line 81 of file SolverPerformance.H.

Constructor & Destructor Documentation

◆ SolverPerformance() [1/2]

SolverPerformance ( )
inline

Definition at line 116 of file SolverPerformance.H.

◆ SolverPerformance() [2/2]

SolverPerformance ( const word solverName,
const word fieldName,
const Type &  iRes = pTraits<Type>::zero,
const Type &  fRes = pTraits<Type>::zero,
const labelType &  nIter = pTraits<labelType>::zero,
const bool  converged = false,
const bool  singular = false 
)
inline

Definition at line 126 of file SolverPerformance.H.

Member Function Documentation

◆ ClassName()

ClassName ( "SolverPerformance< Type >"  )

◆ solverName() [1/2]

const word & solverName ( ) const
inlinenoexcept

Return solver name.

Definition at line 150 of file SolverPerformance.H.

Referenced by faMatrix< Type >::solve(), fvMatrix< Type >::solveSegregated(), and solverInfo::updateSolverInfo().

Here is the caller graph for this function:

◆ solverName() [2/2]

word & solverName ( )
inlinenoexcept

Return solver name.

Definition at line 156 of file SolverPerformance.H.

◆ fieldName()

const word & fieldName ( ) const
inlinenoexcept

Return field name.

Definition at line 163 of file SolverPerformance.H.

Referenced by data::setSolverPerformance().

Here is the caller graph for this function:

◆ initialResidual() [1/2]

const Type & initialResidual ( ) const
inlinenoexcept

Return initial residual.

Definition at line 170 of file SolverPerformance.H.

Referenced by radiativeIntensityRay::correct(), PBiCGStab::scalarSolve(), PCG::scalarSolve(), PPCG::scalarSolveCG(), PBiCCCG< Type, DType, LUType >::solve(), PBiCICG< Type, DType, LUType >::solve(), PCICG< Type, DType, LUType >::solve(), SmoothSolver< Type, DType, LUType >::solve(), GAMGSolver::solve(), PBiCG::solve(), smoothSolver::solve(), and solverInfo::updateSolverInfo().

Here is the caller graph for this function:

◆ initialResidual() [2/2]

Type & initialResidual ( )
inlinenoexcept

Return initial residual.

Definition at line 176 of file SolverPerformance.H.

◆ finalResidual() [1/2]

const Type & finalResidual ( ) const
inlinenoexcept

Return final residual.

Definition at line 183 of file SolverPerformance.H.

Referenced by PBiCGStab::scalarSolve(), PCG::scalarSolve(), PPCG::scalarSolveCG(), PBiCCCG< Type, DType, LUType >::solve(), PBiCICG< Type, DType, LUType >::solve(), PCICG< Type, DType, LUType >::solve(), SmoothSolver< Type, DType, LUType >::solve(), GAMGSolver::solve(), PBiCG::solve(), smoothSolver::solve(), and solverInfo::updateSolverInfo().

Here is the caller graph for this function:

◆ finalResidual() [2/2]

Type & finalResidual ( )
inlinenoexcept

Return final residual.

Definition at line 189 of file SolverPerformance.H.

◆ nIterations() [1/2]

const labelType & nIterations ( ) const
inlinenoexcept

Return number of iterations.

Definition at line 196 of file SolverPerformance.H.

Referenced by PBiCGStab::scalarSolve(), PCG::scalarSolve(), PPCG::scalarSolveCG(), PBiCCCG< Type, DType, LUType >::solve(), PBiCICG< Type, DType, LUType >::solve(), PCICG< Type, DType, LUType >::solve(), SmoothSolver< Type, DType, LUType >::solve(), GAMGSolver::solve(), PBiCG::solve(), smoothSolver::solve(), and solverInfo::updateSolverInfo().

Here is the caller graph for this function:

◆ nIterations() [2/2]

labelType & nIterations ( )
inlinenoexcept

Return number of iterations.

Definition at line 202 of file SolverPerformance.H.

◆ converged()

bool converged ( ) const
inlinenoexcept

Has the solver converged?

Definition at line 209 of file SolverPerformance.H.

Referenced by solverInfo::updateSolverInfo().

Here is the caller graph for this function:

◆ singular()

bool singular

Is the matrix singular?

Definition at line 51 of file SolverPerformance.C.

◆ checkConvergence()

bool checkConvergence ( const Type &  tolerance,
const Type &  relTolerance,
const int  logLevel = 0 
)

Check, store and return convergence.

Definition at line 63 of file SolverPerformance.C.

References Foam::cmptMultiply(), Foam::endl(), and Foam::Info.

Referenced by PBiCGStab::scalarSolve(), PCG::scalarSolve(), PPCG::scalarSolveCG(), PBiCCCG< Type, DType, LUType >::solve(), PBiCICG< Type, DType, LUType >::solve(), PCICG< Type, DType, LUType >::solve(), SmoothSolver< Type, DType, LUType >::solve(), GAMGSolver::solve(), PBiCG::solve(), and smoothSolver::solve().

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

◆ checkSingularity()

bool checkSingularity ( const Type &  residual)

Singularity test.

Definition at line 35 of file SolverPerformance.C.

References Foam::component().

Referenced by PBiCGStab::scalarSolve(), PCG::scalarSolve(), PBiCCCG< Type, DType, LUType >::solve(), PBiCICG< Type, DType, LUType >::solve(), PCICG< Type, DType, LUType >::solve(), and PBiCG::solve().

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

◆ print()

void print ( Ostream os) const

Print summary of solver performance to the given stream.

Definition at line 92 of file SolverPerformance.C.

References Foam::component(), Foam::endl(), and os().

Referenced by viewFactor::calculate(), faMatrix< Type >::solve(), fvMatrix< Type >::fvSolver::solve(), GAMGSolver::solve(), fvMatrix< Type >::solveCoupled(), and fvMatrix< Type >::solveSegregated().

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

◆ replace()

void replace ( const label  cmpt,
const SolverPerformance< typename pTraits< Type >::cmptType > &  sp 
)

Replace component based on the minimal SolverPerformance.

Definition at line 125 of file SolverPerformance.C.

◆ max() [1/3]

Foam::SolverPerformance< typename Foam::pTraits< Type >::cmptType > max

Return the summary maximum of SolverPerformance<Type>

Effectively it will mostly return solverPerformanceScalar

Definition at line 140 of file SolverPerformance.C.

References Foam::cmptMax().

Here is the call graph for this function:

◆ operator!=()

bool operator!= ( const SolverPerformance< Type > &  sp) const

Definition at line 156 of file SolverPerformance.C.

◆ max() [2/3]

Foam::SolverPerformance< Foam::scalar > max ( )

Definition at line 43 of file solverPerformance.C.

◆ max() [3/3]

SolverPerformance< scalar > max ( )

Friends And Related Function Documentation

◆ Foam::max

SolverPerformance< Type > Foam::max ( const SolverPerformance< Type > &  ,
const SolverPerformance< Type > &   
)
friend

Return the element-wise maximum of two SolverPerformance<Type>s.

◆ operator>>

Istream & operator>> ( Istream ,
SolverPerformance< Type > &   
)
friend

◆ operator

Ostream & operator ( Ostream ,
const SolverPerformance< Type > &   
)
friend

Member Data Documentation

◆ great_

const scalar great_
static

Large Type for the use in solvers.

Definition at line 105 of file SolverPerformance.H.

Referenced by PCG::scalarSolve(), PBiCICG< Type, DType, LUType >::solve(), and PCICG< Type, DType, LUType >::solve().

◆ small_

const scalar small_
static

Small Type for the use in solvers.

Definition at line 108 of file SolverPerformance.H.

Referenced by lduMatrix::solver::normFactor().

◆ vsmall_

const scalar vsmall_
static

Very small Type for the use in solvers.

Definition at line 111 of file SolverPerformance.H.

Referenced by PBiCICG< Type, DType, LUType >::solve(), and PCICG< Type, DType, LUType >::solve().


The documentation for this class was generated from the following files: