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:
@ -55,16 +55,16 @@ void Foam::domainDecomposition::addInterProcFace
|
||||
List<DynamicList<DynamicList<label>>>& interPatchFaces
|
||||
) const
|
||||
{
|
||||
Map<label>::iterator patchiter = nbrToInterPatch[ownerProc].find(nbrProc);
|
||||
|
||||
// Introduce turning index only for internal faces (are duplicated).
|
||||
label ownerIndex = facei+1;
|
||||
label nbrIndex = -(facei+1);
|
||||
const label ownerIndex = facei+1;
|
||||
const label nbrIndex = -(facei+1);
|
||||
|
||||
if (patchiter != nbrToInterPatch[ownerProc].end())
|
||||
const auto patchiter = nbrToInterPatch[ownerProc].cfind(nbrProc);
|
||||
|
||||
if (patchiter.found())
|
||||
{
|
||||
// Existing interproc patch. Add to both sides.
|
||||
label toNbrProcPatchi = patchiter();
|
||||
const label toNbrProcPatchi = *patchiter;
|
||||
interPatchFaces[ownerProc][toNbrProcPatchi].append(ownerIndex);
|
||||
|
||||
if (isInternalFace(facei))
|
||||
@ -76,8 +76,9 @@ void Foam::domainDecomposition::addInterProcFace
|
||||
else
|
||||
{
|
||||
// Create new interproc patches.
|
||||
label toNbrProcPatchi = nbrToInterPatch[ownerProc].size();
|
||||
const label toNbrProcPatchi = nbrToInterPatch[ownerProc].size();
|
||||
nbrToInterPatch[ownerProc].insert(nbrProc, toNbrProcPatchi);
|
||||
|
||||
DynamicList<label> oneFace;
|
||||
oneFace.append(ownerIndex);
|
||||
interPatchFaces[ownerProc].append(oneFace);
|
||||
|
||||
Reference in New Issue
Block a user