46 const word& fieldName,
73 auto* ctorPtr = symMatrixConstructorTable(
name);
80 "symmetric matrix solver",
82 *symMatrixConstructorTablePtr_
101 auto* ctorPtr = asymMatrixConstructorTable(
name);
108 "asymmetric matrix solver",
110 *asymMatrixConstructorTablePtr_
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),
155 profiling_(
"lduMatrix::solver." + fieldName)
165 log_ = controlDict_.getOrDefault<
int>(
"log", 1);
166 minIter_ = controlDict_.getOrDefault<label>(
"minIter", 0);
167 maxIter_ = controlDict_.getOrDefault<label>(
"maxIter", defaultMaxIter_);
168 tolerance_ = controlDict_.getOrDefault<scalar>(
"tolerance", 1
e-6);
169 relTol_ = controlDict_.getOrDefault<scalar>(
"relTol", 0);
175 controlDict_ = solverControls;
206 matrix_.sumA(tmpField, interfaceBouCoeffs_, interfaces_);
213 (
mag(Apsi - tmpField) +
mag(source - tmpField))(),
214 matrix_.mesh().comm()
A const Field/List wrapper with possible data conversion.
const Mesh & mesh() const
Return mesh.
A field of fields is a PtrList of fields with reference counting.
A non-const Field/List wrapper with possible data conversion.
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
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
label comm() const noexcept
Return communicator used for parallel communication.
Abstract base-class for lduMatrix solvers.
const FieldField< Field, scalar > & interfaceIntCoeffs() const noexcept
const lduInterfaceFieldPtrsList & interfaces() const noexcept
const lduMatrix & matrix() const noexcept
solveScalarField::cmptType normFactor(const solveScalarField &psi, const solveScalarField &source, const solveScalarField &Apsi, solveScalarField &tmpField) const
virtual solverPerformance scalarSolve(solveScalarField &psi, const solveScalarField &source, const direction cmpt=0) const
Solve with given field and rhs (in solveScalar precision).
virtual void readControls()
Read the control parameters from the controlDict_.
const FieldField< Field, scalar > & interfaceBouCoeffs() const noexcept
const word & fieldName() const noexcept
lduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
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)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Type gAverage(const FieldField< Field, Type > &f)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define defineRunTimeSelectionTable(baseType, argNames)
Define run-time selection table.