Loading...
Searching...
No Matches
SolverPerformance< Type > Class Template Reference

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

#include <SolverPerformance.H>

Inheritance diagram for SolverPerformance< Type >:

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.
wordsolverName () noexcept
 Return solver name.
const wordfieldName () const noexcept
 Return field name.
const Type & initialResidual () const noexcept
 Return initial residual.
Type & initialResidual () noexcept
 Return initial residual.
const Type & finalResidual () const noexcept
 Return final residual.
Type & finalResidual () noexcept
 Return final residual.
const labelType & nIterations () const noexcept
 Return number of iterations.
labelType & nIterations () noexcept
 Return number of iterations.
bool converged () const noexcept
 Has the solver converged?
bool singular () const
 Is the matrix singular?
bool checkConvergence (const Type &tolerance, const Type &relTolerance, const int logLevel=0)
 Check, store and return convergence.
bool checkSingularity (const Type &residual)
 Singularity test.
void print (Ostream &os) const
 Print summary of solver performance to the given stream.
void replace (const label cmpt, const SolverPerformance< typename pTraits< Type >::cmptType > &sp)
 Replace component based on the minimal SolverPerformance.
SolverPerformance< typename pTraits< Type >::cmptTypemax ()
 Return the summary maximum of SolverPerformance<Type>.
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.
static const scalar small_
 Small Type for the use in solvers.
static const scalar vsmall_
 Very small Type for the use in solvers.

Friends

SolverPerformance< Type > Foam::max (const SolverPerformance< Type > &, const SolverPerformance< Type > &)
 Return the element-wise maximum of two SolverPerformance<Type>s.
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 77 of file SolverPerformance.H.

Constructor & Destructor Documentation

◆ SolverPerformance() [1/2]

template<class Type>
SolverPerformance ( )
inline

Definition at line 118 of file SolverPerformance.H.

Referenced by max(), and operator!=().

Here is the caller graph for this function:

◆ SolverPerformance() [2/2]

template<class Type>
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 128 of file SolverPerformance.H.

Member Function Documentation

◆ ClassName()

template<class Type>
ClassName ( "SolverPerformance< Type >" )

◆ solverName() [1/2]

template<class Type>
const word & solverName ( ) const
inlinenoexcept

Return solver name.

Definition at line 154 of file SolverPerformance.H.

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

Here is the caller graph for this function:

◆ solverName() [2/2]

template<class Type>
word & solverName ( )
inlinenoexcept

Return solver name.

Definition at line 162 of file SolverPerformance.H.

◆ fieldName()

template<class Type>
const word & fieldName ( ) const
inlinenoexcept

Return field name.

Definition at line 171 of file SolverPerformance.H.

Referenced by operator!=(), and meshState::setSolverPerformance().

Here is the caller graph for this function:

◆ initialResidual() [1/2]

◆ initialResidual() [2/2]

template<class Type>
Type & initialResidual ( )
inlinenoexcept

Return initial residual.

Definition at line 188 of file SolverPerformance.H.

◆ finalResidual() [1/2]

◆ finalResidual() [2/2]

template<class Type>
Type & finalResidual ( )
inlinenoexcept

Return final residual.

Definition at line 205 of file SolverPerformance.H.

◆ nIterations() [1/2]

◆ nIterations() [2/2]

template<class Type>
labelType & nIterations ( )
inlinenoexcept

Return number of iterations.

Definition at line 222 of file SolverPerformance.H.

◆ converged()

template<class Type>
bool converged ( ) const
inlinenoexcept

Has the solver converged?

Definition at line 231 of file SolverPerformance.H.

Referenced by operator!=(), and solverInfo::updateSolverInfo().

Here is the caller graph for this function:

◆ singular()

template<class Type>
bool singular ( ) const

Is the matrix singular?

Definition at line 44 of file SolverPerformance.C.

Referenced by checkSingularity(), max(), and operator!=().

Here is the caller graph for this function:

◆ checkConvergence()

template<class Type>
bool checkConvergence ( const Type & tolerance,
const Type & relTolerance,
const int logLevel = 0 )

◆ checkSingularity()

template<class Type>
bool checkSingularity ( const Type & residual)

Singularity test.

Definition at line 28 of file SolverPerformance.C.

References Foam::component(), singular(), and vsmall_.

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

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

◆ print()

template<class Type>
void print ( Ostream & os) const

Print summary of solver performance to the given stream.

Definition at line 85 of file SolverPerformance.C.

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

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

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

◆ replace()

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

Replace component based on the minimal SolverPerformance.

Definition at line 118 of file SolverPerformance.C.

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

Here is the caller graph for this function:

◆ max() [1/3]

template<class Type>
Foam::SolverPerformance< typename Foam::pTraits< Type >::cmptType > max ( )

Return the summary maximum of SolverPerformance<Type>.

Effectively it will mostly return solverPerformanceScalar

Definition at line 133 of file SolverPerformance.C.

References Foam::cmptMax(), singular(), and SolverPerformance().

Here is the call graph for this function:

◆ operator!=()

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

Definition at line 149 of file SolverPerformance.C.

References converged(), fieldName(), finalResidual(), initialResidual(), nIterations(), singular(), solverName(), and SolverPerformance().

Here is the call graph for this function:

◆ max() [2/3]

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

Definition at line 36 of file solverPerformance.C.

◆ max() [3/3]

SolverPerformance< scalar > max ( )

◆ Foam::max

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

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

◆ operator>>

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

◆ operator<<

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

Member Data Documentation

◆ great_

template<class Type>
const scalar great_
static

Large Type for the use in solvers.

Definition at line 103 of file SolverPerformance.H.

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

◆ small_

template<class Type>
const scalar small_
static

Small Type for the use in solvers.

Definition at line 108 of file SolverPerformance.H.

Referenced by checkConvergence(), and LduMatrix< scalar, scalar, scalar >::solver::readControls().

◆ vsmall_

template<class Type>
const scalar vsmall_
static

Very small Type for the use in solvers.

Definition at line 113 of file SolverPerformance.H.

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


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