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

@ -148,8 +148,7 @@ displacementInterpolationFvMotionSolver
forAll(faceZoneToTable, i)
{
const word& zoneName = faceZoneToTable[i][0];
label zoneI = fZones.findZoneID(zoneName);
const faceZone& fz = fZones[zoneI];
const faceZone& fz = fZones[zoneName];
scalar minCoord = VGREAT;
scalar maxCoord = -VGREAT;

View File

@ -353,8 +353,7 @@ void Foam::displacementLayeredMotionFvMotionSolver::cellZoneSolve
const dictionary& faceZoneDict = patchIter().dict();
// Determine the points of the faceZone within the cellZone
label zoneI = mesh().faceZones().findZoneID(faceZoneName);
const faceZone& fz = mesh().faceZones()[zoneI];
const faceZone& fz = mesh().faceZones()[faceZoneName];
const labelList& fzMeshPoints = fz().meshPoints();
DynamicList<label> meshPoints(fzMeshPoints.size());
forAll(fzMeshPoints, i)

View File

@ -78,7 +78,7 @@ void Foam::inverseFaceDistanceDiffusivity::correct()
forAll(patchNames_, i)
{
label pID = bdry.findPatchID(patchNames_[i]);
const label pID = bdry.findPatchID(patchNames_[i]);
if (pID > -1)
{

View File

@ -78,7 +78,7 @@ void Foam::inversePointDistanceDiffusivity::correct()
forAll(patchNames_, i)
{
label pID = bdry.findPatchID(patchNames_[i]);
const label pID = bdry.findPatchID(patchNames_[i]);
if (pID > -1)
{

View File

@ -87,7 +87,7 @@ void surfaceDisplacementPointPatchVectorField::calcProjection
{
const pointZoneMesh& pZones = mesh.pointZones();
zonePtr = &pZones[pZones.findZoneID(frozenPointsZone_)];
zonePtr = &pZones[frozenPointsZone_];
Pout<< "surfaceDisplacementPointPatchVectorField : Fixing all "
<< zonePtr->size() << " points in pointZone " << zonePtr->name()

View File

@ -86,7 +86,7 @@ void surfaceSlipDisplacementPointPatchVectorField::calcProjection
{
const pointZoneMesh& pZones = mesh.pointZones();
zonePtr = &pZones[pZones.findZoneID(frozenPointsZone_)];
zonePtr = &pZones[frozenPointsZone_];
Pout<< "surfaceSlipDisplacementPointPatchVectorField : Fixing all "
<< zonePtr->size() << " points in pointZone " << zonePtr->name()