46 const word& fieldName,
73 auto* ctorPtr = symMatrixConstructorTable(
name);
80 "symmetric matrix solver",
82 *symMatrixConstructorTablePtr_
86 return autoPtr<lduMatrix::solver>
101 auto* ctorPtr = asymMatrixConstructorTable(
name);
108 "asymmetric matrix solver",
110 *asymMatrixConstructorTablePtr_
114 return autoPtr<lduMatrix::solver>
129 <<
"cannot solve incomplete matrix, " 130 "no diagonal or off-diagonal coefficient" 141 const word& fieldName,
149 fieldName_(fieldName),
151 interfaceBouCoeffs_(interfaceBouCoeffs),
152 interfaceIntCoeffs_(interfaceIntCoeffs),
153 interfaces_(interfaces),
154 controlDict_(solverControls),
163 profiling_(
"lduMatrix::solver." + fieldName)
180 controlDict_.readIfPresent(
"log", log_);
182 controlDict_.readIfPresent(
"minIter", minIter_);
183 controlDict_.readIfPresent(
"maxIter", maxIter_);
184 controlDict_.readIfPresent(
"tolerance", tolerance_);
185 controlDict_.readIfPresent(
"relTol", relTol_);
191 controlDict_ = solverControls;
233 matrix_.sumA(tmpField, interfaceBouCoeffs_, interfaces_);
240 (
mag(Apsi - tmpField) +
mag(source - tmpField))(),
241 matrix_.mesh().comm()
const FieldField< Field, scalar > & interfaceBouCoeffs() const noexcept
bool symmetric() const noexcept
virtual void read(const dictionary &)
Read and reset the solver parameters from the given stream.
SolverPerformance< Type > solve(faMatrix< Type > &, const dictionary &)
Solve returning the solution statistics given convergence tolerance.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
pTraits< solveScalar >::cmptType cmptType
Component type.
const lduMatrix & matrix() const noexcept
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T. FatalIOError if not found, or if the number of tokens is incorrect.
A non-const Field/List wrapper with possible data conversion.
static constexpr const label defaultMaxIter
Default maximum number of iterations for solvers (1000)
A field of fields is a PtrList of fields with reference counting.
static const Enum< normTypes > normTypesNames_
Names for the normTypes.
Type gSum(const FieldField< Field, Type > &f)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
A class for handling words, derived from Foam::string.
Abstract base-class for lduMatrix solvers.
A const Field/List wrapper with possible data conversion.
const lduInterfaceFieldPtrsList & interfaces() const noexcept
static const scalar defaultTolerance
Default (absolute) tolerance (1e-6)
solver(const word &fieldName, const lduMatrix &matrix, const FieldField< Field, scalar > &interfaceBouCoeffs, const FieldField< Field, scalar > &interfaceIntCoeffs, const lduInterfaceFieldPtrsList &interfaces, const dictionary &solverControls)
Construct solver for given field name, matrix etc.
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.
normTypes
Enumerated matrix normalisation types.
bool asymmetric() const noexcept
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
solveScalarField::cmptType normFactor(const solveScalarField &psi, const solveScalarField &source, const solveScalarField &Apsi, solveScalarField &tmpField, const lduMatrix::normTypes normType) const
Return the matrix norm using the specified norm method.
bool diagonal() const noexcept
"default" norm (== L1_scaled)
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)
bool readIfPresent(const word &key, const dictionary &dict, EnumType &val) const
Find an entry if present, and assign to T val.
const FieldField< Field, scalar > & interfaceIntCoeffs() const noexcept
virtual solverPerformance scalarSolve(solveScalarField &psi, const solveScalarField &source, const direction cmpt=0) const
Solve with given field and rhs (in solveScalar precision).
const volScalarField & psi
const word & fieldName() const noexcept
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
virtual void readControls()
Read the control parameters from controlDict_.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
static constexpr const zero Zero
Global zero (0)