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

@ -128,7 +128,7 @@ int main(int argc, char *argv[])
}
// Sync agglomeration across coupled patches
labelList nbrAgglom(mesh.nFaces() - mesh.nInternalFaces(), -1);
labelList nbrAgglom(mesh.nBoundaryFaces(), -1);
forAll(boundary, patchi)
{

View File

@ -239,7 +239,7 @@ bool setFaceFieldType
const Type& value = pTraits<Type>(fieldValueStream);
// Create flat list of selected faces and their value.
Field<Type> allBoundaryValues(mesh.nFaces()-mesh.nInternalFaces());
Field<Type> allBoundaryValues(mesh.nBoundaryFaces());
forAll(field.boundaryField(), patchi)
{
SubField<Type>
@ -447,7 +447,7 @@ int main(int argc, char *argv[])
(
mesh,
"faceSet",
(mesh.nFaces()-mesh.nInternalFaces())/10+1
mesh.nBoundaryFaces()/10+1
);
source->applyToSet

View File

@ -82,10 +82,7 @@ triSurface triangulate
const polyMesh& mesh = bMesh.mesh();
// Storage for surfaceMesh. Size estimate.
DynamicList<labelledTri> triangles
(
mesh.nFaces() - mesh.nInternalFaces()
);
DynamicList<labelledTri> triangles(mesh.nBoundaryFaces());
label newPatchI = 0;
label localTriFaceI = 0;