Go to the documentation of this file.
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)
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()
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.
Type gAverage(const FieldField< Field, Type > &f)
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
lduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Type gSum(const FieldField< Field, Type > &f)
dimensioned< scalar > mag(const dimensioned< Type > &)
label minIter_
Minimum number of iterations in the solver.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
virtual void read(const dictionary &)
Read and reset the solver parameters from the given stream.
Pre-declare SubField and related Field type.
label maxIter_
Maximum number of iterations in the solver.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
A list of keyword definitions, which are a keyword followed by any number of values (e....
virtual void readControls()
Read the control parameters from the controlDict_.
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.
const double e
Elementary charge.
scalar relTol_
Convergence tolerance relative to the initial.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dictionary controlDict_
Dictionary of controls.
scalar tolerance_
Final convergence tolerance.
const volScalarField & psi
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
word name(const complex &)
Return a string representation of a complex.
solver(const word &fieldName, const lduMatrix &matrix, const FieldField< Field, scalar > &interfaceBouCoeffs, const FieldField< Field, scalar > &interfaceIntCoeffs, const lduInterfaceFieldPtrsList &interfaces, const dictionary &solverControls)