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

@ -678,17 +678,17 @@ int main(int argc, char *argv[])
{
const dictionary& dict = patchSources[addedI];
word patchName(dict.lookup("name"));
const word patchName(dict.lookup("name"));
label destPatchI = patches.findPatchID(patchName);
if (destPatchI == -1)
{
FatalErrorIn(args.executable()) << "patch " << patchName
<< " not added. Problem." << abort(FatalError);
FatalErrorIn(args.executable())
<< "patch " << patchName << " not added. Problem."
<< abort(FatalError);
}
word sourceType(dict.lookup("constructFrom"));
const word sourceType(dict.lookup("constructFrom"));
if (sourceType == "patches")
{
@ -716,7 +716,7 @@ int main(int argc, char *argv[])
}
else if (sourceType == "set")
{
word setName(dict.lookup("set"));
const word setName(dict.lookup("set"));
faceSet faces(mesh, setName);