COMP: Resolved compiler warning

This commit is contained in:
Andrew Heather
2020-03-31 10:04:19 +01:00
parent 0e6213e548
commit c589d1c90f
4 changed files with 17 additions and 17 deletions

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2019-2020 M. Janssens
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -55,7 +56,7 @@ void Foam::PPCG::gSumMagProd
const label nCells = a.size();
globalSum = 0.0;
for (label cell=0; cell<nCells; cell++)
for (label cell=0; cell<nCells; ++cell)
{
globalSum[0] += a[cell]*b[cell]; // sumProd(a, b)
globalSum[1] += a[cell]*c[cell]; // sumProd(a, c)
@ -77,7 +78,7 @@ void Foam::PPCG::gSumMagProd
}
Foam::solverPerformance Foam::PPCG::scalarSolve
Foam::solverPerformance Foam::PPCG::scalarSolveCG
(
solveScalarField& psi,
const solveScalarField& source,
@ -113,11 +114,11 @@ Foam::solverPerformance Foam::PPCG::scalarSolve
// --- Select and construct the preconditioner
autoPtr<lduMatrix::preconditioner> preconPtr =
lduMatrix::preconditioner::New
(
*this,
controlDict_
);
lduMatrix::preconditioner::New
(
*this,
controlDict_
);
// --- Precondition residual (= u0)
solveScalarField u(nCells);
@ -209,7 +210,7 @@ Foam::solverPerformance Foam::PPCG::scalarSolve
const solveScalar beta = gamma/gammaOld;
alpha = gamma/(delta-beta*gamma/alpha);
for (label cell=0; cell<nCells; cell++)
for (label cell=0; cell<nCells; ++cell)
{
z[cell] = n[cell] + beta*z[cell];
q[cell] = m[cell] + beta*q[cell];
@ -218,7 +219,7 @@ Foam::solverPerformance Foam::PPCG::scalarSolve
}
}
for (label cell=0; cell<nCells; cell++)
for (label cell=0; cell<nCells; ++cell)
{
psi[cell] += alpha*p[cell];
r[cell] -= alpha*s[cell];
@ -286,7 +287,7 @@ Foam::solverPerformance Foam::PPCG::solve
) const
{
PrecisionAdaptor<solveScalar, scalar> tpsi(psi_s);
return scalarSolve
return scalarSolveCG
(
tpsi.ref(),
ConstPrecisionAdaptor<solveScalar, scalar>(source)(),

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2019-2020 M. Janssens
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -89,8 +90,8 @@ class PPCG
protected:
//- CG solver. Operates either in conjugate-gradient mode or
// conjugate residual
solverPerformance scalarSolve
//- conjugate residual
solverPerformance scalarSolveCG
(
solveScalarField& psi,
const solveScalarField& source,
@ -120,8 +121,7 @@ public:
//- Destructor
virtual ~PPCG()
{}
virtual ~PPCG() = default;
// Member Functions

View File

@ -73,7 +73,7 @@ Foam::solverPerformance Foam::PPCR::solve
) const
{
PrecisionAdaptor<solveScalar, scalar> tpsi(psi_s);
return PPCG::scalarSolve
return PPCG::scalarSolveCG
(
tpsi.ref(),
ConstPrecisionAdaptor<solveScalar, scalar>(source)(),

View File

@ -98,8 +98,7 @@ public:
//- Destructor
virtual ~PPCR()
{}
virtual ~PPCR() = default;
// Member Functions