mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: comunicators: have solver with user-defined communicator
(originating from polyMesh::comm() and processorPolyPatch::comm())
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -166,6 +166,74 @@ Foam::OSstream& Foam::messageStream::operator()
|
||||
}
|
||||
|
||||
|
||||
Foam::OSstream& Foam::messageStream::operator()(const label communicator)
|
||||
{
|
||||
if (UPstream::warnComm != -1 && communicator != UPstream::warnComm)
|
||||
{
|
||||
Pout<< "** messageStream with comm:" << communicator
|
||||
<< endl;
|
||||
error::printStack(Pout);
|
||||
}
|
||||
|
||||
if (communicator == UPstream::worldComm)
|
||||
{
|
||||
return operator()();
|
||||
}
|
||||
else
|
||||
{
|
||||
bool master = UPstream::master(communicator);
|
||||
|
||||
if (level)
|
||||
{
|
||||
bool collect = (severity_ == INFO || severity_ == WARNING);
|
||||
|
||||
// Report the error
|
||||
if (!master && collect)
|
||||
{
|
||||
return Snull;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (title().size())
|
||||
{
|
||||
if (Pstream::parRun() && !collect)
|
||||
{
|
||||
Pout<< title().c_str();
|
||||
}
|
||||
else
|
||||
{
|
||||
Sout<< title().c_str();
|
||||
}
|
||||
}
|
||||
|
||||
if (maxErrors_)
|
||||
{
|
||||
errorCount_++;
|
||||
|
||||
if (errorCount_ >= maxErrors_)
|
||||
{
|
||||
FatalErrorIn("messageStream::operator OSstream&()")
|
||||
<< "Too many errors"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
if (Pstream::parRun() && !collect)
|
||||
{
|
||||
return Pout;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Sout;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Snull;
|
||||
}
|
||||
|
||||
|
||||
Foam::messageStream::operator Foam::OSstream&()
|
||||
{
|
||||
if (level)
|
||||
|
||||
Reference in New Issue
Block a user