Skip to content
Snippets Groups Projects
Commit 7c672a52 authored by Andrew Heather's avatar Andrew Heather
Browse files

nicer code for find faces

parent bb8f7a28
No related branches found
No related tags found
No related merge requests found
......@@ -45,7 +45,7 @@ Foam::labelList Foam::Particle<ParticleType>::findFaces
const labelList& faces = mesh.cells()[celli_];
const vector& C = mesh.cellCentres()[celli_];
labelList faceList(0);
DynamicList<label> faceList(10);
forAll(faces, i)
{
label facei = faces[i];
......@@ -53,12 +53,12 @@ Foam::labelList Foam::Particle<ParticleType>::findFaces
if ((lam > 0) && (lam < 1.0))
{
label n = faceList.size();
faceList.setSize(n+1);
faceList[n] = facei;
faceList.append(facei);
}
}
faceList.shrink();
return faceList;
}
......@@ -75,7 +75,7 @@ Foam::labelList Foam::Particle<ParticleType>::findFaces
const labelList& faces = mesh.cells()[celli];
const vector& C = mesh.cellCentres()[celli];
labelList faceList(0);
DynamicList<label> faceList(10);
forAll(faces, i)
{
label facei = faces[i];
......@@ -83,12 +83,12 @@ Foam::labelList Foam::Particle<ParticleType>::findFaces
if ((lam > 0) && (lam < 1.0))
{
label n = faceList.size();
faceList.setSize(n+1);
faceList[n] = facei;
faceList.append(facei);
}
}
faceList.shrink();
return faceList;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment