ENH: wallBoundedStreamline: handle patches with zero faces. See #502.

This commit is contained in:
mattijs
2017-06-21 14:05:26 +01:00
parent cbbf08dc0d
commit c462d48196
2 changed files with 34 additions and 30 deletions

View File

@ -767,7 +767,7 @@ bool Foam::functionObjects::streamLineBase::write()
// Convert scalar values
if (allScalars_.size() > 0)
if (allScalars_.size() > 0 && tracks.size() > 0)
{
List<List<scalarField>> scalarValues(allScalars_.size());
@ -811,7 +811,7 @@ bool Foam::functionObjects::streamLineBase::write()
// Convert vector values
if (allVectors_.size() > 0)
if (allVectors_.size() > 0 && tracks.size() > 0)
{
List<List<vectorField>> vectorValues(allVectors_.size());

View File

@ -139,9 +139,11 @@ void Foam::functionObjects::wallBoundedStreamLine::track()
forAll(seedPoints, i)
{
const point& seedPt = seedPoints[i];
label celli = seedPoints.cells()[i];
if (celli != -1)
{
const point& seedPt = seedPoints[i];
tetIndices ids(findNearestTet(isWallPatch, seedPt, celli));
if (ids.face() != -1 && isWallPatch[ids.face()])
@ -149,9 +151,10 @@ void Foam::functionObjects::wallBoundedStreamLine::track()
//Pout<< "Seeding particle :" << nl
// << " seedPt:" << seedPt << nl
// << " face :" << ids.face() << nl
// << " at :" << mesh_.faceCentres()[ids.face()] << nl
// << " cell :" << mesh_.cellCentres()[ids.cell()] << nl
// << endl;
// << " at :" << mesh_.faceCentres()[ids.face()]
// << nl
// << " cell :" << mesh_.cellCentres()[ids.cell()]
// << nl << endl;
particles.addParticle
(
@ -175,6 +178,7 @@ void Foam::functionObjects::wallBoundedStreamLine::track()
}
}
}
}
label nSeeds = returnReduce(particles.size(), sumOp<label>());