LduMatrix< Type, DType, LUType >::solver Class Referenceabstract

Abstract base-class for LduMatrix solvers. More...

Inheritance diagram for LduMatrix< Type, DType, LUType >::solver:
[legend]
Collaboration diagram for LduMatrix< Type, DType, LUType >::solver:
[legend]

Public Member Functions

virtual const wordtype () const =0
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, solver, symMatrix,(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix, const dictionary &solverDict),(fieldName, matrix, solverDict))
 
 declareRunTimeSelectionTable (autoPtr, solver, asymMatrix,(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix, const dictionary &solverDict),(fieldName, matrix, solverDict))
 
 solver (const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix, const dictionary &solverDict)
 
virtual ~solver ()=default
 
const wordfieldName () const noexcept
 
const LduMatrix< Type, DType, LUType > & matrix () const noexcept
 
virtual void read (const dictionary &solverDict)
 Read and reset the solver parameters from the given dictionary. More...
 
virtual SolverPerformance< Type > solve (Field< Type > &psi) const =0
 
Type normFactor (const Field< Type > &psi, const Field< Type > &Apsi, Field< Type > &tmpField) const
 Return the matrix norm used to normalise the residual for the. More...
 

Static Public Member Functions

static autoPtr< solverNew (const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix, const dictionary &solverDict)
 Return a new solver. More...
 

Protected Member Functions

virtual void readControls ()
 Read the control parameters from the controlDict_. More...
 
template<class T >
void readControl (const dictionary &dict, T &val, const word &key)
 Deprecated(2021-09) Read control parameter from dictionary. More...
 

Protected Attributes

word fieldName_
 
const LduMatrix< Type, DType, LUType > & matrix_
 
dictionary controlDict_
 Dictionary of controls. More...
 
int log_
 Level of verbosity in the solver output statements. More...
 
label minIter_
 Minimum number of iterations in the solver. More...
 
label maxIter_
 Maximum number of iterations in the solver. More...
 
Type tolerance_
 Final convergence tolerance. More...
 
Type relTol_
 Convergence tolerance relative to the initial. More...
 

Static Protected Attributes

static const label defaultMaxIter_ = 1000
 Default maximum number of iterations in the solver. More...
 

Detailed Description

template<class Type, class DType, class LUType>
class Foam::LduMatrix< Type, DType, LUType >::solver

Abstract base-class for LduMatrix solvers.

Definition at line 115 of file LduMatrix.H.

Constructor & Destructor Documentation

◆ solver()

solver ( const word fieldName,
const LduMatrix< Type, DType, LUType > &  matrix,
const dictionary solverDict 
)

Definition at line 121 of file LduMatrixSolver.C.

◆ ~solver()

virtual ~solver ( )
virtualdefault

Member Function Documentation

◆ readControls()

void readControls ( )
protectedvirtual

Read the control parameters from the controlDict_.

Reimplemented in SmoothSolver< Type, DType, LUType >.

Definition at line 145 of file LduMatrixSolver.C.

References LduMatrix< Type, DType, LUType >::solver::controlDict_, LduMatrix< Type, DType, LUType >::solver::log_, LduMatrix< Type, DType, LUType >::solver::maxIter_, LduMatrix< Type, DType, LUType >::solver::minIter_, dictionary::readIfPresent(), LduMatrix< Type, DType, LUType >::solver::relTol_, and LduMatrix< Type, DType, LUType >::solver::tolerance_.

Here is the call graph for this function:

◆ readControl()

void readControl ( const dictionary dict,
T val,
const word key 
)
inlineprotected

Deprecated(2021-09) Read control parameter from dictionary.

Deprecated:
(2021-09) - use dictionary methods directly

Definition at line 157 of file LduMatrix.H.

References dict, and Foam::glTF::key().

Here is the call graph for this function:

◆ type()

virtual const word& type ( ) const
pure virtual

Runtime type information.

◆ declareRunTimeSelectionTable() [1/2]

declareRunTimeSelectionTable ( autoPtr  ,
solver  ,
symMatrix  ,
(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix, const dictionary &solverDict)  ,
(fieldName, matrix, solverDict)   
)

