From bf30779b6465efb3d0cb9cb74320bba049b8e133 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 24 Apr 2019 19:03:00 +0200 Subject: [PATCH] ENH: add partial sorting to SortableList --- applications/test/sort/Test-sortList.C | 6 ++- .../Lists/SortableList/SortableList.C | 48 +++++++++++++++++-- .../Lists/SortableList/SortableList.H | 8 +++- 3 files changed, 56 insertions(+), 6 deletions(-) diff --git a/applications/test/sort/Test-sortList.C b/applications/test/sort/Test-sortList.C index 9e511eb07f..4cadeeb65c 100644 --- a/applications/test/sort/Test-sortList.C +++ b/applications/test/sort/Test-sortList.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011 OpenFOAM Foundation @@ -67,6 +67,10 @@ int main(int argc, char *argv[]) Info<< "reverse ..." << nl; printInfo(list1r); + list1r.partialSort(list1r.size()/2); + Info<< "partial sorted ..." << nl; + printInfo(list1r); + SortableList