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

@ -492,7 +492,7 @@ void Foam::meshToMesh::calculate(const word& methodName, const bool normalise)
patches[0] = new polyPatch
(
"defaultFaces",
newTgt.nFaces() - newTgt.nInternalFaces(),
newTgt.nBoundaryFaces(),
newTgt.nInternalFaces(),
0,
newTgt.boundaryMesh(),

View File

@ -238,7 +238,7 @@ void Foam::shortestPathSet::genSamples(const polyMesh& mesh)
// Situation 2: we're on a coupled patch and might need to
// switch processor/cell
boolList isFront(mesh.nFaces()-mesh.nInternalFaces(), false);
boolList isFront(mesh.nBoundaryFaces(), false);
if (frontFaceI != -1)
{

View File

@ -116,7 +116,7 @@ Foam::sampledTriSurfaceMesh::nonCoupledboundaryTree() const
// all non-coupled boundary faces (not just walls)
const polyBoundaryMesh& patches = mesh().boundaryMesh();
labelList bndFaces(mesh().nFaces()-mesh().nInternalFaces());
labelList bndFaces(patches.nFaces());
label bndI = 0;
for (const polyPatch& pp : patches)
{

View File

@ -58,7 +58,7 @@ Foam::sampledTriSurfaceMesh::sampleOnFaces
auto& values = tvalues.ref();
const polyBoundaryMesh& pbm = mesh().boundaryMesh();
const label nBnd = mesh().nFaces()-mesh().nInternalFaces();
const label nBnd = mesh().nBoundaryFaces();
// Create flat boundary field

View File

@ -1453,7 +1453,7 @@ Foam::isoSurface::isoSurface
// Pre-calculate patch-per-face to avoid whichPatch call.
labelList boundaryRegion(mesh_.nFaces()-mesh_.nInternalFaces());
labelList boundaryRegion(mesh_.nBoundaryFaces());
forAll(patches, patchi)
{

View File

@ -606,7 +606,7 @@ void Foam::isoSurface::generateTriPoints
// Determine neighbouring snap status
boolList neiSnapped(mesh_.nFaces()-mesh_.nInternalFaces(), false);
boolList neiSnapped(mesh_.nBoundaryFaces(), false);
List<Type> neiSnappedPoint(neiSnapped.size(), Type(Zero));
for (const polyPatch& pp : patches)
{

View File

@ -110,7 +110,7 @@ Foam::discreteSurface::nonCoupledboundaryTree() const
// all non-coupled boundary faces (not just walls)
const polyBoundaryMesh& patches = mesh().boundaryMesh();
labelList bndFaces(mesh().nFaces()-mesh().nInternalFaces());
labelList bndFaces(patches.nFaces());
label bndI = 0;
for (const polyPatch& pp : patches)
{

View File

@ -169,7 +169,7 @@ Foam::discreteSurface::sampleOnFaces
// Sample boundary faces
const polyBoundaryMesh& pbm = mesh().boundaryMesh();
const label nBnd = mesh().nFaces()-mesh().nInternalFaces();
const label nBnd = mesh().nBoundaryFaces();
// Create flat boundary field