◆ declareRunTimeSelectionTable() [2/2]

declareRunTimeSelectionTable ( autoPtr  ,
solver  ,
asymMatrix  ,
(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix, const dictionary &solverDict)  ,
(fieldName, matrix, solverDict)   
)

◆ New()

Foam::autoPtr< typename Foam::LduMatrix< Type, DType, LUType >::solver > New ( const word fieldName,
const LduMatrix< Type, DType, LUType > &  matrix,
const dictionary solverDict 
)
static

Return a new solver.

Definition at line 37 of file LduMatrixSolver.C.

References LduMatrix< Type, DType, LUType >::asymmetric(), LduMatrix< Type, DType, LUType >::diagonal(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, FatalIOErrorInLookup, dictionary::get(), and LduMatrix< Type, DType, LUType >::symmetric().

Here is the call graph for this function:

◆ fieldName()

const word& fieldName ( ) const
inlinenoexcept

Definition at line 234 of file LduMatrix.H.

References LduMatrix< Type, DType, LUType >::solver::fieldName_.

◆ matrix()

const LduMatrix<Type, DType, LUType>& matrix ( ) const
inlinenoexcept

Definition at line 239 of file LduMatrix.H.

References LduMatrix< Type, DType, LUType >::solver::matrix_.

Referenced by LduMatrix< Type, DType, LUType >::preconditioner::New(), and TDILUPreconditioner< Type, DType, LUType >::TDILUPreconditioner().

Here is the caller graph for this function:

◆ read()

void read ( const dictionary solverDict)
virtual

Read and reset the solver parameters from the given dictionary.

Reimplemented in DiagonalSolver< Type, DType, LUType >.

Definition at line 157 of file LduMatrixSolver.C.

◆ solve()

◆ normFactor()

Type normFactor ( const Field< Type > &  psi,
const Field< Type > &  Apsi,
Field< Type > &  tmpField 
) const

Return the matrix norm used to normalise the residual for the.

stopping criterion

Definition at line 168 of file LduMatrixSolver.C.

References Foam::cmptMag(), Foam::cmptMultiply(), Foam::gAverage(), Foam::gSum(), psi, and Foam::stabilise().

Here is the call graph for this function:

Member Data Documentation

◆ defaultMaxIter_

const label defaultMaxIter_ = 1000
staticprotected

Default maximum number of iterations in the solver.

Definition at line 122 of file LduMatrix.H.

◆ fieldName_

word fieldName_
protected

Definition at line 124 of file LduMatrix.H.

Referenced by LduMatrix< Type, DType, LUType >::solver::fieldName().

◆ matrix_

const LduMatrix<Type, DType, LUType>& matrix_
protected

Definition at line 125 of file LduMatrix.H.

Referenced by LduMatrix< Type, DType, LUType >::solver::matrix().

◆ controlDict_

dictionary controlDict_
protected

Dictionary of controls.

Definition at line 128 of file LduMatrix.H.

Referenced by LduMatrix< Type, DType, LUType >::solver::readControls().

◆ log_

int log_
protected

Level of verbosity in the solver output statements.

Definition at line 131 of file LduMatrix.H.

Referenced by LduMatrix< Type, DType, LUType >::solver::readControls().

◆ minIter_

label minIter_
protected

Minimum number of iterations in the solver.

Definition at line 134 of file LduMatrix.H.

Referenced by LduMatrix< Type, DType, LUType >::solver::readControls().

◆ maxIter_

label maxIter_
protected

Maximum number of iterations in the solver.

Definition at line 137 of file LduMatrix.H.

Referenced by LduMatrix< Type, DType, LUType >::solver::readControls().

◆ tolerance_

Type tolerance_
protected

Final convergence tolerance.

Definition at line 140 of file LduMatrix.H.

Referenced by LduMatrix< Type, DType, LUType >::solver::readControls().

◆ relTol_

Type relTol_
protected

Convergence tolerance relative to the initial.

Definition at line 143 of file LduMatrix.H.

Referenced by LduMatrix< Type, DType, LUType >::solver::readControls().


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