mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: add operator[](const word&) as "find-by-name" to some classes
- affected: polyBoundary, fvBoundaryMesh, ZoneMesh, searchableSurfaces
before:
const label zoneI = mesh.cellZones().findZoneID(zoneName);
const cellZone& cz = mesh.cellZones()[zoneI];
after:
const cellZone& cz = mesh.cellZones()[zoneName];
This commit is contained in:
@ -27,10 +27,7 @@
|
||||
// Master patch
|
||||
const word masterPatchName(mergePatchPairs[pairI].first());
|
||||
const polyPatch& masterPatch =
|
||||
mesh.boundaryMesh()
|
||||
[
|
||||
mesh.boundaryMesh().findPatchID(masterPatchName)
|
||||
];
|
||||
mesh.boundaryMesh()[masterPatchName];
|
||||
|
||||
labelList isf(masterPatch.size());
|
||||
|
||||
@ -51,10 +48,7 @@
|
||||
// Slave patch
|
||||
const word slavePatchName(mergePatchPairs[pairI].second());
|
||||
const polyPatch& slavePatch =
|
||||
mesh.boundaryMesh()
|
||||
[
|
||||
mesh.boundaryMesh().findPatchID(slavePatchName)
|
||||
];
|
||||
mesh.boundaryMesh()[slavePatchName];
|
||||
|
||||
labelList osf(slavePatch.size());
|
||||
|
||||
|
||||
@ -123,7 +123,7 @@ void createDummyFvMeshFiles(const polyMesh& mesh, const word& regionName)
|
||||
|
||||
label findPatchID(const polyBoundaryMesh& patches, const word& name)
|
||||
{
|
||||
label patchID = patches.findPatchID(name);
|
||||
const label patchID = patches.findPatchID(name);
|
||||
|
||||
if (patchID == -1)
|
||||
{
|
||||
|
||||
@ -849,8 +849,7 @@ int main(int argc, char *argv[])
|
||||
nExtrudeFaces = 0;
|
||||
forAll(zoneNames, i)
|
||||
{
|
||||
label zoneI = faceZones.findZoneID(zoneNames[i]);
|
||||
const faceZone& fz = faceZones[zoneI];
|
||||
const faceZone& fz = faceZones[zoneNames[i]];
|
||||
forAll(fz, j)
|
||||
{
|
||||
extrudeTopPatchID[nExtrudeFaces] = interRegionTopPatch[i];
|
||||
|
||||
Reference in New Issue
Block a user