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
 Return solver name. More...
 
wordsolverName ()
 Return solver name. More...
 
const wordfieldName () const
 Return field name. More...
 
const Type & initialResidual () const
 Return initial residual. More...
 
Type & initialResidual ()
 Return initial residual. More...
 
const Type & finalResidual () const
 Return final residual. More...
 
Type & finalResidual ()
 Return final residual. More...
 
const labelType & nIterations () const
 Return number of iterations. More...
 
labelType & nIterations ()
 Return number of iterations. More...
 
bool converged () const
 Has the solver converged? More...
 
bool singular () const
 Is the matrix singular? More...
 
bool checkConvergence (const Type &tolerance, const Type &relTolerance)
 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
 
template<>
Foam::SolverPerformance< Foam::scalar > max ()
 
template<>
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 49 of file SolverPerformance.H.

Constructor & Destructor Documentation

◆ SolverPerformance() [1/2]

SolverPerformance ( )
inline

Definition at line 113 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 124 of file SolverPerformance.H.

Member Function Documentation

◆ ClassName()

ClassName ( "SolverPerformance< Type >"  )

◆ solverName() [1/2]

const word& solverName ( ) const
inline

Return solver name.

Definition at line 147 of file SolverPerformance.H.

Referenced by SolverPerformance< Type >::operator!=(), and fvMatrix< Type >::solveSegregated().

Here is the caller graph for this function:

◆ solverName() [2/2]

word& solverName ( )
inline

Return solver name.

Definition at line 153 of file SolverPerformance.H.

◆ fieldName()

const word& fieldName ( ) const
inline

Return field name.

Definition at line 160 of file SolverPerformance.H.

Referenced by Residuals< Type >::append().

Here is the caller graph for this function:

◆ initialResidual() [1/2]

const Type& initialResidual ( ) const
inline

◆ initialResidual() [2/2]

Type& initialResidual ( )
inline

Return initial residual.

Definition at line 173 of file SolverPerformance.H.

◆ finalResidual() [1/2]

const Type& finalResidual ( ) const
inline

Return final residual.

Definition at line 180 of file SolverPerformance.H.

Referenced by SolverPerformance< Type >::operator!=(), PCG::solve(), PBiCG::solve(), SmoothSolver< Type, DType, LUType >::solve(), smoothSolver::solve(), PBiCGStab::solve(), and GAMGSolver::solve().

Here is the caller graph for this function:

◆ finalResidual() [2/2]

Type& finalResidual ( )
inline

Return final residual.

Definition at line 186 of file SolverPerformance.H.

◆ nIterations() [1/2]

const labelType& nIterations ( ) const
inline

Return number of iterations.

Definition at line 193 of file SolverPerformance.H.

Referenced by SolverPerformance< Type >::operator!=(), PCG::solve(), PBiCG::solve(), SmoothSolver< Type, DType, LUType >::solve(), smoothSolver::solve(), PBiCGStab::solve(), and GAMGSolver::solve().

Here is the caller graph for this function:

◆ nIterations() [2/2]

labelType& nIterations ( )
inline

Return number of iterations.

Definition at line 199 of file SolverPerformance.H.

◆ converged()

bool converged ( ) const
inline

◆ singular()

bool singular ( ) const

Is the matrix singular?

Definition at line 48 of file SolverPerformance.C.

References SolverPerformance< Type >::checkConvergence().

Referenced by SolverPerformance< Type >::converged(), and SolverPerformance< Type >::operator!=().

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

◆ checkConvergence()

bool checkConvergence ( const Type &  tolerance,
const Type &  relTolerance 
)

Check, store and return convergence.

Definition at line 61 of file SolverPerformance.C.

References Foam::cmptMultiply(), Foam::endl(), Foam::Info, and SolverPerformance< Type >::print().

Referenced by SolverPerformance< Type >::converged(), SolverPerformance< Type >::singular(), PBiCG::solve(), PCG::solve(), SmoothSolver< Type, DType, LUType >::solve(), smoothSolver::solve(), PBiCGStab::solve(), and GAMGSolver::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 33 of file SolverPerformance.C.

References Foam::component().

Referenced by SolverPerformance< Type >::converged(), PCG::solve(), PBiCG::solve(), and PBiCGStab::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 97 of file SolverPerformance.C.

References Foam::component(), Foam::endl(), and SolverPerformance< Type >::replace().

Referenced by SolverPerformance< Type >::checkConvergence(), SolverPerformance< Type >::converged(), 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 131 of file SolverPerformance.C.

Referenced by SolverPerformance< Type >::converged(), and SolverPerformance< Type >::print().

Here is the caller graph for this function:

◆ 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 145 of file SolverPerformance.C.

References Foam::cmptMax().

Referenced by SolverPerformance< Type >::converged().

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

◆ operator!=()

◆ max() [2/3]

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

Definition at line 41 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 102 of file SolverPerformance.H.

Referenced by PCG::solve().

◆ small_

const scalar small_
static

Small Type for the use in solvers.

Definition at line 105 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 108 of file SolverPerformance.H.


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