mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: for-range, forAllIters() ... in applications/utilities
- reduced clutter when iterating over containers
This commit is contained in:
@ -151,10 +151,8 @@ Foam::parLagrangianRedistributor::redistributeLagrangianPositions
|
||||
labelList destProc(lpi.size());
|
||||
|
||||
label particleI = 0;
|
||||
forAllIter(passivePositionParticleCloud, lpi, iter)
|
||||
for (passivePositionParticle& ppi : lpi)
|
||||
{
|
||||
passivePositionParticle& ppi = iter();
|
||||
|
||||
const label destProcI = destinationProcID_[ppi.cell()];
|
||||
const label destCellI = destinationCell_[ppi.cell()];
|
||||
|
||||
@ -222,14 +220,8 @@ Foam::parLagrangianRedistributor::redistributeLagrangianPositions
|
||||
passivePositionParticle::iNew(tgtMesh_)
|
||||
);
|
||||
|
||||
forAllIter
|
||||
(
|
||||
IDLList<passivePositionParticle>,
|
||||
newParticles,
|
||||
newpIter
|
||||
)
|
||||
for (passivePositionParticle& newp : newParticles)
|
||||
{
|
||||
passivePositionParticle& newp = newpIter();
|
||||
lagrangianPositions.addParticle(newParticles.remove(&newp));
|
||||
}
|
||||
}
|
||||
|
||||
@ -284,7 +284,7 @@ Foam::label Foam::parLagrangianRedistributor::redistributeStoredFields
|
||||
label nFields = 0;
|
||||
forAllIters(fields, iter)
|
||||
{
|
||||
Container& field = *(iter.object());
|
||||
Container& field = *(iter.val());
|
||||
|
||||
if (!nFields++)
|
||||
{
|
||||
|
||||
@ -746,7 +746,7 @@ void correctCoupledBoundaryConditions(fvMesh& mesh)
|
||||
mesh.objectRegistry::lookupClass<GeoField>()
|
||||
);
|
||||
|
||||
forAllIter(typename HashTable<GeoField*>, flds, iter)
|
||||
forAllIters(flds, iter)
|
||||
{
|
||||
GeoField& fld = *iter();
|
||||
|
||||
@ -1944,16 +1944,11 @@ void readLagrangian
|
||||
);
|
||||
|
||||
|
||||
//forAllConstIter
|
||||
//(
|
||||
// unmappedPassivePositionParticleCloud,
|
||||
// clouds[i],
|
||||
// iter
|
||||
//)
|
||||
//for (passivePositionParticle& p : clouds[i]))
|
||||
//{
|
||||
// Pout<< "Particle position:" << iter().position()
|
||||
// << " cell:" << iter().cell()
|
||||
// << " with cc:" << mesh.cellCentres()[iter().cell()]
|
||||
// Pout<< "Particle position:" << p.position()
|
||||
// << " cell:" << p.cell()
|
||||
// << " with cc:" << mesh.cellCentres()[p.cell()]
|
||||
// << endl;
|
||||
//}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user