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()
virtual void read(const dictionary &)
Read and reset the solver parameters from the given stream.
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...
Ostream & endl(Ostream &os)
Add newline and flush stream.
Type gSum(const FieldField< Field, Type > &f)
A class for handling words, derived from string.
solver(const word &fieldName, const lduMatrix &matrix, const FieldField< Field, scalar > &interfaceBouCoeffs, const FieldField< Field, scalar > &interfaceIntCoeffs, const lduInterfaceFieldPtrsList &interfaces, const dictionary &solverControls)
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.
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
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.
lduMatrix is a general matrix class in which the coefficients are stored as three arrays...
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Type gAverage(const FieldField< Field, Type > &f)
dimensioned< scalar > mag(const dimensioned< Type > &)
const doubleScalar e
Elementary charge.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
virtual void readControls()
Read the control parameters from the controlDict_.