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

@ -70,9 +70,7 @@ Foam::Map<Foam::label> Foam::autoSnapDriver::getZoneBafflePatches
if (faceZoneNames[surfI].size())
{
// Get zone
label zoneI = fZones.findZoneID(faceZoneNames[surfI]);
const faceZone& fZone = fZones[zoneI];
const faceZone& fZone = fZones[faceZoneNames[surfI]];
//// Get patch allocated for zone
//label patchI = surfaceToCyclicPatch_[surfI];
@ -1311,11 +1309,8 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::autoSnapDriver::repatchToSurface
forAll(zonedSurfaces, i)
{
label zoneSurfI = zonedSurfaces[i];
label zoneI = fZones.findZoneID(faceZoneNames[zoneSurfI]);
const faceZone& fZone = fZones[zoneI];
const label zoneSurfI = zonedSurfaces[i];
const faceZone& fZone = fZones[faceZoneNames[zoneSurfI]];
forAll(fZone, i)
{

View File

@ -1119,9 +1119,7 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::meshRefinement::balance
if (fzNames[surfI].size())
{
// Get zone
label zoneI = fZones.findZoneID(fzNames[surfI]);
const faceZone& fZone = fZones[zoneI];
const faceZone& fZone = fZones[fzNames[surfI]];
forAll(fZone, i)
{
@ -1540,7 +1538,7 @@ Foam::label Foam::meshRefinement::addPatch
polyBoundaryMesh& polyPatches =
const_cast<polyBoundaryMesh&>(mesh.boundaryMesh());
label patchI = polyPatches.findPatchID(patchName);
const label patchI = polyPatches.findPatchID(patchName);
if (patchI != -1)
{
if (polyPatches[patchI].type() == patchType)