mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
@ -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(),
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user