From 328513fcaa7200c5fdb6f7e18a3f0f9a35d5d706 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 29 Oct 2019 10:46:33 +0100 Subject: [PATCH] ENH: use List instead of UList for internal decomposition implementation - enables future use of precision adaptors --- src/dummyThirdParty/MGridGen/dummyMGridGen.C | 12 +- src/dummyThirdParty/MGridGen/mgridgen.h | 4 - .../kahipDecomp/dummyKahipDecomp.C | 26 ++- .../kahipDecomp/kaHIP_interface.h | 9 +- .../metisDecomp/dummyMetisDecomp.C | 26 ++- src/dummyThirdParty/metisDecomp/metis.h | 9 +- .../ptscotchDecomp/dummyPtscotchDecomp.C | 48 ++--- .../scotchDecomp/dummyScotchDecomp.C | 44 ++-- .../metisLikeDecomp/metisLikeDecomp.C | 14 +- .../metisLikeDecomp/metisLikeDecomp.H | 36 ++-- .../decompose/kahipDecomp/kahipDecomp.C | 18 +- .../decompose/kahipDecomp/kahipDecomp.H | 14 +- .../decompose/metisDecomp/metisDecomp.C | 12 +- .../decompose/metisDecomp/metisDecomp.H | 17 +- .../decompose/ptscotchDecomp/ptscotchDecomp.C | 202 ++---------------- .../decompose/ptscotchDecomp/ptscotchDecomp.H | 15 +- .../decompose/scotchDecomp/scotchDecomp.C | 122 ++--------- .../decompose/scotchDecomp/scotchDecomp.H | 17 +- 18 files changed, 183 insertions(+), 462 deletions(-) diff --git a/src/dummyThirdParty/MGridGen/dummyMGridGen.C b/src/dummyThirdParty/MGridGen/dummyMGridGen.C index 87ada3a21b..d73bbeb4c4 100644 --- a/src/dummyThirdParty/MGridGen/dummyMGridGen.C +++ b/src/dummyThirdParty/MGridGen/dummyMGridGen.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-2015 OpenFOAM Foundation @@ -37,13 +37,9 @@ using namespace Foam; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // static const char* notImplementedMessage = -"You are trying to use MGridGen but do not have the MGridGen library loaded.\n" -"This message is from the dummy MGridGen stub library instead.\n" -"\n" -"Normally the MGridGen library will be loaded through the LD_LIBRARY_PATH\n" -"environment variable but you are picking up this dummy library from the\n" -"$FOAM_LIBBIN/dummy directory. Please install MGridGen and make sure the\n" -"libMGridGen.so is in your LD_LIBRARY_PATH."; +"Attempted use without the MGridGen library loaded.\n" +"This message is from the dummy MGridGen stub library instead.\n\n" +"Please install and ensure libMGridGen.so is in LD_LIBRARY_PATH.\n"; #ifdef __cplusplus extern "C" diff --git a/src/dummyThirdParty/MGridGen/mgridgen.h b/src/dummyThirdParty/MGridGen/mgridgen.h index 54628324c8..11c03987b9 100644 --- a/src/dummyThirdParty/MGridGen/mgridgen.h +++ b/src/dummyThirdParty/MGridGen/mgridgen.h @@ -47,10 +47,6 @@ SourceFiles // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -/*---------------------------------------------------------------------------*\ - Class metis Declaration -\*---------------------------------------------------------------------------*/ - #ifdef __cplusplus extern "C" #endif diff --git a/src/dummyThirdParty/kahipDecomp/dummyKahipDecomp.C b/src/dummyThirdParty/kahipDecomp/dummyKahipDecomp.C index c0e7d8f361..7b80103fbc 100644 --- a/src/dummyThirdParty/kahipDecomp/dummyKahipDecomp.C +++ b/src/dummyThirdParty/kahipDecomp/dummyKahipDecomp.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,17 +25,15 @@ License #include "kahipDecomp.H" #include "addToRunTimeSelectionTable.H" -#include "Time.H" static const char* notImplementedMessage = -"You are trying to use kahip but do not have the kahipDecomp library loaded." -"\nThis message is from the dummy kahipDecomp stub library instead.\n" -"\n" -"Please install kahip and make sure that libkahip.so is in your " -"LD_LIBRARY_PATH.\n" +"Attempted to use without the kahipDecomp library loaded.\n" +"This message is from the dummy kahipDecomp stub library instead.\n\n" +"Please install and ensure libkahip.so is in LD_LIBRARY_PATH.\n" "The kahipDecomp library can then be built from " -"src/parallel/decompose/kahipDecomp and dynamically loading or linking" -" this library will add kahip as a decomposition method.\n"; +"src/parallel/decompose/kahipDecomp.\n" +"Dynamically loading or linking this library will add " +" as a decomposition method.\n"; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -52,14 +50,14 @@ namespace Foam } -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // Foam::label Foam::kahipDecomp::decomposeSerial ( - const labelUList& adjncy, - const labelUList& xadj, - const UList& cellWeights, - List