38 lduMatrix::solver::addsymMatrixConstructorToTable<PPCG>
45void Foam::PPCG::gSumMagProd
47 FixedList<solveScalar, 3>& globalSum,
48 const solveScalarField& a,
49 const solveScalarField&
b,
50 const solveScalarField& c,
51 const solveScalarField& sumMag,
52 label& outstandingRequest,
56 const label nCells = a.size();
59 for (label cell=0; cell<nCells; ++cell)
61 globalSum[0] += a[cell]*
b[cell];
62 globalSum[1] += a[cell]*c[cell];
96 const label comm = matrix().mesh().comm();
97 const label nCells =
psi.
size();
101 matrix_.Amul(w,
psi, interfaceBouCoeffs_, interfaces_, cmpt);
108 const solveScalar normFactor = this->normFactor(
psi, source, w,
p);
110 if ((log_ >= 2) || (lduMatrix::debug >= 2))
112 Info<<
" Normalisation factor = " << normFactor <<
endl;
125 preconPtr->precondition(u, r, cmpt);
128 matrix_.Amul(w, u, interfaceBouCoeffs_, interfaces_, cmpt);
139 label outstandingRequest = -1;
143 gSumMagProd(globalSum, u, r, w, r, outstandingRequest, comm);
146 preconPtr->precondition(m, w, cmpt);
151 preconPtr->precondition(m, w, cmpt);
154 gSumMagProd(globalSum, w, u, m, r, outstandingRequest, comm);
159 matrix_.Amul(
n, m, interfaceBouCoeffs_, interfaces_, cmpt);
161 solveScalar
alpha = 0.0;
162 solveScalar
gamma = 0.0;
176 outstandingRequest = -1;
179 const solveScalar gammaOld =
gamma;
180 gamma = globalSum[0];
181 const solveScalar
delta = globalSum[1];
192 (minIter_ <= 0 || solverPerf.
nIterations() >= minIter_)
233 gSumMagProd(globalSum, u, r, w, r, outstandingRequest, comm);
236 preconPtr->precondition(m, w, cmpt);
241 preconPtr->precondition(m, w, cmpt);
244 gSumMagProd(globalSum, w, u, m, r, outstandingRequest, comm);
248 matrix_.Amul(
n, m, interfaceBouCoeffs_, interfaces_, cmpt);
260 const word& fieldName,
A const Field/List wrapper with possible data conversion.
A field of fields is a PtrList of fields with reference counting.
A 1D vector of objects of type <T> with a fixed length <N>.
const word & getName() const
Get name.
Preconditioned pipelined conjugate gradient solver for symmetric lduMatrices using a run-time selecta...
solverPerformance scalarSolveCG(solveScalarField &psi, const solveScalarField &source, const direction cmpt, const bool cgMode) const
A non-const Field/List wrapper with possible data conversion.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
void size(const label n)
Older name for setAddressableSize.
static int & msgType() noexcept
Message tag of standard messages.
static void waitRequest(const label i)
Wait until request i has finished.
static bool & parRun() noexcept
Test if this a parallel run.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A cell is defined as a list of faces with extra functionality.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
lduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
Base class for solution control classes.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
const volScalarField & psi
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
messageStream Info
Information stream (stdout output on master, null elsewhere)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
dimensioned< typename typeOfMag< Type >::type > sumMag(const DimensionedField< Type, GeoMesh > &df)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
lduMatrix::solver::addsymMatrixConstructorToTable< PPCG > addPPCGSymMatrixConstructorToTable_
dimensionedScalar beta("beta", dimless/dimTemperature, laminarTransport)