42 const word& fieldName,
69 symMatrixConstructorTable::iterator constructorIter =
70 symMatrixConstructorTablePtr_->find(
name);
72 if (constructorIter == symMatrixConstructorTablePtr_->end())
76 "lduMatrix::solver::New", solverControls
77 ) <<
"Unknown symmetric matrix solver " <<
name <<
nl <<
nl 78 <<
"Valid symmetric matrix solvers are :" <<
endl 79 << symMatrixConstructorTablePtr_->sortedToc()
98 asymMatrixConstructorTable::iterator constructorIter =
99 asymMatrixConstructorTablePtr_->find(
name);
101 if (constructorIter == asymMatrixConstructorTablePtr_->end())
105 "lduMatrix::solver::New", solverControls
106 ) <<
"Unknown asymmetric matrix solver " <<
name <<
nl <<
nl 107 <<
"Valid asymmetric matrix solvers are :" <<
endl 108 << asymMatrixConstructorTablePtr_->sortedToc()
129 "lduMatrix::solver::New", solverControls
130 ) <<
"cannot solve incomplete matrix, " 131 "no diagonal or off-diagonal coefficient" 143 const word& fieldName,
151 fieldName_(fieldName),
153 interfaceBouCoeffs_(interfaceBouCoeffs),
154 interfaceIntCoeffs_(interfaceIntCoeffs),
155 interfaces_(interfaces),
156 controlDict_(solverControls)
166 maxIter_ = controlDict_.lookupOrDefault<
label>(
"maxIter", 1000);
167 minIter_ = controlDict_.lookupOrDefault<
label>(
"minIter", 0);
168 tolerance_ = controlDict_.lookupOrDefault<scalar>(
"tolerance", 1
e-6);
169 relTol_ = controlDict_.lookupOrDefault<scalar>(
"relTol", 0);
175 controlDict_ = solverControls;
189 matrix_.sumA(tmpField, interfaceBouCoeffs_, interfaces_);
191 tmpField *=
gAverage(psi, matrix_.lduMesh_.comm());
196 (
mag(Apsi - tmpField) +
mag(source - tmpField))(),
197 matrix_.lduMesh_.comm()
virtual void read(const dictionary &)
Read and reset the solver parameters from the given stream.
virtual void readControls()
Read the control parameters from the controlDict_.
dimensioned< scalar > mag(const dimensioned< Type > &)
word name(const complex &)
Return a string representation of a complex.
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.
A class for handling words, derived from string.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by any number of values (e...
Type gSum(const FieldField< Field, Type > &f)
const double e
Elementary charge.
Ostream & endl(Ostream &os)
Add newline and flush stream.
lduMatrix is a general matrix class in which the coefficients are stored as three arrays...
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.
static const scalar small_
Small Type for the use in solvers.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Type gAverage(const FieldField< Field, Type > &f)
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
#define FatalIOErrorIn(functionName, ios)
Report an error message using Foam::FatalIOError.
solver(const word &fieldName, const lduMatrix &matrix, const FieldField< Field, scalar > &interfaceBouCoeffs, const FieldField< Field, scalar > &interfaceIntCoeffs, const lduInterfaceFieldPtrsList &interfaces, const dictionary &solverControls)