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* ctorPtr = symMatrixConstructorTable(solverName);
66 "symmetric matrix solver",
68 *symMatrixConstructorTablePtr_
84 auto* ctorPtr = asymMatrixConstructorTable(solverName);
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),
134 maxIter_(defaultMaxIter_),
144 template<
class Type,
class DType,
class LUType>
155 template<
class Type,
class DType,
class LUType>
161 controlDict_ = solverDict;
166 template<
class Type,
class DType,
class LUType>
175 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)
int log_
Level of verbosity in the solver output statements.
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,...
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.
A traits class, which is primarily used 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.
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
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_.