Go to the documentation of this file.
34 template<
class Type,
class DType,
class LUType>
38 const word& fieldName,
43 const word solverName(solverDict.
get<
word>(
"solver"));
59 auto cstrIter = symMatrixConstructorTablePtr_->cfind(solverName);
61 if (!cstrIter.found())
66 "symmetric matrix solver",
68 *symMatrixConstructorTablePtr_
84 auto cstrIter = asymMatrixConstructorTablePtr_->cfind(solverName);
86 if (!cstrIter.found())
91 "asymmetric matrix solver",
93 *asymMatrixConstructorTablePtr_
109 <<
"cannot solve incomplete matrix, "
110 "no diagonal or off-diagonal coefficient"
119 template<
class Type,
class DType,
class LUType>
122 const word& fieldName,
127 fieldName_(fieldName),
130 controlDict_(solverDict),
132 maxIter_(defaultMaxIter_),
143 template<
class Type,
class DType,
class LUType>
153 template<
class Type,
class DType,
class LUType>
159 controlDict_ = solverDict;
164 template<
class Type,
class DType,
class LUType>
173 matrix_.sumA(tmpField);
A class for handling words, derived from Foam::string.
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
static constexpr const zero Zero
Global zero (0)
Type gAverage(const FieldField< Field, Type > &f)
LduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
label maxIter_
Maximum number of iterations in the solver.
Type gSum(const FieldField< Field, Type > &f)
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
void cmptMag(FieldField< Field, Type > &cf, const FieldField< Field, Type > &f)
dictionary controlDict_
Dictionary of controls.
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
Generic templated field type.
virtual void read(const dictionary &solverDict)
Read and reset the solver parameters from the given dictionary.
tmp< DimensionedField< scalar, GeoMesh > > stabilise(const DimensionedField< scalar, GeoMesh > &dsf, const dimensioned< scalar > &ds)
Type relTol_
Convergence tolerance relative to the initial.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
void readControl(const dictionary &controlDict, T &control, const word &controlName)
Read a control parameter from controlDict.
Type tolerance_
Final convergence tolerance.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
label minIter_
Minimum number of iterations in the solver.
Traits class for primitives.
const dimensionedScalar e
Elementary charge.
solver(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix, const dictionary &solverDict)
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
const volScalarField & psi
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.
static autoPtr< solver > New(const word &fieldName, const LduMatrix< Type, DType, LUType > &matrix, const dictionary &solverDict)
Return a new solver.
virtual void readControls()
Read the control parameters from the controlDict_.