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:
@ -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)
|
||||
{
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user