From f498d09dbfdd1e4da0051d5ef07705a98187052d Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 16 Jan 2019 21:33:06 +0100 Subject: [PATCH] ENH: add simplified gather methods for globalIndex with default communicator - when combining lists in processor order this simplifies code and reduces memory overhead. Write this: ---- labelList collected; const globalIndex sizing(input.size()); sizing.gather(input, collected); ---- OR ---- labelList collected; globalIndex::gatherOp(input, collected); ---- Instead of this: ---- labelList collected; List scratch(Pstream::nProcs()); scratch[Pstream::myProcNo()] = input; Pstream::gatherList(scratch); if (Pstream::master()) { collected = ListListOps::combine ( scratch, accessOp() ); } scratch.clear(); ---- --- .../manipulation/checkMesh/checkGeometry.C | 26 +---- .../moveDynamicMesh/moveDynamicMesh.C | 15 +-- src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H | 36 +++--- .../polyMesh/globalMeshData/globalIndex.C | 38 +++--- .../polyMesh/globalMeshData/globalIndex.H | 91 ++++++++++++--- .../polyMesh/globalMeshData/globalIndexI.H | 18 ++- .../globalMeshData/globalIndexTemplates.C | 109 +++++++++++++++++- .../field/AMIWeights/AMIWeights.C | 26 +---- .../meshRefinement/meshRefinementTemplates.C | 8 +- 9 files changed, 236 insertions(+), 131 deletions(-) diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C b/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C index 5b096c1a87..76f9bbe690 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C +++ b/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C @@ -1014,12 +1014,6 @@ Foam::label Foam::checkGeometry scalarField mergedWeights; globalFaces().gather ( - UPstream::worldComm, - ListOps::create