From 323daeda3c0be16477b68fd506ba785574599981 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 3 Mar 2022 18:35:11 +0100 Subject: [PATCH] ENH: update CompactListList code - eliminate redundant size_ accounting - drop extra 'Container' template parameter and replace functionality with more flexible pack/unpack methods. There is also a pack() method that handles indirect lists of lists that can be used, for example, to pack a patch slice of faces. Drop the 'operator()' method in favour of unpack to expose and properly document the conversion. Should revisit the corresponding code in some places for optimization potential. - align some method names with globalIndex: totalSize(), maxSize() etc --- .../CompactListList/Test-CompactListList.C | 54 +- .../CompactListList/CompactListList.C | 466 ++++++++----- .../CompactListList/CompactListList.H | 435 +++++++++---- .../CompactListList/CompactListListI.H | 611 ++++++++++++------ .../CompactListList/CompactListListIO.C | 39 +- .../parallel/globalIndex/globalIndex.C | 25 +- .../parallel/globalIndex/globalIndex.H | 4 +- .../globalIndex/globalIndexTemplates.C | 18 +- .../fvMeshDistribute/fvMeshDistribute.C | 8 +- src/meshTools/polyTopoChange/polyTopoChange.C | 7 +- src/meshTools/polyTopoChange/polyTopoChange.H | 4 +- .../decompose/decompositionInformation.C | 2 +- .../decompose/decompositionInformation.H | 6 +- .../decompositionMethod/decompositionMethod.C | 2 +- .../metisLikeDecomp/metisLikeDecomp.C | 27 +- .../multiLevelDecomp/multiLevelDecomp.C | 4 +- .../decompose/ptscotchDecomp/ptscotchDecomp.C | 10 +- .../CuthillMcKeeRenumber.C | 4 +- .../renumberMethod/renumberMethod.C | 6 +- .../renumberMethod/renumberMethod.H | 8 +- .../springRenumber/springRenumber.C | 4 +- 21 files changed, 1170 insertions(+), 574 deletions(-) diff --git a/applications/test/CompactListList/Test-CompactListList.C b/applications/test/CompactListList/Test-CompactListList.C index 2b9593aa29..a8ad0d471e 100644 --- a/applications/test/CompactListList/Test-CompactListList.C +++ b/applications/test/CompactListList/Test-CompactListList.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -24,7 +25,7 @@ License along with OpenFOAM. If not, see . Application - CompactListListTest + Test-CompactListList Description Simple demonstration and test application for the CompactListList class. @@ -32,6 +33,7 @@ Description \*---------------------------------------------------------------------------*/ #include "CompactListList.H" +#include "IndirectList.H" #include "IOstreams.H" #include "StringStream.H" #include "faceList.H" @@ -44,9 +46,9 @@ using namespace Foam; int main(int argc, char *argv[]) { { - // null construct + // Default construct CompactListList