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:
@ -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)
|
||||
{
|
||||
|
||||
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user