particle: Fixed topology error in locate method

Fixes problem introduced by commit 89de5349
This commit is contained in:
Will Bainbridge
2018-06-08 15:58:22 +01:00
parent 675bfc7321
commit 50a965f886
2 changed files with 7 additions and 7 deletions

View File

@ -390,24 +390,23 @@ void Foam::particle::locate
( (
const vector& position, const vector& position,
const vector* direction, const vector* direction,
const label celli, label celli,
const bool boundaryFail, const bool boundaryFail,
const string boundaryMsg const string boundaryMsg
) )
{ {
celli_ = celli;
// Find the cell, if it has not been given // Find the cell, if it has not been given
if (celli_ < 0) if (celli < 0)
{ {
celli_ = mesh_.cellTree().findInside(position); celli = mesh_.cellTree().findInside(position);
} }
if (celli_ < 0) if (celli < 0)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Cell not found for particle position " << position << "." << "Cell not found for particle position " << position << "."
<< exit(FatalError); << exit(FatalError);
} }
celli_ = celli;
// Track from the centre of the cell to the desired position // Track from the centre of the cell to the desired position
const vector displacement = position - mesh_.cellCentres()[celli_]; const vector displacement = position - mesh_.cellCentres()[celli_];
@ -479,6 +478,7 @@ void Foam::particle::locate
const vector sT = displacement - sN; const vector sT = displacement - sN;
coordinates_ = barycentric(1, 0, 0, 0); coordinates_ = barycentric(1, 0, 0, 0);
celli_ = celli;
tetFacei_ = minTetFacei; tetFacei_ = minTetFacei;
tetPti_ = minTetPti; tetPti_ = minTetPti;
facei_ = -1; facei_ = -1;

View File

@ -275,7 +275,7 @@ private:
( (
const vector& position, const vector& position,
const vector* direction, const vector* direction,
const label celli, label celli,
const bool boundaryFail, const bool boundaryFail,
const string boundaryMsg const string boundaryMsg
); );