42 const word& fieldName,
69 symMatrixConstructorTable::iterator constructorIter =
70 symMatrixConstructorTablePtr_->find(
name);
72 if (constructorIter == symMatrixConstructorTablePtr_->end())
75 <<
"Unknown symmetric matrix solver " <<
name <<
nl <<
nl
76 <<
"Valid symmetric matrix solvers are :" <<
endl
77 << symMatrixConstructorTablePtr_->sortedToc()
96 asymMatrixConstructorTable::iterator constructorIter =
97 asymMatrixConstructorTablePtr_->find(
name);
99 if (constructorIter == asymMatrixConstructorTablePtr_->end())
102 <<
"Unknown asymmetric matrix solver " <<
name <<
nl <<
nl
103 <<
"Valid asymmetric matrix solvers are :" <<
endl
104 << asymMatrixConstructorTablePtr_->sortedToc()
124 <<
"cannot solve incomplete matrix, "
125 "no diagonal or off-diagonal coefficient"
137 const word& fieldName,
145 fieldName_(fieldName),
147 interfaceBouCoeffs_(interfaceBouCoeffs),
148 interfaceIntCoeffs_(interfaceIntCoeffs),
149 interfaces_(interfaces),
150 controlDict_(solverControls)
160 maxIter_ = controlDict_.lookupOrDefault<
label>(
"maxIter", defaultMaxIter_);
161 minIter_ = controlDict_.lookupOrDefault<
label>(
"minIter", 0);
162 tolerance_ = controlDict_.lookupOrDefault<scalar>(
"tolerance", 1
e-6);
163 relTol_ = controlDict_.lookupOrDefault<scalar>(
"relTol", 0);
169 controlDict_ = solverControls;
183 matrix_.sumA(tmpField, interfaceBouCoeffs_, interfaces_);
185 tmpField *=
gAverage(
psi, matrix_.lduMesh_.comm());
190 (
mag(Apsi - tmpField) +
mag(source - tmpField))(),
191 matrix_.lduMesh_.comm()
A list of keyword definitions, which are a keyword followed by any number of values (e....
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Abstract base-class for lduMatrix solvers.
solver(const word &fieldName, const lduMatrix &matrix, const FieldField< Field, scalar > &interfaceBouCoeffs, const FieldField< Field, scalar > &interfaceIntCoeffs, const lduInterfaceFieldPtrsList &interfaces, const dictionary &solverControls)
const lduInterfaceFieldPtrsList & interfaces() const
const FieldField< Field, scalar > & interfaceIntCoeffs() const
scalar normFactor(const scalarField &psi, const scalarField &source, const scalarField &Apsi, scalarField &tmpField) const
Return the matrix norm used to normalise the residual for the.
const word & fieldName() const
static autoPtr< solver > New(const word &fieldName, const lduMatrix &matrix, const FieldField< Field, scalar > &interfaceBouCoeffs, const FieldField< Field, scalar > &interfaceIntCoeffs, const lduInterfaceFieldPtrsList &interfaces, const dictionary &solverControls)
Return a new solver.
virtual void readControls()
Read the control parameters from the controlDict_.
virtual void read(const dictionary &)
Read and reset the solver parameters from the given stream.
const lduMatrix & matrix() const
const FieldField< Field, scalar > & interfaceBouCoeffs() const
lduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
A class for handling words, derived from string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
const volScalarField & psi
errorManipArg< error, int > exit(error &err, const int errNo=1)
Type gSum(const FieldField< Field, Type > &f)
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
dimensioned< scalar > mag(const dimensioned< Type > &)
Type gAverage(const FieldField< Field, Type > &f)