STYLE: add nBoundaryFaces() method to primitiveMesh

- nBoundaryFaces() is often used and is identical to
  (nFaces() - nInternalFaces()).

- forward the mesh nInternalFaces() and nBoundaryFaces() to
  polyBoundaryMesh as nFaces() and start() respectively,
  for use when operating on a polyBoundaryMesh.

STYLE:

- use identity() function with starting offset when creating boundary maps.

     labelList map
     (
         identity(mesh.nBoundaryFaces(), mesh.nInternalFaces())
     );

  vs.

     labelList map(mesh.nBoundaryFaces());
     forAll(map, i)
     {
         map[i] = mesh.nInternalFaces() + i;
     }
This commit is contained in:
Mark Olesen
2018-09-27 10:17:30 +02:00
parent 3a641275d3
commit 64c3e484bb
83 changed files with 279 additions and 303 deletions

View File

@ -146,7 +146,7 @@ void Foam::decompositionConstraints::preserveFaceZonesConstraint::apply
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
labelList destProc(mesh.nFaces()-mesh.nInternalFaces(), labelMax);
labelList destProc(mesh.nBoundaryFaces(), labelMax);
for (const polyPatch& pp : pbm)
{

View File

@ -146,7 +146,7 @@ void Foam::decompositionConstraints::preservePatchesConstraint::apply
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
labelList destProc(mesh.nFaces()-mesh.nInternalFaces(), labelMax);
labelList destProc(mesh.nBoundaryFaces(), labelMax);
for (const polyPatch& pp : pbm)
{

View File

@ -535,7 +535,7 @@ void Foam::decompositionMethod::calcCellCells
// Get agglomerate owner on other side of coupled faces
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
labelList globalNeighbour(mesh.nFaces()-mesh.nInternalFaces());
labelList globalNeighbour(mesh.nBoundaryFaces());
for (const polyPatch& pp : patches)
{
@ -734,7 +734,7 @@ void Foam::decompositionMethod::calcCellCells
// Get agglomerate owner on other side of coupled faces
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
labelList globalNeighbour(mesh.nFaces()-mesh.nInternalFaces());
labelList globalNeighbour(mesh.nBoundaryFaces());
for (const polyPatch& pp : patches)
{