mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +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:
@ -353,7 +353,7 @@ void getInterfaceSizes
|
||||
// ~~~~~~~~~~~~~~
|
||||
|
||||
// Neighbour cellRegion.
|
||||
labelList coupledRegion(mesh.nFaces()-mesh.nInternalFaces());
|
||||
labelList coupledRegion(mesh.nBoundaryFaces());
|
||||
|
||||
forAll(coupledRegion, i)
|
||||
{
|
||||
@ -641,7 +641,7 @@ autoPtr<mapPolyMesh> createRegionMesh
|
||||
|
||||
|
||||
// Neighbour cellRegion.
|
||||
labelList coupledRegion(mesh.nFaces()-mesh.nInternalFaces());
|
||||
labelList coupledRegion(mesh.nBoundaryFaces());
|
||||
|
||||
forAll(coupledRegion, i)
|
||||
{
|
||||
@ -1232,7 +1232,7 @@ void getZoneID
|
||||
}
|
||||
|
||||
// Neighbour zoneID.
|
||||
neiZoneID.setSize(mesh.nFaces()-mesh.nInternalFaces());
|
||||
neiZoneID.setSize(mesh.nBoundaryFaces());
|
||||
|
||||
forAll(neiZoneID, i)
|
||||
{
|
||||
@ -1263,7 +1263,7 @@ void matchRegions
|
||||
|
||||
// Get current per cell zoneID
|
||||
labelList zoneID(mesh.nCells(), -1);
|
||||
labelList neiZoneID(mesh.nFaces()-mesh.nInternalFaces());
|
||||
labelList neiZoneID(mesh.nBoundaryFaces());
|
||||
getZoneID(mesh, cellZones, zoneID, neiZoneID);
|
||||
|
||||
// Sizes per cellzone
|
||||
@ -1552,7 +1552,7 @@ int main(int argc, char *argv[])
|
||||
// Existing zoneID
|
||||
labelList zoneID(mesh.nCells(), -1);
|
||||
// Neighbour zoneID.
|
||||
labelList neiZoneID(mesh.nFaces()-mesh.nInternalFaces());
|
||||
labelList neiZoneID(mesh.nBoundaryFaces());
|
||||
getZoneID(mesh, cellZones, zoneID, neiZoneID);
|
||||
|
||||
|
||||
@ -1622,7 +1622,7 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
|
||||
labelList newZoneID(mesh.nCells(), -1);
|
||||
labelList newNeiZoneID(mesh.nFaces()-mesh.nInternalFaces());
|
||||
labelList newNeiZoneID(mesh.nBoundaryFaces());
|
||||
getZoneID(mesh, newCellZones, newZoneID, newNeiZoneID);
|
||||
|
||||
label unzonedCelli = newZoneID.find(-1);
|
||||
|
||||
Reference in New Issue
Block a user