Commit cb727ab3 authored by mattijs's avatar mattijs
Browse files

ENH: processorPolyPatch: warn for wrong number of processors. Fixes #933.

parent 181582fe
......@@ -144,6 +144,11 @@ public:
return tag_;
}
label comm() const
{
return comm_;
}
//- Mark all sends as having been done. This will start receives
// in non-blocking mode. If block will wait for all transfers to
// finish (only relevant for nonBlocking mode)
......
......@@ -197,6 +197,16 @@ void Foam::processorPolyPatch::initGeometry(PstreamBuffers& pBufs)
{
if (Pstream::parRun())
{
if (neighbProcNo() >= Pstream::nProcs(pBufs.comm()))
{
FatalErrorInFunction
<< "On patch " << name()
<< " trying to access out of range neighbour processor "
<< neighbProcNo() << ". This can happen if" << nl
<< " trying to run on an incorrect number of processors"
<< exit(FatalError);
}
UOPstream toNeighbProc(neighbProcNo(), pBufs);
toNeighbProc
......@@ -350,6 +360,16 @@ void Foam::processorPolyPatch::initUpdateMesh(PstreamBuffers& pBufs)
if (Pstream::parRun())
{
if (neighbProcNo() >= Pstream::nProcs(pBufs.comm()))
{
FatalErrorInFunction
<< "On patch " << name()
<< " trying to access out of range neighbour processor "
<< neighbProcNo() << ". This can happen if" << nl
<< " trying to run on an incorrect number of processors"
<< exit(FatalError);
}
// Express all points as patch face and index in face.
labelList pointFace(nPoints());
labelList pointIndex(nPoints());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment