ENH: correct the selfComm procNo relative to world communicator

STYLE: qualify worldComm as UPstream instead Pstream

STYLE: PPCG::gSumMagProd() as static function
This commit is contained in:
Mark Olesen
2023-04-20 12:54:49 +02:00
parent a7c4c184b8
commit ce282dfbbf
8 changed files with 40 additions and 35 deletions

View File

@ -44,14 +44,14 @@ namespace Foam
Foam::LUscalarMatrix::LUscalarMatrix()
:
comm_(Pstream::worldComm)
comm_(UPstream::worldComm)
{}
Foam::LUscalarMatrix::LUscalarMatrix(const scalarSquareMatrix& matrix)
:
scalarSquareMatrix(matrix),
comm_(Pstream::worldComm),
comm_(UPstream::worldComm),
pivotIndices_(m())
{
LUDecompose(*this, pivotIndices_);
@ -67,9 +67,9 @@ Foam::LUscalarMatrix::LUscalarMatrix
:
comm_(ldum.mesh().comm())
{
if (Pstream::parRun())
if (UPstream::parRun())
{
PtrList<procLduMatrix> lduMatrices(Pstream::nProcs(comm_));
PtrList<procLduMatrix> lduMatrices(UPstream::nProcs(comm_));
label lduMatrixi = 0;
@ -84,9 +84,9 @@ Foam::LUscalarMatrix::LUscalarMatrix
)
);
if (Pstream::master(comm_))
if (UPstream::master(comm_))
{
for (const int proci : Pstream::subProcs(comm_))
for (const int proci : UPstream::subProcs(comm_))
{
lduMatrices.set
(
@ -95,10 +95,10 @@ Foam::LUscalarMatrix::LUscalarMatrix
(
IPstream
(
Pstream::commsTypes::scheduled,
UPstream::commsTypes::scheduled,
proci,
0, // bufSize
Pstream::msgType(),
UPstream::msgType(),
comm_
)()
)
@ -109,10 +109,10 @@ Foam::LUscalarMatrix::LUscalarMatrix
{
OPstream toMaster
(
Pstream::commsTypes::scheduled,
Pstream::masterNo(),
UPstream::commsTypes::scheduled,
UPstream::masterNo(),
0, // bufSize
Pstream::msgType(),
UPstream::msgType(),
comm_
);
procLduMatrix cldum
@ -125,7 +125,7 @@ Foam::LUscalarMatrix::LUscalarMatrix
}
if (Pstream::master(comm_))
if (UPstream::master(comm_))
{
label nCells = 0;
forAll(lduMatrices, i)
@ -146,7 +146,7 @@ Foam::LUscalarMatrix::LUscalarMatrix
convert(ldum, interfaceCoeffs, interfaces);
}
if (Pstream::master(comm_))
if (UPstream::master(comm_))
{
if (debug)
{