34template<
class Type,
class DType,
class LUType>
38 const word& fieldName,
43 const word solverName(solverDict.
get<
word>(
"solver"));
57 else if (
matrix.symmetric())
59 auto* ctorPtr = symMatrixConstructorTable(solverName);
66 "symmetric matrix solver",
68 *symMatrixConstructorTablePtr_
82 else if (
matrix.asymmetric())
84 auto* ctorPtr = asymMatrixConstructorTable(solverName);
91 "asymmetric matrix solver",
93 *asymMatrixConstructorTablePtr_
109 <<
"cannot solve incomplete matrix, "
110 "no diagonal or off-diagonal coefficient"
119template<
class Type,
class DType,
class LUType>
122 const word& fieldName,
127 fieldName_(fieldName),
130 controlDict_(solverDict),
134 maxIter_(defaultMaxIter_),
144template<
class Type,
class DType,
class LUType>
147 controlDict_.readIfPresent(
"log", log_);
148 controlDict_.readIfPresent(
"minIter", minIter_);
149 controlDict_.readIfPresent(
"maxIter", maxIter_);
150 controlDict_.readIfPresent(
"tolerance", tolerance_);
151 controlDict_.readIfPresent(
"relTol", relTol_);
155template<
class Type,
class DType,
class LUType>
161 controlDict_ = solverDict;
166template<
class Type,
class DType,
class LUType>
175 matrix_.sumA(tmpField);
Generic templated field type.
const LduMatrix< Type, DType, LUType > & matrix() const noexcept
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.
virtual void readControls()
Read the control parameters from the controlDict_.
const word & fieldName() const noexcept
LduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
virtual bool read()
Re-read model coefficients if they have changed.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Abstract base-class for lduMatrix solvers.
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
A traits class, which is primarily used for primitives.
A class for handling words, derived from Foam::string.
const volScalarField & psi
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Type gSum(const FieldField< Field, Type > &f)
dimensionedScalar stabilise(const dimensionedScalar &x, const dimensionedScalar &y)
Type gAverage(const FieldField< Field, Type > &f)
static constexpr const zero Zero
Global zero (0)
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
void cmptMag(FieldField< Field, Type > &cf, const FieldField< Field, Type > &f)
errorManipArg< error, int > exit(error &err, const int errNo=1)