ENH: primitiveMesh: updated C++

This commit is contained in:
mattijs
2018-01-15 15:59:40 +00:00
parent effe4ce217
commit 434a2cb1b9
2 changed files with 8 additions and 21 deletions

View File

@ -73,14 +73,9 @@ const Foam::labelList& Foam::primitiveMesh::cellPoints
set.clear();
forAll(cFaces, i)
for (const label facei : cFaces)
{
const labelList& f = fcs[cFaces[i]];
forAll(f, fp)
{
set.insert(f[fp]);
}
set.insert(fcs[facei]);
}
storage.clear();
@ -89,9 +84,9 @@ const Foam::labelList& Foam::primitiveMesh::cellPoints
storage.setCapacity(set.size());
}
forAllConstIter(labelHashSet, set, iter)
for (const label pointi : set)
{
storage.append(iter.key());
storage.append(pointi);
}
return storage;
@ -105,6 +100,4 @@ const Foam::labelList& Foam::primitiveMesh::cellPoints(const label celli) const
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -644,26 +644,20 @@ const Foam::labelList& Foam::primitiveMesh::cellEdges
set.clear();
forAll(cFaces, i)
for (const label facei : cFaces)
{
const labelList& fe = faceEdges(cFaces[i]);
forAll(fe, feI)
{
set.insert(fe[feI]);
}
set.insert(faceEdges(facei));
}
storage.clear();
if (set.size() > storage.capacity())
{
storage.setCapacity(set.size());
}
forAllConstIter(labelHashSet, set, iter)
for (const label edgei : set)
{
storage.append(iter.key());
storage.append(edgei);
}
return storage;