ENH: added polyBoundaryMesh patchID(meshFacei) method

- this complements the whichPatch(meshFacei) method [binary search]
  and the list of patchID() by adding internal range checks.

  eg,
     Before
     ~~~~~~
     if (facei >= mesh.nInternalFaces() && facei < mesh.nFaces())
     {
         patchi = pbm.patchID()[facei - mesh.nInternalFaces()];
         ...
     }

     After
     ~~~~~
     patchi = pbm.patchID(facei);

     if (patchi >= 0)
     {
         ...
     }
This commit is contained in:
Mark Olesen
2023-05-09 10:22:29 +02:00
parent dfa5c05a16
commit f462a850ce
17 changed files with 123 additions and 109 deletions

View File

@ -391,7 +391,7 @@ bool setFaceFieldType
}
else
{
label patchi = mesh.boundaryMesh().patchID()[bFacei];
const label patchi = mesh.boundaryMesh().patchID()[bFacei];
allBoundaryValues[bFacei] = fieldValue;
++nChanged[patchi];