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:
Mark Olesen
2010-04-29 10:12:35 +02:00
parent 845314b280
commit 72f7d46f23
46 changed files with 438 additions and 258 deletions

View File

@ -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());

View File

@ -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)
{

View File

@ -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];