diff --git a/src/parallel/decompose/decompositionMethods/decompositionConstraints/singleProcessorFaceSets/singleProcessorFaceSetsConstraint.C b/src/parallel/decompose/decompositionMethods/decompositionConstraints/singleProcessorFaceSets/singleProcessorFaceSetsConstraint.C index 3393b49683..d41bcd613b 100644 --- a/src/parallel/decompose/decompositionMethods/decompositionConstraints/singleProcessorFaceSets/singleProcessorFaceSetsConstraint.C +++ b/src/parallel/decompose/decompositionMethods/decompositionConstraints/singleProcessorFaceSets/singleProcessorFaceSetsConstraint.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2018 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2015-2016 OpenFOAM Foundation @@ -159,9 +159,9 @@ void Foam::decompositionConstraints::singleProcessorFaceSets::add // Check that it does not overlap with existing specifiedProcessorFaces labelList nMatch(specifiedProcessorFaces.size(), Zero); - forAllConstIter(faceSet, fz, iter) + for (const label facei : fz) { - label seti = faceToSet[iter.key()]; + const label seti = faceToSet[facei]; if (seti != -1) { ++nMatch[seti]; @@ -191,7 +191,6 @@ void Foam::decompositionConstraints::singleProcessorFaceSets::add reduce(store, andOp()); - if (store) { specifiedProcessorFaces.append(new labelList(fz.sortedToc())); diff --git a/src/parallel/distributed/distributedTriSurfaceMesh/distributedTriSurfaceMeshTemplates.C b/src/parallel/distributed/distributedTriSurfaceMesh/distributedTriSurfaceMeshTemplates.C index 3c9bebd118..6d72114fe0 100644 --- a/src/parallel/distributed/distributedTriSurfaceMesh/distributedTriSurfaceMeshTemplates.C +++ b/src/parallel/distributed/distributedTriSurfaceMesh/distributedTriSurfaceMeshTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2013 OpenFOAM Foundation @@ -39,8 +39,7 @@ License // List& values //) const //{ -// typedef DimensionedField DimensionedSurfField; -// +// typedef DimensionedField fieldType; // // // Get query data (= local index of triangle) // // ~~~~~~~~~~~~~~ @@ -60,10 +59,8 @@ License // // Do my tests // // ~~~~~~~~~~~ // -// const DimensionedSurfField& fld = lookupObject -// ( -// fieldName -// ); +// const auto& fld = lookupObject(fieldName); +// // const triSurface& s = static_cast(*this); // // values.setSize(triangleIndex.size()); @@ -88,33 +85,24 @@ void Foam::distributedTriSurfaceMesh::distributeFields const mapDistribute& map ) { - typedef DimensionedField DimensionedSurfField; + typedef DimensionedField fieldType; - HashTable fields + HashTable fields ( - objectRegistry::lookupClass() + objectRegistry::lookupClass() ); - for - ( - typename HashTable::iterator fieldIter = - fields.begin(); - fieldIter != fields.end(); - ++fieldIter - ) + forAllIters(fields, fieldIter) { - DimensionedSurfField& field = *fieldIter(); + fieldType& field = *fieldIter(); - label oldSize = field.size(); + const label oldSize = field.size(); map.distribute(field); - if (debug) - { - Info<< "Mapped " << field.typeName << ' ' << field.name() - << " from size " << oldSize << " to size " << field.size() - << endl; - } + DebugInfo + << "Mapped " << field.typeName << ' ' << field.name() + << " from size " << oldSize << " to size " << field.size() << endl; } }