Loading...
Searching...
No Matches
LduMatrix< Type, DType, LUType >::solver Class Referenceabstract

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

#include <LduMatrix.H>

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

Public Member Functions

virtual const wordtype () const =0
 Runtime type information.
 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)
 Construct for given field name, matrix and controls.
virtual ~solver ()=default
 Destructor.
const wordfieldName () const noexcept
const LduMatrix< Type, DType, LUType > & matrix () const noexcept
virtual void read (const dictionary &)
 Read and reset the solver parameters from the given dictionary.
virtual SolverPerformance< Type > solve (Field< Type > &psi) const =0
Type normFactor (const Field< Type > &psi, const Field< Type > &Apsi, Field< Type > &tmpField, const lduMatrix::normTypes normType) const
 Return the matrix norm using the specified norm method.
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.

Static Public Member Functions

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

Protected Member Functions

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

Protected Attributes

word fieldName_
const LduMatrix< Type, DType, LUType > & matrix_
dictionary controlDict_
 Dictionary of solution controls.
int log_
 Verbosity level for solver output statements.
label minIter_
 Minimum number of iterations in the solver.
label maxIter_
 Maximum number of iterations in the solver.
lduMatrix::normTypes normType_
 The matrix normalisation type.
Type tolerance_
 Final convergence tolerance.
Type relTol_
 Convergence tolerance relative to the initial.

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 136 of file LduMatrix.H.

Constructor & Destructor Documentation

◆ solver()

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

◆ ~solver()

template<class Type, class DType, class LUType>
virtual ~solver ( )
virtualdefault

Destructor.

Member Function Documentation

◆ readControls()

template<class Type, class DType, class LUType>
void readControls ( )
protectedvirtual

Read the control parameters from controlDict_.

Reimplemented in SmoothSolver< Type, DType, LUType >.

Definition at line 139 of file LduMatrixSolver.C.

References controlDict_, lduMatrix::DEFAULT_NORM, log_, maxIter_, minIter_, normType_, lduMatrix::normTypesNames_, relTol_, and tolerance_.

Referenced by read(), SmoothSolver< Type, DType, LUType >::readControls(), and solver().

Here is the caller graph for this function:

◆ readControl()

template<class Type, class DType, class LUType>
template<class T>
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 197 of file LduMatrix.H.

References dict, and Foam::T().

Here is the call graph for this function:

◆ type()

template<class Type, class DType, class LUType>
virtual const word & type ( ) const
pure virtual

Runtime type information.

◆ declareRunTimeSelectionTable() [1/2]

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

References fieldName(), LduMatrix< Type, DType, LUType >::LduMatrix(), matrix(), and solver().

Here is the call graph for this function:

◆ declareRunTimeSelectionTable() [2/2]

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

References fieldName(), LduMatrix< Type, DType, LUType >::LduMatrix(), matrix(), and solver().

Here is the call graph for this function:

◆ New()

template<class Type, class DType, class LUType>
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 29 of file LduMatrixSolver.C.

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

Referenced by fvMatrix< Type >::solveCoupled().

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

◆ fieldName()

◆ matrix()

◆ read()

template<class Type, class DType, class LUType>
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 152 of file LduMatrixSolver.C.

References controlDict_, and readControls().

Here is the call graph for this function:

◆ solve()

template<class Type, class DType, class LUType>
virtual SolverPerformance< Type > solve ( Field< Type > & psi) const
pure virtual

◆ normFactor() [1/2]

template<class Type, class DType, class LUType>
Type normFactor ( const Field< Type > & psi,
const Field< Type > & Apsi,
Field< Type > & tmpField,
const lduMatrix::normTypes normType ) const

Return the matrix norm using the specified norm method.

Definition at line 163 of file LduMatrixSolver.C.

References Foam::cmptMultiply(), lduMatrix::DEFAULT_NORM, Foam::gAverage(), lduMatrix::L1_SCALED_NORM, matrix_, lduMatrix::NO_NORM, psi, and Foam::stabilise().

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

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

◆ normFactor() [2/2]

template<class Type, class DType, class LUType>
Type normFactor ( const Field< Type > & psi,
const Field< Type > & Apsi,
Field< Type > & tmpField ) const
inline

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

Definition at line 318 of file LduMatrix.H.

References normFactor(), normType_, and psi.

Here is the call graph for this function:

Member Data Documentation

◆ fieldName_

◆ matrix_

◆ controlDict_

◆ log_

template<class Type, class DType, class LUType>
int log_
protected

◆ minIter_

template<class Type, class DType, class LUType>
label minIter_
protected

◆ maxIter_

template<class Type, class DType, class LUType>
label maxIter_
protected

◆ normType_

template<class Type, class DType, class LUType>
lduMatrix::normTypes normType_
protected

The matrix normalisation type.

Definition at line 168 of file LduMatrix.H.

Referenced by normFactor(), readControls(), and solver().

◆ tolerance_

template<class Type, class DType, class LUType>
Type tolerance_
protected

Final convergence tolerance.

Definition at line 173 of file LduMatrix.H.

Referenced by readControls(), and solver().

◆ relTol_

template<class Type, class DType, class LUType>
Type relTol_
protected

Convergence tolerance relative to the initial.

Definition at line 178 of file LduMatrix.H.

Referenced by readControls(), and solver().


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