Go to the documentation of this file.
32 template<
class Type,
class DType,
class LUType>
35 const word& fieldName,
51 template<
class Type,
class DType,
class LUType>
58 const word preconditionerName(this->controlDict_.getWord(
"preconditioner"));
63 preconditionerName + typeName,
69 label nCells =
psi.size();
71 Type* __restrict__ psiPtr =
psi.begin();
74 Type* __restrict__ pAPtr = pA.begin();
77 Type* __restrict__ pTPtr = pT.begin();
80 Type* __restrict__ wAPtr = wA.begin();
83 Type* __restrict__ wTPtr = wT.begin();
86 scalar wArTold = wArT;
89 this->matrix_.Amul(wA,
psi);
90 this->matrix_.Tmul(wT,
psi);
95 Type* __restrict__ rAPtr = rA.begin();
96 Type* __restrict__ rTPtr = rT.begin();
99 Type normFactor = this->normFactor(
psi, wA, pA);
103 Info<<
" Normalisation factor = " << normFactor <<
endl;
108 solverPerf.finalResidual() = solverPerf.initialResidual();
114 || !solverPerf.checkConvergence(this->tolerance_, this->relTol_)
132 preconPtr->precondition(wA, rA);
133 preconPtr->preconditionT(wT, rT);
148 scalar
beta = wArT/wArTold;
159 this->matrix_.Amul(wA, pA);
160 this->matrix_.Tmul(wT, pT);
167 solverPerf.checkSingularity
179 scalar
alpha = wArT/wApT;
188 solverPerf.finalResidual() =
194 nIter++ < this->maxIter_
195 && !solverPerf.checkConvergence(this->tolerance_, this->relTol_)
197 || nIter < this->minIter_
201 solverPerf.nIterations() =
virtual SolverPerformance< Type > solve(Field< Type > &psi) const
Solve the matrix with this solver.
A class for handling words, derived from Foam::string.
static constexpr const zero Zero
Global zero (0)
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
LduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
Ostream & endl(Ostream &os)
Add newline and flush stream.
Abstract base-class for LduMatrix solvers.
Type gSumCmptMag(const UList< Type > &f, const label comm)
Generic templated field type.
messageStream Info
Information stream (uses stdout - output is on the master only)
dimensionedScalar beta("beta", dimless/dimTemperature, laminarTransport)
scalarProduct< Type, Type >::type gSumProd(const UList< Type > &f1, const UList< Type > &f2, const label comm)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
dimensioned< Type > cmptDivide(const dimensioned< Type > &, const dimensioned< Type > &)
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Traits class for primitives.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
const volScalarField & psi
A cell is defined as a list of faces with extra functionality.
Preconditioned bi-conjugate gradient solver for asymmetric lduMatrices using a run-time selectable pr...