From 98246a438e1bb203745b6eaa813bc91280a9e28d Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Sun, 5 Nov 2023 20:46:12 +0100 Subject: [PATCH] ENH: simplify calling of decomposition, support CompactListList - combined most of the unweighted and weighted decomposition routines such that an empty weight field is treated as uniform weighting. This allows default parameters and cuts down on the number of decompose methods. - for topology-driven decomposition, it is now possible to pass in the owner/neighbour connectivity as a CompactListList directly instead of first creating a labelListList (which was internally repacked into a CompactListList in many cases). However, multiLevelDecomp still uses unpacking (to avoid a larger reworking of code). - support direct creation of some methods (eg, random, scotch etc) without a dictionary - fix incorrect neighbour face weighting (fixes #3019) ENH: relocate calcCellCells from decompositionMethod to globalMeshData - makes it more universally available --- .../Test-checkDecomposePar.C | 5 +- .../decomposePar/domainDecompositionDryRun.C | 7 +- src/OpenFOAM/Make/files | 1 + .../polyMesh/globalMeshData/globalMeshData.H | 39 +- .../globalMeshData/globalMeshDataTopology.C | 401 +++++++++++++++ src/dummyThirdParty/MGridGen/Make/files | 2 +- .../{dummyMGridGen.C => dummyMGridGen.cxx} | 0 src/dummyThirdParty/MGridGen/mgridgen.h | 4 +- src/dummyThirdParty/kahipDecomp/Make/files | 2 +- ...ummyKahipDecomp.C => dummyKahipDecomp.cxx} | 8 +- src/dummyThirdParty/metisDecomp/Make/files | 2 +- ...ummyMetisDecomp.C => dummyMetisDecomp.cxx} | 0 src/dummyThirdParty/ptscotchDecomp/Make/files | 2 +- ...scotchDecomp.C => dummyPtscotchDecomp.cxx} | 25 +- src/dummyThirdParty/scotchDecomp/Make/files | 2 +- ...myScotchDecomp.C => dummyScotchDecomp.cxx} | 28 +- .../decompositionMethod/decompositionMethod.C | 462 ++---------------- .../decompositionMethod/decompositionMethod.H | 160 +++--- .../geomDecomp/geomDecomp.C | 13 +- .../geomDecomp/geomDecomp.H | 19 +- .../hierarchGeomDecomp/hierarchGeomDecomp.C | 88 ++-- .../hierarchGeomDecomp/hierarchGeomDecomp.H | 50 +- .../manualDecomp/manualDecomp.C | 6 +- .../manualDecomp/manualDecomp.H | 28 +- .../metisLikeDecomp/metisLikeDecomp.C | 85 +++- .../metisLikeDecomp/metisLikeDecomp.H | 36 +- .../multiLevelDecomp/multiLevelDecomp.C | 82 +++- .../multiLevelDecomp/multiLevelDecomp.H | 28 +- .../decompositionMethods/noDecomp/noDecomp.C | 53 +- .../decompositionMethods/noDecomp/noDecomp.H | 57 ++- .../randomDecomp/randomDecomp.C | 37 +- .../randomDecomp/randomDecomp.H | 44 +- .../simpleGeomDecomp/simpleGeomDecomp.C | 103 ++-- .../simpleGeomDecomp/simpleGeomDecomp.H | 78 ++- .../structuredDecomp/structuredDecomp.C | 8 +- .../structuredDecomp/structuredDecomp.H | 29 +- .../decompose/kahipDecomp/kahipDecomp.C | 16 +- .../decompose/kahipDecomp/kahipDecomp.H | 26 +- .../decompose/metisDecomp/metisDecomp.C | 46 +- .../decompose/metisDecomp/metisDecomp.H | 16 +- .../decompose/ptscotchDecomp/ptscotchDecomp.C | 82 +++- .../decompose/ptscotchDecomp/ptscotchDecomp.H | 36 +- .../decompose/scotchDecomp/scotchDecomp.C | 33 +- .../decompose/scotchDecomp/scotchDecomp.H | 38 +- src/renumber/SloanRenumber/Make/options | 2 - src/renumber/SloanRenumber/SloanRenumber.C | 4 +- .../CuthillMcKeeRenumber.C | 6 +- src/renumber/renumberMethods/Make/options | 6 +- .../renumberMethod/renumberMethod.C | 19 +- .../springRenumber/springRenumber.C | 6 +- 50 files changed, 1365 insertions(+), 965 deletions(-) create mode 100644 src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshDataTopology.C rename src/dummyThirdParty/MGridGen/{dummyMGridGen.C => dummyMGridGen.cxx} (100%) rename src/dummyThirdParty/kahipDecomp/{dummyKahipDecomp.C => dummyKahipDecomp.cxx} (95%) rename src/dummyThirdParty/metisDecomp/{dummyMetisDecomp.C => dummyMetisDecomp.cxx} (100%) rename src/dummyThirdParty/ptscotchDecomp/{dummyPtscotchDecomp.C => dummyPtscotchDecomp.cxx} (88%) rename src/dummyThirdParty/scotchDecomp/{dummyScotchDecomp.C => dummyScotchDecomp.cxx} (88%) diff --git a/applications/test/checkDecomposePar/Test-checkDecomposePar.C b/applications/test/checkDecomposePar/Test-checkDecomposePar.C index d616b013c7..8019fd0d45 100644 --- a/applications/test/checkDecomposePar/Test-checkDecomposePar.C +++ b/applications/test/checkDecomposePar/Test-checkDecomposePar.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2017-2021 OpenCFD Ltd. + Copyright (C) 2017-2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -40,6 +40,7 @@ Description #include "cpuTime.H" #include "IFstream.H" #include "regionProperties.H" +#include "globalMeshData.H" #include "decompositionInformation.H" #include "decompositionModel.H" @@ -123,7 +124,7 @@ int main(int argc, char *argv[]) const label nDomains = max(cellToProc) + 1; CompactListList