mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: Problem with list combine gather for multiprocessor run
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -53,23 +53,15 @@ void Foam::patchProbes::findElements(const fvMesh& mesh)
|
|||||||
{
|
{
|
||||||
const vector& sample = operator[](probeI);
|
const vector& sample = operator[](probeI);
|
||||||
label faceI = meshSearchEngine.findNearestBoundaryFace(sample);
|
label faceI = meshSearchEngine.findNearestBoundaryFace(sample);
|
||||||
if (faceI == -1)
|
const point& fc = mesh.faceCentres()[faceI];
|
||||||
{
|
nearest[probeI].first() = pointIndexHit
|
||||||
nearest[probeI].second().first() = Foam::sqr(GREAT);
|
(
|
||||||
nearest[probeI].second().second() = Pstream::myProcNo();
|
true,
|
||||||
}
|
fc,
|
||||||
else
|
faceI
|
||||||
{
|
);
|
||||||
const point& fc = mesh.faceCentres()[faceI];
|
nearest[probeI].second().first() = magSqr(fc-sample);
|
||||||
nearest[probeI].first() = pointIndexHit
|
nearest[probeI].second().second() = Pstream::myProcNo();
|
||||||
(
|
|
||||||
true,
|
|
||||||
fc,
|
|
||||||
faceI
|
|
||||||
);
|
|
||||||
nearest[probeI].second().first() = magSqr(fc-sample);
|
|
||||||
nearest[probeI].second().second() = Pstream::myProcNo();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -92,27 +84,16 @@ void Foam::patchProbes::findElements(const fvMesh& mesh)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Check if all patchProbes have been found.
|
// Check if all patchProbes have been found.
|
||||||
forAll(nearest, sampleI)
|
forAll(nearest, sampleI)
|
||||||
{
|
{
|
||||||
label localI = nearest[sampleI].first().index();
|
label localI = -1;
|
||||||
|
if (nearest[sampleI].second().second() == Pstream::myProcNo())
|
||||||
|
{
|
||||||
|
localI = nearest[sampleI].first().index();
|
||||||
|
}
|
||||||
|
|
||||||
if (localI == -1)
|
elementList_[sampleI] = localI;
|
||||||
{
|
|
||||||
if (Pstream::master())
|
|
||||||
{
|
|
||||||
WarningIn("patchProbes::findElements()")
|
|
||||||
<< "Did not find location "
|
|
||||||
<< nearest[sampleI].second().first()
|
|
||||||
<< " in any cell. Skipping location." << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
elementList_[sampleI] = localI;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user