polyBoundaryMesh::findPatchID,findPatchIDs: renamed findIndex,findIndices
Index is a better name to describe a label index than ID which may be an integer, word or other means of identification.
This commit is contained in:
@ -42,7 +42,7 @@ activeBaffleVelocityFvPatchVectorField
|
||||
fixedValueFvPatchVectorField(p, iF, dict, false),
|
||||
pName_(dict.lookupOrDefault<word>("p", "p")),
|
||||
cyclicPatchName_(dict.lookup("cyclicPatch")),
|
||||
cyclicPatchLabel_(p.patch().boundaryMesh().findPatchID(cyclicPatchName_)),
|
||||
cyclicPatchLabel_(p.patch().boundaryMesh().findIndex(cyclicPatchName_)),
|
||||
orientation_(dict.lookup<label>("orientation")),
|
||||
initWallSf_(p.Sf()),
|
||||
initCyclicSf_(p.boundaryMesh()[cyclicPatchLabel_].Sf()),
|
||||
|
||||
@ -42,7 +42,7 @@ activePressureForceBaffleVelocityFvPatchVectorField
|
||||
fixedValueFvPatchVectorField(p, iF, dict, false),
|
||||
pName_(dict.lookupOrDefault<word>("p", "p")),
|
||||
cyclicPatchName_(dict.lookup("cyclicPatch")),
|
||||
cyclicPatchLabel_(p.patch().boundaryMesh().findPatchID(cyclicPatchName_)),
|
||||
cyclicPatchLabel_(p.patch().boundaryMesh().findIndex(cyclicPatchName_)),
|
||||
orientation_(dict.lookup<label>("orientation")),
|
||||
initWallSf_(0),
|
||||
initCyclicSf_(0),
|
||||
|
||||
@ -60,7 +60,7 @@ Foam::fv::VoFFilmTransfer::VoFFilmTransfer
|
||||
fvModel(sourceName, modelType, mesh, dict),
|
||||
VoF_(mesh.lookupObject<solvers::compressibleVoF>(solver::typeName)),
|
||||
filmPatchName_(dict.lookup("filmPatch")),
|
||||
filmPatchi_(mesh.boundaryMesh().findPatchID(filmPatchName_)),
|
||||
filmPatchi_(mesh.boundaryMesh().findIndex(filmPatchName_)),
|
||||
phaseName_(dict.lookup("phase")),
|
||||
thermo_
|
||||
(
|
||||
|
||||
@ -208,7 +208,7 @@ int main(int argc, char *argv[])
|
||||
#include "createMesh.H"
|
||||
|
||||
const word patchName = args[1];
|
||||
label patchi = mesh.boundaryMesh().findPatchID(patchName);
|
||||
label patchi = mesh.boundaryMesh().findIndex(patchName);
|
||||
const polyPatch& pp = mesh.boundaryMesh()[patchi];
|
||||
|
||||
const indirectPrimitivePatch& cpp = mesh.globalData().coupledPatch();
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -59,7 +59,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
|
||||
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
|
||||
label patchi = pbm.findPatchID(patchName);
|
||||
label patchi = pbm.findIndex(patchName);
|
||||
const polyPatch& patch = pbm[patchi];
|
||||
|
||||
Info<< "Patch:" << patch.name() << endl;
|
||||
|
||||
@ -513,7 +513,7 @@ void createBaffles
|
||||
// Wrapper around find patch. Also makes sure same patch in parallel.
|
||||
label findPatch(const polyBoundaryMesh& patches, const word& patchName)
|
||||
{
|
||||
label patchi = patches.findPatchID(patchName);
|
||||
label patchi = patches.findIndex(patchName);
|
||||
|
||||
if (patchi == -1)
|
||||
{
|
||||
|
||||
@ -193,7 +193,7 @@ scalar getEdgeStats(const primitiveMesh& mesh, const direction excludeCmpt)
|
||||
// Adds empty patch if not yet there. Returns patchID.
|
||||
label addPatch(polyMesh& mesh, const word& patchName)
|
||||
{
|
||||
label patchi = mesh.boundaryMesh().findPatchID(patchName);
|
||||
label patchi = mesh.boundaryMesh().findIndex(patchName);
|
||||
|
||||
if (patchi == -1)
|
||||
{
|
||||
|
||||
@ -1099,7 +1099,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Remove empty defaultFaces
|
||||
label defaultPatchID = mesh.boundaryMesh().findPatchID(defaultFacesName);
|
||||
label defaultPatchID = mesh.boundaryMesh().findIndex(defaultFacesName);
|
||||
if (mesh.boundaryMesh()[defaultPatchID].size() == 0)
|
||||
{
|
||||
List<polyPatch*> newPatchPtrList((mesh.boundaryMesh().size() - 1));
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -111,8 +111,8 @@ void Foam::extrude2DMesh::addFrontBackPatches()
|
||||
{
|
||||
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
|
||||
|
||||
frontPatchi_ = patches.findPatchID("front");
|
||||
backPatchi_ = patches.findPatchID("back");
|
||||
frontPatchi_ = patches.findIndex("front");
|
||||
backPatchi_ = patches.findIndex("back");
|
||||
|
||||
// Add patch.
|
||||
List<polyPatch*> newPatches(patches.size() + 2);
|
||||
|
||||
@ -80,9 +80,9 @@ namespace Foam
|
||||
static const NamedEnum<ExtrudeMode, 3> ExtrudeModeNames;
|
||||
|
||||
|
||||
label findPatchID(const polyBoundaryMesh& patches, const word& name)
|
||||
label findIndex(const polyBoundaryMesh& patches, const word& name)
|
||||
{
|
||||
const label patchID = patches.findPatchID(name);
|
||||
const label patchID = patches.findIndex(name);
|
||||
|
||||
if (patchID == -1)
|
||||
{
|
||||
@ -102,7 +102,7 @@ labelList patchFaces(const polyBoundaryMesh& patches, const wordList& names)
|
||||
|
||||
forAll(names, i)
|
||||
{
|
||||
const polyPatch& pp = patches[findPatchID(patches, names[i])];
|
||||
const polyPatch& pp = patches[findIndex(patches, names[i])];
|
||||
|
||||
n += pp.size();
|
||||
}
|
||||
@ -110,7 +110,7 @@ labelList patchFaces(const polyBoundaryMesh& patches, const wordList& names)
|
||||
n = 0;
|
||||
forAll(names, i)
|
||||
{
|
||||
const polyPatch& pp = patches[findPatchID(patches, names[i])];
|
||||
const polyPatch& pp = patches[findIndex(patches, names[i])];
|
||||
|
||||
forAll(pp, j)
|
||||
{
|
||||
@ -172,8 +172,8 @@ void changeFrontBackPatches
|
||||
{
|
||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||
|
||||
label frontPatchi = findPatchID(patches, frontPatchName);
|
||||
label backPatchi = findPatchID(patches, backPatchName);
|
||||
label frontPatchi = findIndex(patches, frontPatchName);
|
||||
label backPatchi = findIndex(patches, backPatchName);
|
||||
|
||||
DynamicList<polyPatch*> newPatches(patches.size());
|
||||
|
||||
@ -498,7 +498,7 @@ int main(int argc, char *argv[])
|
||||
exposedPatchID.setSize
|
||||
(
|
||||
extrudePatch.size(),
|
||||
findPatchID(patches, backPatchName)
|
||||
findIndex(patches, backPatchName)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -133,7 +133,7 @@ using namespace Foam;
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
label findPatchID(const List<polyPatch*>& newPatches, const word& name)
|
||||
label findIndex(const List<polyPatch*>& newPatches, const word& name)
|
||||
{
|
||||
forAll(newPatches, i)
|
||||
{
|
||||
@ -155,7 +155,7 @@ label addPatch
|
||||
DynamicList<polyPatch*>& newPatches
|
||||
)
|
||||
{
|
||||
label patchi = findPatchID(newPatches, patchName);
|
||||
label patchi = findIndex(newPatches, patchName);
|
||||
|
||||
if (patchi != -1)
|
||||
{
|
||||
@ -221,7 +221,7 @@ void deleteEmptyPatches(fvMesh& mesh)
|
||||
// Add all the non-empty, non-processor patches
|
||||
forAll(masterNames, masterI)
|
||||
{
|
||||
label patchi = patches.findPatchID(masterNames[masterI]);
|
||||
label patchi = patches.findIndex(masterNames[masterI]);
|
||||
|
||||
if (patchi != -1)
|
||||
{
|
||||
@ -976,7 +976,7 @@ labelList addExtrudeEdgeSidePatches
|
||||
{
|
||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||
|
||||
const label newPatchi = findPatchID
|
||||
const label newPatchi = findIndex
|
||||
(
|
||||
newPatches,
|
||||
patches[patches.whichPatch(facei)].name()
|
||||
@ -997,7 +997,7 @@ labelList addExtrudeEdgeSidePatches
|
||||
const word name =
|
||||
processorPolyPatch::newName(Pstream::myProcNo(), nbrProci);
|
||||
|
||||
extrudeEdgeSidePatches[edgeI] = findPatchID(newPatches, name);
|
||||
extrudeEdgeSidePatches[edgeI] = findIndex(newPatches, name);
|
||||
|
||||
if (extrudeEdgeSidePatches[edgeI] == -1)
|
||||
{
|
||||
@ -1661,7 +1661,7 @@ int main(int argc, char *argv[])
|
||||
if (facei != -1)
|
||||
{
|
||||
const label newPatchi =
|
||||
findPatchID
|
||||
findIndex
|
||||
(
|
||||
regionPatches,
|
||||
mesh.boundaryMesh()
|
||||
|
||||
@ -409,7 +409,7 @@ void extractSurface
|
||||
labelList patchToCompactZone(bMesh.size(), -1);
|
||||
forAllConstIter(HashTable<label>, compactZoneID, iter)
|
||||
{
|
||||
label patchi = bMesh.findPatchID(iter.key());
|
||||
label patchi = bMesh.findIndex(iter.key());
|
||||
if (patchi != -1)
|
||||
{
|
||||
patchToCompactZone[patchi] = iter();
|
||||
|
||||
@ -140,7 +140,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
patchName = "auto" + name(suffix++);
|
||||
}
|
||||
while (rMesh.findPatchID(patchName) != -1);
|
||||
while (rMesh.findIndex(patchName) != -1);
|
||||
|
||||
rMesh.addPatch(patchName);
|
||||
|
||||
|
||||
@ -528,7 +528,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
const word patchName(patchDict.lookup<word>("name"));
|
||||
|
||||
if (bMesh.findPatchID(patchName) == -1)
|
||||
if (bMesh.findIndex(patchName) == -1)
|
||||
{
|
||||
Info<< "Adding patch '" << patchName << "' to the mesh" << endl;
|
||||
|
||||
@ -626,7 +626,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
const word patchName(patchDict.lookup<word>("name"));
|
||||
|
||||
newPatchIDs[i] = bMesh.findPatchID(patchName);
|
||||
newPatchIDs[i] = bMesh.findIndex(patchName);
|
||||
}
|
||||
|
||||
const label nModified =
|
||||
@ -698,7 +698,7 @@ int main(int argc, char *argv[])
|
||||
fvMeshTools::setPatchFields
|
||||
(
|
||||
mesh,
|
||||
bMesh.findPatchID(patchName),
|
||||
bMesh.findIndex(patchName),
|
||||
patchFieldsDict
|
||||
);
|
||||
}
|
||||
|
||||
@ -545,7 +545,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
word patchName(dict.lookup("name"));
|
||||
|
||||
label destPatchi = patches.findPatchID(patchName);
|
||||
label destPatchi = patches.findIndex(patchName);
|
||||
|
||||
if (destPatchi == -1)
|
||||
{
|
||||
@ -620,7 +620,7 @@ int main(int argc, char *argv[])
|
||||
const dictionary& dict = patchSources[addedI];
|
||||
|
||||
const word patchName(dict.lookup("name"));
|
||||
label destPatchi = patches.findPatchID(patchName);
|
||||
label destPatchi = patches.findIndex(patchName);
|
||||
|
||||
if (destPatchi == -1)
|
||||
{
|
||||
|
||||
@ -175,7 +175,7 @@ label addCellZone(const polyMesh& mesh, const word& name)
|
||||
// Checks whether patch present
|
||||
void checkPatch(const polyBoundaryMesh& bMesh, const word& name)
|
||||
{
|
||||
const label patchi = bMesh.findPatchID(name);
|
||||
const label patchi = bMesh.findIndex(name);
|
||||
|
||||
if (patchi == -1)
|
||||
{
|
||||
|
||||
@ -253,7 +253,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
const word patchName = args["patch"];
|
||||
|
||||
patchi = mesh.boundaryMesh().findPatchID(patchName);
|
||||
patchi = mesh.boundaryMesh().findIndex(patchName);
|
||||
|
||||
if (patchi == -1)
|
||||
{
|
||||
|
||||
@ -113,7 +113,7 @@ void Foam::vtkPVFoam::convertPointFields
|
||||
{
|
||||
const word patchName = getPartName(partId);
|
||||
const label datasetNo = partDataset_[partId];
|
||||
const label patchId = patches.findPatchID(patchName);
|
||||
const label patchId = patches.findIndex(patchName);
|
||||
|
||||
if (!partStatus_[partId] || datasetNo < 0 || patchId < 0)
|
||||
{
|
||||
|
||||
@ -221,7 +221,7 @@ void Foam::vtkPVFoam::convertSurfaceFields
|
||||
{
|
||||
const word patchName = getPartName(partId);
|
||||
const label datasetNo = partDataset_[partId];
|
||||
const label patchId = mesh.boundaryMesh().findPatchID(patchName);
|
||||
const label patchId = mesh.boundaryMesh().findIndex(patchName);
|
||||
|
||||
if (!partStatus_[partId] || datasetNo < 0 || patchId < 0)
|
||||
{
|
||||
|
||||
@ -129,7 +129,7 @@ void Foam::vtkPVFoam::convertVolFields
|
||||
{
|
||||
const word patchName = getPartName(partId);
|
||||
const label datasetNo = partDataset_[partId];
|
||||
const label patchId = patches.findPatchID(patchName);
|
||||
const label patchId = patches.findIndex(patchName);
|
||||
|
||||
if (!partStatus_[partId] || datasetNo < 0 || patchId < 0)
|
||||
{
|
||||
|
||||
@ -230,7 +230,7 @@ int main(int argc, char *argv[])
|
||||
labelList faceZoneToCompactZone(bMesh.size(), -1);
|
||||
forAllConstIter(HashTable<label>, compactZoneID, iter)
|
||||
{
|
||||
label patchi = bMesh.findPatchID(iter.key());
|
||||
label patchi = bMesh.findIndex(iter.key());
|
||||
if (patchi != -1)
|
||||
{
|
||||
patchToCompactZone[patchi] = iter();
|
||||
|
||||
@ -46,7 +46,7 @@ using namespace Foam;
|
||||
// Adds empty patch if not yet there. Returns patchID.
|
||||
label addPatch(polyMesh& mesh, const word& patchName)
|
||||
{
|
||||
label patchi = mesh.boundaryMesh().findPatchID(patchName);
|
||||
label patchi = mesh.boundaryMesh().findIndex(patchName);
|
||||
|
||||
if (patchi == -1)
|
||||
{
|
||||
|
||||
@ -90,7 +90,7 @@ void Foam::LESModels::vanDriestDelta::calcDelta()
|
||||
fvPatchDistWave::calculateAndCorrect<WallLocationYPlus>
|
||||
(
|
||||
mesh,
|
||||
mesh.boundaryMesh().findPatchIDs<wallPolyPatch>(),
|
||||
mesh.boundaryMesh().findIndices<wallPolyPatch>(),
|
||||
minWallFaceFraction_,
|
||||
2, // <-- roughly equivalent to old point-cell corrections
|
||||
y,
|
||||
|
||||
@ -58,7 +58,7 @@ void Foam::GeometricBoundaryField<Type, PatchField, GeoMesh>::readField
|
||||
{
|
||||
if (iter().isDict() && !iter().keyword().isPattern())
|
||||
{
|
||||
label patchi = bmesh_.findPatchID(iter().keyword());
|
||||
label patchi = bmesh_.findIndex(iter().keyword());
|
||||
|
||||
if (patchi != -1)
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -60,9 +60,9 @@ Foam::pointBoundaryMesh::pointBoundaryMesh
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::label Foam::pointBoundaryMesh::findPatchID(const word& patchName) const
|
||||
Foam::label Foam::pointBoundaryMesh::findIndex(const word& patchName) const
|
||||
{
|
||||
return mesh()().boundaryMesh().findPatchID(patchName);
|
||||
return mesh()().boundaryMesh().findIndex(patchName);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -94,7 +94,7 @@ public:
|
||||
}
|
||||
|
||||
//- Find patch index given a name
|
||||
label findPatchID(const word& patchName) const;
|
||||
label findIndex(const word& patchName) const;
|
||||
|
||||
//- Find patch indices given a name
|
||||
labelList findIndices(const wordRe&, const bool useGroups) const;
|
||||
|
||||
@ -684,7 +684,7 @@ Foam::labelList Foam::polyBoundaryMesh::findIndices
|
||||
}
|
||||
|
||||
|
||||
Foam::label Foam::polyBoundaryMesh::findPatchID(const word& patchName) const
|
||||
Foam::label Foam::polyBoundaryMesh::findIndex(const word& patchName) const
|
||||
{
|
||||
const polyPatchList& patches = *this;
|
||||
|
||||
@ -699,7 +699,7 @@ Foam::label Foam::polyBoundaryMesh::findPatchID(const word& patchName) const
|
||||
// Patch not found
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "label polyBoundaryMesh::findPatchID(const word&) const"
|
||||
Pout<< "label polyBoundaryMesh::findIndex(const word&) const"
|
||||
<< "Patch named " << patchName << " not found. "
|
||||
<< "List of available patch names: " << names() << endl;
|
||||
}
|
||||
@ -1196,7 +1196,7 @@ const Foam::polyPatch& Foam::polyBoundaryMesh::operator[]
|
||||
const word& patchName
|
||||
) const
|
||||
{
|
||||
const label patchi = findPatchID(patchName);
|
||||
const label patchi = findIndex(patchName);
|
||||
|
||||
if (patchi < 0)
|
||||
{
|
||||
@ -1215,7 +1215,7 @@ Foam::polyPatch& Foam::polyBoundaryMesh::operator[]
|
||||
const word& patchName
|
||||
)
|
||||
{
|
||||
const label patchi = findPatchID(patchName);
|
||||
const label patchi = findIndex(patchName);
|
||||
|
||||
if (patchi < 0)
|
||||
{
|
||||
|
||||
@ -169,21 +169,12 @@ public:
|
||||
const bool usePatchGroups = true
|
||||
) const;
|
||||
|
||||
//- Return patch index for the first match, return -1 if not found
|
||||
label findIndex(const wordRe&) const = delete;
|
||||
|
||||
//- Find patch index given a name
|
||||
label findIndex(const word& patchName) const
|
||||
{
|
||||
return findPatchID(patchName);
|
||||
}
|
||||
|
||||
//- Find patch index given a name
|
||||
label findPatchID(const word& patchName) const;
|
||||
label findIndex(const word& patchName) const;
|
||||
|
||||
//- Find patch indices for a given polyPatch type
|
||||
template<class Type>
|
||||
labelHashSet findPatchIDs() const;
|
||||
labelHashSet findIndices() const;
|
||||
|
||||
//- Return patch index for a given face label
|
||||
label whichPatch(const label faceIndex) const;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2013-2018 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -26,7 +26,7 @@ License
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::labelHashSet Foam::polyBoundaryMesh::findPatchIDs() const
|
||||
Foam::labelHashSet Foam::polyBoundaryMesh::findIndices() const
|
||||
{
|
||||
const polyBoundaryMesh& bm = *this;
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -309,7 +309,7 @@ Foam::label Foam::cyclicPolyPatch::nbrPatchID() const
|
||||
{
|
||||
if (nbrPatchID_ == -1)
|
||||
{
|
||||
nbrPatchID_ = this->boundaryMesh().findPatchID(nbrPatchName());
|
||||
nbrPatchID_ = this->boundaryMesh().findIndex(nbrPatchName());
|
||||
|
||||
if (nbrPatchID_ == -1)
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -234,7 +234,7 @@ public:
|
||||
{
|
||||
if (referPatchID_ == -1)
|
||||
{
|
||||
referPatchID_ = this->boundaryMesh().findPatchID
|
||||
referPatchID_ = this->boundaryMesh().findIndex
|
||||
(
|
||||
referPatchName_
|
||||
);
|
||||
|
||||
@ -38,7 +38,7 @@ void Foam::flowRateInletVelocityFvPatchVectorField::setWallDist()
|
||||
{
|
||||
const labelHashSet otherPatchIDs
|
||||
(
|
||||
patch().patch().boundaryMesh().findPatchIDs<wallPolyPatch>()
|
||||
patch().patch().boundaryMesh().findIndices<wallPolyPatch>()
|
||||
);
|
||||
|
||||
const patchPatchDist pwd(patch().patch(), otherPatchIDs);
|
||||
|
||||
@ -170,7 +170,7 @@ void Foam::matchedFlowRateOutletVelocityFvPatchVectorField::updateCoeffs()
|
||||
|
||||
// Find corresponding inlet patch
|
||||
const label inletPatchID =
|
||||
patch().patch().boundaryMesh().findPatchID(inletPatchName_);
|
||||
patch().patch().boundaryMesh().findIndex(inletPatchName_);
|
||||
|
||||
if (inletPatchID < 0)
|
||||
{
|
||||
|
||||
@ -94,7 +94,7 @@ void Foam::outletMappedUniformInletFvPatchField<Type>::updateCoeffs()
|
||||
|
||||
const fvPatch& p = this->patch();
|
||||
label outletPatchID =
|
||||
p.patch().boundaryMesh().findPatchID(outletPatchName_);
|
||||
p.patch().boundaryMesh().findIndex(outletPatchName_);
|
||||
|
||||
if (outletPatchID < 0)
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -70,7 +70,7 @@ Foam::fvBoundaryMesh::fvBoundaryMesh
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::label Foam::fvBoundaryMesh::findPatchID(const word& patchName) const
|
||||
Foam::label Foam::fvBoundaryMesh::findIndex(const word& patchName) const
|
||||
{
|
||||
const fvPatchList& patches = *this;
|
||||
|
||||
@ -158,7 +158,7 @@ const Foam::fvPatch& Foam::fvBoundaryMesh::operator[]
|
||||
const word& patchName
|
||||
) const
|
||||
{
|
||||
const label patchi = findPatchID(patchName);
|
||||
const label patchi = findIndex(patchName);
|
||||
|
||||
if (patchi < 0)
|
||||
{
|
||||
@ -176,7 +176,7 @@ Foam::fvPatch& Foam::fvBoundaryMesh::operator[]
|
||||
const word& patchName
|
||||
)
|
||||
{
|
||||
const label patchi = findPatchID(patchName);
|
||||
const label patchi = findIndex(patchName);
|
||||
|
||||
if (patchi < 0)
|
||||
{
|
||||
|
||||
@ -107,7 +107,7 @@ public:
|
||||
lduInterfacePtrsList interfaces() const;
|
||||
|
||||
//- Find patch index given a name
|
||||
label findPatchID(const word& patchName) const;
|
||||
label findIndex(const word& patchName) const;
|
||||
|
||||
//- Find patch indices given a name
|
||||
labelList findIndices(const wordRe&, const bool useGroups) const;
|
||||
|
||||
@ -57,7 +57,7 @@ Foam::nearWallDist::nearWallDist(const Foam::fvMesh& mesh)
|
||||
fvPatchDistWave::correct
|
||||
(
|
||||
mesh,
|
||||
mesh.boundaryMesh().findPatchIDs<wallPolyPatch>(),
|
||||
mesh.boundaryMesh().findIndices<wallPolyPatch>(),
|
||||
-vGreat,
|
||||
2,
|
||||
yVf
|
||||
|
||||
@ -68,7 +68,7 @@ void Foam::wallDist::constructn() const
|
||||
Foam::wallDist::wallDist(const fvMesh& mesh, const word& patchTypeName)
|
||||
:
|
||||
DemandDrivenMeshObject<fvMesh, DeletableMeshObject, wallDist>(mesh),
|
||||
patchIDs_(mesh.boundaryMesh().findPatchIDs<wallPolyPatch>()),
|
||||
patchIDs_(mesh.boundaryMesh().findIndices<wallPolyPatch>()),
|
||||
patchTypeName_(patchTypeName),
|
||||
pdm_
|
||||
(
|
||||
|
||||
@ -174,7 +174,7 @@ void Foam::functionObjects::fieldValues::surfaceFieldValue::setFaceZoneFaces()
|
||||
|
||||
void Foam::functionObjects::fieldValues::surfaceFieldValue::setPatchFaces()
|
||||
{
|
||||
const label patchId = mesh_.boundaryMesh().findPatchID(selectionName_);
|
||||
const label patchId = mesh_.boundaryMesh().findIndex(selectionName_);
|
||||
|
||||
if (patchId < 0)
|
||||
{
|
||||
|
||||
@ -52,7 +52,7 @@ void Foam::fv::patchMeanVelocityForce::readCoeffs()
|
||||
{
|
||||
patch_ = coeffs().lookup<word>("patch");
|
||||
|
||||
if (mesh().boundaryMesh().findPatchID(patch_) < 0)
|
||||
if (mesh().boundaryMesh().findIndex(patch_) < 0)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Cannot find patch " << patch_
|
||||
@ -85,7 +85,7 @@ Foam::scalar Foam::fv::patchMeanVelocityForce::magUbarAve
|
||||
const volVectorField& U
|
||||
) const
|
||||
{
|
||||
const label patchi = mesh().boundaryMesh().findPatchID(patch_);
|
||||
const label patchi = mesh().boundaryMesh().findIndex(patch_);
|
||||
|
||||
scalar sumA = sum(mesh().boundary()[patchi].magSf());
|
||||
scalar sumAmagU =
|
||||
|
||||
@ -41,7 +41,7 @@ Foam::patchInjectionBase::patchInjectionBase
|
||||
)
|
||||
:
|
||||
patchName_(patchName),
|
||||
patchId_(mesh.boundaryMesh().findPatchID(patchName_)),
|
||||
patchId_(mesh.boundaryMesh().findIndex(patchName_)),
|
||||
sumProcArea_(),
|
||||
sumFaceArea_(),
|
||||
sumFaceTriArea_()
|
||||
|
||||
@ -568,7 +568,7 @@ Foam::polyMesh* Foam::blockMesh::createTopology
|
||||
if
|
||||
(
|
||||
!defaultPatchTypeSet
|
||||
&& blockMeshPtr->boundaryMesh().findPatchID(defaultPatchName) != -1
|
||||
&& blockMeshPtr->boundaryMesh().findIndex(defaultPatchName) != -1
|
||||
)
|
||||
{
|
||||
defaultPatchError(defaultPatchName, meshDescription);
|
||||
@ -616,7 +616,7 @@ Foam::polyMesh* Foam::blockMesh::createTopology
|
||||
if
|
||||
(
|
||||
!defaultPatchTypeSet
|
||||
&& blockMeshPtr->boundaryMesh().findPatchID(defaultPatchName) != -1
|
||||
&& blockMeshPtr->boundaryMesh().findIndex(defaultPatchName) != -1
|
||||
)
|
||||
{
|
||||
defaultPatchError(defaultPatchName, meshDescription);
|
||||
|
||||
@ -1993,13 +1993,13 @@ Foam::label Foam::meshRefinement::addMeshedPatch
|
||||
if (meshedI != -1)
|
||||
{
|
||||
// Already there. Get corresponding polypatch
|
||||
return pbm.findPatchID(name);
|
||||
return pbm.findIndex(name);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Add patch
|
||||
|
||||
label patchi = pbm.findPatchID(name);
|
||||
label patchi = pbm.findIndex(name);
|
||||
if (patchi == -1)
|
||||
{
|
||||
patchi = pbm.size();
|
||||
@ -2052,7 +2052,7 @@ Foam::labelList Foam::meshRefinement::meshedPatches() const
|
||||
DynamicList<label> patchIDs(meshedPatches_.size());
|
||||
forAll(meshedPatches_, i)
|
||||
{
|
||||
label patchi = patches.findPatchID(meshedPatches_[i]);
|
||||
label patchi = patches.findIndex(meshedPatches_[i]);
|
||||
|
||||
if (patchi == -1)
|
||||
{
|
||||
|
||||
@ -478,7 +478,7 @@ const Foam::polyPatch& Foam::mappedPatchBase::nbrPolyPatch() const
|
||||
{
|
||||
const polyMesh& nbrMesh = this->nbrMesh();
|
||||
|
||||
const label patchi = nbrMesh.boundaryMesh().findPatchID(nbrPatchName());
|
||||
const label patchi = nbrMesh.boundaryMesh().findIndex(nbrPatchName());
|
||||
|
||||
if (patchi == -1)
|
||||
{
|
||||
|
||||
@ -81,7 +81,7 @@ Foam::meshToMesh::meshToMesh
|
||||
)
|
||||
{
|
||||
const label tgtPatchi =
|
||||
tgtMesh_.boundaryMesh().findPatchID(srcPp.name());
|
||||
tgtMesh_.boundaryMesh().findIndex(srcPp.name());
|
||||
|
||||
if (tgtPatchi == -1)
|
||||
{
|
||||
@ -111,9 +111,9 @@ Foam::meshToMesh::meshToMesh
|
||||
const word& srcPatchName = iter();
|
||||
|
||||
const label srcPatchi =
|
||||
srcMesh_.boundaryMesh().findPatchID(srcPatchName);
|
||||
srcMesh_.boundaryMesh().findIndex(srcPatchName);
|
||||
const label tgtPatchi =
|
||||
tgtMesh_.boundaryMesh().findPatchID(tgtPatchName);
|
||||
tgtMesh_.boundaryMesh().findIndex(tgtPatchName);
|
||||
|
||||
if (srcPatchi == -1)
|
||||
{
|
||||
|
||||
@ -153,7 +153,7 @@ Foam::label Foam::nonConformalPolyPatch::origPatchID() const
|
||||
{
|
||||
if (origPatchID_ == -1)
|
||||
{
|
||||
origPatchID_ = patch_.boundaryMesh().findPatchID(origPatchName());
|
||||
origPatchID_ = patch_.boundaryMesh().findIndex(origPatchName());
|
||||
|
||||
if (origPatchID_ == -1)
|
||||
{
|
||||
|
||||
@ -258,7 +258,7 @@ Foam::displacementLayeredMotionMotionSolver::faceZoneEvaluate
|
||||
// Reads name of name of patch. Then get average point displacement on
|
||||
// patch. That becomes the value of fld.
|
||||
const word patchName(dict.lookup("patch"));
|
||||
label patchID = mesh().boundaryMesh().findPatchID(patchName);
|
||||
label patchID = mesh().boundaryMesh().findIndex(patchName);
|
||||
pointField pdf
|
||||
(
|
||||
pointDisplacement_.boundaryField()[patchID].patchInternalField()
|
||||
|
||||
@ -77,9 +77,9 @@ Foam::domainDecomposition::determineCoupledFaces
|
||||
);
|
||||
|
||||
const label masterToAddID =
|
||||
masterPatches.findPatchID(masterToAddName);
|
||||
masterPatches.findIndex(masterToAddName);
|
||||
const label addToMasterID =
|
||||
addPatches.findPatchID(addToMasterName);
|
||||
addPatches.findIndex(addToMasterName);
|
||||
|
||||
if (masterToAddID != -1 && addToMasterID != -1)
|
||||
{
|
||||
@ -297,7 +297,7 @@ void Foam::domainDecomposition::reconstruct()
|
||||
const polyBoundaryMesh& patches = masterMeshes[0].boundaryMesh();
|
||||
|
||||
// Move all faces of processor cyclic patches into the associated cyclics
|
||||
if (!patches.findPatchIDs<processorCyclicPolyPatch>().empty())
|
||||
if (!patches.findIndices<processorCyclicPolyPatch>().empty())
|
||||
{
|
||||
// Determine what patches are to be combined into each patch
|
||||
List<DynamicList<label>> patchPatches
|
||||
|
||||
@ -510,7 +510,7 @@ void Foam::fvMeshSubset::setCellSubset
|
||||
{
|
||||
// No explicit patch specified. Put in oldInternalFaces patch.
|
||||
// Check if patch with this name already exists.
|
||||
wantedPatchID = oldPatches.findPatchID("oldInternalFaces");
|
||||
wantedPatchID = oldPatches.findIndex("oldInternalFaces");
|
||||
}
|
||||
else if (wantedPatchID < 0 || wantedPatchID >= oldPatches.size())
|
||||
{
|
||||
@ -925,7 +925,7 @@ void Foam::fvMeshSubset::setLargeCellSubset
|
||||
{
|
||||
// No explicit patch specified. Put in oldInternalFaces patch.
|
||||
// Check if patch with this name already exists.
|
||||
wantedPatchID = oldPatches.findPatchID("oldInternalFaces");
|
||||
wantedPatchID = oldPatches.findIndex("oldInternalFaces");
|
||||
}
|
||||
else if (wantedPatchID < 0 || wantedPatchID >= oldPatches.size())
|
||||
{
|
||||
|
||||
@ -42,7 +42,7 @@ Foam::label Foam::fvMeshTools::addPatch
|
||||
polyBoundaryMesh& polyPatches =
|
||||
const_cast<polyBoundaryMesh&>(mesh.boundaryMesh());
|
||||
|
||||
label patchi = polyPatches.findPatchID(patch.name());
|
||||
label patchi = polyPatches.findIndex(patch.name());
|
||||
if (patchi != -1)
|
||||
{
|
||||
// Already there
|
||||
|
||||
@ -352,7 +352,7 @@ Foam::directions::directions
|
||||
|
||||
const word patchName(patchDict.lookup("patch"));
|
||||
|
||||
const label patchi = mesh.boundaryMesh().findPatchID(patchName);
|
||||
const label patchi = mesh.boundaryMesh().findIndex(patchName);
|
||||
|
||||
if (patchi == -1)
|
||||
{
|
||||
|
||||
@ -1124,7 +1124,7 @@ Foam::label Foam::repatchMesh::whichPatch(const label facei) const
|
||||
}
|
||||
|
||||
|
||||
Foam::label Foam::repatchMesh::findPatchID(const word& patchName) const
|
||||
Foam::label Foam::repatchMesh::findIndex(const word& patchName) const
|
||||
{
|
||||
forAll(patches_, patchi)
|
||||
{
|
||||
@ -1177,7 +1177,7 @@ void Foam::repatchMesh::addPatch(const word& patchName)
|
||||
|
||||
void Foam::repatchMesh::deletePatch(const word& patchName)
|
||||
{
|
||||
const label delPatchi = findPatchID(patchName);
|
||||
const label delPatchi = findIndex(patchName);
|
||||
|
||||
if (delPatchi == -1)
|
||||
{
|
||||
@ -1236,7 +1236,7 @@ void Foam::repatchMesh::changePatchType
|
||||
const word& patchType
|
||||
)
|
||||
{
|
||||
const label changeI = findPatchID(patchName);
|
||||
const label changeI = findIndex(patchName);
|
||||
|
||||
if (changeI == -1)
|
||||
{
|
||||
|
||||
@ -256,7 +256,7 @@ public:
|
||||
label whichPatch(const label facei) const;
|
||||
|
||||
//- Get index of patch by name
|
||||
label findPatchID(const word& patchName) const;
|
||||
label findIndex(const word& patchName) const;
|
||||
|
||||
//- Add to back of patch list.
|
||||
void addPatch(const word& patchName);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -54,7 +54,7 @@ void Foam::patchProbes::findElements(const fvMesh& mesh)
|
||||
|
||||
const polyBoundaryMesh& bm = mesh.boundaryMesh();
|
||||
|
||||
label patchi = bm.findPatchID(patchName_);
|
||||
label patchi = bm.findIndex(patchName_);
|
||||
|
||||
if (patchi == -1)
|
||||
{
|
||||
|
||||
@ -171,7 +171,7 @@ int main(int argc, char *argv[])
|
||||
// Remove the added patch
|
||||
if (newPatchName.size())
|
||||
{
|
||||
label removei = pbm.findPatchID(newPatchName);
|
||||
label removei = pbm.findIndex(newPatchName);
|
||||
if (removei == -1)
|
||||
{
|
||||
FatalErrorInFunction << "Problem" << exit(FatalError);
|
||||
|
||||
@ -66,7 +66,7 @@ int main(int argc, char *argv[])
|
||||
const scalar h = mesh.bounds().span().y();
|
||||
Info<< "Height from centreline to wall = " << h << endl;
|
||||
|
||||
const label centrelineID = mesh.boundary().findPatchID("centreline");
|
||||
const label centrelineID = mesh.boundary().findIndex("centreline");
|
||||
const vector patchToCell =
|
||||
mesh.boundary()[centrelineID].Cf()[0]
|
||||
- mesh.C()[mesh.findNearestCell(location)];
|
||||
|
||||
@ -67,7 +67,7 @@ functions
|
||||
Info<< "Reading inlet velocity uInfX\n" << endl;
|
||||
|
||||
scalar ULeft = 0.0;
|
||||
label leftI = mesh().boundaryMesh().findPatchID("left");
|
||||
label leftI = mesh().boundaryMesh().findIndex("left");
|
||||
const fvPatchVectorField& fvp = U.boundaryField()[leftI];
|
||||
if (fvp.size())
|
||||
{
|
||||
@ -86,7 +86,7 @@ functions
|
||||
|
||||
|
||||
scalar magCylinder = 0.0;
|
||||
label cylI = mesh().boundaryMesh().findPatchID("cylinder");
|
||||
label cylI = mesh().boundaryMesh().findIndex("cylinder");
|
||||
const fvPatchVectorField& cylFvp = mesh().C().boundaryField()[cylI];
|
||||
if (cylFvp.size())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user