Renamed IDs() -> Indices()

Indices is a better name to describe label indices than IDs which may be an
integers, words or other means of identification.
This commit is contained in:
Henry Weller
2023-12-20 14:29:23 +00:00
parent 2057174b55
commit a99155d0f0
70 changed files with 328 additions and 320 deletions

View File

@ -56,7 +56,7 @@ bool Foam::solvers::isothermalFilm::initFilmMesh()
// Search for film wall patches // Search for film wall patches
label nWallFaces = 0; label nWallFaces = 0;
DynamicList<label> wallPatchIDs_; DynamicList<label> wallPatchIndices_;
const polyBoundaryMesh& bm = mesh.boundaryMesh(); const polyBoundaryMesh& bm = mesh.boundaryMesh();
@ -66,7 +66,7 @@ bool Foam::solvers::isothermalFilm::initFilmMesh()
if (isA<filmWallPolyPatch>(p)) if (isA<filmWallPolyPatch>(p))
{ {
wallPatchIDs_.append(patchi); wallPatchIndices_.append(patchi);
nWallFaces += p.faceCells().size(); nWallFaces += p.faceCells().size();
} }
} }
@ -88,7 +88,7 @@ bool Foam::solvers::isothermalFilm::initFilmMesh()
<< exit(FatalError); << exit(FatalError);
} }
wallPatchIDs.transfer(wallPatchIDs_); wallPatchIDs.transfer(wallPatchIndices_);
// Search for film surface patch // Search for film surface patch

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -94,16 +94,16 @@ bool Foam::starMesh::starEqualFace
void Foam::starMesh::markBoundaryFaces() void Foam::starMesh::markBoundaryFaces()
{ {
// set size of mark lists for the boundary // set size of mark lists for the boundary
boundaryCellIDs_.setSize(boundary_.size()); boundaryCellIndices_.setSize(boundary_.size());
boundaryCellFaceIDs_.setSize(boundary_.size()); boundaryCellFaceIndices_.setSize(boundary_.size());
forAll(boundary_, patchi) forAll(boundary_, patchi)
{ {
const faceList& patchFaces = boundary_[patchi]; const faceList& patchFaces = boundary_[patchi];
// set size of patch lists // set size of patch lists
labelList& curBoundaryCellIDs = boundaryCellIDs_[patchi]; labelList& curBoundaryCellIDs = boundaryCellIndices_[patchi];
labelList& curBoundaryCellFaceIDs = boundaryCellFaceIDs_[patchi]; labelList& curBoundaryCellFaceIDs = boundaryCellFaceIndices_[patchi];
curBoundaryCellIDs.setSize(patchFaces.size()); curBoundaryCellIDs.setSize(patchFaces.size());
curBoundaryCellFaceIDs.setSize(patchFaces.size()); curBoundaryCellFaceIDs.setSize(patchFaces.size());
@ -183,8 +183,9 @@ void Foam::starMesh::collectBoundaryFaces()
faceList& patchFaces = boundary_[patchi]; faceList& patchFaces = boundary_[patchi];
// set size of patch lists // set size of patch lists
const labelList& curBoundaryCellIDs = boundaryCellIDs_[patchi]; const labelList& curBoundaryCellIDs = boundaryCellIndices_[patchi];
const labelList& curBoundaryCellFaceIDs = boundaryCellFaceIDs_[patchi]; const labelList& curBoundaryCellFaceIDs =
boundaryCellFaceIndices_[patchi];
forAll(curBoundaryCellIDs, facei) forAll(curBoundaryCellIDs, facei)
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -216,8 +216,8 @@ void Foam::starMesh::clearExtraStorage()
starCellLabelLookup_.setSize(0); starCellLabelLookup_.setSize(0);
starCellPermutation_.setSize(0); starCellPermutation_.setSize(0);
cellFaces_.setSize(0); cellFaces_.setSize(0);
boundaryCellIDs_.setSize(0); boundaryCellIndices_.setSize(0);
boundaryCellFaceIDs_.setSize(0); boundaryCellFaceIndices_.setSize(0);
couples_.clear(); couples_.clear();
deleteDemandDrivenData(pointCellsPtr_); deleteDemandDrivenData(pointCellsPtr_);
@ -249,8 +249,8 @@ Foam::starMesh::starMesh
starCellLabelLookup_(0), starCellLabelLookup_(0),
starCellPermutation_(0), starCellPermutation_(0),
cellFaces_(0), cellFaces_(0),
boundaryCellIDs_(0), boundaryCellIndices_(0),
boundaryCellFaceIDs_(0), boundaryCellFaceIndices_(0),
meshFaces_(0), meshFaces_(0),
cellPolys_(0), cellPolys_(0),
nInternalFaces_(0), nInternalFaces_(0),

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -119,11 +119,11 @@ class starMesh
//- Cell ID for every boundary face. Used in two-tier boundary //- Cell ID for every boundary face. Used in two-tier boundary
// reconstruction // reconstruction
labelListList boundaryCellIDs_; labelListList boundaryCellIndices_;
//- Cell face ID for every boundary face. Used in two-tier boundary //- Cell face ID for every boundary face. Used in two-tier boundary
// reconstruction // reconstruction
labelListList boundaryCellFaceIDs_; labelListList boundaryCellFaceIndices_;
//- Global face list for polyMesh //- Global face list for polyMesh
faceList meshFaces_; faceList meshFaces_;

View File

@ -761,7 +761,7 @@ int main(int argc, char *argv[])
); );
// Write cellID field // Write cellID field
writer.writeCellIDs(); writer.writeCellIndices();
// Write volFields::Internal // Write volFields::Internal
writer.write(visf); writer.write(visf);
@ -930,7 +930,7 @@ int main(int argc, char *argv[])
); );
// Write patchID field // Write patchID field
writer.writePatchIDs(); writer.writePatchIndices();
// Write volFields // Write volFields
writer.write(vsf); writer.write(vsf);
@ -1003,7 +1003,7 @@ int main(int argc, char *argv[])
); );
// Write patchID field // Write patchID field
writer.writePatchIDs(); writer.writePatchIndices();
// Write volFields // Write volFields
writer.write(vsf); writer.write(vsf);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -115,7 +115,7 @@ Foam::internalWriter::internalWriter
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::internalWriter::writeCellIDs() void Foam::internalWriter::writeCellIndices()
{ {
const fvMesh& mesh = vMesh_.mesh(); const fvMesh& mesh = vMesh_.mesh();
const vtkTopo& topo = vMesh_.topo(); const vtkTopo& topo = vMesh_.topo();

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -86,7 +86,7 @@ public:
} }
//- Write cellIDs //- Write cellIDs
void writeCellIDs(); void writeCellIndices();
//- Write generic GeometricFields //- Write generic GeometricFields
template<class Type, class GeoMesh> template<class Type, class GeoMesh>

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -41,16 +41,20 @@ Foam::patchWriter::patchWriter
binary_(binary), binary_(binary),
nearCellValue_(nearCellValue), nearCellValue_(nearCellValue),
fName_(fName), fName_(fName),
patchIDs_(patchIDs), patchIndices_(patchIDs),
os_(fName.c_str()) os_(fName.c_str())
{ {
const fvMesh& mesh = vMesh_.mesh(); const fvMesh& mesh = vMesh_.mesh();
const polyBoundaryMesh& patches = mesh.boundaryMesh(); const polyBoundaryMesh& patches = mesh.boundaryMesh();
// Write header // Write header
if (patchIDs_.size() == 1) if (patchIndices_.size() == 1)
{ {
vtkWriteOps::writeHeader(os_, binary_, patches[patchIDs_[0]].name()); vtkWriteOps::writeHeader
(
os_,
binary_, patches[patchIndices_[0]].name()
);
} }
else else
{ {
@ -63,9 +67,9 @@ Foam::patchWriter::patchWriter
nFaces_ = 0; nFaces_ = 0;
label nFaceVerts = 0; label nFaceVerts = 0;
forAll(patchIDs_, i) forAll(patchIndices_, i)
{ {
const polyPatch& pp = patches[patchIDs_[i]]; const polyPatch& pp = patches[patchIndices_[i]];
nPoints_ += pp.nPoints(); nPoints_ += pp.nPoints();
nFaces_ += pp.size(); nFaces_ += pp.size();
@ -80,9 +84,9 @@ Foam::patchWriter::patchWriter
DynamicList<floatScalar> ptField(3*nPoints_); DynamicList<floatScalar> ptField(3*nPoints_);
forAll(patchIDs_, i) forAll(patchIndices_, i)
{ {
const polyPatch& pp = patches[patchIDs_[i]]; const polyPatch& pp = patches[patchIndices_[i]];
vtkWriteOps::insert(pp.localPoints(), ptField); vtkWriteOps::insert(pp.localPoints(), ptField);
} }
@ -94,9 +98,9 @@ Foam::patchWriter::patchWriter
label offset = 0; label offset = 0;
forAll(patchIDs_, i) forAll(patchIndices_, i)
{ {
const polyPatch& pp = patches[patchIDs_[i]]; const polyPatch& pp = patches[patchIndices_[i]];
forAll(pp, facei) forAll(pp, facei)
{ {
@ -113,7 +117,7 @@ Foam::patchWriter::patchWriter
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::patchWriter::writePatchIDs() void Foam::patchWriter::writePatchIndices()
{ {
const fvMesh& mesh = vMesh_.mesh(); const fvMesh& mesh = vMesh_.mesh();
@ -121,9 +125,9 @@ void Foam::patchWriter::writePatchIDs()
os_ << "patchID 1 " << nFaces_ << " float" << std::endl; os_ << "patchID 1 " << nFaces_ << " float" << std::endl;
forAll(patchIDs_, i) forAll(patchIndices_, i)
{ {
label patchi = patchIDs_[i]; label patchi = patchIndices_[i];
const polyPatch& pp = mesh.boundaryMesh()[patchi]; const polyPatch& pp = mesh.boundaryMesh()[patchi];

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -67,7 +67,7 @@ class patchWriter
const fileName fName_; const fileName fName_;
const labelList patchIDs_; const labelList patchIndices_;
std::ofstream os_; std::ofstream os_;
@ -108,7 +108,7 @@ public:
} }
//- Write cellIDs //- Write cellIDs
void writePatchIDs(); void writePatchIndices();
//- Write volFields //- Write volFields
template<class Type> template<class Type>

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -43,9 +43,9 @@ void Foam::patchWriter::write
DynamicList<floatScalar> fField(pTraits<Type>::nComponents*nFaces_); DynamicList<floatScalar> fField(pTraits<Type>::nComponents*nFaces_);
forAll(patchIDs_, j) forAll(patchIndices_, j)
{ {
label patchi = patchIDs_[j]; label patchi = patchIndices_[j];
const fvPatchField<Type>& pfld = fld.boundaryField()[patchi]; const fvPatchField<Type>& pfld = fld.boundaryField()[patchi];
@ -79,9 +79,9 @@ void Foam::patchWriter::write
DynamicList<floatScalar> fField(pTraits<Type>::nComponents*nPoints_); DynamicList<floatScalar> fField(pTraits<Type>::nComponents*nPoints_);
forAll(patchIDs_, j) forAll(patchIndices_, j)
{ {
label patchi = patchIDs_[j]; label patchi = patchIndices_[j];
const pointPatchField<Type>& pfld = fld.boundaryField()[patchi]; const pointPatchField<Type>& pfld = fld.boundaryField()[patchi];
@ -108,9 +108,9 @@ void Foam::patchWriter::write
DynamicList<floatScalar> fField(pTraits<Type>::nComponents*nPoints_); DynamicList<floatScalar> fField(pTraits<Type>::nComponents*nPoints_);
forAll(patchIDs_, j) forAll(patchIndices_, j)
{ {
label patchi = patchIDs_[j]; label patchi = patchIndices_[j];
const fvPatchField<Type>& pfld = fld.boundaryField()[patchi]; const fvPatchField<Type>& pfld = fld.boundaryField()[patchi];

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2016-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2016-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -175,7 +175,7 @@ bool Foam::functionObjects::writeVTK::write()
); );
// Write cellID field // Write cellID field
writer.writeCellIDs(); writer.writeCellIndices();
// Write volFields // Write volFields
#define WriteTypeFields(Type, nullArg) \ #define WriteTypeFields(Type, nullArg) \

View File

@ -262,7 +262,7 @@ Foam::label Foam::UPstream::allocateCommunicator
index = parentCommunicator_.size(); index = parentCommunicator_.size();
myProcNo_.append(-1); myProcNo_.append(-1);
procIDs_.append(List<int>(0)); procIndices_.append(List<int>(0));
parentCommunicator_.append(-1); parentCommunicator_.append(-1);
linearCommunication_.append(List<commsStruct>(0)); linearCommunication_.append(List<commsStruct>(0));
treeCommunication_.append(List<commsStruct>(0)); treeCommunication_.append(List<commsStruct>(0));
@ -280,10 +280,10 @@ Foam::label Foam::UPstream::allocateCommunicator
myProcNo_[index] = 0; myProcNo_[index] = 0;
// Convert from label to int // Convert from label to int
procIDs_[index].setSize(subRanks.size()); procIndices_[index].setSize(subRanks.size());
forAll(procIDs_[index], i) forAll(procIndices_[index], i)
{ {
procIDs_[index][i] = subRanks[i]; procIndices_[index][i] = subRanks[i];
// Enforce incremental order (so index is rank in next communicator) // Enforce incremental order (so index is rank in next communicator)
if (i >= 1 && subRanks[i] <= subRanks[i-1]) if (i >= 1 && subRanks[i] <= subRanks[i-1])
@ -297,8 +297,8 @@ Foam::label Foam::UPstream::allocateCommunicator
} }
parentCommunicator_[index] = parentIndex; parentCommunicator_[index] = parentIndex;
linearCommunication_[index] = calcLinearComm(procIDs_[index].size()); linearCommunication_[index] = calcLinearComm(procIndices_[index].size());
treeCommunication_[index] = calcTreeComm(procIDs_[index].size()); treeCommunication_[index] = calcTreeComm(procIndices_[index].size());
if (doPstream && parRun()) if (doPstream && parRun())
@ -329,7 +329,7 @@ void Foam::UPstream::freeCommunicator
freePstreamCommunicator(communicator); freePstreamCommunicator(communicator);
} }
myProcNo_[communicator] = -1; myProcNo_[communicator] = -1;
// procIDs_[communicator].clear(); // procIndices_[communicator].clear();
parentCommunicator_[communicator] = -1; parentCommunicator_[communicator] = -1;
linearCommunication_[communicator].clear(); linearCommunication_[communicator].clear();
treeCommunication_[communicator].clear(); treeCommunication_[communicator].clear();
@ -405,7 +405,7 @@ Foam::LIFOStack<Foam::label> Foam::UPstream::freeComms_;
Foam::DynamicList<int> Foam::UPstream::myProcNo_(10); Foam::DynamicList<int> Foam::UPstream::myProcNo_(10);
Foam::DynamicList<Foam::List<int>> Foam::UPstream::procIDs_(10); Foam::DynamicList<Foam::List<int>> Foam::UPstream::procIndices_(10);
Foam::DynamicList<Foam::label> Foam::UPstream::parentCommunicator_(10); Foam::DynamicList<Foam::label> Foam::UPstream::parentCommunicator_(10);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -199,7 +199,7 @@ private:
static DynamicList<int> myProcNo_; static DynamicList<int> myProcNo_;
//- List of process IDs //- List of process IDs
static DynamicList<List<int>> procIDs_; static DynamicList<List<int>> procIndices_;
//- Parent communicator //- Parent communicator
static DynamicList<label> parentCommunicator_; static DynamicList<label> parentCommunicator_;
@ -411,7 +411,7 @@ public:
//- Number of processes in parallel run //- Number of processes in parallel run
static label nProcs(const label communicator = 0) static label nProcs(const label communicator = 0)
{ {
return procIDs_[communicator].size(); return procIndices_[communicator].size();
} }
//- Process index of the master //- Process index of the master
@ -440,7 +440,7 @@ public:
//- Process ID of given process index //- Process ID of given process index
static List<int>& procID(label communicator) static List<int>& procID(label communicator)
{ {
return procIDs_[communicator]; return procIndices_[communicator];
} }
//- Process index of first slave //- Process index of first slave

View File

@ -367,7 +367,7 @@ void Foam::GAMGAgglomeration::procAgglomerateLduAddressing
procAgglomMap_.set(levelIndex, new labelList(procAgglomMap)); procAgglomMap_.set(levelIndex, new labelList(procAgglomMap));
agglomProcIDs_.set(levelIndex, new labelList(procIDs)); agglomProcIndices_.set(levelIndex, new labelList(procIDs));
procCommunicator_[levelIndex] = allMeshComm; procCommunicator_[levelIndex] = allMeshComm;
// These could only be set on the master procs but it is // These could only be set on the master procs but it is

View File

@ -61,7 +61,7 @@ void Foam::GAMGAgglomeration::compactLevels(const label nCreatedLevels)
if (processorAgglomerate()) if (processorAgglomerate())
{ {
procAgglomMap_.setSize(nCreatedLevels); procAgglomMap_.setSize(nCreatedLevels);
agglomProcIDs_.setSize(nCreatedLevels); agglomProcIndices_.setSize(nCreatedLevels);
procCellOffsets_.setSize(nCreatedLevels); procCellOffsets_.setSize(nCreatedLevels);
procFaceMap_.setSize(nCreatedLevels); procFaceMap_.setSize(nCreatedLevels);
procBoundaryMap_.setSize(nCreatedLevels); procBoundaryMap_.setSize(nCreatedLevels);
@ -274,7 +274,7 @@ Foam::GAMGAgglomeration::GAMGAgglomeration
if (processorAgglomerate()) if (processorAgglomerate())
{ {
procAgglomMap_.setSize(maxLevels_); procAgglomMap_.setSize(maxLevels_);
agglomProcIDs_.setSize(maxLevels_); agglomProcIndices_.setSize(maxLevels_);
procCellOffsets_.setSize(maxLevels_); procCellOffsets_.setSize(maxLevels_);
procFaceMap_.setSize(maxLevels_); procFaceMap_.setSize(maxLevels_);
procBoundaryMap_.setSize(maxLevels_); procBoundaryMap_.setSize(maxLevels_);
@ -523,7 +523,7 @@ const Foam::labelList& Foam::GAMGAgglomeration::agglomProcIDs
const label leveli const label leveli
) const ) const
{ {
return agglomProcIDs_[leveli]; return agglomProcIndices_[leveli];
} }

View File

@ -127,7 +127,7 @@ protected:
//- Per level the set of processors to agglomerate. Element 0 is //- Per level the set of processors to agglomerate. Element 0 is
// the 'master' of the cluster. // the 'master' of the cluster.
mutable PtrList<labelList> agglomProcIDs_; mutable PtrList<labelList> agglomProcIndices_;
//- Communicator for given level //- Communicator for given level
mutable labelList procCommunicator_; mutable labelList procCommunicator_;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -103,7 +103,7 @@ void Foam::GAMGProcAgglomeration::printStats
<< nl << nl
<< " procAgglomMap:" << agglom.procAgglomMap_[levelI] << " procAgglomMap:" << agglom.procAgglomMap_[levelI]
<< nl << nl
<< " procIDs:" << agglom.agglomProcIDs_[levelI] << " procIDs:" << agglom.agglomProcIndices_[levelI]
<< nl << nl
<< " comm:" << agglom.procCommunicator_[levelI] << " comm:" << agglom.procCommunicator_[levelI]
<< endl; << endl;

View File

@ -615,11 +615,11 @@ void Foam::UPstream::allocatePstreamCommunicator
int numProcs; int numProcs;
MPI_Comm_size(PstreamGlobals::MPICommunicators_[index], &numProcs); MPI_Comm_size(PstreamGlobals::MPICommunicators_[index], &numProcs);
// procIDs_[index] = identityMap(numProcs); // procIndices_[index] = identityMap(numProcs);
procIDs_[index].setSize(numProcs); procIndices_[index].setSize(numProcs);
forAll(procIDs_[index], i) forAll(procIndices_[index], i)
{ {
procIDs_[index][i] = i; procIndices_[index][i] = i;
} }
} }
else else
@ -628,8 +628,8 @@ void Foam::UPstream::allocatePstreamCommunicator
MPI_Group_incl MPI_Group_incl
( (
PstreamGlobals::MPIGroups_[parentIndex], PstreamGlobals::MPIGroups_[parentIndex],
procIDs_[index].size(), procIndices_[index].size(),
procIDs_[index].begin(), procIndices_[index].begin(),
&PstreamGlobals::MPIGroups_[index] &PstreamGlobals::MPIGroups_[index]
); );
@ -659,7 +659,7 @@ void Foam::UPstream::allocatePstreamCommunicator
FatalErrorInFunction FatalErrorInFunction
<< "Problem :" << "Problem :"
<< " when allocating communicator at " << index << " when allocating communicator at " << index
<< " from ranks " << procIDs_[index] << " from ranks " << procIndices_[index]
<< " of parent " << parentIndex << " of parent " << parentIndex
<< " cannot find my own rank" << " cannot find my own rank"
<< Foam::exit(FatalError); << Foam::exit(FatalError);

View File

@ -249,9 +249,9 @@ void Foam::externalCoupledMixedFvPatchField<Type>::startWait() const
const typename VolField<Type>::Boundary& bf = const typename VolField<Type>::Boundary& bf =
cvf.boundaryField(); cvf.boundaryField();
forAll(coupledPatchIDs_, i) forAll(coupledPatchIndices_, i)
{ {
label patchi = coupledPatchIDs_[i]; label patchi = coupledPatchIndices_[i];
const externalCoupledMixedFvPatchField<Type>& pf = const externalCoupledMixedFvPatchField<Type>& pf =
refCast<const externalCoupledMixedFvPatchField<Type>>(bf[patchi]); refCast<const externalCoupledMixedFvPatchField<Type>>(bf[patchi]);
@ -414,9 +414,9 @@ void Foam::externalCoupledMixedFvPatchField<Type>::writeData
const typename VolField<Type>::Boundary& bf = const typename VolField<Type>::Boundary& bf =
cvf.boundaryField(); cvf.boundaryField();
forAll(coupledPatchIDs_, i) forAll(coupledPatchIndices_, i)
{ {
label patchi = coupledPatchIDs_[i]; label patchi = coupledPatchIndices_[i];
const externalCoupledMixedFvPatchField<Type>& pf = const externalCoupledMixedFvPatchField<Type>& pf =
refCast<const externalCoupledMixedFvPatchField<Type>>(bf[patchi]); refCast<const externalCoupledMixedFvPatchField<Type>>(bf[patchi]);
@ -458,7 +458,7 @@ externalCoupledMixedFvPatchField
master_(true), master_(true),
offsets_(), offsets_(),
initialised_(false), initialised_(false),
coupledPatchIDs_() coupledPatchIndices_()
{ {
if (dict.found("value")) if (dict.found("value"))
{ {
@ -512,7 +512,7 @@ externalCoupledMixedFvPatchField
master_(ptf.master_), master_(ptf.master_),
offsets_(ptf.offsets_), offsets_(ptf.offsets_),
initialised_(ptf.initialised_), initialised_(ptf.initialised_),
coupledPatchIDs_(ptf.coupledPatchIDs_) coupledPatchIndices_(ptf.coupledPatchIndices_)
{} {}
@ -535,7 +535,7 @@ externalCoupledMixedFvPatchField
master_(ecmpf.master_), master_(ecmpf.master_),
offsets_(ecmpf.offsets_), offsets_(ecmpf.offsets_),
initialised_(ecmpf.initialised_), initialised_(ecmpf.initialised_),
coupledPatchIDs_(ecmpf.coupledPatchIDs_) coupledPatchIndices_(ecmpf.coupledPatchIndices_)
{} {}
@ -580,7 +580,7 @@ void Foam::externalCoupledMixedFvPatchField<Type>::initialise
} }
} }
coupledPatchIDs_.transfer(coupledPatchIDs); coupledPatchIndices_.transfer(coupledPatchIDs);
// initialise by external solver, or just set the master patch // initialise by external solver, or just set the master patch
@ -589,14 +589,14 @@ void Foam::externalCoupledMixedFvPatchField<Type>::initialise
// remove lock file, signalling external source to execute // remove lock file, signalling external source to execute
// removeLockFile(); // removeLockFile();
forAll(coupledPatchIDs_, i) forAll(coupledPatchIndices_, i)
{ {
label patchi = coupledPatchIDs_[i]; label patchi = coupledPatchIndices_[i];
externalCoupledMixedFvPatchField<Type>& pf = externalCoupledMixedFvPatchField<Type>& pf =
refCast<externalCoupledMixedFvPatchField<Type>>(bf[patchi]); refCast<externalCoupledMixedFvPatchField<Type>>(bf[patchi]);
pf.setMaster(coupledPatchIDs_); pf.setMaster(coupledPatchIndices_);
} }
@ -606,9 +606,9 @@ void Foam::externalCoupledMixedFvPatchField<Type>::initialise
// read the initial data // read the initial data
if (master_) if (master_)
{ {
forAll(coupledPatchIDs_, i) forAll(coupledPatchIndices_, i)
{ {
label patchi = coupledPatchIDs_[i]; label patchi = coupledPatchIndices_[i];
externalCoupledMixedFvPatchField<Type>& pf = externalCoupledMixedFvPatchField<Type>& pf =
refCast<externalCoupledMixedFvPatchField<Type>>(bf[patchi]); refCast<externalCoupledMixedFvPatchField<Type>>(bf[patchi]);
@ -619,7 +619,7 @@ void Foam::externalCoupledMixedFvPatchField<Type>::initialise
} }
else else
{ {
setMaster(coupledPatchIDs_); setMaster(coupledPatchIndices_);
} }
initialised_ = true; initialised_ = true;

View File

@ -168,7 +168,7 @@ class externalCoupledMixedFvPatchField
bool initialised_; bool initialised_;
//- List of coupled patch IDs //- List of coupled patch IDs
List<label> coupledPatchIDs_; List<label> coupledPatchIndices_;
// Private Member Functions // Private Member Functions

View File

@ -60,7 +60,7 @@ void Foam::conformedFvsPatchField<Type>::conform
const fvBoundaryMesh& fvbm = iF.mesh().boundary(); const fvBoundaryMesh& fvbm = iF.mesh().boundary();
const labelList origPatchIDs = const labelList origPatchIDs =
nonConformalBoundary::New(iF.mesh()).allOrigPatchIDs(); nonConformalBoundary::New(iF.mesh()).allOrigPatchIndices();
// Evaluate the conformed orig and non-conformal boundary fields // Evaluate the conformed orig and non-conformal boundary fields
const typename SurfaceField<Type>::Boundary origBf const typename SurfaceField<Type>::Boundary origBf
@ -115,7 +115,7 @@ void Foam::conformedFvsPatchField<Type>::unconform
const fvBoundaryMesh& fvbm = iF.mesh().boundary(); const fvBoundaryMesh& fvbm = iF.mesh().boundary();
const labelList origPatchIDs = const labelList origPatchIDs =
nonConformalBoundary::New(iF.mesh()).allOrigPatchIDs(); nonConformalBoundary::New(iF.mesh()).allOrigPatchIndices();
// Extract the conformed orig and non-conformal boundary fields from // Extract the conformed orig and non-conformal boundary fields from
// the stored conformed patch fields // the stored conformed patch fields

View File

@ -606,7 +606,7 @@ void Foam::fvMeshStitcher::applyOwnerOrigBoundaryEdgeParts
const polyBoundaryMesh& pbMesh = mesh_.boundaryMesh(); const polyBoundaryMesh& pbMesh = mesh_.boundaryMesh();
const nonConformalBoundary& ncb = nonConformalBoundary::New(mesh_); const nonConformalBoundary& ncb = nonConformalBoundary::New(mesh_);
const labelList ownerOrigPatchIDs = ncb.ownerOrigPatchIDs(); const labelList ownerOrigPatchIDs = ncb.ownerOrigPatchIndices();
const labelList& ownerOrigBoundaryEdgeMeshEdge = const labelList& ownerOrigBoundaryEdgeMeshEdge =
ncb.ownerOrigBoundaryEdgeMeshEdge(); ncb.ownerOrigBoundaryEdgeMeshEdge();
const edgeList& ownerOrigBoundaryMeshEdges = const edgeList& ownerOrigBoundaryMeshEdges =
@ -845,7 +845,7 @@ void Foam::fvMeshStitcher::stabiliseOrigPatchFaces
) const ) const
{ {
const nonConformalBoundary& ncb = nonConformalBoundary::New(mesh_); const nonConformalBoundary& ncb = nonConformalBoundary::New(mesh_);
const labelList allOrigPatchIDs = ncb.allOrigPatchIDs(); const labelList allOrigPatchIDs = ncb.allOrigPatchIndices();
forAll(allOrigPatchIDs, i) forAll(allOrigPatchIDs, i)
{ {
@ -899,7 +899,7 @@ void Foam::fvMeshStitcher::intersectNonConformalCyclics
const polyBoundaryMesh& pbMesh = mesh_.boundaryMesh(); const polyBoundaryMesh& pbMesh = mesh_.boundaryMesh();
const nonConformalBoundary& ncb = nonConformalBoundary::New(mesh_); const nonConformalBoundary& ncb = nonConformalBoundary::New(mesh_);
const labelList ownerOrigPatchIDs = ncb.ownerOrigPatchIDs(); const labelList ownerOrigPatchIDs = ncb.ownerOrigPatchIndices();
// Alias the boundary geometry fields // Alias the boundary geometry fields
surfaceVectorField::Boundary& SfBf = SfSf.boundaryFieldRef(); surfaceVectorField::Boundary& SfBf = SfSf.boundaryFieldRef();

View File

@ -127,7 +127,7 @@ Foam::fvMeshStitcherTools::conformedNcBoundaryField
); );
const labelList origPatchIDs = const labelList origPatchIDs =
nonConformalBoundary::New(fvbm.mesh()).allOrigPatchIDs(); nonConformalBoundary::New(fvbm.mesh()).allOrigPatchIndices();
// Accumulate the non-conformal parts of the field into the original faces // Accumulate the non-conformal parts of the field into the original faces
forAll(fvbm, ncPatchi) forAll(fvbm, ncPatchi)
@ -215,7 +215,7 @@ Foam::fvMeshStitcherTools::conformedOrigBoundaryField
); );
const labelList origPatchIDs = const labelList origPatchIDs =
nonConformalBoundary::New(fvbm.mesh()).allOrigPatchIDs(); nonConformalBoundary::New(fvbm.mesh()).allOrigPatchIndices();
// Scale or average as appropriate // Scale or average as appropriate
forAll(origPatchIDs, i) forAll(origPatchIDs, i)
@ -291,7 +291,7 @@ Foam::fvMeshStitcherTools::unconformedBoundaryField
} }
const labelList origPatchIDs = const labelList origPatchIDs =
nonConformalBoundary::New(fvbm.mesh()).allOrigPatchIDs(); nonConformalBoundary::New(fvbm.mesh()).allOrigPatchIndices();
// If a flux then scale down to the part face area // If a flux then scale down to the part face area
if (isFluxField) if (isFluxField)

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -106,13 +106,13 @@ bool Foam::patchDistMethods::advectionDiffusion::correct
), ),
mesh_, mesh_,
dimensionedVector(dimless, Zero), dimensionedVector(dimless, Zero),
patchTypes<vector>(mesh_, patchIDs_) patchTypes<vector>(mesh_, patchIndices_)
); );
const fvPatchList& patches = mesh_.boundary(); const fvPatchList& patches = mesh_.boundary();
volVectorField::Boundary& nybf = ny.boundaryFieldRef(); volVectorField::Boundary& nybf = ny.boundaryFieldRef();
forAllConstIter(labelHashSet, patchIDs_, iter) forAllConstIter(labelHashSet, patchIndices_, iter)
{ {
label patchi = iter.key(); label patchi = iter.key();
nybf[patchi] == -patches[patchi].nf(); nybf[patchi] == -patches[patchi].nf();

View File

@ -80,7 +80,7 @@ bool Foam::patchDistMethods::meshWave::correct(volScalarField& y)
fvPatchDistWave::calculateAndCorrect fvPatchDistWave::calculateAndCorrect
( (
mesh_, mesh_,
patchIDs_, patchIndices_,
minFaceFraction_, minFaceFraction_,
nCorrectors_, nCorrectors_,
y y
@ -105,7 +105,7 @@ bool Foam::patchDistMethods::meshWave::correct
fvPatchDistWave::calculateAndCorrect fvPatchDistWave::calculateAndCorrect
( (
mesh_, mesh_,
patchIDs_, patchIndices_,
minFaceFraction_, minFaceFraction_,
nCorrectors_, nCorrectors_,
y, y,

View File

@ -43,7 +43,7 @@ Foam::patchDistMethod::patchDistMethod
) )
: :
mesh_(mesh), mesh_(mesh),
patchIDs_(patchIDs) patchIndices_(patchIDs)
{} {}

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -65,7 +65,7 @@ protected:
const fvMesh& mesh_; const fvMesh& mesh_;
//- Set of patch IDs //- Set of patch IDs
const labelHashSet patchIDs_; const labelHashSet patchIndices_;
public: public:
@ -132,9 +132,9 @@ public:
// Member Functions // Member Functions
//- Return the patchIDs //- Return the patchIDs
const labelHashSet& patchIDs() const const labelHashSet& patchIndices() const
{ {
return patchIDs_; return patchIndices_;
} }
//- Update cached geometry when the mesh moves //- Update cached geometry when the mesh moves

View File

@ -48,14 +48,14 @@ void Foam::wallDist::constructn() const
), ),
mesh(), mesh(),
dimensionedVector(dimless, Zero), dimensionedVector(dimless, Zero),
patchDistMethod::patchTypes<vector>(mesh(), patchIDs_) patchDistMethod::patchTypes<vector>(mesh(), patchIndices_)
); );
const fvPatchList& patches = mesh().boundary(); const fvPatchList& patches = mesh().boundary();
volVectorField::Boundary& nbf = n_->boundaryFieldRef(); volVectorField::Boundary& nbf = n_->boundaryFieldRef();
forAllConstIter(labelHashSet, patchIDs_, iter) forAllConstIter(labelHashSet, patchIndices_, iter)
{ {
label patchi = iter.key(); label patchi = iter.key();
nbf[patchi] == patches[patchi].nf(); nbf[patchi] == patches[patchi].nf();
@ -68,7 +68,7 @@ void Foam::wallDist::constructn() const
Foam::wallDist::wallDist(const fvMesh& mesh, const word& patchTypeName) Foam::wallDist::wallDist(const fvMesh& mesh, const word& patchTypeName)
: :
DemandDrivenMeshObject<fvMesh, DeletableMeshObject, wallDist>(mesh), DemandDrivenMeshObject<fvMesh, DeletableMeshObject, wallDist>(mesh),
patchIDs_(mesh.boundaryMesh().findIndices<wallPolyPatch>()), patchIndices_(mesh.boundaryMesh().findIndices<wallPolyPatch>()),
patchTypeName_(patchTypeName), patchTypeName_(patchTypeName),
pdm_ pdm_
( (
@ -77,7 +77,7 @@ Foam::wallDist::wallDist(const fvMesh& mesh, const word& patchTypeName)
static_cast<const fvSchemes&>(mesh) static_cast<const fvSchemes&>(mesh)
.subDict(patchTypeName_ & "Dist"), .subDict(patchTypeName_ & "Dist"),
mesh, mesh,
patchIDs_ patchIndices_
) )
), ),
y_ y_
@ -90,7 +90,7 @@ Foam::wallDist::wallDist(const fvMesh& mesh, const word& patchTypeName)
), ),
mesh, mesh,
dimensionedScalar("y" & patchTypeName_, dimLength, small), dimensionedScalar("y" & patchTypeName_, dimLength, small),
patchDistMethod::patchTypes<scalar>(mesh, patchIDs_) patchDistMethod::patchTypes<scalar>(mesh, patchIndices_)
), ),
nRequired_ nRequired_
( (
@ -118,7 +118,7 @@ Foam::wallDist::wallDist
) )
: :
DemandDrivenMeshObject<fvMesh, DeletableMeshObject, wallDist>(mesh), DemandDrivenMeshObject<fvMesh, DeletableMeshObject, wallDist>(mesh),
patchIDs_(patchIDs), patchIndices_(patchIDs),
patchTypeName_(patchTypeName), patchTypeName_(patchTypeName),
pdm_ pdm_
( (
@ -127,7 +127,7 @@ Foam::wallDist::wallDist
static_cast<const fvSchemes&>(mesh) static_cast<const fvSchemes&>(mesh)
.subDict(patchTypeName_ & "Dist"), .subDict(patchTypeName_ & "Dist"),
mesh, mesh,
patchIDs_ patchIndices_
) )
), ),
y_ y_
@ -140,7 +140,7 @@ Foam::wallDist::wallDist
), ),
mesh, mesh,
dimensionedScalar("y" & patchTypeName_, dimLength, small), dimensionedScalar("y" & patchTypeName_, dimLength, small),
patchDistMethod::patchTypes<scalar>(mesh, patchIDs_) patchDistMethod::patchTypes<scalar>(mesh, patchIndices_)
), ),
nRequired_ nRequired_
( (

View File

@ -73,7 +73,7 @@ class wallDist
// Private Data // Private Data
//- Set of patch IDs //- Set of patch IDs
const labelHashSet patchIDs_; const labelHashSet patchIndices_;
//- Name for the patch set, e.g. "wall" //- Name for the patch set, e.g. "wall"
const word patchTypeName_; const word patchTypeName_;
@ -143,9 +143,9 @@ public:
// Member Functions // Member Functions
//- Return the patchIDs //- Return the patchIDs
const labelHashSet& patchIDs() const const labelHashSet& patchIndices() const
{ {
return patchIDs_; return patchIndices_;
} }
//- Return reference to cached distance-to-wall field //- Return reference to cached distance-to-wall field

View File

@ -125,10 +125,10 @@ Foam::tmp<Foam::VolField<Type>> Foam::fvMeshToFvMesh::srcToTgt
// Construct target patch fields as copies of source patch fields, but do // Construct target patch fields as copies of source patch fields, but do
// not map values yet // not map values yet
PtrList<fvPatchField<Type>> tgtPatchFields(tgtMesh.boundary().size()); PtrList<fvPatchField<Type>> tgtPatchFields(tgtMesh.boundary().size());
forAll(patchIDs(), i) forAll(patchIndices(), i)
{ {
const label srcPatchi = patchIDs()[i].first(); const label srcPatchi = patchIndices()[i].first();
const label tgtPatchi = patchIDs()[i].second(); const label tgtPatchi = patchIndices()[i].second();
if (!tgtPatchFields.set(tgtPatchi)) if (!tgtPatchFields.set(tgtPatchi))
{ {
@ -185,10 +185,10 @@ Foam::tmp<Foam::VolField<Type>> Foam::fvMeshToFvMesh::srcToTgt
ttgtFld.ref().boundaryFieldRef(); ttgtFld.ref().boundaryFieldRef();
// Mapped patches // Mapped patches
forAll(patchIDs(), i) forAll(patchIndices(), i)
{ {
const label srcPatchi = patchIDs()[i].first(); const label srcPatchi = patchIndices()[i].first();
const label tgtPatchi = patchIDs()[i].second(); const label tgtPatchi = patchIndices()[i].second();
tgtBfld[tgtPatchi].map tgtBfld[tgtPatchi].map
( (
@ -238,10 +238,10 @@ Foam::tmp<Foam::VolField<Type>> Foam::fvMeshToFvMesh::srcToTgt
ttgtFld.ref().boundaryFieldRef(); ttgtFld.ref().boundaryFieldRef();
// Mapped patches // Mapped patches
forAll(patchIDs(), i) forAll(patchIndices(), i)
{ {
const label srcPatchi = patchIDs()[i].first(); const label srcPatchi = patchIndices()[i].first();
const label tgtPatchi = patchIDs()[i].second(); const label tgtPatchi = patchIndices()[i].second();
tgtBfld[tgtPatchi].map tgtBfld[tgtPatchi].map
( (
@ -320,10 +320,10 @@ Foam::fvMeshToFvMesh::srcToTgt
// Map all patch fields // Map all patch fields
PtrList<fvsPatchField<Type>> tgtPatchFields(tgtMesh.boundary().size()); PtrList<fvsPatchField<Type>> tgtPatchFields(tgtMesh.boundary().size());
forAll(patchIDs(), i) forAll(patchIndices(), i)
{ {
const label srcPatchi = patchIDs()[i].first(); const label srcPatchi = patchIndices()[i].first();
const label tgtPatchi = patchIDs()[i].second(); const label tgtPatchi = patchIndices()[i].second();
if (!tgtPatchFields.set(tgtPatchi)) if (!tgtPatchFields.set(tgtPatchi))
{ {

View File

@ -55,18 +55,18 @@ void Foam::functionObjects::layerAverage::calcLayers()
// Initialise the faces from which the layers extrude // Initialise the faces from which the layers extrude
DynamicList<label> startFaces; DynamicList<label> startFaces;
DynamicList<layerInfo> startFacesInfo; DynamicList<layerInfo> startFacesInfo;
forAll(patchIDs_, i) forAll(patchIndices_, i)
{ {
const polyPatch& pp = mesh_.boundaryMesh()[patchIDs_[i]]; const polyPatch& pp = mesh_.boundaryMesh()[patchIndices_[i]];
forAll(pp, j) forAll(pp, j)
{ {
startFaces.append(pp.start() + j); startFaces.append(pp.start() + j);
startFacesInfo.append(layerInfo(0, -1)); startFacesInfo.append(layerInfo(0, -1));
} }
} }
forAll(zoneIDs_, i) forAll(zoneIndices_, i)
{ {
const faceZone& fz = mesh_.faceZones()[zoneIDs_[i]]; const faceZone& fz = mesh_.faceZones()[zoneIndices_[i]];
forAll(fz, j) forAll(fz, j)
{ {
startFaces.append(fz[j]); startFaces.append(fz[j]);
@ -240,20 +240,20 @@ bool Foam::functionObjects::layerAverage::read(const dictionary& dict)
{ {
Info<< type() << " " << name() << ":" << nl; Info<< type() << " " << name() << ":" << nl;
patchIDs_ = patchIndices_ =
mesh_.boundaryMesh().patchSet mesh_.boundaryMesh().patchSet
( (
dict.lookupOrDefault<wordReList>("patches", wordReList()) dict.lookupOrDefault<wordReList>("patches", wordReList())
).toc(); ).toc();
zoneIDs_ = zoneIndices_ =
findStrings findStrings
( (
dict.lookupOrDefault<wordReList>("zones", wordReList()), dict.lookupOrDefault<wordReList>("zones", wordReList()),
mesh_.faceZones().names() mesh_.faceZones().names()
); );
if (patchIDs_.empty() && zoneIDs_.empty()) if (patchIndices_.empty() && zoneIndices_.empty())
{ {
WarningInFunction WarningInFunction
<< "No patches or zones specified" << endl; << "No patches or zones specified" << endl;

View File

@ -96,13 +96,13 @@ class layerAverage
// Private Data // Private Data
//- Patches which form the start of the layers //- Patches which form the start of the layers
labelList patchIDs_; labelList patchIndices_;
//- Zones which form the start of the layers //- Zones which form the start of the layers
labelList zoneIDs_; labelList zoneIndices_;
//- Zones on which the layers are considered to end //- Zones on which the layers are considered to end
labelList endZoneIDs_; labelList endZoneIndices_;
//- Is the case symmetric? //- Is the case symmetric?
bool symmetric_; bool symmetric_;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -205,7 +205,7 @@ Foam::scalar Foam::engineValve::curVelocity() const
} }
Foam::labelList Foam::engineValve::movingPatchIDs() const Foam::labelList Foam::engineValve::movingPatchIndices() const
{ {
labelList mpIDs(2); labelList mpIDs(2);
label nMpIDs = 0; label nMpIDs = 0;

View File

@ -288,7 +288,7 @@ public:
//- Return list of active patch labels for the valve head //- Return list of active patch labels for the valve head
// (stem is excluded) // (stem is excluded)
labelList movingPatchIDs() const; labelList movingPatchIndices() const;
//- Write dictionary //- Write dictionary

View File

@ -174,8 +174,8 @@ void Foam::fvMeshStitchers::moving::createNonConformalCorrectMeshPhiGeometry
) )
{ {
const nonConformalBoundary& ncb = nonConformalBoundary::New(mesh()); const nonConformalBoundary& ncb = nonConformalBoundary::New(mesh());
const labelList origPatchIDs = ncb.allOrigPatchIDs(); const labelList origPatchIDs = ncb.allOrigPatchIndices();
const labelList errorPatchIDs = ncb.allErrorPatchIDs(); const labelList errorPatchIDs = ncb.allErrorPatchIndices();
forAll(origPatchIDs, i) forAll(origPatchIDs, i)
{ {
@ -856,8 +856,8 @@ void Foam::fvMeshStitchers::moving::unconformErrorFaceCorrectMeshPhi
) )
{ {
const nonConformalBoundary& ncb = nonConformalBoundary::New(mesh()); const nonConformalBoundary& ncb = nonConformalBoundary::New(mesh());
const labelList origPatchIDs = ncb.allOrigPatchIDs(); const labelList origPatchIDs = ncb.allOrigPatchIndices();
const labelList errorPatchIDs = ncb.allErrorPatchIDs(); const labelList errorPatchIDs = ncb.allErrorPatchIndices();
// Synchronise the mesh fluxes on both sides of coupled patches. Store // Synchronise the mesh fluxes on both sides of coupled patches. Store
// the change made to the mesh flux as an error. // the change made to the mesh flux as an error.

View File

@ -91,7 +91,7 @@ void Foam::FacePostProcessing<CloudType>::write()
const scalar alpha = (totalTime_ - timeElapsed)/totalTime_; const scalar alpha = (totalTime_ - timeElapsed)/totalTime_;
const scalar beta = timeElapsed/totalTime_; const scalar beta = timeElapsed/totalTime_;
forAll(faceZoneIDs_, zoneI) forAll(faceZoneIndices_, zoneI)
{ {
massFlowRate_[zoneI] = massFlowRate_[zoneI] =
alpha*massFlowRate_[zoneI] + beta*mass_[zoneI]/timeElapsed; alpha*massFlowRate_[zoneI] + beta*mass_[zoneI]/timeElapsed;
@ -104,9 +104,9 @@ void Foam::FacePostProcessing<CloudType>::write()
List<scalarField> zoneMassTotal(mass_.size()); List<scalarField> zoneMassTotal(mass_.size());
List<scalarField> zoneMassFlowRate(massFlowRate_.size()); List<scalarField> zoneMassFlowRate(massFlowRate_.size());
forAll(faceZoneIDs_, zoneI) forAll(faceZoneIndices_, zoneI)
{ {
const word& zoneName = mfz[faceZoneIDs_[zoneI]].name(); const word& zoneName = mfz[faceZoneIndices_[zoneI]].name();
scalarListList allProcMass(Pstream::nProcs()); scalarListList allProcMass(Pstream::nProcs());
allProcMass[proci] = massTotal_[zoneI]; allProcMass[proci] = massTotal_[zoneI];
@ -146,9 +146,9 @@ void Foam::FacePostProcessing<CloudType>::write()
if (surfaceFormat_ != "none") if (surfaceFormat_ != "none")
{ {
forAll(faceZoneIDs_, zoneI) forAll(faceZoneIndices_, zoneI)
{ {
const faceZone& fZone = mfz[faceZoneIDs_[zoneI]]; const faceZone& fZone = mfz[faceZoneIndices_[zoneI]];
labelList pointToGlobal; labelList pointToGlobal;
labelList uniqueMeshPointLabels; labelList uniqueMeshPointLabels;
@ -217,7 +217,7 @@ void Foam::FacePostProcessing<CloudType>::write()
if (resetOnWrite_) if (resetOnWrite_)
{ {
forAll(faceZoneIDs_, zoneI) forAll(faceZoneIndices_, zoneI)
{ {
massFlowRate_[zoneI] = 0.0; massFlowRate_[zoneI] = 0.0;
} }
@ -245,7 +245,7 @@ Foam::FacePostProcessing<CloudType>::FacePostProcessing
) )
: :
CloudFunctionObject<CloudType>(dict, owner, modelName, typeName), CloudFunctionObject<CloudType>(dict, owner, modelName, typeName),
faceZoneIDs_(), faceZoneIndices_(),
surfaceFormat_(this->coeffDict().lookup("surfaceFormat")), surfaceFormat_(this->coeffDict().lookup("surfaceFormat")),
resetOnWrite_(this->coeffDict().lookup("resetOnWrite")), resetOnWrite_(this->coeffDict().lookup("resetOnWrite")),
totalTime_(0.0), totalTime_(0.0),
@ -313,7 +313,7 @@ Foam::FacePostProcessing<CloudType>::FacePostProcessing
} }
} }
faceZoneIDs_.transfer(zoneIDs); faceZoneIndices_.transfer(zoneIDs);
// readProperties(); AND initialise mass... fields // readProperties(); AND initialise mass... fields
} }
@ -326,7 +326,7 @@ Foam::FacePostProcessing<CloudType>::FacePostProcessing
) )
: :
CloudFunctionObject<CloudType>(pff), CloudFunctionObject<CloudType>(pff),
faceZoneIDs_(pff.faceZoneIDs_), faceZoneIndices_(pff.faceZoneIndices_),
surfaceFormat_(pff.surfaceFormat_), surfaceFormat_(pff.surfaceFormat_),
resetOnWrite_(pff.resetOnWrite_), resetOnWrite_(pff.resetOnWrite_),
totalTime_(pff.totalTime_), totalTime_(pff.totalTime_),
@ -359,9 +359,9 @@ void Foam::FacePostProcessing<CloudType>::preFace(const parcelType& p)
{ {
const meshFaceZones& mfz = this->owner().mesh().faceZones(); const meshFaceZones& mfz = this->owner().mesh().faceZones();
forAll(faceZoneIDs_, i) forAll(faceZoneIndices_, i)
{ {
const faceZone& fz = mfz[faceZoneIDs_[i]]; const faceZone& fz = mfz[faceZoneIndices_[i]];
label faceId = -1; label faceId = -1;
forAll(fz, j) forAll(fz, j)

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -65,7 +65,7 @@ class FacePostProcessing
//- Face zone IDs //- Face zone IDs
labelList faceZoneIDs_; labelList faceZoneIndices_;
//- Surface output format //- Surface output format
const word surfaceFormat_; const word surfaceFormat_;

View File

@ -321,7 +321,7 @@ void Foam::ParticleCollector<CloudType>::collectParcelPolygon
// Add to the list of hits // Add to the list of hits
if (inside) if (inside)
{ {
hitFaceIDs_.append(facei); hitFaceIndices_.append(facei);
} }
} }
} }
@ -377,7 +377,7 @@ void Foam::ParticleCollector<CloudType>::collectParcelConcentricCircles
if (secI != -1) if (secI != -1)
{ {
hitFaceIDs_.append(secI); hitFaceIndices_.append(secI);
} }
} }
@ -530,7 +530,7 @@ Foam::ParticleCollector<CloudType>::ParticleCollector
log_(this->coeffDict().lookup("log")), log_(this->coeffDict().lookup("log")),
outputFilePtr_(), outputFilePtr_(),
timeOld_(owner.mesh().time().value()), timeOld_(owner.mesh().time().value()),
hitFaceIDs_() hitFaceIndices_()
{ {
normal_ /= mag(normal_); normal_ /= mag(normal_);
@ -612,7 +612,7 @@ Foam::ParticleCollector<CloudType>::ParticleCollector
log_(pc.log_), log_(pc.log_),
outputFilePtr_(), outputFilePtr_(),
timeOld_(0.0), timeOld_(0.0),
hitFaceIDs_() hitFaceIndices_()
{} {}
@ -639,7 +639,7 @@ void Foam::ParticleCollector<CloudType>::postMove
return; return;
} }
hitFaceIDs_.clear(); hitFaceIndices_.clear();
switch (mode_) switch (mode_)
{ {
@ -665,9 +665,9 @@ void Foam::ParticleCollector<CloudType>::postMove
{} {}
} }
forAll(hitFaceIDs_, i) forAll(hitFaceIndices_, i)
{ {
label facei = hitFaceIDs_[i]; label facei = hitFaceIndices_[i];
scalar m = p.nParticle()*p.mass(); scalar m = p.nParticle()*p.mass();
if (negateParcelsOppositeNormal_) if (negateParcelsOppositeNormal_)

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -193,7 +193,7 @@ private:
scalar timeOld_; scalar timeOld_;
//- Work list to store which faces are hit //- Work list to store which faces are hit
mutable DynamicList<label> hitFaceIDs_; mutable DynamicList<label> hitFaceIndices_;
// Private Member Functions // Private Member Functions

View File

@ -36,9 +36,9 @@ Foam::label Foam::ParticleErosion<CloudType>::applyToPatch
const label globalPatchi const label globalPatchi
) const ) const
{ {
forAll(patchIDs_, i) forAll(patchIndices_, i)
{ {
if (patchIDs_[i] == globalPatchi) if (patchIndices_[i] == globalPatchi)
{ {
return i; return i;
} }
@ -75,7 +75,7 @@ Foam::ParticleErosion<CloudType>::ParticleErosion
: :
CloudFunctionObject<CloudType>(dict, owner, modelName, typeName), CloudFunctionObject<CloudType>(dict, owner, modelName, typeName),
QPtr_(nullptr), QPtr_(nullptr),
patchIDs_(), patchIndices_(),
p_(this->coeffDict().template lookup<scalar>("p")), p_(this->coeffDict().template lookup<scalar>("p")),
psi_(this->coeffDict().template lookupOrDefault<scalar>("psi", 2.0)), psi_(this->coeffDict().template lookupOrDefault<scalar>("psi", 2.0)),
K_(this->coeffDict().template lookupOrDefault<scalar>("K", 2.0)) K_(this->coeffDict().template lookupOrDefault<scalar>("K", 2.0))
@ -98,7 +98,7 @@ Foam::ParticleErosion<CloudType>::ParticleErosion
uniquePatchIDs.insert(patchIDs); uniquePatchIDs.insert(patchIDs);
} }
patchIDs_ = uniquePatchIDs.toc(); patchIndices_ = uniquePatchIDs.toc();
// Trigger creation of the Q field // Trigger creation of the Q field
preEvolve(); preEvolve();
@ -113,7 +113,7 @@ Foam::ParticleErosion<CloudType>::ParticleErosion
: :
CloudFunctionObject<CloudType>(pe), CloudFunctionObject<CloudType>(pe),
QPtr_(nullptr), QPtr_(nullptr),
patchIDs_(pe.patchIDs_), patchIndices_(pe.patchIndices_),
p_(pe.p_), p_(pe.p_),
psi_(pe.psi_), psi_(pe.psi_),
K_(pe.K_) K_(pe.K_)

View File

@ -106,7 +106,7 @@ class ParticleErosion
autoPtr<volScalarField> QPtr_; autoPtr<volScalarField> QPtr_;
//- List of patch indices to post-process //- List of patch indices to post-process
labelList patchIDs_; labelList patchIndices_;
//- Plastic flow stress //- Plastic flow stress
scalar p_; scalar p_;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -38,9 +38,9 @@ Foam::label Foam::PatchPostProcessing<CloudType>::applyToPatch
const label globalPatchi const label globalPatchi
) const ) const
{ {
forAll(patchIDs_, i) forAll(patchIndices_, i)
{ {
if (patchIDs_[i] == globalPatchi) if (patchIndices_[i] == globalPatchi)
{ {
return i; return i;
} }
@ -72,7 +72,8 @@ void Foam::PatchPostProcessing<CloudType>::write()
// Create directory if it doesn't exist // Create directory if it doesn't exist
mkDir(this->writeTimeDir()); mkDir(this->writeTimeDir());
const word& patchName = mesh.boundaryMesh()[patchIDs_[i]].name(); const word& patchName =
mesh.boundaryMesh()[patchIndices_[i]].name();
OFstream patchOutFile OFstream patchOutFile
( (
@ -134,7 +135,7 @@ Foam::PatchPostProcessing<CloudType>::PatchPostProcessing
( (
this->coeffDict().template lookup<scalar>("maxStoredParcels") this->coeffDict().template lookup<scalar>("maxStoredParcels")
), ),
patchIDs_(), patchIndices_(),
times_(), times_(),
patchData_() patchData_()
{ {
@ -156,20 +157,20 @@ Foam::PatchPostProcessing<CloudType>::PatchPostProcessing
uniquePatchIDs.insert(patchIDs); uniquePatchIDs.insert(patchIDs);
} }
patchIDs_ = uniquePatchIDs.toc(); patchIndices_ = uniquePatchIDs.toc();
if (debug) if (debug)
{ {
forAll(patchIDs_, i) forAll(patchIndices_, i)
{ {
const label patchi = patchIDs_[i]; const label patchi = patchIndices_[i];
const word& patchName = owner.mesh().boundaryMesh()[patchi].name(); const word& patchName = owner.mesh().boundaryMesh()[patchi].name();
Info<< "Post-process patch " << patchName << endl; Info<< "Post-process patch " << patchName << endl;
} }
} }
patchData_.setSize(patchIDs_.size()); patchData_.setSize(patchIndices_.size());
times_.setSize(patchIDs_.size()); times_.setSize(patchIndices_.size());
} }
@ -181,7 +182,7 @@ Foam::PatchPostProcessing<CloudType>::PatchPostProcessing
: :
CloudFunctionObject<CloudType>(ppm), CloudFunctionObject<CloudType>(ppm),
maxStoredParcels_(ppm.maxStoredParcels_), maxStoredParcels_(ppm.maxStoredParcels_),
patchIDs_(ppm.patchIDs_), patchIndices_(ppm.patchIndices_),
times_(ppm.times_), times_(ppm.times_),
patchData_(ppm.patchData_) patchData_(ppm.patchData_)
{} {}

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -59,7 +59,7 @@ class PatchPostProcessing
scalar maxStoredParcels_; scalar maxStoredParcels_;
//- List of patch indices to post-process //- List of patch indices to post-process
labelList patchIDs_; labelList patchIndices_;
//- List of time for each data record //- List of time for each data record
List<DynamicList<scalar>> times_; List<DynamicList<scalar>> times_;
@ -123,7 +123,7 @@ public:
inline label maxStoredParcels() const; inline label maxStoredParcels() const;
//- Return const mapping from local to global patch ids //- Return const mapping from local to global patch ids
inline const labelList& patchIDs() const; inline const labelList& patchIndices() const;
// Evaluation // Evaluation

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -31,9 +31,10 @@ Foam::label Foam::PatchPostProcessing<CloudType>::maxStoredParcels() const
template<class CloudType> template<class CloudType>
const Foam::labelList& Foam::PatchPostProcessing<CloudType>::patchIDs() const const Foam::labelList&
Foam::PatchPostProcessing<CloudType>::patchIndices() const
{ {
return patchIDs_; return patchIndices_;
} }

View File

@ -626,7 +626,7 @@ void Foam::medialAxisMeshMover::update(const dictionary& coeffDict)
// 2. Seed non-adapt patches // 2. Seed non-adapt patches
const polyBoundaryMesh& patches = mesh().boundaryMesh(); const polyBoundaryMesh& patches = mesh().boundaryMesh();
labelHashSet adaptPatches(adaptPatchIDs_); labelHashSet adaptPatches(adaptPatchIndices_);
forAll(patches, patchi) forAll(patches, patchi)
@ -1526,8 +1526,8 @@ Foam::medialAxisMeshMover::medialAxisMeshMover
) )
: :
externalDisplacementMeshMover(dict, baffles, pointDisplacement), externalDisplacementMeshMover(dict, baffles, pointDisplacement),
adaptPatchIDs_(getFixedValueBCs(pointDisplacement)), adaptPatchIndices_(getFixedValueBCs(pointDisplacement)),
adaptPatchPtr_(getPatch(mesh(), adaptPatchIDs_)), adaptPatchPtr_(getPatch(mesh(), adaptPatchIndices_)),
scale_ scale_
( (
IOobject IOobject
@ -1550,7 +1550,7 @@ Foam::medialAxisMeshMover::medialAxisMeshMover
pointDisplacement, pointDisplacement,
scale_, scale_,
oldPoints_, oldPoints_,
adaptPatchIDs_, adaptPatchIndices_,
dict dict
), ),
dispVec_ dispVec_

View File

@ -62,7 +62,7 @@ class medialAxisMeshMover
{ {
// Private Data // Private Data
const labelList adaptPatchIDs_; const labelList adaptPatchIndices_;
autoPtr<indirectPrimitivePatch> adaptPatchPtr_; autoPtr<indirectPrimitivePatch> adaptPatchPtr_;

View File

@ -365,7 +365,7 @@ Foam::motionSmootherAlgo::motionSmootherAlgo
displacement_(displacement), displacement_(displacement),
scale_(scale), scale_(scale),
oldPoints_(oldPoints), oldPoints_(oldPoints),
adaptPatchIDs_(adaptPatchIDs), adaptPatchIndices_(adaptPatchIDs),
paramDict_(paramDict), paramDict_(paramDict),
isInternalPoint_(mesh_.nPoints(), 1) isInternalPoint_(mesh_.nPoints(), 1)
{ {
@ -399,9 +399,9 @@ const Foam::indirectPrimitivePatch& Foam::motionSmootherAlgo::patch() const
} }
const Foam::labelList& Foam::motionSmootherAlgo::adaptPatchIDs() const const Foam::labelList& Foam::motionSmootherAlgo::adaptPatchIndices() const
{ {
return adaptPatchIDs_; return adaptPatchIndices_;
} }
@ -488,7 +488,7 @@ void Foam::motionSmootherAlgo::setDisplacementPatchFields
void Foam::motionSmootherAlgo::setDisplacementPatchFields() void Foam::motionSmootherAlgo::setDisplacementPatchFields()
{ {
setDisplacementPatchFields(adaptPatchIDs_, displacement_); setDisplacementPatchFields(adaptPatchIndices_, displacement_);
} }
@ -571,7 +571,7 @@ void Foam::motionSmootherAlgo::setDisplacement
void Foam::motionSmootherAlgo::setDisplacement(pointField& patchDisp) void Foam::motionSmootherAlgo::setDisplacement(pointField& patchDisp)
{ {
setDisplacement(adaptPatchIDs_, pp_, patchDisp, displacement_); setDisplacement(adaptPatchIndices_, pp_, patchDisp, displacement_);
} }
@ -581,7 +581,7 @@ void Foam::motionSmootherAlgo::correctBoundaryConditions
pointVectorField& displacement pointVectorField& displacement
) const ) const
{ {
labelHashSet adaptPatchSet(adaptPatchIDs_); labelHashSet adaptPatchSet(adaptPatchIndices_);
const lduSchedule& patchSchedule = mesh_.globalData().patchSchedule(); const lduSchedule& patchSchedule = mesh_.globalData().patchSchedule();
@ -838,7 +838,7 @@ bool Foam::motionSmootherAlgo::scaleMesh
const label nAllowableErrors const label nAllowableErrors
) )
{ {
if (!smoothMesh && adaptPatchIDs_.empty()) if (!smoothMesh && adaptPatchIndices_.empty())
{ {
FatalErrorInFunction FatalErrorInFunction
<< "You specified both no movement on the internal mesh points" << "You specified both no movement on the internal mesh points"
@ -980,7 +980,7 @@ bool Foam::motionSmootherAlgo::scaleMesh
<< endl; << endl;
} }
if (adaptPatchIDs_.size()) if (adaptPatchIndices_.size())
{ {
// Scale conflicting patch points // Scale conflicting patch points
scaleField(pp_.meshPoints(), usedPoints, errorReduction, scale_); scaleField(pp_.meshPoints(), usedPoints, errorReduction, scale_);
@ -997,7 +997,7 @@ bool Foam::motionSmootherAlgo::scaleMesh
for (label i = 0; i < nSmoothScale; i++) for (label i = 0; i < nSmoothScale; i++)
{ {
if (adaptPatchIDs_.size()) if (adaptPatchIndices_.size())
{ {
// Smooth patch values // Smooth patch values
pointScalarField oldScale(scale_); pointScalarField oldScale(scale_);
@ -1047,9 +1047,9 @@ void Foam::motionSmootherAlgo::topoChange()
const pointBoundaryMesh& patches = pMesh_.boundary(); const pointBoundaryMesh& patches = pMesh_.boundary();
// Check whether displacement has fixed value b.c. on adaptPatchID // Check whether displacement has fixed value b.c. on adaptPatchID
forAll(adaptPatchIDs_, i) forAll(adaptPatchIndices_, i)
{ {
label patchi = adaptPatchIDs_[i]; label patchi = adaptPatchIndices_[i];
if if
( (

View File

@ -153,7 +153,7 @@ class motionSmootherAlgo
//- Indices of fixedValue patches that we're allowed to modify the //- Indices of fixedValue patches that we're allowed to modify the
// displacement on. // displacement on.
const labelList adaptPatchIDs_; const labelList adaptPatchIndices_;
// Smoothing and checking parameters // Smoothing and checking parameters
dictionary paramDict_; dictionary paramDict_;
@ -324,7 +324,7 @@ public:
const indirectPrimitivePatch& patch() const; const indirectPrimitivePatch& patch() const;
//- Patch labels that are being adapted //- Patch labels that are being adapted
const labelList& adaptPatchIDs() const; const labelList& adaptPatchIndices() const;
const dictionary& paramDict() const; const dictionary& paramDict() const;

View File

@ -1111,7 +1111,7 @@ void Foam::snappyLayerDriver::medialAxisSmoothingInfo
// 2. Seed non-adapt patches // 2. Seed non-adapt patches
const polyBoundaryMesh& patches = mesh.boundaryMesh(); const polyBoundaryMesh& patches = mesh.boundaryMesh();
labelHashSet adaptPatches(meshMover.adaptPatchIDs()); labelHashSet adaptPatches(meshMover.adaptPatchIndices());
forAll(patches, patchi) forAll(patches, patchi)

View File

@ -38,7 +38,7 @@ Foam::patchPatchDist::patchPatchDist
) )
: :
patch_(patch), patch_(patch),
nbrPatchIDs_(nbrPatchIDs), nbrPatchIndices_(nbrPatchIDs),
nUnset_(0) nUnset_(0)
{ {
patchPatchDist::correct(); patchPatchDist::correct();
@ -57,7 +57,7 @@ void Foam::patchPatchDist::correct()
{ {
// Mark all edge connected to a nbrPatch. // Mark all edge connected to a nbrPatch.
label nBnd = 0; label nBnd = 0;
forAllConstIter(labelHashSet, nbrPatchIDs_, iter) forAllConstIter(labelHashSet, nbrPatchIndices_, iter)
{ {
label nbrPatchi = iter.key(); label nbrPatchi = iter.key();
const polyPatch& nbrPatch = patch_.boundaryMesh()[nbrPatchi]; const polyPatch& nbrPatch = patch_.boundaryMesh()[nbrPatchi];
@ -68,7 +68,7 @@ void Foam::patchPatchDist::correct()
// functionality for these. // functionality for these.
EdgeMap<label> nbrEdges(2*nBnd); EdgeMap<label> nbrEdges(2*nBnd);
forAllConstIter(labelHashSet, nbrPatchIDs_, iter) forAllConstIter(labelHashSet, nbrPatchIndices_, iter)
{ {
label nbrPatchi = iter.key(); label nbrPatchi = iter.key();
const polyPatch& nbrPatch = patch_.boundaryMesh()[nbrPatchi]; const polyPatch& nbrPatch = patch_.boundaryMesh()[nbrPatchi];

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -61,7 +61,7 @@ class patchPatchDist
const polyPatch& patch_; const polyPatch& patch_;
//- Patches to determine the distance to //- Patches to determine the distance to
const labelHashSet nbrPatchIDs_; const labelHashSet nbrPatchIndices_;
//- Number of unset faces. //- Number of unset faces.
label nUnset_; label nUnset_;

View File

@ -52,7 +52,7 @@ Foam::meshToMesh::meshToMesh
cellsInterpolation_(), cellsInterpolation_(),
srcCellsStabilisation_(), srcCellsStabilisation_(),
tgtCellsStabilisation_(), tgtCellsStabilisation_(),
patchIDs_(), patchIndices_(),
patchInterpolations_(), patchInterpolations_(),
srcPatchStabilisations_(), srcPatchStabilisations_(),
tgtPatchStabilisations_() tgtPatchStabilisations_()
@ -97,13 +97,13 @@ Foam::meshToMesh::meshToMesh
} }
} }
patchIDs_.transfer(patchIDs); patchIndices_.transfer(patchIDs);
} }
// If a patch mas was supplied then convert it to pairs of patch indices // If a patch mas was supplied then convert it to pairs of patch indices
else else
{ {
patchIDs_.setSize(patchMap.size()); patchIndices_.setSize(patchMap.size());
label i = 0; label i = 0;
forAllConstIter(HashTable<word>, patchMap, iter) forAllConstIter(HashTable<word>, patchMap, iter)
{ {
@ -134,7 +134,7 @@ Foam::meshToMesh::meshToMesh
<< exit(FatalError); << exit(FatalError);
} }
patchIDs_[i ++] = labelPair(srcPatchi, tgtPatchi); patchIndices_[i ++] = labelPair(srcPatchi, tgtPatchi);
} }
} }
@ -152,13 +152,13 @@ Foam::meshToMesh::meshToMesh
Info<< decrIndent; Info<< decrIndent;
// Calculate patch addressing and weights // Calculate patch addressing and weights
patchInterpolations_.setSize(patchIDs_.size()); patchInterpolations_.setSize(patchIndices_.size());
srcPatchStabilisations_.setSize(patchIDs_.size()); srcPatchStabilisations_.setSize(patchIndices_.size());
tgtPatchStabilisations_.setSize(patchIDs_.size()); tgtPatchStabilisations_.setSize(patchIndices_.size());
forAll(patchIDs_, i) forAll(patchIndices_, i)
{ {
const label srcPatchi = patchIDs_[i].first(); const label srcPatchi = patchIndices_[i].first();
const label tgtPatchi = patchIDs_[i].second(); const label tgtPatchi = patchIndices_[i].second();
const polyPatch& srcPp = srcMesh_.boundaryMesh()[srcPatchi]; const polyPatch& srcPp = srcMesh_.boundaryMesh()[srcPatchi];
const polyPatch& tgtPp = tgtMesh_.boundaryMesh()[tgtPatchi]; const polyPatch& tgtPp = tgtMesh_.boundaryMesh()[tgtPatchi];
@ -199,10 +199,10 @@ bool Foam::meshToMesh::consistent() const
boolList tgtPatchIsMapped(tgtMesh_.boundaryMesh().size(), false); boolList tgtPatchIsMapped(tgtMesh_.boundaryMesh().size(), false);
// Mark anything paired as mapped // Mark anything paired as mapped
forAll(patchIDs_, i) forAll(patchIndices_, i)
{ {
const label srcPatchi = patchIDs_[i].first(); const label srcPatchi = patchIndices_[i].first();
const label tgtPatchi = patchIDs_[i].second(); const label tgtPatchi = patchIndices_[i].second();
srcPatchIsMapped[srcPatchi] = true; srcPatchIsMapped[srcPatchi] = true;
tgtPatchIsMapped[tgtPatchi] = true; tgtPatchIsMapped[tgtPatchi] = true;

View File

@ -71,7 +71,7 @@ class meshToMesh
mutable autoPtr<cellsToCellsStabilisation> tgtCellsStabilisation_; mutable autoPtr<cellsToCellsStabilisation> tgtCellsStabilisation_;
//- List of corresponding source and target patch indices //- List of corresponding source and target patch indices
List<labelPair> patchIDs_; List<labelPair> patchIndices_;
//- List of interpolation engines between source and target patches //- List of interpolation engines between source and target patches
PtrList<patchToPatch> patchInterpolations_; PtrList<patchToPatch> patchInterpolations_;
@ -101,7 +101,7 @@ protected:
tgtCellsStabilisation() const; tgtCellsStabilisation() const;
//- Return the list of corresponding source and target patch indices //- Return the list of corresponding source and target patch indices
inline const List<labelPair>& patchIDs() const; inline const List<labelPair>& patchIndices() const;
//- Return the interpolation engine between a source and a target //- Return the interpolation engine between a source and a target
// patch // patch

View File

@ -67,9 +67,9 @@ Foam::meshToMesh::tgtCellsStabilisation() const
} }
inline const Foam::List<Foam::labelPair>& Foam::meshToMesh::patchIDs() const inline const Foam::List<Foam::labelPair>& Foam::meshToMesh::patchIndices() const
{ {
return patchIDs_; return patchIndices_;
} }
@ -87,7 +87,7 @@ Foam::meshToMesh::srcPatchStabilisation(const label i) const
{ {
if (!srcPatchStabilisations_.set(i)) if (!srcPatchStabilisations_.set(i))
{ {
const label srcPatchi = patchIDs_[i].first(); const label srcPatchi = patchIndices_[i].first();
const polyPatch& srcPp = srcMesh_.boundaryMesh()[srcPatchi]; const polyPatch& srcPp = srcMesh_.boundaryMesh()[srcPatchi];
srcPatchStabilisations_.set(i, new patchToPatchStabilisation()); srcPatchStabilisations_.set(i, new patchToPatchStabilisation());
@ -107,7 +107,7 @@ Foam::meshToMesh::tgtPatchStabilisation(const label i) const
{ {
if (!tgtPatchStabilisations_.set(i)) if (!tgtPatchStabilisations_.set(i))
{ {
const label tgtPatchi = patchIDs_[i].first(); const label tgtPatchi = patchIndices_[i].first();
const polyPatch& tgtPp = tgtMesh_.boundaryMesh()[tgtPatchi]; const polyPatch& tgtPp = tgtMesh_.boundaryMesh()[tgtPatchi];
tgtPatchStabilisations_.set(i, new patchToPatchStabilisation()); tgtPatchStabilisations_.set(i, new patchToPatchStabilisation());

View File

@ -186,7 +186,7 @@ Foam::nonConformalBoundary::nonConformalBoundary(const polyMesh& mesh)
MoveableMeshObject, MoveableMeshObject,
nonConformalBoundary nonConformalBoundary
>(mesh), >(mesh),
ownerOrigBoundary_(boundary(ownerOrigPatchIDs())), ownerOrigBoundary_(boundary(ownerOrigPatchIndices())),
meshPointOwnerOrigBoundaryPointPtr_(nullptr), meshPointOwnerOrigBoundaryPointPtr_(nullptr),
ownerOrigBoundaryPointMeshPointPtr_(nullptr), ownerOrigBoundaryPointMeshPointPtr_(nullptr),
ownerOrigBoundaryEdgeMeshEdgePtr_(nullptr), ownerOrigBoundaryEdgeMeshEdgePtr_(nullptr),
@ -254,28 +254,28 @@ Foam::labelList Foam::nonConformalBoundary::nonConformalNonCoupledPatchIDs
} }
Foam::labelList Foam::nonConformalBoundary::allOrigPatchIDs() const Foam::labelList Foam::nonConformalBoundary::allOrigPatchIndices() const
{ {
auto method = &nonConformalCoupledPolyPatch::origPatchID; auto method = &nonConformalCoupledPolyPatch::origPatchID;
return nonConformalNonCoupledPatchIDs(0, method); return nonConformalNonCoupledPatchIDs(0, method);
} }
Foam::labelList Foam::nonConformalBoundary::allErrorPatchIDs() const Foam::labelList Foam::nonConformalBoundary::allErrorPatchIndices() const
{ {
auto method = &nonConformalCoupledPolyPatch::errorPatchID; auto method = &nonConformalCoupledPolyPatch::errorPatchID;
return nonConformalNonCoupledPatchIDs(0, method); return nonConformalNonCoupledPatchIDs(0, method);
} }
Foam::labelList Foam::nonConformalBoundary::ownerOrigPatchIDs() const Foam::labelList Foam::nonConformalBoundary::ownerOrigPatchIndices() const
{ {
auto method = &nonConformalCoupledPolyPatch::origPatchID; auto method = &nonConformalCoupledPolyPatch::origPatchID;
return nonConformalNonCoupledPatchIDs(1, method); return nonConformalNonCoupledPatchIDs(1, method);
} }
Foam::labelList Foam::nonConformalBoundary::ownerErrorPatchIDs() const Foam::labelList Foam::nonConformalBoundary::ownerErrorPatchIndices() const
{ {
auto method = &nonConformalCoupledPolyPatch::errorPatchID; auto method = &nonConformalCoupledPolyPatch::errorPatchID;
return nonConformalNonCoupledPatchIDs(1, method); return nonConformalNonCoupledPatchIDs(1, method);
@ -339,7 +339,7 @@ Foam::nonConformalBoundary::ownerOrigBoundaryEdgeMeshEdge() const
if (!ownerOrigBoundaryEdgeMeshEdgePtr_.valid()) if (!ownerOrigBoundaryEdgeMeshEdgePtr_.valid())
{ {
// Create boundary of all owner-orig and proc patches // Create boundary of all owner-orig and proc patches
labelList ownerOrigAndProcPatchIDs = this->ownerOrigPatchIDs(); labelList ownerOrigAndProcPatchIDs = this->ownerOrigPatchIndices();
forAll(mesh().boundaryMesh(), patchi) forAll(mesh().boundaryMesh(), patchi)
{ {
if (isA<processorPolyPatch>(mesh().boundaryMesh()[patchi])) if (isA<processorPolyPatch>(mesh().boundaryMesh()[patchi]))

View File

@ -153,16 +153,16 @@ public:
) const; ) const;
//- Return a list of the orig patch indices //- Return a list of the orig patch indices
labelList allOrigPatchIDs() const; labelList allOrigPatchIndices() const;
//- Return a list of the error patch indices //- Return a list of the error patch indices
labelList allErrorPatchIDs() const; labelList allErrorPatchIndices() const;
//- Return a list of the owner-orig patch indices //- Return a list of the owner-orig patch indices
labelList ownerOrigPatchIDs() const; labelList ownerOrigPatchIndices() const;
//- Return a list of the owner error patch indices //- Return a list of the owner error patch indices
labelList ownerErrorPatchIDs() const; labelList ownerErrorPatchIndices() const;
//- Get a map from owner-orig boundary point to mesh point //- Get a map from owner-orig boundary point to mesh point
const labelList& ownerOrigBoundaryPointMeshPoint() const; const labelList& ownerOrigBoundaryPointMeshPoint() const;

View File

@ -49,7 +49,7 @@ Foam::pointDist::pointDist
dimensionedScalar(dimLength, great) dimensionedScalar(dimLength, great)
), ),
points_(points), points_(points),
patchIDs_(patchIDs), patchIndices_(patchIDs),
nUnset_(0) nUnset_(0)
{ {
correct(); correct();
@ -76,8 +76,8 @@ Foam::pointDist::pointDist
dimensionedScalar(dimLength, great) dimensionedScalar(dimLength, great)
), ),
points_(points), points_(points),
patchIDs_(patchIDs), patchIndices_(patchIDs),
zoneIDs_(zoneIDs), zoneIndices_(zoneIDs),
nUnset_(0) nUnset_(0)
{ {
correct(); correct();
@ -98,13 +98,13 @@ void Foam::pointDist::correct()
label nPatchPoints = 0; label nPatchPoints = 0;
forAllConstIter(labelHashSet, patchIDs_, iter) forAllConstIter(labelHashSet, patchIndices_, iter)
{ {
const label patchi = iter.key(); const label patchi = iter.key();
nPatchPoints += pbm[patchi].meshPoints().size(); nPatchPoints += pbm[patchi].meshPoints().size();
} }
forAllConstIter(labelHashSet, zoneIDs_, iter) forAllConstIter(labelHashSet, zoneIndices_, iter)
{ {
const label zonei = iter.key(); const label zonei = iter.key();
nPatchPoints += mesh()().pointZones()[zonei].size(); nPatchPoints += mesh()().pointZones()[zonei].size();
@ -118,7 +118,7 @@ void Foam::pointDist::correct()
nPatchPoints = 0; nPatchPoints = 0;
// Add the patch points to the patchPointsInfo // Add the patch points to the patchPointsInfo
forAllConstIter(labelHashSet, patchIDs_, iter) forAllConstIter(labelHashSet, patchIndices_, iter)
{ {
const label patchi = iter.key(); const label patchi = iter.key();
const labelList& mp = pbm[patchi].meshPoints(); const labelList& mp = pbm[patchi].meshPoints();
@ -137,7 +137,7 @@ void Foam::pointDist::correct()
} }
// Add the zone points to the patchPointsInfo // Add the zone points to the patchPointsInfo
forAllConstIter(labelHashSet, zoneIDs_, iter) forAllConstIter(labelHashSet, zoneIndices_, iter)
{ {
const label zonei = iter.key(); const label zonei = iter.key();
const labelList& zonePoints = mesh()().pointZones()[zonei]; const labelList& zonePoints = mesh()().pointZones()[zonei];
@ -191,7 +191,7 @@ void Foam::pointDist::correct()
} }
} }
forAllConstIter(labelHashSet, zoneIDs_, iter) forAllConstIter(labelHashSet, zoneIndices_, iter)
{ {
const label zonei = iter.key(); const label zonei = iter.key();
const labelList& zonePoints = mesh()().pointZones()[zonei]; const labelList& zonePoints = mesh()().pointZones()[zonei];

View File

@ -59,10 +59,10 @@ class pointDist
const pointField& points_; const pointField& points_;
//- Set of patch IDs //- Set of patch IDs
const labelHashSet patchIDs_; const labelHashSet patchIndices_;
//- Set of pointZone IDs for which the distance is 0 //- Set of pointZone IDs for which the distance is 0
const labelHashSet zoneIDs_; const labelHashSet zoneIndices_;
//- Number of unset points //- Number of unset points
label nUnset_; label nUnset_;

View File

@ -55,18 +55,18 @@ Foam::multiSolidBodyMotionSolver::multiSolidBodyMotionSolver
: :
points0MotionSolver(name, mesh, dict, typeName) points0MotionSolver(name, mesh, dict, typeName)
{ {
zoneIDs_.setSize(coeffDict().size()); zoneIndices_.setSize(coeffDict().size());
SBMFs_.setSize(coeffDict().size()); SBMFs_.setSize(coeffDict().size());
pointIDs_.setSize(coeffDict().size()); pointIndices_.setSize(coeffDict().size());
label zonei = 0; label zonei = 0;
forAllConstIter(dictionary, coeffDict(), iter) forAllConstIter(dictionary, coeffDict(), iter)
{ {
if (iter().isDict()) if (iter().isDict())
{ {
zoneIDs_[zonei] = mesh.cellZones().findIndex(iter().keyword()); zoneIndices_[zonei] = mesh.cellZones().findIndex(iter().keyword());
if (zoneIDs_[zonei] == -1) if (zoneIndices_[zonei] == -1)
{ {
FatalIOErrorInFunction FatalIOErrorInFunction
( (
@ -85,7 +85,7 @@ Foam::multiSolidBodyMotionSolver::multiSolidBodyMotionSolver
); );
// Collect points of cell zone. // Collect points of cell zone.
const cellZone& cz = mesh.cellZones()[zoneIDs_[zonei]]; const cellZone& cz = mesh.cellZones()[zoneIndices_[zonei]];
boolList movePts(mesh.nPoints(), false); boolList movePts(mesh.nPoints(), false);
@ -115,18 +115,19 @@ Foam::multiSolidBodyMotionSolver::multiSolidBodyMotionSolver
} }
} }
pointIDs_[zonei].transfer(ptIDs); pointIndices_[zonei].transfer(ptIDs);
Info<< "Applying solid body motion " << SBMFs_[zonei].type() Info<< "Applying solid body motion " << SBMFs_[zonei].type()
<< " to " << pointIDs_[zonei].size() << " points of cellZone " << " to " << pointIndices_[zonei].size()
<< iter().keyword() << endl; << " points of cellZone " << iter().keyword()
<< endl;
zonei++; zonei++;
} }
} }
zoneIDs_.setSize(zonei); zoneIndices_.setSize(zonei);
SBMFs_.setSize(zonei); SBMFs_.setSize(zonei);
pointIDs_.setSize(zonei); pointIndices_.setSize(zonei);
} }
@ -143,9 +144,9 @@ Foam::tmp<Foam::pointField> Foam::multiSolidBodyMotionSolver::curPoints() const
tmp<pointField> ttransformedPts(new pointField(mesh().points())); tmp<pointField> ttransformedPts(new pointField(mesh().points()));
pointField& transformedPts = ttransformedPts.ref(); pointField& transformedPts = ttransformedPts.ref();
forAll(zoneIDs_, i) forAll(zoneIndices_, i)
{ {
const labelList& zonePoints = pointIDs_[i]; const labelList& zonePoints = pointIndices_[i];
UIndirectList<point>(transformedPts, zonePoints) = transformPoints UIndirectList<point>(transformedPts, zonePoints) = transformPoints
( (

View File

@ -58,10 +58,10 @@ class multiSolidBodyMotionSolver
PtrList<solidBodyMotionFunction> SBMFs_; PtrList<solidBodyMotionFunction> SBMFs_;
//- Specified cellZones //- Specified cellZones
labelList zoneIDs_; labelList zoneIndices_;
//- Points to move per cellZone //- Points to move per cellZone
labelListList pointIDs_; labelListList pointIndices_;
public: public:

View File

@ -46,11 +46,11 @@ namespace Foam
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::solidBodyMotionSolver::updateSetPointIDs() void Foam::solidBodyMotionSolver::updateSetPointIndices()
{ {
if (set_.selectionType() == polyCellSet::selectionTypes::all) if (set_.selectionType() == polyCellSet::selectionTypes::all)
{ {
setPointIDs_.clear(); setPointIndices_.clear();
return; return;
} }
@ -71,14 +71,14 @@ void Foam::solidBodyMotionSolver::updateSetPointIDs()
syncTools::syncPointList(mesh(), pointInSet, orEqOp<bool>(), false); syncTools::syncPointList(mesh(), pointInSet, orEqOp<bool>(), false);
setPointIDs_.resize(count(pointInSet, true)); setPointIndices_.resize(count(pointInSet, true));
label setPointi = 0; label setPointi = 0;
forAll(pointInSet, pointi) forAll(pointInSet, pointi)
{ {
if (pointInSet[pointi]) if (pointInSet[pointi])
{ {
setPointIDs_[setPointi ++] = pointi; setPointIndices_[setPointi ++] = pointi;
} }
} }
} }
@ -96,7 +96,7 @@ Foam::solidBodyMotionSolver::solidBodyMotionSolver
points0MotionSolver(name, mesh, dict, typeName), points0MotionSolver(name, mesh, dict, typeName),
SBMFPtr_(solidBodyMotionFunction::New(coeffDict(), mesh.time())), SBMFPtr_(solidBodyMotionFunction::New(coeffDict(), mesh.time())),
set_(mesh, dict), set_(mesh, dict),
setPointIDs_(), setPointIndices_(),
transform_(SBMFPtr_().transformation()) transform_(SBMFPtr_().transformation())
{ {
if (set_.selectionType() == polyCellSet::selectionTypes::all) if (set_.selectionType() == polyCellSet::selectionTypes::all)
@ -104,7 +104,7 @@ Foam::solidBodyMotionSolver::solidBodyMotionSolver
Info<< "Applying solid body motion to entire mesh" << endl; Info<< "Applying solid body motion to entire mesh" << endl;
} }
updateSetPointIDs(); updateSetPointIndices();
} }
@ -129,10 +129,10 @@ Foam::tmp<Foam::pointField> Foam::solidBodyMotionSolver::curPoints() const
tmp<pointField> ttransformedPts(new pointField(mesh().points())); tmp<pointField> ttransformedPts(new pointField(mesh().points()));
pointField& transformedPts = ttransformedPts.ref(); pointField& transformedPts = ttransformedPts.ref();
UIndirectList<point>(transformedPts, setPointIDs_) = transformPoints UIndirectList<point>(transformedPts, setPointIndices_) = transformPoints
( (
transform_, transform_,
pointField(points0_, setPointIDs_) pointField(points0_, setPointIndices_)
); );
return ttransformedPts; return ttransformedPts;
@ -143,14 +143,14 @@ Foam::tmp<Foam::pointField> Foam::solidBodyMotionSolver::curPoints() const
void Foam::solidBodyMotionSolver::topoChange(const polyTopoChangeMap& map) void Foam::solidBodyMotionSolver::topoChange(const polyTopoChangeMap& map)
{ {
set_.topoChange(map); set_.topoChange(map);
updateSetPointIDs(); updateSetPointIndices();
boolList pointInSet boolList pointInSet
( (
mesh().nPoints(), mesh().nPoints(),
set_.selectionType() == polyCellSet::selectionTypes::all set_.selectionType() == polyCellSet::selectionTypes::all
); );
UIndirectList<bool>(pointInSet, setPointIDs_) = true; UIndirectList<bool>(pointInSet, setPointIndices_) = true;
// pointMesh already updates pointFields // pointMesh already updates pointFields
@ -203,7 +203,7 @@ void Foam::solidBodyMotionSolver::distribute(const polyDistributionMap& map)
points0MotionSolver::distribute(map); points0MotionSolver::distribute(map);
set_.distribute(map); set_.distribute(map);
updateSetPointIDs(); updateSetPointIndices();
} }
@ -212,7 +212,7 @@ void Foam::solidBodyMotionSolver::mapMesh(const polyMeshMap& map)
points0MotionSolver::mapMesh(map); points0MotionSolver::mapMesh(map);
set_.mapMesh(map); set_.mapMesh(map);
updateSetPointIDs(); updateSetPointIndices();
} }

View File

@ -62,7 +62,7 @@ class solidBodyMotionSolver
polyCellSet set_; polyCellSet set_;
//- Points to move when cell zone is supplied //- Points to move when cell zone is supplied
labelList setPointIDs_; labelList setPointIndices_;
//- Cache the current transform for topoChange //- Cache the current transform for topoChange
mutable septernion transform_; mutable septernion transform_;
@ -71,7 +71,7 @@ class solidBodyMotionSolver
// Private Member Functions // Private Member Functions
//- Re-calculate the set point ID-s from the set, following mesh change //- Re-calculate the set point ID-s from the set, following mesh change
void updateSetPointIDs(); void updateSetPointIndices();
public: public:

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2016-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2016-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -47,7 +47,7 @@ void Foam::RBD::rigidBodyModel::initialiseRootBody()
{ {
bodies_.append(new masslessBody("root")); bodies_.append(new masslessBody("root"));
lambda_.append(0); lambda_.append(0);
bodyIDs_.insert("root", 0); bodyIndices_.insert("root", 0);
joints_.append(new joints::null(*this)); joints_.append(new joints::null(*this));
XT_.append(spatialTransform()); XT_.append(spatialTransform());
@ -128,7 +128,7 @@ Foam::label Foam::RBD::rigidBodyModel::join_
const rigidBody& body = bodyPtr(); const rigidBody& body = bodyPtr();
bodies_.append(bodyPtr); bodies_.append(bodyPtr);
const label bodyID = nBodies()-1; const label bodyID = nBodies()-1;
bodyIDs_.insert(body.name(), bodyID); bodyIndices_.insert(body.name(), bodyID);
// If the parentID refers to a merged body find the parent into which it has // If the parentID refers to a merged body find the parent into which it has
// been merged and set lambda and XT accordingly // been merged and set lambda and XT accordingly
@ -361,7 +361,7 @@ Foam::label Foam::RBD::rigidBodyModel::merge
bodies_[sBody.masterID()].merge(sBody); bodies_[sBody.masterID()].merge(sBody);
const label sBodyID = mergedBodyID(mergedBodies_.size() - 1); const label sBodyID = mergedBodyID(mergedBodies_.size() - 1);
bodyIDs_.insert(sBody.name(), sBodyID); bodyIndices_.insert(sBody.name(), sBodyID);
return sBodyID; return sBodyID;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2016-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2016-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -108,7 +108,7 @@ protected:
PtrList<subBody> mergedBodies_; PtrList<subBody> mergedBodies_;
//- Lookup-table of the IDs of the bodies //- Lookup-table of the IDs of the bodies
HashTable<label, word> bodyIDs_; HashTable<label, word> bodyIndices_;
//- List of indices of the parent of each body //- List of indices of the parent of each body
DynamicList<label> lambda_; DynamicList<label> lambda_;

View File

@ -155,7 +155,7 @@ Foam::RBD::rigidBodyModel::mergedBody(label mergedBodyID) const
inline Foam::label Foam::RBD::rigidBodyModel::bodyID(const word& name) const inline Foam::label Foam::RBD::rigidBodyModel::bodyID(const word& name) const
{ {
return bodyIDs_[name]; return bodyIndices_[name];
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -78,17 +78,17 @@ Foam::sampledSurfaces::patch::~patch()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::labelList& Foam::sampledSurfaces::patch::patchIDs() const const Foam::labelList& Foam::sampledSurfaces::patch::patchIndices() const
{ {
if (patchIDs_.empty()) if (patchIndices_.empty())
{ {
patchIDs_ = mesh().boundaryMesh().patchSet patchIndices_ = mesh().boundaryMesh().patchSet
( (
patchNames_, patchNames_,
false false
).sortedToc(); ).sortedToc();
} }
return patchIDs_; return patchIndices_;
} }
@ -108,7 +108,7 @@ bool Foam::sampledSurfaces::patch::expire()
sampledSurface::clearGeom(); sampledSurface::clearGeom();
MeshStorage::clear(); MeshStorage::clear();
patchIDs_.clear(); patchIndices_.clear();
patchIndex_.clear(); patchIndex_.clear();
patchFaceLabels_.clear(); patchFaceLabels_.clear();
patchStart_.clear(); patchStart_.clear();
@ -126,9 +126,9 @@ bool Foam::sampledSurfaces::patch::update()
} }
label sz = 0; label sz = 0;
forAll(patchIDs(), i) forAll(patchIndices(), i)
{ {
label patchi = patchIDs()[i]; label patchi = patchIndices()[i];
const polyPatch& pp = mesh().boundaryMesh()[patchi]; const polyPatch& pp = mesh().boundaryMesh()[patchi];
if (isA<emptyPolyPatch>(pp)) if (isA<emptyPolyPatch>(pp))
@ -145,14 +145,14 @@ bool Foam::sampledSurfaces::patch::update()
// patch. // patch.
patchIndex_.setSize(sz); patchIndex_.setSize(sz);
patchFaceLabels_.setSize(sz); patchFaceLabels_.setSize(sz);
patchStart_.setSize(patchIDs().size()); patchStart_.setSize(patchIndices().size());
labelList meshFaceLabels(sz); labelList meshFaceLabels(sz);
sz = 0; sz = 0;
forAll(patchIDs(), i) forAll(patchIndices(), i)
{ {
label patchi = patchIDs()[i]; label patchi = patchIndices()[i];
patchStart_[i] = sz; patchStart_[i] = sz;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -83,7 +83,7 @@ class patch
const wordReList patchNames_; const wordReList patchNames_;
//- Corresponding patchIDs //- Corresponding patchIDs
mutable labelList patchIDs_; mutable labelList patchIndices_;
//- Triangulated faces or keep faces as is //- Triangulated faces or keep faces as is
bool triangulate_; bool triangulate_;
@ -131,7 +131,7 @@ protected:
return patchNames_; return patchNames_;
} }
const labelList& patchIDs() const; const labelList& patchIndices() const;
const labelList& patchStart() const const labelList& patchStart() const
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -39,7 +39,7 @@ Foam::sampledSurfaces::patch::sampleField
Field<Type>& values = tvalues.ref(); Field<Type>& values = tvalues.ref();
forAll(patchFaceLabels_, i) forAll(patchFaceLabels_, i)
{ {
label patchi = patchIDs_[patchIndex_[i]]; label patchi = patchIndices_[patchIndex_[i]];
const Field<Type>& bField = vField.boundaryField()[patchi]; const Field<Type>& bField = vField.boundaryField()[patchi];
values[i] = bField[patchFaceLabels_[i]]; values[i] = bField[patchFaceLabels_[i]];
} }
@ -61,7 +61,7 @@ Foam::sampledSurfaces::patch::sampleField
forAll(patchFaceLabels_, i) forAll(patchFaceLabels_, i)
{ {
label patchi = patchIDs_[patchIndex_[i]]; label patchi = patchIndices_[patchIndex_[i]];
values[i] = sField.boundaryField()[patchi][patchFaceLabels_[i]]; values[i] = sField.boundaryField()[patchi][patchFaceLabels_[i]];
} }
@ -86,7 +86,7 @@ Foam::sampledSurfaces::patch::interpolateField
forAll(faces(), cutFacei) forAll(faces(), cutFacei)
{ {
label patchi = patchIDs_[patchIndex_[cutFacei]]; label patchi = patchIndices_[patchIndex_[cutFacei]];
const polyPatch& pp = mesh().boundaryMesh()[patchi]; const polyPatch& pp = mesh().boundaryMesh()[patchi];
label patchFacei = patchFaceLabels()[cutFacei]; label patchFacei = patchFaceLabels()[cutFacei];
const face& f = faces()[cutFacei]; const face& f = faces()[cutFacei];

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -48,7 +48,7 @@ Foam::sampledSurfaces::patchInternalField::patchInternalField
) )
: :
patch(name, mesh, dict), patch(name, mesh, dict),
mappers_(patchIDs().size()) mappers_(patchIndices().size())
{ {
// Negate the distance so that we sample cells inside the patch // Negate the distance so that we sample cells inside the patch
dictionary mappersDict(dict); dictionary mappersDict(dict);
@ -57,14 +57,14 @@ Foam::sampledSurfaces::patchInternalField::patchInternalField
mappersDict.set("distance", -mappersDict.lookup<scalar>("distance")); mappersDict.set("distance", -mappersDict.lookup<scalar>("distance"));
} }
forAll(patchIDs(), i) forAll(patchIndices(), i)
{ {
mappers_.set mappers_.set
( (
i, i,
new mappedInternalPatchBase new mappedInternalPatchBase
( (
mesh.boundaryMesh()[patchIDs()[i]], mesh.boundaryMesh()[patchIndices()[i]],
mappersDict mappersDict
) )
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -72,15 +72,15 @@ Foam::sampledSurfaces::patchInternalField::interpolateField
) const ) const
{ {
label sz = 0; label sz = 0;
forAll(patchIDs(), i) forAll(patchIndices(), i)
{ {
sz += mesh().boundaryMesh()[patchIDs()[i]].size(); sz += mesh().boundaryMesh()[patchIndices()[i]].size();
} }
Field<Type> allPatchVals(sz); Field<Type> allPatchVals(sz);
sz = 0; sz = 0;
forAll(patchIDs(), i) forAll(patchIndices(), i)
{ {
// Cells on which samples are generated // Cells on which samples are generated
const labelList& sampleCells = mappers_[i].cellIndices(); const labelList& sampleCells = mappers_[i].cellIndices();
@ -115,9 +115,9 @@ Foam::sampledSurfaces::patchInternalField::interpolateField
labelList meshFaceLabels(allPatchVals.size()); labelList meshFaceLabels(allPatchVals.size());
sz = 0; sz = 0;
forAll(patchIDs(), i) forAll(patchIndices(), i)
{ {
const polyPatch& pp = mesh().boundaryMesh()[patchIDs()[i]]; const polyPatch& pp = mesh().boundaryMesh()[patchIndices()[i]];
forAll(pp, i) forAll(pp, i)
{ {
meshFaceLabels[sz++] = pp.start()+i; meshFaceLabels[sz++] = pp.start()+i;