From 049617d037d963533d554a1efc9e110f70e05589 Mon Sep 17 00:00:00 2001
From: Mark Olesen <Mark.Olesen@esi-group.com>
Date: Wed, 20 Sep 2017 17:20:54 +0200
Subject: [PATCH] ENH: update List and DynamicList methods (issue #595)

- improve functional compatibility with DynList (remove methods)
  * eg, remove an element from any position in a DynamicList
  * reduce the number of template parameters
  * remove/subset regions of DynamicList

- propagate Swap template specializations for lists, hashtables

- move construct/assignment to various containers.

- add find/found methods for FixedList and UList for a more succinct
  (and clearer?) usage than the equivalent global findIndex() function.

- simplify List_FOR_ALL loops
---
 .../test/DynamicList/Test-DynamicList.C       | 109 ++-
 applications/test/Field/Make/files            |   3 -
 applications/test/Field/Make/options          |   2 -
 applications/test/Field/Test-Field.C          |  11 -
 applications/test/Field/Test-Field.H          |  58 --
 applications/test/FixedList/Test-FixedList.C  |  59 +-
 applications/test/FixedList/fixedListFile     | Bin 30 -> 0 bytes
 applications/test/FixedList2/Make/files       |   3 +
 applications/test/FixedList2/Make/options     |   0
 .../test/FixedList2/Test-FixedList2.C         | 190 ++++++
 applications/test/Function1/Test-Function1.C  |   7 +-
 applications/test/HashSet/Test-hashSet.C      |  25 +
 applications/test/HashTable/Test-hashTable.C  |  28 +
 .../test/IndirectList/Test-IndirectList.C     |  56 +-
 applications/test/List/Test-List.C            |  24 +-
 applications/test/List2/Make/files            |   3 +
 applications/test/List2/Make/options          |   0
 applications/test/List2/Test-List2.C          | 269 ++++++++
 applications/test/ListOps2/Make/files         |   2 +
 applications/test/ListOps2/Make/options       |   3 +
 applications/test/ListOps2/Test-ListOps2.C    | 144 ++++
 applications/test/Map/Test-Map.C              |  58 +-
 .../test/UIndirectList/Test-UIndirectList.C   |  87 ++-
 applications/test/sort/Test-sortList.C        | 167 +++--
 .../ideasUnvToFoam/ideasUnvToFoam.C           |   3 +-
 .../containers/HashTables/HashSet/HashSet.C   |  11 +-
 .../containers/HashTables/HashSet/HashSet.H   |  35 +-
 .../HashTables/HashTable/HashTable.C          |  39 ++
 .../HashTables/HashTable/HashTable.H          |  20 +
 .../HashTables/HashTable/HashTableI.H         |  13 +
 src/OpenFOAM/containers/HashTables/Map/Map.H  |  31 +-
 .../Lists/BiIndirectList/BiIndirectList.H     |  20 +-
 .../Lists/BiIndirectList/BiIndirectListI.H    |  38 +-
 .../Lists/DynamicList/DynamicList.C           |  76 ++-
 .../Lists/DynamicList/DynamicList.H           | 231 +++++--
 .../Lists/DynamicList/DynamicListI.H          | 639 +++++++++++++-----
 .../containers/Lists/FixedList/FixedList.C    |  94 ++-
 .../containers/Lists/FixedList/FixedList.H    |  91 ++-
 .../containers/Lists/FixedList/FixedListI.H   | 115 +++-
 .../Lists/IndirectList/IndirectList.H         |  58 +-
 .../Lists/IndirectList/IndirectListI.H        |   1 -
 src/OpenFOAM/containers/Lists/List/List.C     | 168 +++--
 src/OpenFOAM/containers/Lists/List/List.H     |  59 +-
 src/OpenFOAM/containers/Lists/List/ListI.H    |  14 +-
 .../containers/Lists/List/ListLoopM.H         |  49 +-
 .../Lists/ListOps/ListOpsTemplates.C          |   2 +-
 .../Lists/SortableList/SortableList.C         | 105 ++-
 .../Lists/SortableList/SortableList.H         |  48 +-
 .../Lists/UIndirectList/UIndirectList.C       |  87 +++
 .../Lists/UIndirectList/UIndirectList.H       |  81 ++-
 .../Lists/UIndirectList/UIndirectListI.H      |  11 +
 .../Lists/UIndirectList/UIndirectListIO.C     |   4 +-
 src/OpenFOAM/containers/Lists/UList/UList.C   | 135 +++-
 src/OpenFOAM/containers/Lists/UList/UList.H   |  75 +-
 src/OpenFOAM/containers/Lists/UList/UListI.H  |  59 +-
 .../fields/Fields/DynamicField/DynamicField.C |  24 +-
 .../fields/Fields/DynamicField/DynamicField.H |  56 +-
 .../Fields/DynamicField/DynamicFieldI.H       | 282 ++++----
 src/OpenFOAM/fields/Fields/Field/FieldM.H     | 179 +++--
 src/OpenFOAM/meshes/meshShapes/face/face.H    |   7 +-
 src/OpenFOAM/meshes/meshShapes/face/faceI.H   |   4 +-
 .../meshes/meshShapes/face/faceTemplates.C    |   4 +-
 .../meshes/polyMesh/polyMeshFromShapeMesh.C   |   6 +-
 .../primitiveMesh/primitiveMeshCellEdges.C    |   6 +-
 src/OpenFOAM/primitives/Swap/Swap.H           |  44 +-
 .../enrichedPatch/enrichedPatchPointPoints.C  |   6 +-
 .../searchableBox/searchableBox.C             |   2 +-
 .../searchableRotatedBox.C                    |   2 +-
 .../triSurfaceMesh/triSurfaceMesh.H           |   2 +-
 .../triSurfaceSearch/triSurfaceSearch.C       |   4 +-
 .../triSurfaceSearch/triSurfaceSearch.H       |   2 +-
 wmake/rules/linux64GccKNL/c                   |   2 +-
 wmake/rules/linux64GccKNL/c++                 |   2 +-
 wmake/rules/linux64IccKNL/c++                 |   2 +-
 74 files changed, 3196 insertions(+), 1160 deletions(-)
 delete mode 100644 applications/test/Field/Make/files
 delete mode 100644 applications/test/Field/Make/options
 delete mode 100644 applications/test/Field/Test-Field.C
 delete mode 100644 applications/test/Field/Test-Field.H
 delete mode 100644 applications/test/FixedList/fixedListFile
 create mode 100644 applications/test/FixedList2/Make/files
 create mode 100644 applications/test/FixedList2/Make/options
 create mode 100644 applications/test/FixedList2/Test-FixedList2.C
 create mode 100644 applications/test/List2/Make/files
 create mode 100644 applications/test/List2/Make/options
 create mode 100644 applications/test/List2/Test-List2.C
 create mode 100644 applications/test/ListOps2/Make/files
 create mode 100644 applications/test/ListOps2/Make/options
 create mode 100644 applications/test/ListOps2/Test-ListOps2.C
 create mode 100644 src/OpenFOAM/containers/Lists/UIndirectList/UIndirectList.C

diff --git a/applications/test/DynamicList/Test-DynamicList.C b/applications/test/DynamicList/Test-DynamicList.C
index c8e2ed4a93b..ca3f4fc7872 100644
--- a/applications/test/DynamicList/Test-DynamicList.C
+++ b/applications/test/DynamicList/Test-DynamicList.C
@@ -3,7 +3,7 @@
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
     \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
-     \\/     M anipulation  |
+     \\/     M anipulation  | Copyright (C) 2017 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -27,7 +27,10 @@ Description
 
 #include "DynamicList.H"
 #include "IOstreams.H"
+#include "FlatOutput.H"
 #include "ListOps.H"
+#include "labelRange.H"
+#include "labelIndList.H"
 
 using namespace Foam;
 
@@ -44,15 +47,15 @@ void printInfo
     {
         Info<< " size=\"" << lst.size() << "\"";
     }
-    Info<< ">" << lst << "</" << tag << ">" << endl;
+    Info<< ">" << nl << flatOutput(lst) << nl << "</" << tag << ">" << endl;
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
+template<class T, int SizeMin>
 void printInfo
 (
     const word& tag,
-    const DynamicList<T, SizeInc, SizeMult, SizeDiv>& lst,
+    const DynamicList<T, SizeMin>& lst,
     const bool showSize = false
 )
 {
@@ -62,7 +65,7 @@ void printInfo
         Info<< " size=\"" << lst.size()
             << "\" capacity=\"" << lst.capacity() << "\"";
     }
-    Info<< ">" << lst << "</" << tag << ">" << endl;
+    Info<< ">" << nl << flatOutput(lst) << nl << "</" << tag << ">" << endl;
 }
 
 
@@ -71,7 +74,7 @@ void printInfo
 
 int main(int argc, char *argv[])
 {
-    List<DynamicList<label, 1, 0>> ldl(2);
+    List<DynamicList<label>> ldl(2);
 
     ldl[0](0) = 0;
     ldl[0](2) = 2;
@@ -89,7 +92,7 @@ int main(int argc, char *argv[])
 
     ldl[1] = 3;
 
-    Info<< "<ldl>" << ldl << "</ldl>" << nl << "sizes: ";
+    Info<< "<ldl>" << flatOutput(ldl) << "</ldl>" << nl << "sizes: ";
     forAll(ldl, i)
     {
         Info<< " " << ldl[i].size() << "/" << ldl[i].capacity();
@@ -100,7 +103,7 @@ int main(int argc, char *argv[])
     ll[0].transfer(ldl[0]);
     ll[1].transfer(ldl[1].shrink());
 
-    Info<< "<ldl>" << ldl << "</ldl>" << nl << "sizes: ";
+    Info<< "<ldl>" << flatOutput(ldl) << "</ldl>" << nl << "sizes: ";
     forAll(ldl, i)
     {
         Info<< " " << ldl[i].size() << "/" << ldl[i].capacity();
@@ -111,18 +114,18 @@ int main(int argc, char *argv[])
 
 
     // test the transfer between DynamicLists
-    DynamicList<label, 1, 0> dlA
+    DynamicList<label> dlA
     {
         0, 1, 2, 3, 4
     };
     dlA.append({ 5, 6 });
     dlA = { 1, 2, 4 };
 
-    DynamicList<label, 1, 0> dlB;
+    DynamicList<label> dlB;
 
     dlA.setCapacity(10);
 
-    Info<< "<dlA>" << dlA << "</dlA>" << nl << "sizes: "
+    Info<< "<dlA>" << flatOutput(dlA) << "</dlA>" << nl << "sizes: "
         << " " << dlA.size() << "/" << dlA.capacity() << endl;
 
     dlB.transfer(dlA);
@@ -132,9 +135,9 @@ int main(int argc, char *argv[])
     dlB[6] = 6;
 
     Info<< "Transferred to dlB" << endl;
-    Info<< "<dlA>" << dlA << "</dlA>" << nl << "sizes: "
+    Info<< "<dlA>" << flatOutput(dlA) << "</dlA>" << nl << "sizes: "
         << " " << dlA.size() << "/" << dlA.capacity() << endl;
-    Info<< "<dlB>" << dlB << "</dlB>" << nl << "sizes: "
+    Info<< "<dlB>" << flatOutput(dlB) << "</dlB>" << nl << "sizes: "
         << " " << dlB.size() << "/" << dlB.capacity() << endl;
 
     // try with a normal list:
@@ -166,7 +169,7 @@ int main(int argc, char *argv[])
 
 
     // check allocation granularity
-    DynamicList<label, 6, 0> dlC;
+    DynamicList<label> dlC;
 
     printInfo("dlC", dlC, true);
 
@@ -227,15 +230,89 @@ int main(int argc, char *argv[])
             dlE2[i] *= 10;
         }
 
-        UIndirectList<label> uil
+        labelUIndList uil
         (
             dlE2, addr
         );
         Info<< "use UIndirectList " << uil << " remapped from " << dlE2 << endl;
         dlE4 = uil;
         printInfo("dlE4", dlE4, true);
-     }
+    }
+
+    {
+        Info<< nl << "Test moving:" << nl;
+
+        labelList input1 = identity(15);
+        labelList input2 = identity(15);
+        inplaceReverseList(input2);
+
+        DynamicList<label> list1(std::move(input1));
+        DynamicList<label> list2;
+
+        Info<< "move construct:" << nl
+            << "input: " << flatOutput(input1) << nl
+            << "list:  " << flatOutput(list1) << endl;
+
+        list1 = std::move(input2);
+
+        Info<< "move assignment:" << nl
+            << "input: " << flatOutput(input2) << nl
+            << "list:  " << flatOutput(list1) << endl;
+
+        list2 = std::move(list1);
+        Info<< "list in:  " << flatOutput(list1) << nl
+            << "list out: " << flatOutput(list2) << endl;
+
+        input2 = std::move(identity(15));
+        list2 = std::move(input2);
+        Info<< "list in:  " << flatOutput(input2) << nl
+            << "list out: " << flatOutput(list2) << endl;
+
+        input1 = identity(15);
+        input2 = identity(15);
+        inplaceReverseList(input2);
+
+        Info<< "test move-append with "
+            << flatOutput(input1) << " and " << flatOutput(input2) << endl;
 
+        list2.append(std::move(list1));
+        list2.append(std::move(input1));
+        list2.append(std::move(input2));
+
+        Info<< "result: " << flatOutput(list2) << nl
+            << "inputs: " << flatOutput(list1) << " / "
+            << flatOutput(input1) << " / "
+            << flatOutput(input2) << nl;
+
+
+        input1 = list2;
+
+        Info<< nl << "test subset/remove with "
+            << flatOutput(input1) << endl;
+
+        for
+        (
+            const labelRange range :
+            {
+                labelRange(-10, 8),  // invalid range
+                labelRange(40, 18),  // trailing portion
+                labelRange(-5, 10),  // leading portion
+                labelRange(10, 8),   // mid-portion
+                labelRange(0, input1.size()), // everything
+            }
+        )
+        {
+            list1 = input1;
+            list2 = input1;
+
+            list1.remove(range);
+            list2.subset(range);
+
+            Info<< "input = " << flatOutput(input1) << nl
+                << "remove " << range << " = " << flatOutput(list1) << nl
+                << "subset " << range << " = " << flatOutput(list2) << nl;
+        }
+    }
 
     Info<< "\nEnd\n";
 
diff --git a/applications/test/Field/Make/files b/applications/test/Field/Make/files
deleted file mode 100644
index f8f0bb64df8..00000000000
--- a/applications/test/Field/Make/files
+++ /dev/null
@@ -1,3 +0,0 @@
-Test-Field.C
-
-EXE = $(FOAM_USER_APPBIN)/Test-Field
diff --git a/applications/test/Field/Make/options b/applications/test/Field/Make/options
deleted file mode 100644
index 6a9e9810b3d..00000000000
--- a/applications/test/Field/Make/options
+++ /dev/null
@@ -1,2 +0,0 @@
-/* EXE_INC = -I$(LIB_SRC)/cfdTools/include */
-/* EXE_LIBS = -lfiniteVolume */
diff --git a/applications/test/Field/Test-Field.C b/applications/test/Field/Test-Field.C
deleted file mode 100644
index 2e037f6a34b..00000000000
--- a/applications/test/Field/Test-Field.C
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "Test-Field.H"
-
-int main()
-{
-    Vector<double> v1(1, 2);
-    Vector<double> v2(2, 3);
-
-    std::cout << v1 + v2;
-
-    return 0;
-}
diff --git a/applications/test/Field/Test-Field.H b/applications/test/Field/Test-Field.H
deleted file mode 100644
index bd6929f838e..00000000000
--- a/applications/test/Field/Test-Field.H
+++ /dev/null
@@ -1,58 +0,0 @@
-#include <iostream>
-
-template<class C>
-class Vector;
-
-template<class C>
-Vector<C> operator+(const Vector<C>& v1, const Vector<C>& v2);
-
-template<class C>
-std::ostream& operator<<(std::ostream& os, const Vector<C>& v);
-
-
-/*---------------------------------------------------------------------------*\
-                           Class Vector Declaration
-\*---------------------------------------------------------------------------*/
-
-template<class C>
-class Vector
-{
-
-    double X, Y;
-
-public:
-
-    inline Vector(const double x, const double y);
-
-    C x() const
-    {
-        return X;
-    }
-
-    C y() const
-    {
-        return Y;
-    }
-
-    friend Vector<C> operator+ <C>(const Vector<C>& v1, const Vector<C>& v2);
-
-    friend std::ostream& operator<<(std::ostream& os, const Vector<C>& v)
-    {
-        os  << v.X << '\t' << v.Y << '\n';
-        return os;
-    }
-};
-
-template<class C>
-inline Vector<C>::Vector(const double x, const double y)
-{
-    X = x;
-    Y = y;
-}
-
-
-template<class C>
-inline Vector<C> operator+(const Vector<C>& v1, const Vector<C>& v2)
-{
-    return Vector<C>(v1.X+v2.X, v1.Y+v2.Y);
-}
diff --git a/applications/test/FixedList/Test-FixedList.C b/applications/test/FixedList/Test-FixedList.C
index b057b43f276..a06abee82f6 100644
--- a/applications/test/FixedList/Test-FixedList.C
+++ b/applications/test/FixedList/Test-FixedList.C
@@ -35,6 +35,7 @@ See also
 #include "argList.H"
 #include "FixedList.H"
 #include "Fstream.H"
+#include "List.H"
 #include "IPstream.H"
 #include "OPstream.H"
 
@@ -47,36 +48,44 @@ int main(int argc, char *argv[])
 {
     argList args(argc, argv);
 
-    FixedList<label, 4> list;
-    list[0] = 1;
-    list[1] = 2;
-    list[2] = 3;
-    list[3] = 4;
+    {
+        FixedList<label, 4> list1{1, 2, 3, 4};
 
-    Info<< "list:" << list
-        << " hash:" << FixedList<label, 4>::Hash<>()(list) << endl;
+        Info<< "list1:" << list1
+            << " hash:" << FixedList<label, 4>::Hash<>()(list1) << endl;
 
-    label a[4] = {0, 1, 2, 3};
-    FixedList<label, 4> list2(a);
+        label a[4] = {0, 1, 2, 3};
+        FixedList<label, 4> list2(a);
 
-    Info<< "list2:" << list2
-        << " hash:" << FixedList<label, 4>::Hash<>()(list2) << endl;
+        Info<< "list2:" << list2
+            << " hash:" << FixedList<label, 4>::Hash<>()(list2) << endl;
 
-    // Using FixedList for content too
-    {
-        List<FixedList<label, 4>> twolists{list, list2};
-        Info<<"List of FixedList: " << flatOutput(twolists) << endl;
-        sort(twolists);
-        // outer-sort only
-        Info<<"sorted FixedList : " << flatOutput(twolists) << endl;
-    }
+        // Using FixedList for content too
+        {
+            List<FixedList<label, 4>> twolists{list1, list2};
+            Info<<"List of FixedList: " << flatOutput(twolists) << endl;
+            sort(twolists);
+            // outer-sort only
+            Info<<"sorted FixedList : " << flatOutput(twolists) << endl;
+        }
 
-    Info<< "list: " << list << nl
-        << "list2: " << list2 << endl;
-    list.swap(list2);
-    Info<< "Swapped via the swap() method" << endl;
-    Info<< "list: " << list << nl
-        << "list2: " << list2 << endl;
+        Info<< "====" << nl
+            << "Test swap" << nl;
+
+        Info<< "list1: " << list1 << nl
+            << "list2: " << list2 << endl;
+        list1.swap(list2);
+        Info<< "The swap() method" << endl;
+        Info<< "list1: " << list1 << nl
+            << "list2: " << list2 << endl;
+
+        Swap(list1, list2);
+        Info<< "The Swap() function" << endl;
+        Info<< "list1: " << list1 << nl
+            << "list2: " << list2 << endl;
+
+        Info<< "====" << nl;
+    }
 
     List<label> list3{0, 1, 2, 3};
     FixedList<label, 4> list4(list3.begin(), list3.end());
diff --git a/applications/test/FixedList/fixedListFile b/applications/test/FixedList/fixedListFile
deleted file mode 100644
index 4faae2f6aab9b12b7503643eb87c1756e9139d44..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 30
fcmd-w;?m&KU}RumU;<)IE)5U`;%ahfa&Z9w7<U13

diff --git a/applications/test/FixedList2/Make/files b/applications/test/FixedList2/Make/files
new file mode 100644
index 00000000000..548fa36bc5e
--- /dev/null
+++ b/applications/test/FixedList2/Make/files
@@ -0,0 +1,3 @@
+Test-FixedList2.C
+
+EXE = $(FOAM_USER_APPBIN)/Test-FixedList2
diff --git a/applications/test/FixedList2/Make/options b/applications/test/FixedList2/Make/options
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/applications/test/FixedList2/Test-FixedList2.C b/applications/test/FixedList2/Test-FixedList2.C
new file mode 100644
index 00000000000..efd3cfabdcb
--- /dev/null
+++ b/applications/test/FixedList2/Test-FixedList2.C
@@ -0,0 +1,190 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2017 OpenCFD Ltd.
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+License
+    This file is part of OpenFOAM.
+
+    OpenFOAM is free software: you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
+    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+    for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
+
+Application
+    Test-FixedList2
+
+Description
+    Test speeds, usability of some List/FixedList operations
+
+See also
+    Foam::FixedList
+
+\*---------------------------------------------------------------------------*/
+
+#include "argList.H"
+#include "FixedList.H"
+#include "labelList.H"
+#include "vectorList.H"
+#include "ListOps.H"
+#include "IFstream.H"
+#include "OFstream.H"
+#include "cpuTime.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+using namespace Foam;
+
+template<class ListType>
+void runSwapTest
+(
+    const label nLoops,
+    ListType& list1,
+    ListType& list2
+)
+{
+    cpuTime timer;
+
+    Info<<"Swapping fixed lists with " << list1.size() << " elements\n";
+
+    Info<< "input 1: " << list1.first() << nl;
+    Info<< "input 2: " << list2.first() << nl;
+
+    // Should be zero, since this is a compile-time value
+
+    Info<< "Perform " << nLoops << " swaps..." << nl;
+
+    for (label iLoop = 0; iLoop < nLoops; ++iLoop)
+    {
+        Swap(list1, list2);
+    }
+
+    Info<< "output 1: " << list1.first() << nl;
+    Info<< "output 2: " << list2.first() << nl;
+
+    Info<< "Operation took"
+        << "  " << timer.cpuTimeIncrement() << " s\n\n";
+}
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+int main(int argc, char *argv[])
+{
+    argList::addBoolOption("label");
+    argList::addBoolOption("float");
+    argList::addBoolOption("vector");
+    argList::addBoolOption("labelList");
+    argList::addBoolOption("vectorList");
+    argList::addBoolOption("fixedLabel");
+    argList::addBoolOption("fixedLabelList");
+
+    argList args(argc, argv);
+
+    if (args.options().empty())
+    {
+        Info<< nl << "Specify an option! " << nl << endl;
+    }
+
+    if (args.optionFound("label"))
+    {
+        FixedList<label, 100000> list1(1);
+        FixedList<label, 100000> list2(0);
+
+        runSwapTest(1000001, list1, list2);
+    }
+
+    if (args.optionFound("float"))
+    {
+        FixedList<double, 100000> list1(1.0);
+        FixedList<double, 100000> list2(0.0);
+
+        runSwapTest(1000001, list1, list2);
+    }
+
+    if (args.optionFound("vector"))
+    {
+        FixedList<vector, 100000> list1(vector::one);
+        FixedList<vector, 100000> list2(vector::zero);
+
+        runSwapTest(100001, list1, list2);
+    }
+
+    if (args.optionFound("labelList"))
+    {
+        typedef labelList testType;
+        testType initVal(500);
+
+        initVal = 0;
+        FixedList<testType, 1000> list1(initVal);
+
+        initVal = 1;
+        FixedList<testType, 1000> list2(initVal);
+
+        runSwapTest(100001, list1, list2);
+    }
+
+    if (args.optionFound("vectorList"))
+    {
+        typedef vectorList testType;
+        testType initVal(500);
+
+        initVal = vector::zero;
+        FixedList<testType, 1000> list1(initVal);
+
+        initVal = vector::one;
+        FixedList<testType, 1000> list2(initVal);
+
+        runSwapTest(100001, list1, list2);
+    }
+
+    if (args.optionFound("fixedLabel"))
+    {
+        typedef FixedList<label,1000> testType;
+
+        testType initVal;
+
+        initVal = 0;
+        FixedList<testType, 1000> list1(initVal);
+
+        initVal = 1;
+        FixedList<testType, 1000> list2(initVal);
+
+        runSwapTest(100001, list1, list2);
+    }
+
+    if (args.optionFound("fixedLabelList"))
+    {
+        typedef labelList testType;
+        typedef FixedList<testType,10> containerType;
+
+        testType tinitVal(500);
+        containerType initVal;
+
+        tinitVal = 0;
+        initVal = tinitVal;
+        FixedList<containerType, 1000> list1(initVal);
+
+        tinitVal = 1;
+        initVal = tinitVal;
+        FixedList<containerType, 1000> list2(initVal);
+
+        runSwapTest(10001, list1, list2);
+    }
+
+    Info<< nl << "Done" << nl << endl;
+    return 0;
+}
+
+
+// ************************************************************************* //
diff --git a/applications/test/Function1/Test-Function1.C b/applications/test/Function1/Test-Function1.C
index ab4baee1509..d1d3b1f073c 100644
--- a/applications/test/Function1/Test-Function1.C
+++ b/applications/test/Function1/Test-Function1.C
@@ -31,6 +31,7 @@ Description
 
 #include "fvCFD.H"
 #include "Function1.H"
+#include "scalarIndList.H"
 #include "IOdictionary.H"
 #include "linearInterpolationWeights.H"
 #include "splineInterpolationWeights.H"
@@ -69,7 +70,7 @@ int main(int argc, char *argv[])
     scalar baseSum = interpolator.weightedSum
     (
         weights,
-        UIndirectList<scalar>(values, indices)
+        scalarUIndList(values, indices)
     );
     Pout<< "baseSum=" << baseSum << nl << nl << endl;
 
@@ -78,7 +79,7 @@ int main(int argc, char *argv[])
 //    scalar partialSum = interpolator.weightedSum
 //    (
 //        weights,
-//        UIndirectList<scalar>(values, indices)
+//        scalarUIndList(values, indices)
 //    );
 //    Pout<< "partialSum=" << partialSum << nl << nl << endl;
 //
@@ -90,7 +91,7 @@ int main(int argc, char *argv[])
 //    scalar sum = interpolator.weightedSum
 //    (
 //        weights,
-//        UIndirectList<scalar>(values, indices)
+//        scalarUIndList(values, indices)
 //    );
 //    Pout<< "integrand=" << sum << nl << nl << endl;
 
diff --git a/applications/test/HashSet/Test-hashSet.C b/applications/test/HashSet/Test-hashSet.C
index 55640829fb2..781c6ceabdf 100644
--- a/applications/test/HashSet/Test-hashSet.C
+++ b/applications/test/HashSet/Test-hashSet.C
@@ -223,6 +223,31 @@ int main(int argc, char *argv[])
         Info << i << endl;
     }
 
+    Info<< nl << "Test swapping, moving etc." << nl;
+    setA.insert({ "some", "more", "entries" });
+
+    Info<< "input" << nl;
+    Info<< "setA: " << setA << nl;
+
+    wordHashSet setA1(std::move(setA));
+
+    Info<< "move construct" << nl;
+    Info<< "setA: " << setA << nl
+        << "setA1: " << setA1 << nl;
+
+
+    wordHashSet setB1;
+    Info<< "move assign" << nl;
+    setB1 = std::move(setA1);
+
+    Info<< "setA1: " << setA1 << nl
+        << "setB1: " << setB1 << nl;
+
+    setB1.swap(setA1);
+
+    Info<< "setA1: " << setA1 << nl
+        << "setB1: " << setB1 << nl;
+
     return 0;
 }
 
diff --git a/applications/test/HashTable/Test-hashTable.C b/applications/test/HashTable/Test-hashTable.C
index 1071b0a473a..f0017d4e5af 100644
--- a/applications/test/HashTable/Test-hashTable.C
+++ b/applications/test/HashTable/Test-hashTable.C
@@ -324,6 +324,34 @@ int main()
         << nl;
 
 
+    // Start again with new value
+    table2.set("ada", 14.0);
+    table2.set("aeq", 15.0);
+    table2.set("aaw", 16.0);
+
+    Info<< nl << "input values" << nl;
+    Info<<"table1 =  " << table1 << nl <<"table2 =  " << table2 << nl;
+
+    Info<<"global Swap function" << nl;
+    Swap(table1, table2);
+    Info<<"table1 =  " << table1 << nl <<"table2 =  " << table2 << nl;
+
+    Info<<"swap method" << nl;
+    table1.swap(table2);
+    Info<<"table1 =  " << table1 << nl <<"table2 =  " << table2 << nl;
+
+    Info<<"transfer" << nl;
+    table1.transfer(table2);
+    Info<<"table1 =  " << table1 << nl <<"table2 =  " << table2 << nl;
+
+    Info<<"move assign" << nl;
+    table2 = std::move(table1);
+    Info<<"table1 =  " << table1 << nl <<"table2 =  " << table2 << nl;
+
+    Info<<"move construct" << nl;
+    HashTable<scalar> table1b(std::move(table2));
+    Info<<"table1 =  " << table1b << nl <<"table2 =  " << table2 << nl;
+
     Info<< "\nDone\n";
 
     return 0;
diff --git a/applications/test/IndirectList/Test-IndirectList.C b/applications/test/IndirectList/Test-IndirectList.C
index 1af5a1682cf..4727ed52484 100644
--- a/applications/test/IndirectList/Test-IndirectList.C
+++ b/applications/test/IndirectList/Test-IndirectList.C
@@ -27,58 +27,70 @@ Description
 
 #include "IndirectList.H"
 #include "IOstreams.H"
+#include "ListOps.H"
+#include "labelIndList.H"
 
 using namespace Foam;
 
 template<class ListType>
 void printInfo(const ListType& lst)
 {
-    Info<< "addr: " << lst.addressing() << nl
-        << "list: " << lst << nl
+    Info<< "addr: " << flatOutput(lst.addressing()) << nl
+        << "list: " << flatOutput(lst) << nl
         << endl;
 }
 
 
+template<class T, class ListType>
+void testFind(const T& val, const ListType& lst)
+{
+    Info<< nl
+        << "Search for "<< val << " in " << flatOutput(lst) << nl
+        <<" found() = " << lst.found(val)
+        <<" find() = " << lst.find(val)
+        <<" rfind() = " << lst.rfind(val)
+        <<" find(2) = " << lst.find(val, 2)
+        <<" rfind(2) = " << lst.rfind(val, 2)
+        <<" findIndex = " << findIndex(lst, val) << nl
+        << nl;
+}
+
+
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 // Main program:
 
 int main(int argc, char *argv[])
 {
-    List<double> completeList(10);
+    List<label> completeList(20);
 
     forAll(completeList, i)
     {
-        completeList[i] = 0.1*i;
+        completeList[i] = 10*i;
     }
 
-    Info<< "raw : " << completeList << nl << endl;
+    Info<< "raw : " << flatOutput(completeList) << nl << endl;
 
+    List<label> addresses{1, 0, 3, 7, 4, 8, 5, 1, 0, 3, 7, 4, 8, 5, };
 
-    List<label> addresses(5);
-    addresses[0] = 1;
-    addresses[1] = 0;
-    addresses[2] = 7;
-    addresses[3] = 8;
-    addresses[4] = 5;
-
-    IndirectList<double> idl1(completeList, addresses);
+    labelIndList idl1(completeList, addresses);
 
     printInfo(idl1);
 
-    addresses[4] = 1;
-    addresses[3] = 0;
-    addresses[2] = 7;
-    addresses[1] = 8;
-    addresses[0] = 5;
+    for (const label val : { 10, 30, 40, 50, 90, 80, 120 } )
+    {
+        testFind(val, idl1);
+    }
+
+    inplaceReverseList(addresses);
 
     idl1.resetAddressing(addresses.xfer());
 
     printInfo(idl1);
 
-    // test copying
-    UIndirectList<double> uidl1(idl1);
-    IndirectList<double> idl2(uidl1);
-    IndirectList<double> idl3(idl2);
+    // Test copying
+    labelUIndList uidl1(idl1);
+    labelIndList idl2(uidl1);
+    labelIndList idl3(idl2);
 
     printInfo(uidl1);
 
diff --git a/applications/test/List/Test-List.C b/applications/test/List/Test-List.C
index 5d3f3ba4b49..990da8729f5 100644
--- a/applications/test/List/Test-List.C
+++ b/applications/test/List/Test-List.C
@@ -50,6 +50,20 @@ See also
 
 using namespace Foam;
 
+template<class T, class ListType>
+void testFind(const T& val, const ListType& lst)
+{
+    Info<< nl
+        << "Search for "<< val << " in " << flatOutput(lst) << nl
+        <<" found() = " << lst.found(val)
+        <<" find() = " << lst.find(val)
+        <<" rfind() = " << lst.rfind(val)
+        <<" find(2) = " << lst.find(val, 2)
+        <<" rfind(2) = " << lst.rfind(val, 2)
+        <<" findIndex = " << findIndex(lst, val) << nl
+        << nl;
+}
+
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 //  Main program:
@@ -84,14 +98,20 @@ int main(int argc, char *argv[])
     {
         vector(0, 1, 2),
         vector(3, 4, 5),
-        vector(6, 7, 8)
+        vector(6, 7, 8),
+        vector(0, 1, 2),
+        vector(3, 4, 5),
+        vector(6, 7, 8),
     };
     Info<< "list2: " << list2 << endl;
 
     list1.append(list2);
     Info<< "list1.append(list2): " << list1 << endl;
 
-    Info<< findIndex(list2, vector(3, 4, 5)) << endl;
+    for (const vector& val : { vector(3, 4, 5), vector(10,11, 12)} )
+    {
+        testFind(val, list2);
+    }
 
     list2.setSize(10, vector(1, 2, 3));
     Info<< "list2: " << list2 << endl;
diff --git a/applications/test/List2/Make/files b/applications/test/List2/Make/files
new file mode 100644
index 00000000000..49c6d304c83
--- /dev/null
+++ b/applications/test/List2/Make/files
@@ -0,0 +1,3 @@
+Test-List2.C
+
+EXE = $(FOAM_USER_APPBIN)/Test-List2
diff --git a/applications/test/List2/Make/options b/applications/test/List2/Make/options
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/applications/test/List2/Test-List2.C b/applications/test/List2/Test-List2.C
new file mode 100644
index 00000000000..0be3acda63e
--- /dev/null
+++ b/applications/test/List2/Test-List2.C
@@ -0,0 +1,269 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2017 OpenCFD Ltd.
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+License
+    This file is part of OpenFOAM.
+
+    OpenFOAM is free software: you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
+    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+    for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
+
+Application
+    Test-List2
+
+Description
+    Test speeds, usability of some List/FixedList operations
+
+\*---------------------------------------------------------------------------*/
+
+#include "argList.H"
+#include "FixedList.H"
+#include "labelList.H"
+#include "vectorList.H"
+#include "ListOps.H"
+#include "IFstream.H"
+#include "OFstream.H"
+#include "cpuTime.H"
+
+#include <initializer_list>
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+using namespace Foam;
+
+template<class ListType>
+void runResizeTest
+(
+    const label nLoops,
+    ListType& list,
+    std::initializer_list<label> sizes
+)
+{
+    cpuTime timer;
+
+    const label size0 = list.size();
+    const auto val = list.first();
+
+    Info<<"Resize list(" << list.size() << ") to";
+
+    for (auto len : sizes)
+    {
+        Info<< " " << len;
+    }
+    Info<< nl;
+
+    Info<< "Perform " << nLoops << " times..." << nl;
+    for (label iLoop = 0; iLoop < nLoops; ++iLoop)
+    {
+        list.setSize(size0, val);
+
+        for (auto len : sizes)
+        {
+            list.setSize(len, val);
+        }
+    }
+
+    Info<< "Operation took"
+        << "  " << timer.cpuTimeIncrement() << " s\n\n";
+}
+
+
+template<class ListType>
+void runOrderingTest(const label nLoops, const ListType& list)
+{
+    if (true)
+    {
+        cpuTime timer;
+
+        float total = 0;
+
+        Info<<"forAll - perform " << nLoops << " times..." << nl;
+        for (label iLoop = 0; iLoop < nLoops; ++iLoop)
+        {
+            float sum = 0;
+            forAll(list, i)
+            {
+                sum += list[i];
+            }
+
+            total += sum;
+        }
+
+        Info<< "Operation (sum " << total << ") took"
+            << "  " << timer.cpuTimeIncrement() << " s\n\n";
+    }
+
+    if (true)
+    {
+        cpuTime timer;
+
+        float total = 0;
+
+        Info<<"reverse pointer loop - perform " << nLoops << " times..." << nl;
+        for (label iLoop = 0; iLoop < nLoops; ++iLoop)
+        {
+            float sum = 0;
+
+            const typename ListType::value_type* __restrict__ fp
+                = (list).end();
+
+            label i = (list).size();
+            while (i--)
+            {
+                sum += (*--fp);
+            }
+
+            total += sum;
+        }
+
+        Info<< "Operation (sum " << total << ") took"
+            << "  " << timer.cpuTimeIncrement() << " s\n\n";
+    }
+
+    if (true)
+    {
+        cpuTime timer;
+
+        float total = 0;
+
+        Info<<"forward pointer loop - perform " << nLoops << " times..." << nl;
+        for (label iLoop = 0; iLoop < nLoops; ++iLoop)
+        {
+            float sum = 0;
+
+            const typename ListType::value_type* __restrict__ fp
+                = (list).begin();
+
+            label i = (list).size();
+            while (i--)
+            {
+                sum += (*fp++);
+            }
+
+            total += sum;
+        }
+
+        Info<< "Operation (sum " << total << ") took"
+            << "  " << timer.cpuTimeIncrement() << " s\n\n";
+    }
+
+
+    if (true)
+    {
+        cpuTime timer;
+
+        float total = 0;
+
+        Info<<"for loop - perform " << nLoops << " times..." << nl;
+        for (label iLoop = 0; iLoop < nLoops; ++iLoop)
+        {
+            float sum = 0;
+
+            const typename ListType::value_type* __restrict__ fp
+                = (list).begin();
+
+            const label sz = (list).size();
+            for (label i=0; i<sz; ++i)
+            {
+                sum += fp[i];
+            }
+
+            total += sum;
+        }
+
+        Info<< "Operation (sum " << total << ") took"
+            << "  " << timer.cpuTimeIncrement() << " s\n\n";
+    }
+}
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+int main(int argc, char *argv[])
+{
+    argList::addBoolOption("label");
+    argList::addBoolOption("float");
+    argList::addBoolOption("vector");
+    argList::addBoolOption("order");
+    argList::addBoolOption("labelList");
+    argList::addBoolOption("vectorList");
+
+    argList args(argc, argv);
+
+    if (args.options().empty())
+    {
+        Info<< nl << "Specify an option! " << nl << endl;
+    }
+
+
+    std::initializer_list<label> increments
+        = {10000, 20000, 40000, 80000, 160000};
+
+    if (args.optionFound("label"))
+    {
+        List<label> list(10, 1);
+
+        runResizeTest(100000, list, increments);
+    }
+
+    if (args.optionFound("float"))
+    {
+        List<double> list(10, 1.0);
+
+        runResizeTest(10000, list, increments);
+    }
+
+    if (args.optionFound("vector"))
+    {
+        List<vector> list(10, vector::one);
+
+        runResizeTest(10000, list, increments);
+    }
+
+    if (args.optionFound("labelList"))
+    {
+        typedef labelList testType;
+        testType initVal(500, label(1));
+
+        List<testType> list(10, initVal);
+
+        runResizeTest(200, list, increments);
+    }
+
+    if (args.optionFound("vectorList"))
+    {
+        typedef vectorList testType;
+        testType initVal(500, vector::one);
+
+        List<testType> list(10, initVal);
+
+        runResizeTest(100, list, increments);
+    }
+
+    if (args.optionFound("order"))
+    {
+        List<label> list(100000000, 1);
+
+        runOrderingTest(100, list);
+    }
+
+
+    Info<< nl << "Done" << nl << endl;
+    return 0;
+}
+
+
+// ************************************************************************* //
diff --git a/applications/test/ListOps2/Make/files b/applications/test/ListOps2/Make/files
new file mode 100644
index 00000000000..4149f5146d3
--- /dev/null
+++ b/applications/test/ListOps2/Make/files
@@ -0,0 +1,2 @@
+Test-ListOps2.C
+EXE = $(FOAM_USER_APPBIN)/Test-ListOps2
diff --git a/applications/test/ListOps2/Make/options b/applications/test/ListOps2/Make/options
new file mode 100644
index 00000000000..51903c0ce4f
--- /dev/null
+++ b/applications/test/ListOps2/Make/options
@@ -0,0 +1,3 @@
+EXE_INC = /*-DFULLDEBUG -O0 -g*/ \
+
+EXE_LIBS =
diff --git a/applications/test/ListOps2/Test-ListOps2.C b/applications/test/ListOps2/Test-ListOps2.C
new file mode 100644
index 00000000000..e41ae9f893b
--- /dev/null
+++ b/applications/test/ListOps2/Test-ListOps2.C
@@ -0,0 +1,144 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2017 OpenCFD Ltd.
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+License
+    This file is part of OpenFOAM.
+
+    OpenFOAM is free software: you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
+    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+    for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
+
+Application
+    Test-ListOps2
+
+Description
+
+\*---------------------------------------------------------------------------*/
+
+#include "argList.H"
+#include "List.H"
+#include "FixedList.H"
+#include "DynamicList.H"
+#include "SubList.H"
+#include "ListOps.H"
+#include "FlatOutput.H"
+
+using namespace Foam;
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+template<class ListType>
+void testFind(const ListType& list)
+{
+    Info<< nl << "list: " << flatOutput(list) << nl << endl;
+
+    for (auto val : { 20, 35, 6, 13, 12, -12})
+    {
+        Info<< "lookup " << val
+            << " found " << list.found(val)
+            << " index " << list.find(val) << nl;
+    }
+}
+
+
+template<class ListType>
+void testMoving(ListType& list)
+{
+    Info<< nl << "list: " << flatOutput(list) << nl << endl;
+
+    {
+        const label i = 3;
+        list.swapFirst(i);
+        Info<<"swapFirst: " << i << " = " << flatOutput(list) << nl;
+    }
+
+    {
+        const label i = 6;
+        list.moveFirst(i);
+        Info<<"moveFirst: " << i << " = " << flatOutput(list) << nl;
+    }
+
+    {
+        const label i = 6;
+        list.moveLast(i);
+        Info<<"moveLast: " << i  << " = " << flatOutput(list) << nl;
+    }
+
+    {
+        const label i = 8;
+        list.swapLast(i);
+        Info<<"swapLast: " << i << " = " << flatOutput(list) << nl;
+    }
+}
+
+
+// Main program:
+
+int main(int argc, char *argv[])
+{
+    List<label> list1(identity(15));
+    shuffle(list1);
+
+    FixedList<label, 15> list2(list1);
+    inplaceReverseList(list2);
+
+    DynamicList<label> list3(list1);
+    inplaceReverseList(list3);
+
+    testFind(list1);
+    testFind(list2);
+    testFind(list3);
+
+    testMoving(list1);
+    testMoving(list2);
+    testMoving(list3);
+
+    // Test remove
+    {
+        auto& list = list3;
+
+        Info<< nl << "list: " << flatOutput(list) << nl << endl;
+
+        list.remove();
+        Info<<"remove = " << flatOutput(list) << nl;
+
+        {
+            const label i = 6;
+            list.remove(i);
+            Info<<"rmSwap: " << i << " = " << flatOutput(list) << nl;
+        }
+
+        {
+            const label i = 3;
+            list.remove(i);
+            Info<<"rmSwap: " << i << " = " << flatOutput(list) << nl;
+        }
+
+        {
+            const label i = 8;
+            list.remove(i);
+            Info<<"rmMove: " << i << " = " << flatOutput(list) << nl;
+        }
+    }
+
+
+    Info<< "\nEnd\n" << endl;
+
+    return 0;
+}
+
+
+// ************************************************************************* //
diff --git a/applications/test/Map/Test-Map.C b/applications/test/Map/Test-Map.C
index 5ced3b569d0..5ba38e9f60b 100644
--- a/applications/test/Map/Test-Map.C
+++ b/applications/test/Map/Test-Map.C
@@ -38,41 +38,75 @@ using namespace Foam;
 
 int main(int argc, char *argv[])
 {
-    Map<bool> banana{{5, true}};
+    Map<bool> map1
+    {
+        {1, true}, {2, false}, {3, true}, {4, false}, {5, true}
+    };
 
     // Taking a const iterator from find does not work!
     // Also, fails later on op==
-    Map<bool>::const_iterator bananaIter = banana.find(5);
+    Map<bool>::const_iterator map1Iter = map1.cfind(5);
 
-    // This works but now I can change the value.
-    //Map<bool>::iterator bananaIter = banana.find(5);
+    // Same, but with non-const access
+    // Map<bool>::iterator map1Iter = map1.find(5);
 
-    if (!bananaIter.found()) // same as  (bananaIter == banana.end())
+    if (!map1Iter.found()) // same as  (map1Iter == map1.end())
     {
         Info<< "not found" << endl;
     }
     else
     {
-        Info<< "5 is " << bananaIter() << endl;
+        Info<< "5 is " << *map1Iter << endl;
     }
 
-    // Same with STL
+    // Repeat with std::map
     Info<< "Same with STL" << endl;
 
-    std::map<label, bool> STLbanana{{5, true}};
-    std::map<label, bool>::const_iterator STLbananaIter = STLbanana.find(5);
+    std::map<label, bool> stdmap1
+    {
+        {1, true}, {2, false}, {3, true}, {4, false}, {5, true}
+    };
+
+    std::map<label, bool>::const_iterator stdmap1Iter = stdmap1.find(5);
 
-    if (STLbananaIter == STLbanana.end())
+    if (stdmap1Iter == stdmap1.cend())
     {
         Info<< "not found" << endl;
     }
     else
     {
-        Info<< "5 is " << STLbananaIter->second << endl;
+        Info<< "5 is " << stdmap1Iter->second << endl;
     }
 
 
-    Info<< "End\n" << endl;
+    Info<<"test move construct" << nl;
+    Map<bool> map2(std::move(map1));
+    Map<bool> map3;
+
+    std::map<label, bool> stdmap2(std::move(stdmap1));
+    std::map<label, bool> stdmap3;
+
+    Info<<"map1: " << map1 << nl
+        <<"map2: " << map2 << nl;
+
+    Info
+        <<"stdmap1: " << stdmap1.size() << nl
+        <<"stdmap2: " << stdmap2.size() << nl;
+
+
+    Info<<"test move assign" << nl;
+    map3 = std::move(map2);
+    stdmap3 = std::move(stdmap2);
+
+    Info<<"map2: " << map2 << nl
+        <<"map3: " << map3 << nl;
+
+    Info
+        <<"stdmap2: " << stdmap2.size() << nl
+        <<"stdmap3: " << stdmap3.size() << nl;
+
+
+    Info<< nl << "End\n" << endl;
 
     return 0;
 }
diff --git a/applications/test/UIndirectList/Test-UIndirectList.C b/applications/test/UIndirectList/Test-UIndirectList.C
index be78bbd16b3..7749a2b18fc 100644
--- a/applications/test/UIndirectList/Test-UIndirectList.C
+++ b/applications/test/UIndirectList/Test-UIndirectList.C
@@ -29,75 +29,102 @@ Description
 #include "DynamicList.H"
 #include "IOstreams.H"
 #include "ListOps.H"
-#include "OFstream.H"
+#include "labelIndList.H"
 
 using namespace Foam;
 
+template<class ListType>
+void printInfo(const ListType& lst)
+{
+    Info<< "addr: " << flatOutput(lst.addressing()) << nl
+        << "list: " << flatOutput(lst) << nl
+        << endl;
+}
+
+template<class T, class ListType>
+void testFind(const T& val, const ListType& lst)
+{
+    Info<< nl
+        << "Search for "<< val << " in " << flatOutput(lst) << nl
+        <<" found() = " << lst.found(val)
+        <<" find() = " << lst.find(val)
+        <<" rfind() = " << lst.rfind(val)
+        <<" find(2) = " << lst.find(val, 2)
+        <<" rfind(2) = " << lst.rfind(val, 2)
+        <<" findIndex = " << findIndex(lst, val) << nl
+        << nl;
+}
+
+
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 // Main program:
 
 int main(int argc, char *argv[])
 {
-    List<double> completeList(10);
+    List<label> completeList(20);
 
     forAll(completeList, i)
     {
-        completeList[i] = 0.1*i;
+        completeList[i] = 10*i;
     }
 
-    List<label> addresses(5);
-    addresses[0] = 1;
-    addresses[1] = 0;
-    addresses[2] = 7;
-    addresses[3] = 8;
-    addresses[4] = 5;
+    Info<< "raw : " << flatOutput(completeList) << nl << endl;
+
+    List<label> addresses{1, 0, 3, 7, 4, 8, 5, 1, 0, 3, 7, 4, 8, 5, };
+
+    labelUIndList idl1(completeList, addresses);
 
-    UIndirectList<double> idl(completeList, addresses);
+    printInfo(idl1);
 
-    Info<< idl << "\n";
+    for (const label val : { 10, 30, 40, 50, 90, 80, 120 } )
+    {
+        testFind(val, idl1);
+    }
 
-    idl[1] = -666;
+    Info<< flatOutput(idl1) << nl;
 
-    Info<< "idl[1] changed: " << idl << endl;
+    idl1[1] = -666;
 
-    idl = -999;
+    Info<< "idl1[1] changed: " << flatOutput(idl1) << endl;
 
-    Info<< "idl changed: " << idl << endl;
+    idl1 = -999;
 
-    UIndirectList<double> idl2(idl);
+    Info<< "idl1 changed: " << flatOutput(idl1) << endl;
 
-    Info<< "idl2: " << idl2 << endl;
+    labelUIndList idl2(idl1);
 
+    Info<< "idl2: " << flatOutput(idl2) << endl;
 
     {
-        List<double> ident(idl.size());
+        List<label> ident(idl1.size());
 
         forAll(ident, i)
         {
             ident[i] = ident.size() - i;
         }
-        idl = ident;
+        idl1 = ident;
     }
 
-    Info<< "idl assigned from UList: " << idl << endl;
+    Info<< "idl1 assigned from UList: " << flatOutput(idl1) << endl;
 
     // test List operations
 
-    List<double> flatList(UIndirectList<double>(completeList, addresses));
-    Info<< "List constructed from UIndirectList: " << flatList << endl;
+    List<label> flatList(labelUIndList(completeList, addresses));
+    Info<< "List construct from UIndirectList: " << flatOutput(flatList) << nl;
 
-    flatList = UIndirectList<double>(completeList, addresses);
-    Info<< "List assigned from UIndirectList: " << flatList << endl;
+    flatList = labelUIndList(completeList, addresses);
+    Info<< "List assign from UIndirectList: " << flatOutput(flatList) << nl;
 
-    flatList.append(UIndirectList<double>(completeList, addresses));
-    Info<< "List::append(UIndirectList): " << flatList << endl;
+    flatList.append(labelUIndList(completeList, addresses));
+    Info<< "List::append(UIndirectList): " << flatOutput(flatList) << nl;
 
 
-    DynamicList<double> dynList(UIndirectList<double>(completeList, addresses));
-    Info<< "DynamicList constructed from UIndirectList: " << dynList << endl;
+    DynamicList<label> dynList(labelUIndList(completeList, addresses));
+    Info<< "DynamicList construct from UIndirectList: " << flatOutput(dynList)
+        << nl;
 
-    dynList.append(UIndirectList<double>(completeList, addresses));
-    Info<< "DynamicList::append(UIndirectList): " << dynList << endl;
+    dynList.append(labelUIndList(completeList, addresses));
+    Info<< "DynamicList::append(UIndirectList): " << flatOutput(dynList) << nl;
 
     Info<< "\nEnd\n" << endl;
 
diff --git a/applications/test/sort/Test-sortList.C b/applications/test/sort/Test-sortList.C
index d92a4a7ad42..1fbfcfcf39c 100644
--- a/applications/test/sort/Test-sortList.C
+++ b/applications/test/sort/Test-sortList.C
@@ -33,108 +33,147 @@ using namespace Foam;
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 // Main program:
 
+
+template<class T>
+void printInfo(const SortableList<T>& list)
+{
+    Info<< "sorted:   " << list << nl
+        << "indices:  " << list.indices() << endl;
+}
+
+
 int main(int argc, char *argv[])
 {
-    labelList orig(8);
-    orig[0] = 7;
-    orig[1] = 9;
-    orig[2] = 1;
-    orig[3] = 2;
-    orig[4] = 4;
-    orig[5] = 7;
-    orig[6] = 4;
-    orig[7] = 0;
+    const labelList orig{7, 9, 1, 2, 4, 7, 4, 0};
 
     labelList order;
 
-    labelList a(orig);
-    sortedOrder(a, order);
+    labelList list1(orig);
+    sortedOrder(list1, order);
 
-    SortableList<label> aReverse(a.size());
-    aReverse = a;
+    SortableList<label> list1r(list1.size());
+    list1r = list1;
 
-    Info<< "unsorted: " << a << endl;
-    sort(a);
-    Info<< "sorted:   " << a << endl;
-    Info<< "indices:  " << order << endl;
+    Info<< "unsorted: " << orig << endl;
+    sort(list1);
+    Info<< "sorted:   " << list1 << nl
+        << "indices:  " << order << endl;
 
-    aReverse.reverseSort();
-    Info<< "reverse sorted:   " << aReverse << endl;
-    Info<< "reverse indices:  " << aReverse.indices() << endl;
+    list1r.reverseSort();
+    Info<< "reverse ..." << nl;
+    printInfo(list1r);
 
-    SortableList<label> b(orig);
-    Info<< "unsorted: " << orig << endl;
-    Info<< "sorted:   " << b << endl;
-    Info<< "indices:  " << b.indices() << endl;
+    SortableList<label> list2(orig);
+    Info<< "unsorted: " << orig << nl;
+    printInfo(list2);
 
-    Info<< "shrunk:   " << b.shrink() << endl;
-    Info<< "indices:  " << b.indices() << endl;
+    Info<< "shrunk:   " << list2.shrink() << endl;
+    Info<< "indices:  " << list2.indices() << endl;
 
     // repeat by assignment
-    b = orig;
-    Info<< "unsorted: " << b << endl;
-    b.sort();
+    list2 = orig;
+    Info<< "unsorted: " << list2 << endl;
+    list2.sort();
 
-    Info<< "sorted:   " << b << endl;
-    Info<< "indices:  " << b.indices() << endl;
+    printInfo(list2);
 
     // find unique/duplicate values
-    b = orig;
+    list2 = orig;
 
-    Info<< "unsorted: " << b << endl;
-    uniqueOrder(b, order);
+    Info<< "unsorted: " << list2 << endl;
+    uniqueOrder(list2, order);
     Info<< "unique:  " << order << endl;
-    duplicateOrder(b, order);
+    duplicateOrder(list2, order);
     Info<< "duplicate:" << order << endl;
 
     // sort reverse
-    Info<< "unsorted: " << b << endl;
-    b.reverseSort();
-    Info<< "rsort:    " << b << endl;
-    Info<< "indices:  " << b.indices() << endl;
+    Info<< "unsorted: " << list2 << endl;
+    list2.reverseSort();
+    Info<< "rsort:    " << list2 << endl;
+    Info<< "indices:  " << list2.indices() << endl;
 
     // transfer assignment
-    a = orig;
-    b.transfer(a);
-    Info<< "unsorted: " << b << endl;
-    b.sort();
+    {
+        list1 = orig;
+        list2.transfer(list1);
+        Info<< "unsorted: " << list2 << endl;
+        list2.sort();
 
-    Info<< "sorted:   " << b << endl;
-    Info<< "indices:  " << b.indices() << endl;
+        printInfo(list2);
 
-    a.transfer(b);
+        list1.transfer(list2);
 
-    Info<< "plain:    " << a << endl;
-    Info<< "sorted:   " << b << endl;
-    Info<< "indices:  " << b.indices() << endl;
+        Info<< "plain:    " << list1 << endl;
+        printInfo(list2);
+    }
 
     // sort/duplicate/unique with identical values
-    b.setSize(8);
-    b = 5;
+    list2.setSize(8);
+    list2 = 5;
 
-    Info<< "unsorted: " << b << endl;
+    Info<< "unsorted: " << list2 << endl;
 
-    uniqueOrder(b, order);
+    uniqueOrder(list2, order);
     Info<< "unique:  " << order << endl;
-    duplicateOrder(b, order);
+    duplicateOrder(list2, order);
     Info<< "duplicate:" << order << endl;
-    b.sort();
+    list2.sort();
 
-    Info<< "sorted:   " << b << endl;
-    Info<< "indices:  " << b.indices() << endl;
+    printInfo(list2);
 
     // with a single value
-    b.setSize(1);
+    list2.setSize(1);
 
-    Info<< "unsorted: " << b << endl;
-    uniqueOrder(b, order);
+    Info<< "unsorted: " << list2 << endl;
+    uniqueOrder(list2, order);
     Info<< "unique:  " << order << endl;
-    duplicateOrder(b, order);
+    duplicateOrder(list2, order);
     Info<< "duplicate:" << order << endl;
-    b.sort();
+    list2.sort();
+
+    printInfo(list2);
+
+    {
+        labelList tmp(orig);
+
+        Info<< nl << "move construct from List: " << tmp << endl;
+        SortableList<label> list3(std::move(tmp));
+
+        Info<< "input:    " << tmp << endl;
+        printInfo(list3);
+
+        list3.reverseSort();
+
+        Info<< nl << "move construct from SortableList: " << list3 << endl;
+
+        SortableList<label> list4(std::move(list3));
+        Info<< "input:   " << list3 << endl;
+        printInfo(list3);
+        printInfo(list4);
+
+        tmp = orig;
+
+        Info<< nl << "move assign from List: " << tmp << endl;
+        list3 = std::move(tmp);
+
+        Info<< "input:    " << tmp << endl;
+        printInfo(list3);
+
+        Info<< nl << "move assign from SortableList: " << list3 << endl;
+        list4 = std::move(list3);
+
+        Info<< "input:    " << list3 << endl;
+        printInfo(list3);
+        printInfo(list4);
+
+        labelList values;
+        Info<< "move to flat-list: " << list4 << endl;
 
-    Info<< "sorted:   " << b << endl;
-    Info<< "indices:  " << b.indices() << endl;
+        values = std::move(list4);
+        Info<< "input:    " << list4 << endl;
+        printInfo(list4);
+        Info<< "flat = " << values << endl;
+    }
 
     Info<< "\nEnd\n" << endl;
 
diff --git a/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C b/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C
index 6ad6dfcd433..0309bd6c747 100644
--- a/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C
+++ b/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C
@@ -589,7 +589,8 @@ void readDOFS
     is.getLine(line);
     {
         IStringStream lineStr(line);
-        patchNames.append(lineStr);
+        word pName(lineStr);
+        patchNames.append(pName);
     }
 
     Info<< "For DOF set " << group
diff --git a/src/OpenFOAM/containers/HashTables/HashSet/HashSet.C b/src/OpenFOAM/containers/HashTables/HashSet/HashSet.C
index 5b1f45b8395..809adb795b3 100644
--- a/src/OpenFOAM/containers/HashTables/HashSet/HashSet.C
+++ b/src/OpenFOAM/containers/HashTables/HashSet/HashSet.C
@@ -275,7 +275,16 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const HashSet<Key, Hash>& tbl)
 }
 
 
-/* * * * * * * * * * * * * * * * Global operators  * * * * * * * * * * * * * */
+// * * * * * * * * * * * * * * * Global Functions  * * * * * * * * * * * * * //
+
+template<class Key, class Hash>
+void Foam::Swap(const HashSet<Key, Hash>& a, const HashSet<Key, Hash>& b)
+{
+    a.swap(b);
+}
+
+
+/* * * * * * * * * * * * * * * * Global Operators  * * * * * * * * * * * * * */
 
 template<class Key, class Hash>
 Foam::HashSet<Key, Hash>
diff --git a/src/OpenFOAM/containers/HashTables/HashSet/HashSet.H b/src/OpenFOAM/containers/HashTables/HashSet/HashSet.H
index fe82253bc0f..12aea8bea33 100644
--- a/src/OpenFOAM/containers/HashTables/HashSet/HashSet.H
+++ b/src/OpenFOAM/containers/HashTables/HashSet/HashSet.H
@@ -127,12 +127,18 @@ public:
         //- Construct from an initializer list of Key
         HashSet(std::initializer_list<Key> lst);
 
-        //- Construct as copy
-        HashSet(const HashSet<Key, Hash>& hs)
+        //- Copy construct
+        HashSet(const this_type& hs)
         :
             parent_type(hs)
         {}
 
+        //- Move construct
+        HashSet(this_type&& hs)
+        :
+            parent_type(std::move(hs))
+        {}
+
         //- Construct by transferring the parameter contents
         HashSet(const Xfer<HashSet<Key, Hash>>& hs)
         :
@@ -284,6 +290,20 @@ public:
         //- Return true if the entry exists, same as found().
         inline bool operator[](const Key& key) const;
 
+        using parent_type::operator=;
+
+        //- Copy assignment
+        void operator=(const this_type& rhs)
+        {
+            parent_type::operator=(rhs);
+        }
+
+        //- Move assignment
+        void operator=(this_type&& rhs)
+        {
+            parent_type::operator=(std::move(rhs));
+        }
+
 
       // Comparison
 
@@ -340,6 +360,17 @@ public:
 };
 
 
+// Global Functions
+
+// Exchange contents of hash tables - see HashTable::swap().
+template<class T, class Key, class Hash>
+inline void Swap
+(
+    HashSet<Key, Hash>& a,
+    HashSet<Key, Hash>& b
+);
+
+
 // Global Operators
 
 //- Combine entries from HashSets
diff --git a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.C b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.C
index bc887b7d3b9..1f209ef350e 100644
--- a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.C
+++ b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.C
@@ -93,6 +93,18 @@ Foam::HashTable<T, Key, Hash>::HashTable(const HashTable<T, Key, Hash>& ht)
 }
 
 
+template<class T, class Key, class Hash>
+Foam::HashTable<T, Key, Hash>::HashTable(HashTable<T, Key, Hash>&& ht)
+:
+    HashTableCore(),
+    nElmts_(0),
+    tableSize_(0),
+    table_(nullptr)
+{
+    transfer(ht);
+}
+
+
 template<class T, class Key, class Hash>
 Foam::HashTable<T, Key, Hash>::HashTable
 (
@@ -750,6 +762,15 @@ void Foam::HashTable<T, Key, Hash>::clearStorage()
 }
 
 
+template<class T, class Key, class Hash>
+void Foam::HashTable<T, Key, Hash>::swap(HashTable<T, Key, Hash>& ht)
+{
+    Foam::Swap(table_,     ht.table_);
+    Foam::Swap(tableSize_, ht.tableSize_);
+    Foam::Swap(nElmts_,    ht.nElmts_);
+}
+
+
 template<class T, class Key, class Hash>
 void Foam::HashTable<T, Key, Hash>::transfer(HashTable<T, Key, Hash>& ht)
 {
@@ -908,6 +929,24 @@ void Foam::HashTable<T, Key, Hash>::operator=
 }
 
 
+template<class T, class Key, class Hash>
+void Foam::HashTable<T, Key, Hash>::operator=
+(
+    HashTable<T, Key, Hash>&& rhs
+)
+{
+    // Check for assignment to self
+    if (this == &rhs)
+    {
+        FatalErrorInFunction
+            << "attempted assignment to self"
+            << abort(FatalError);
+    }
+
+    transfer(rhs);
+}
+
+
 template<class T, class Key, class Hash>
 bool Foam::HashTable<T, Key, Hash>::operator==
 (
diff --git a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H
index cd50551d5d5..aa848e475c4 100644
--- a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H
+++ b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H
@@ -293,6 +293,9 @@ public:
         //- Construct as copy
         HashTable(const HashTable<T, Key, Hash>& ht);
 
+        //- Move construct
+        HashTable(HashTable<T, Key, Hash>&& ht);
+
         //- Construct by transferring the parameter contents
         HashTable(const Xfer<HashTable<T, Key, Hash>>& ht);
 
@@ -528,6 +531,9 @@ public:
         //  Equivalent to clear() followed by resize(0)
         void clearStorage();
 
+        //- Swap contents of the argument table into this table
+        void swap(HashTable<T, Key, Hash>& ht);
+
         //- Transfer the contents of the argument table into this table
         //  and annul the argument table.
         void transfer(HashTable<T, Key, Hash>& ht);
@@ -561,6 +567,9 @@ public:
         //- Assignment from an initializer list
         void operator=(std::initializer_list<std::pair<Key, T>> lst);
 
+        //- Move assign
+        void operator=(HashTable<T, Key, Hash>&& rhs);
+
         //- Equality. Hash tables are equal if the keys and values are equal.
         //  Independent of table storage size and table order.
         bool operator==(const HashTable<T, Key, Hash>& rhs) const;
@@ -841,6 +850,17 @@ public:
 };
 
 
+// Global Functions
+
+// Exchange contents of hash tables - see HashTable::swap().
+template<class T, class Key, class Hash>
+inline void Swap
+(
+    HashTable<T, Key, Hash>& a,
+    HashTable<T, Key, Hash>& b
+);
+
+
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 } // End namespace Foam
diff --git a/src/OpenFOAM/containers/HashTables/HashTable/HashTableI.H b/src/OpenFOAM/containers/HashTables/HashTable/HashTableI.H
index 4d8028ca139..50f0c42d1e7 100644
--- a/src/OpenFOAM/containers/HashTables/HashTable/HashTableI.H
+++ b/src/OpenFOAM/containers/HashTables/HashTable/HashTableI.H
@@ -604,4 +604,17 @@ Foam::HashTable<T, Key, Hash>::cend() const
 }
 
 
+// * * * * * * * * * * * * * * * Global Functions  * * * * * * * * * * * * * //
+
+template<class T, class Key, class Hash>
+inline void Foam::Swap
+(
+    HashTable<T, Key, Hash>& a,
+    HashTable<T, Key, Hash>& b
+)
+{
+    a.swap(b);
+}
+
+
 // ************************************************************************* //
diff --git a/src/OpenFOAM/containers/HashTables/Map/Map.H b/src/OpenFOAM/containers/HashTables/Map/Map.H
index 56f59128dd1..e862ff97e39 100644
--- a/src/OpenFOAM/containers/HashTables/Map/Map.H
+++ b/src/OpenFOAM/containers/HashTables/Map/Map.H
@@ -77,14 +77,20 @@ public:
             parent_type(is)
         {}
 
-        //- Construct as copy
-        Map(const Map<T>& map)
+        //- Copy construct
+        Map(const this_type& map)
         :
             parent_type(map)
         {}
 
+        //- Move construct
+        Map(this_type&& map)
+        :
+            parent_type(std::move(map))
+        {}
+
         //- Construct by transferring the parameter contents
-        Map(const Xfer<Map<T>>& map)
+        Map(const Xfer<this_type>& map)
         :
             parent_type(map)
         {}
@@ -100,6 +106,25 @@ public:
         :
             parent_type(map)
         {}
+
+
+    // Member Operators
+
+        using parent_type::operator=;
+
+        //- Copy assignment
+        void operator=(const this_type& rhs)
+        {
+            parent_type::operator=(rhs);
+        }
+
+        //- Move assignment
+        void operator=(this_type&& rhs)
+        {
+            parent_type::operator=(std::move(rhs));
+        }
+
+
 };
 
 
diff --git a/src/OpenFOAM/containers/Lists/BiIndirectList/BiIndirectList.H b/src/OpenFOAM/containers/Lists/BiIndirectList/BiIndirectList.H
index 66bd1cb397a..371a64b5bac 100644
--- a/src/OpenFOAM/containers/Lists/BiIndirectList/BiIndirectList.H
+++ b/src/OpenFOAM/containers/Lists/BiIndirectList/BiIndirectList.H
@@ -65,7 +65,7 @@ public:
         (
             const UList<T>& posList,
             const UList<T>& negList,
-            const labelUList&
+            const labelUList& addr
         );
 
         //- Construct given the complete list and by transferring addressing
@@ -73,7 +73,7 @@ public:
         (
             const UList<T>& posList,
             const UList<T>& negList,
-            const Xfer<List<label>>&
+            const Xfer<List<label>>& addr
         );
 
 
@@ -94,14 +94,14 @@ public:
             inline const List<label>& addressing() const;
 
             //- Calculate index given whether index is into posList or negList
-            inline static label posIndex(const label);
-            inline static label negIndex(const label);
+            inline static label posIndex(const label i);
+            inline static label negIndex(const label i);
 
         // Edit
 
             //- Reset addressing
-            inline void resetAddressing(const labelUList&);
-            inline void resetAddressing(const Xfer<List<label>>&);
+            inline void resetAddressing(const labelUList& addr);
+            inline void resetAddressing(const Xfer<List<label>>& addr);
 
 
         // Member Operators
@@ -110,16 +110,16 @@ public:
             inline List<T> operator()() const;
 
             //- Return non-const access to an element
-            inline T& operator[](const label);
+            inline T& operator[](const label i);
 
             //- Return const access to an element
-            inline const T& operator[](const label) const;
+            inline const T& operator[](const label i) const;
 
             //- Assignment to UList of addressed elements
-            inline void operator=(const UList<T>&);
+            inline void operator=(const UList<T>& ae);
 
             //- Assignment of all entries to the given value
-            inline void operator=(const T&);
+            inline void operator=(const T& val);
 };
 
 
diff --git a/src/OpenFOAM/containers/Lists/BiIndirectList/BiIndirectListI.H b/src/OpenFOAM/containers/Lists/BiIndirectList/BiIndirectListI.H
index 1f1dd4de5b3..6b8a6c0b92e 100644
--- a/src/OpenFOAM/containers/Lists/BiIndirectList/BiIndirectListI.H
+++ b/src/OpenFOAM/containers/Lists/BiIndirectList/BiIndirectListI.H
@@ -23,6 +23,22 @@ License
 
 \*---------------------------------------------------------------------------*/
 
+// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
+
+template<class T>
+inline Foam::label Foam::BiIndirectList<T>::posIndex(const label i)
+{
+    return i;
+}
+
+
+template<class T>
+inline Foam::label Foam::BiIndirectList<T>::negIndex(const label i)
+{
+    return -i-1;
+}
+
+
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
 template<class T>
@@ -111,20 +127,6 @@ inline void Foam::BiIndirectList<T>::resetAddressing
 }
 
 
-template<class T>
-inline Foam::label Foam::BiIndirectList<T>::posIndex(const label i)
-{
-    return i;
-}
-
-
-template<class T>
-inline Foam::label Foam::BiIndirectList<T>::negIndex(const label i)
-{
-    return -i-1;
-}
-
-
 // * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
 
 template<class T>
@@ -144,7 +146,7 @@ inline Foam::List<T> Foam::BiIndirectList<T>::operator()() const
 template<class T>
 inline T& Foam::BiIndirectList<T>::operator[](const label i)
 {
-    label index = addressing_[i];
+    const label index = addressing_[i];
 
     if (index >= 0)
     {
@@ -160,7 +162,7 @@ inline T& Foam::BiIndirectList<T>::operator[](const label i)
 template<class T>
 inline const T& Foam::BiIndirectList<T>::operator[](const label i) const
 {
-    label index = addressing_[i];
+    const label index = addressing_[i];
 
     if (index >= 0)
     {
@@ -193,11 +195,11 @@ inline void Foam::BiIndirectList<T>::operator=(const UList<T>& ae)
 
 
 template<class T>
-inline void Foam::BiIndirectList<T>::operator=(const T& t)
+inline void Foam::BiIndirectList<T>::operator=(const T& val)
 {
     forAll(addressing_, i)
     {
-        operator[](i) = t;
+        operator[](i) = val;
     }
 }
 
diff --git a/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.C b/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.C
index 363d6d98e49..deb5b1e7f02 100644
--- a/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.C
+++ b/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.C
@@ -3,7 +3,7 @@
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
-     \\/     M anipulation  |
+     \\/     M anipulation  | Copyright (C) 2017 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -24,23 +24,83 @@ License
 \*---------------------------------------------------------------------------*/
 
 #include "DynamicList.H"
+#include "labelRange.H"
+
+// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+
+template<class T, int SizeMin>
+Foam::label Foam::DynamicList<T, SizeMin>::removeElements
+(
+    const labelRange& slice
+)
+{
+    if (!slice.size())
+    {
+        // Noop
+        return 0;
+    }
+    else if (slice.after() >= this->size())
+    {
+        // Remove tail
+        this->resize(slice.first());
+    }
+    else
+    {
+        // Copy (swap) down
+        label j = slice.first();
+        const label len = this->size();
+
+        for (label i = slice.after(); i < len; ++i, ++j)
+        {
+            Foam::Swap(this->operator[](i), this->operator[](j));
+        }
+
+        resize(this->size() - slice.size());
+    }
+
+    return slice.size();
+}
 
-// * * * * * * * * * * * * * * * IOstream Operators  * * * * * * * * * * * * //
 
+template<class T, int SizeMin>
+Foam::label Foam::DynamicList<T, SizeMin>::subsetElements
+(
+    const labelRange& slice
+)
+{
+    if (slice.first() > 0)
+    {
+        // Copy (swap) down
+        label j = slice.first();
+        const label len = slice.size();
+
+        for (label i = 0; i < len; ++i, ++j)
+        {
+            Foam::Swap(this->operator[](i), this->operator[](j));
+        }
+    }
+
+    // Don't need min size, since slice size was already checked before
+    resize(slice.size());
+    return this->size();
+}
+
+
+// * * * * * * * * * * * * * * * IOstream Operators  * * * * * * * * * * * * //
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList(Istream& is)
+template<class T, int SizeMin>
+Foam::DynamicList<T, SizeMin>::DynamicList(Istream& is)
 :
     List<T>(is),
     capacity_(List<T>::size())
 {}
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
+template<class T, int SizeMin>
 Foam::Ostream& Foam::operator<<
 (
     Ostream& os,
-    const DynamicList<T, SizeInc, SizeMult, SizeDiv>& lst
+    const DynamicList<T, SizeMin>& lst
 )
 {
     os << static_cast<const List<T>&>(lst);
@@ -48,11 +108,11 @@ Foam::Ostream& Foam::operator<<
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
+template<class T, int SizeMin>
 Foam::Istream& Foam::operator>>
 (
     Istream& is,
-    DynamicList<T, SizeInc, SizeMult, SizeDiv>& lst
+    DynamicList<T, SizeMin>& lst
 )
 {
     is >> static_cast<List<T>&>(lst);
diff --git a/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H b/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H
index 6c03173401e..4dae845ed31 100644
--- a/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H
+++ b/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H
@@ -52,21 +52,20 @@ namespace Foam
 {
 
 // Forward declaration of friend functions and operators
+template<class T, int SizeMin> class DynamicList;
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-class DynamicList;
-
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
+template<class T, int SizeMin>
 Ostream& operator<<
 (
     Ostream& os,
-    const DynamicList<T, SizeInc, SizeMult, SizeDiv>& lst
+    const DynamicList<T, SizeMin>& lst
 );
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
+
+template<class T, int SizeMin>
 Istream& operator>>
 (
     Istream& is,
-    DynamicList<T, SizeInc, SizeMult, SizeDiv>& lst
+    DynamicList<T, SizeMin>& lst
 );
 
 
@@ -74,22 +73,36 @@ Istream& operator>>
                            Class DynamicList Declaration
 \*---------------------------------------------------------------------------*/
 
-template<class T, unsigned SizeInc=0, unsigned SizeMult=2, unsigned SizeDiv=1>
+template<class T, int SizeMin = 16>
 class DynamicList
 :
     public List<T>
 {
-    static_assert
-    (
-        (SizeInc || SizeMult) && SizeDiv,
-        "Invalid sizing parameters"
-    );
+    static_assert(SizeMin > 0, "Invalid min size parameter");
 
     // Private data
 
         //- The capacity (allocated size) of the underlying list.
         label capacity_;
 
+private:
+
+    // Private Member Functions
+
+        //- Remove elements in range
+        label removeElements(const labelRange& slice);
+
+        //- Subset elements in range
+        label subsetElements(const labelRange& slice);
+
+
+protected:
+
+    // Protected Member Functions
+
+        //- Copy assignment from another list
+        template<class ListType>
+        inline void assignDynList(const ListType& lst);
 
 public:
 
@@ -108,18 +121,26 @@ public:
         explicit inline DynamicList(const label nElem);
 
         //- Construct with given size and value for all elements.
-        inline DynamicList(const label nElem, const T& a);
+        inline DynamicList(const label nElem, const T& val);
+
+        //- Construct with given size initializing all elements to zero
+        inline DynamicList(const label s, const zero);
+
+        //- Copy construct.
+        inline DynamicList(const DynamicList<T, SizeMin>& lst);
 
-        //- Construct copy.
-        inline DynamicList
-        (
-            const DynamicList<T, SizeInc, SizeMult, SizeDiv>& lst
-        );
+        //- Copy construct from DynamicList with different sizing parameters
+        template<int AnySizeMin>
+        inline DynamicList(const DynamicList<T, AnySizeMin>& lst);
 
         //- Construct from UList. Size set to UList size.
         //  Also constructs from DynamicList with different sizing parameters.
         explicit inline DynamicList(const UList<T>& lst);
 
+        //- Construct from a FixedList
+        template<unsigned FixedSize>
+        inline DynamicList(const FixedList<T, FixedSize>& lst);
+
         //- Construct given begin/end iterators.
         //  Uses std::distance to determine the size.
         template<class InputIterator>
@@ -131,9 +152,18 @@ public:
         //- Construct from UIndirectList. Size set to UIndirectList size.
         explicit inline DynamicList(const UIndirectList<T>& lst);
 
-        //- Construct by transferring the parameter contents
+        //- Transfer (move) construct
         explicit inline DynamicList(const Xfer<List<T>>& lst);
 
+        //- Move construct.
+        inline DynamicList(DynamicList<T, SizeMin>&& lst);
+
+        //- Move construct from List
+        inline DynamicList(List<T>&& lst);
+
+        //- Move construct from SortableList
+        DynamicList(SortableList<T>&& lst);
+
         //- Construct from Istream. Size set to size of list read.
         explicit DynamicList(Istream& is);
 
@@ -153,25 +183,23 @@ public:
             //  Use this or reserve() in combination with append().
             inline void setCapacity(const label nElem);
 
-            //- Alter the addressed list size.
+            //- Alter addressable list size.
             //  New space will be allocated if required.
             //  Use this to resize the list prior to using the operator[] for
             //  setting values (as per List usage).
             inline void setSize(const label nElem);
 
-            //- Alter the addressed list size and fill new space with a
-            //  constant.
-            inline void setSize(const label nElem, const T& t);
+            //- Alter addressable list size and fill new space with constant.
+            inline void setSize(const label nElem, const T& val);
 
-            //- Alter the addressed list size.
+            //- Alter addressable list size.
             //  New space will be allocated if required.
             //  Use this to resize the list prior to using the operator[] for
             //  setting values (as per List usage).
             inline void resize(const label nElem);
 
-            //- Alter the addressed list size and fill new space with a
-            //  constant.
-            inline void resize(const label nElem, const T& t);
+            //- Alter addressable list size and fill new space with constant.
+            inline void resize(const label nElem, const T& val);
 
             //- Reserve allocation space for at least this size.
             //  Never shrinks the allocated size, use setCapacity() for that.
@@ -186,101 +214,162 @@ public:
 
             //- Shrink the allocated space to the number of elements used.
             //  Returns a reference to the DynamicList.
-            inline DynamicList<T, SizeInc, SizeMult, SizeDiv>& shrink();
+            inline DynamicList<T, SizeMin>& shrink();
+
+            //- Swap content with any sized DynamicList
+            template<int AnySizeMin>
+            inline void swap(DynamicList<T, AnySizeMin>& lst);
 
             //- Transfer contents of the argument List into this.
             inline void transfer(List<T>& lst);
 
-            //- Transfer contents of the argument DynamicList into this.
-            inline void transfer
-            (
-                DynamicList<T, SizeInc, SizeMult, SizeDiv>& lst
-            );
+            //- Transfer contents of any sized DynamicList into this.
+            template<int AnySizeMin>
+            inline void transfer(DynamicList<T, AnySizeMin>& lst);
+
+            //- Transfer contents  of the argument SortableList into this.
+            inline void transfer(SortableList<T>& lst);
 
             //- Transfer contents to the Xfer container as a plain List
             inline Xfer<List<T>> xfer();
 
 
-        // Member Operators
+            //- Append an element to the end of this list.
+            inline DynamicList<T, SizeMin>& append(const T& val);
 
-            //- Append an element at the end of the list
-            inline DynamicList<T, SizeInc, SizeMult, SizeDiv>& append
-            (
-                const T& t
-            );
+            //- Append another list to the end of this list.
+            inline DynamicList<T, SizeMin>& append(const UList<T>& lst);
 
-            //- Append a List at the end of this list
-            inline DynamicList<T, SizeInc, SizeMult, SizeDiv>& append
-            (
-                const UList<T>& lst
-            );
+            //- Append a FixedList to the end of this list.
+            template<unsigned FixedSize>
+            inline DynamicList<T, SizeMin>&
+            append(const FixedList<T, FixedSize>& lst);
 
             //- Append an initializer list at the end of this list.
-            inline DynamicList<T, SizeInc, SizeMult, SizeDiv>& append
-            (
-                std::initializer_list<T> lst
-            );
+            inline DynamicList<T, SizeMin>&
+            append(std::initializer_list<T> lst);
 
             //- Append a UIndirectList at the end of this list
-            inline DynamicList<T, SizeInc, SizeMult, SizeDiv>& append
-            (
-                const UIndirectList<T>& lst
-            );
+            inline DynamicList<T, SizeMin>&
+            append(const UIndirectList<T>& lst);
+
+            //- Move append list
+            inline DynamicList<T, SizeMin>& append(List<T>&& lst);
+
+            //- Move append list
+            inline DynamicList<T, SizeMin>&
+            append(DynamicList<T, SizeMin>&& lst);
+
+            //- Move append list
+            template<int AnySizeMin>
+            inline DynamicList<T, SizeMin>&
+            append(DynamicList<T, AnySizeMin>&& lst);
 
-            //- Remove and return the top element
+            //- Move append list
+            inline DynamicList<T, SizeMin>&
+            append(SortableList<T>&& lst);
+
+            //- Remove and return the last element. Fatal on an empty list.
             inline T remove();
 
+            //- Remove and return the specified element. Fatal on an empty list.
+            //  With fast=true (operates in constant time), the place of the
+            //  removed element is swapped with the last one in the list, which
+            //  changes the ordering.
+            //  With fast=false (operates in linear time), the elements
+            //  are swapped down in the list to preserve ordering.
+            inline T remove(const label idx, const bool fast=false);
+
+            //- Remove a (start,size) subset from the list.
+            //  The range is subsetted with the list size itself to ensure
+            //  result always addresses a valid section of the list.
+            //  Remaining elements are moved down.
+            inline label remove(const labelRange& range);
+
+            //- Remove a (start,size) subset from the list.
+            inline label remove(std::initializer_list<label> start_size);
+
+            //- Retain a (start,size) subset from the list.
+            //  The range is subsetted with the list size itself to ensure
+            //  result always addresses a valid section of the list.
+            //  Remaining elements are moved down.
+            inline label subset(const labelRange& range);
+
+            //- Retain a (start,size) subset from List.
+            inline label subset(std::initializer_list<label> start_size);
+
+
+        // Member Operators
+
             //- Return non-const access to an element, resizing list if
             //  necessary
             inline T& operator()(const label elemI);
 
             //- Assignment of all addressed entries to the given value
-            inline void operator=(const T& t);
+            inline void operator=(const T& val);
 
-            //- Assignment to DynamicList
-            inline void operator=
-            (
-                const DynamicList<T, SizeInc, SizeMult, SizeDiv>& lst
-            );
+            //- Assignment of all entries to zero
+            inline void operator=(const zero);
 
             //- Assignment to UList
             inline void operator=(const UList<T>& lst);
 
+            //- Assignment to FixedList
+            template<unsigned FixedSize>
+            inline void operator=(const FixedList<T, FixedSize>& lst);
+
+            //- Assignment to DynamicList
+            inline void operator=(const DynamicList<T, SizeMin>& lst);
+
+            //- Assignment from DynamicList with different sizing parameters
+            template<int AnySizeMin>
+            inline void operator=(const DynamicList<T, AnySizeMin>& lst);
+
             //- Assignment from initializer list
             inline void operator=(std::initializer_list<T> lst);
 
             //- Assignment to UIndirectList
             inline void operator=(const UIndirectList<T>& lst);
 
+            //- Move assignment
+            inline void operator=(List<T>&& lst);
 
-        // STL member functions
+            //- Move assignment
+            inline void operator=(DynamicList<T, SizeMin>&& lst);
 
-            //- Erase an element, move the remaining elements to fill the gap
-            //  and resize the List
-            typename UList<T>::iterator erase
-            (
-                typename UList<T>::iterator curIter
-            );
+            //- Move assignment
+            template<int AnySizeMin>
+            inline void operator=(DynamicList<T, AnySizeMin>&& lst);
+
+            //- Move assignment
+            inline void operator=(SortableList<T>&& lst);
 
 
         // IOstream operators
 
             // Write DynamicList to Ostream.
-            friend Ostream& operator<< <T, SizeInc, SizeMult, SizeDiv>
+            friend Ostream& operator<< <T, SizeMin>
             (
                 Ostream& os,
-                const DynamicList<T, SizeInc, SizeMult, SizeDiv>& lst
+                const DynamicList<T, SizeMin>& lst
             );
 
             //- Read from Istream, discarding contents of existing DynamicList.
-            friend Istream& operator>> <T, SizeInc, SizeMult, SizeDiv>
+            friend Istream& operator>> <T, SizeMin>
             (
                 Istream& is,
-                DynamicList<T, SizeInc, SizeMult, SizeDiv>& lst
+                DynamicList<T, SizeMin>& lst
             );
 };
 
 
+// Global Functions
+
+// Exchange contents of lists - see DynamicList::swap().
+template<class T, int SizeMin1, int SizeMin2>
+inline void Swap(DynamicList<T, SizeMin1>& a, DynamicList<T, SizeMin2>& b);
+
+
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 } // End namespace Foam
diff --git a/src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H b/src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H
index e6ba973b48a..a41f284f639 100644
--- a/src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H
+++ b/src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H
@@ -3,7 +3,7 @@
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
     \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
-     \\/     M anipulation  | Copyright (C) 2016 OpenCFD Ltd.
+     \\/     M anipulation  | Copyright (C) 2016-2017 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -23,17 +23,47 @@ License
 
 \*---------------------------------------------------------------------------*/
 
+#include "FixedList.H"
+
+// * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
+
+template<class T, int SizeMin>
+template<class ListType>
+inline void Foam::DynamicList<T, SizeMin>::assignDynList
+(
+    const ListType& lst
+)
+{
+    const label newSize = lst.size();
+
+    if (capacity_ >= newSize)
+    {
+        // Can copy w/o reallocating - adjust addressable size accordingly.
+        List<T>::size(newSize);
+        List<T>::operator=(lst);
+    }
+    else
+    {
+        // Ensure list size consistency prior to copying.
+        List<T>::size(capacity_);
+
+        List<T>::operator=(lst);
+        capacity_ = List<T>::size();
+    }
+}
+
+
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList()
+template<class T, int SizeMin>
+inline Foam::DynamicList<T, SizeMin>::DynamicList()
 :
     capacity_(0)
 {}
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList
+template<class T, int SizeMin>
+inline Foam::DynamicList<T, SizeMin>::DynamicList
 (
     const label nElem
 )
@@ -41,27 +71,52 @@ inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList
     List<T>(nElem),
     capacity_(nElem)
 {
-    // We could also enforce SizeInc granularity when (!SizeMult || !SizeDiv)
+    // We could also enforce sizing granularity
+
     List<T>::size(0);
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList
+template<class T, int SizeMin>
+inline Foam::DynamicList<T, SizeMin>::DynamicList
+(
+    const label nElem,
+    const T& val
+)
+:
+    List<T>(nElem, val),
+    capacity_(nElem)
+{}
+
+
+template<class T, int SizeMin>
+inline Foam::DynamicList<T, SizeMin>::DynamicList
 (
     const label nElem,
-    const T& a
+    const zero
 )
 :
-    List<T>(nElem, a),
+    List<T>(nElem, Zero),
     capacity_(nElem)
 {}
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList
+template<class T, int SizeMin>
+inline Foam::DynamicList<T, SizeMin>::DynamicList
+(
+    const DynamicList<T, SizeMin>& lst
+)
+:
+    List<T>(lst),
+    capacity_(lst.size())
+{}
+
+
+template<class T, int SizeMin>
+template<int AnySizeMin>
+inline Foam::DynamicList<T, SizeMin>::DynamicList
 (
-    const DynamicList<T, SizeInc, SizeMult, SizeDiv>& lst
+    const DynamicList<T, AnySizeMin>& lst
 )
 :
     List<T>(lst),
@@ -69,8 +124,8 @@ inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList
 {}
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList
+template<class T, int SizeMin>
+inline Foam::DynamicList<T, SizeMin>::DynamicList
 (
     const UList<T>& lst
 )
@@ -80,9 +135,22 @@ inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList
 {}
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
+template<class T, int SizeMin>
+template<unsigned FixedSize>
+inline Foam::DynamicList<T, SizeMin>::DynamicList
+(
+    const FixedList<T, FixedSize>& lst
+)
+:
+    capacity_(0)
+{
+    this->operator=(lst);
+}
+
+
+template<class T, int SizeMin>
 template<class InputIterator>
-inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList
+inline Foam::DynamicList<T, SizeMin>::DynamicList
 (
     InputIterator begIter,
     InputIterator endIter
@@ -93,8 +161,8 @@ inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList
 {}
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList
+template<class T, int SizeMin>
+inline Foam::DynamicList<T, SizeMin>::DynamicList
 (
     std::initializer_list<T> lst
 )
@@ -104,8 +172,8 @@ inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList
 {}
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList
+template<class T, int SizeMin>
+inline Foam::DynamicList<T, SizeMin>::DynamicList
 (
     const UIndirectList<T>& lst
 )
@@ -115,8 +183,8 @@ inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList
 {}
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList
+template<class T, int SizeMin>
+inline Foam::DynamicList<T, SizeMin>::DynamicList
 (
     const Xfer<List<T>>& lst
 )
@@ -126,19 +194,42 @@ inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList
 {}
 
 
+template<class T, int SizeMin>
+inline Foam::DynamicList<T, SizeMin>::DynamicList
+(
+    DynamicList<T, SizeMin>&& lst
+)
+:
+    capacity_(0)
+{
+    transfer(lst);
+}
+
+
+template<class T, int SizeMin>
+inline Foam::DynamicList<T, SizeMin>::DynamicList
+(
+    List<T>&& lst
+)
+:
+    capacity_(0)
+{
+    transfer(lst);
+}
+
 
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline Foam::label Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::capacity()
+template<class T, int SizeMin>
+inline Foam::label Foam::DynamicList<T, SizeMin>::capacity()
 const
 {
     return capacity_;
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::setCapacity
+template<class T, int SizeMin>
+inline void Foam::DynamicList<T, SizeMin>::setCapacity
 (
     const label nElem
 )
@@ -152,15 +243,15 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::setCapacity
         nextFree = capacity_;
     }
 
-    // We could also enforce SizeInc granularity when (!SizeMult || !SizeDiv)
+    // We could also enforce sizing granularity
 
     List<T>::setSize(capacity_);
     List<T>::size(nextFree);
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::reserve
+template<class T, int SizeMin>
+inline void Foam::DynamicList<T, SizeMin>::reserve
 (
     const label nElem
 )
@@ -170,20 +261,25 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::reserve
     {
         capacity_ = max
         (
-            nElem,
-            label(SizeInc + capacity_ * SizeMult / SizeDiv)
+            SizeMin,
+            max
+            (
+                nElem,
+                // label(SizeInc + capacity_ * SizeMult / SizeDiv)
+                label(2 * capacity_)
+            )
         );
 
         // Adjust allocated size, leave addressed size untouched
-        label nextFree = List<T>::size();
+        const label nextFree = List<T>::size();
         List<T>::setSize(capacity_);
         List<T>::size(nextFree);
     }
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::setSize
+template<class T, int SizeMin>
+inline void Foam::DynamicList<T, SizeMin>::setSize
 (
     const label nElem
 )
@@ -193,8 +289,13 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::setSize
     {
         capacity_ = max
         (
-            nElem,
-            label(SizeInc + capacity_ * SizeMult / SizeDiv)
+            SizeMin,
+            max
+            (
+                nElem,
+                // label(SizeInc + capacity_ * SizeMult / SizeDiv)
+                label(2 * capacity_)
+            )
         );
 
         List<T>::setSize(capacity_);
@@ -205,11 +306,11 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::setSize
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::setSize
+template<class T, int SizeMin>
+inline void Foam::DynamicList<T, SizeMin>::setSize
 (
     const label nElem,
-    const T& t
+    const T& val
 )
 {
     label nextFree = List<T>::size();
@@ -218,13 +319,13 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::setSize
     // Set new elements to constant value
     while (nextFree < nElem)
     {
-        this->operator[](nextFree++) = t;
+        this->operator[](nextFree++) = val;
     }
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::resize
+template<class T, int SizeMin>
+inline void Foam::DynamicList<T, SizeMin>::resize
 (
     const label nElem
 )
@@ -233,37 +334,37 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::resize
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::resize
+template<class T, int SizeMin>
+inline void Foam::DynamicList<T, SizeMin>::resize
 (
     const label nElem,
-    const T& t
+    const T& val
 )
 {
-    this->setSize(nElem, t);
+    this->setSize(nElem, val);
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::clear()
+template<class T, int SizeMin>
+inline void Foam::DynamicList<T, SizeMin>::clear()
 {
     List<T>::size(0);
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::clearStorage()
+template<class T, int SizeMin>
+inline void Foam::DynamicList<T, SizeMin>::clearStorage()
 {
     List<T>::clear();
     capacity_ = 0;
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>&
-Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::shrink()
+template<class T, int SizeMin>
+inline Foam::DynamicList<T, SizeMin>&
+Foam::DynamicList<T, SizeMin>::shrink()
 {
-    label nextFree = List<T>::size();
+    const label nextFree = List<T>::size();
     if (capacity_ > nextFree)
     {
         // Use the full list when resizing
@@ -278,9 +379,21 @@ Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::shrink()
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
+template<class T, int SizeMin>
+template<int AnySizeMin>
+inline void Foam::DynamicList<T, SizeMin>::swap
+(
+    DynamicList<T, AnySizeMin>& lst
+)
+{
+    Foam::Swap(static_cast<UList<T>&>(*this), static_cast<UList<T>&>(lst));
+    Foam::Swap(capacity_, lst.capacity_);
+}
+
+
+template<class T, int SizeMin>
 inline void
-Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::transfer(List<T>& lst)
+Foam::DynamicList<T, SizeMin>::transfer(List<T>& lst)
 {
     // Take over storage, clear addressing for lst.
     capacity_ = lst.size();
@@ -288,11 +401,12 @@ Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::transfer(List<T>& lst)
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
+template<class T, int SizeMin>
+template<int AnySizeMin>
 inline void
-Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::transfer
+Foam::DynamicList<T, SizeMin>::transfer
 (
-    DynamicList<T, SizeInc, SizeMult, SizeDiv>& lst
+    DynamicList<T, AnySizeMin>& lst
 )
 {
     // Take over storage as-is (without shrink), clear addressing for lst.
@@ -302,32 +416,45 @@ Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::transfer
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
+template<class T, int SizeMin>
+inline void
+Foam::DynamicList<T, SizeMin>::transfer
+(
+    SortableList<T>& lst
+)
+{
+    lst.shrink();  // Shrink away sort indices
+    capacity_ = lst.size(); // Capacity after transfer == list size
+    List<T>::transfer(lst);
+}
+
+
+template<class T, int SizeMin>
 inline Foam::Xfer<Foam::List<T>>
-Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::xfer()
+Foam::DynamicList<T, SizeMin>::xfer()
 {
     return xferMoveTo<List<T>>(*this);
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>&
-Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::append
+template<class T, int SizeMin>
+inline Foam::DynamicList<T, SizeMin>&
+Foam::DynamicList<T, SizeMin>::append
 (
-    const T& t
+    const T& val
 )
 {
-    const label elemI = List<T>::size();
-    setSize(elemI + 1);
+    const label idx = List<T>::size();
+    setSize(idx + 1);
 
-    this->operator[](elemI) = t;
+    this->operator[](idx) = val;
     return *this;
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>&
-Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::append
+template<class T, int SizeMin>
+inline Foam::DynamicList<T, SizeMin>&
+Foam::DynamicList<T, SizeMin>::append
 (
     const UList<T>& lst
 )
@@ -341,17 +468,36 @@ Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::append
     label nextFree = List<T>::size();
     setSize(nextFree + lst.size());
 
-    forAll(lst, elemI)
+    for (const T& val : lst)
     {
-        this->operator[](nextFree++) = lst[elemI];
+        this->operator[](nextFree++) = val;
+    }
+    return *this;
+}
+
+
+template<class T, int SizeMin>
+template<unsigned FixedSize>
+inline Foam::DynamicList<T, SizeMin>&
+Foam::DynamicList<T, SizeMin>::append
+(
+    const FixedList<T, FixedSize>& lst
+)
+{
+    label nextFree = List<T>::size();
+    setSize(nextFree + lst.size());
+
+    for (const T& val : lst)
+    {
+        this->operator[](nextFree++) = val;
     }
     return *this;
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>&
-Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::append
+template<class T, int SizeMin>
+inline Foam::DynamicList<T, SizeMin>&
+Foam::DynamicList<T, SizeMin>::append
 (
     std::initializer_list<T> lst
 )
@@ -367,9 +513,9 @@ Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::append
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>&
-Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::append
+template<class T, int SizeMin>
+inline Foam::DynamicList<T, SizeMin>&
+Foam::DynamicList<T, SizeMin>::append
 (
     const UIndirectList<T>& lst
 )
@@ -385,29 +531,159 @@ Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::append
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline T Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::remove()
+template<class T, int SizeMin>
+inline Foam::DynamicList<T, SizeMin>&
+Foam::DynamicList<T, SizeMin>::append
+(
+    List<T>&& lst
+)
+{
+    if (this == &lst)
+    {
+        FatalErrorInFunction
+            << "Attempted appending to self" << abort(FatalError);
+    }
+
+    label nextFree = List<T>::size();
+    setSize(nextFree + lst.size());
+
+    for (T& val : lst)
+    {
+        Foam::Swap(this->operator[](nextFree++), val);
+    }
+
+    lst.clear();
+    return *this;
+}
+
+
+template<class T, int SizeMin>
+inline Foam::DynamicList<T, SizeMin>&
+Foam::DynamicList<T, SizeMin>::append
+(
+    DynamicList<T, SizeMin>&& lst
+)
+{
+    append(std::move(static_cast<List<T>&>(lst)));
+    lst.clearStorage();  // Ensure capacity=0 too
+    return *this;
+}
+
+
+template<class T, int SizeMin>
+template<int AnySizeMin>
+inline Foam::DynamicList<T, SizeMin>&
+Foam::DynamicList<T, SizeMin>::append
+(
+    DynamicList<T, AnySizeMin>&& lst
+)
+{
+    append(std::move(static_cast<List<T>&>(lst)));
+    lst.clearStorage();  // Ensure capacity=0 too
+    return *this;
+}
+
+
+template<class T, int SizeMin>
+inline Foam::DynamicList<T, SizeMin>&
+Foam::DynamicList<T, SizeMin>::append
+(
+    SortableList<T>&& lst
+)
+{
+    lst.shrink();  // Shrink away sort indices
+    append(std::move(static_cast<List<T>&>(lst)));
+    return *this;
+}
+
+
+template<class T, int SizeMin>
+inline T Foam::DynamicList<T, SizeMin>::remove()
 {
-    const label elemI = List<T>::size() - 1;
+    // Location of last element and simultaneously the new size
+    const label idx = List<T>::size() - 1;
 
-    if (elemI < 0)
+    if (idx < 0)
     {
         FatalErrorInFunction
             << "List is empty" << abort(FatalError);
     }
 
-    const T& val = List<T>::operator[](elemI);
+    const T& val = List<T>::operator[](idx);
 
-    List<T>::size(elemI);
+    List<T>::size(idx);
 
     return val;
 }
 
 
+template<class T, int SizeMin>
+inline T Foam::DynamicList<T, SizeMin>::remove
+(
+    const label idx,
+    const bool fast
+)
+{
+    if (fast)
+    {
+        // Simply swap idx <=> last
+        this->swapLast(idx);
+    }
+    else
+    {
+        // Move element to the end and move everything down
+        this->moveLast(idx);
+    }
+
+    // Element to remove is now at the end
+    return this->remove();
+}
+
+
+template<class T, int SizeMin>
+inline Foam::label Foam::DynamicList<T, SizeMin>::remove
+(
+    const labelRange& range
+)
+{
+    return this->removeElements(this->validateRange(range));
+}
+
+
+template<class T, int SizeMin>
+inline Foam::label Foam::DynamicList<T, SizeMin>::remove
+(
+    std::initializer_list<label> start_size
+)
+{
+    return this->removeElements(this->validateRange(start_size));
+}
+
+
+template<class T, int SizeMin>
+inline Foam::label Foam::DynamicList<T, SizeMin>::subset
+(
+    const labelRange& range
+)
+{
+    return this->subsetElements(this->validateRange(range));
+}
+
+
+template<class T, int SizeMin>
+inline Foam::label Foam::DynamicList<T, SizeMin>::subset
+(
+    std::initializer_list<label> start_size
+)
+{
+    return this->subsetElements(this->validateRange(start_size));
+}
+
+
 // * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline T& Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::operator()
+template<class T, int SizeMin>
+inline T& Foam::DynamicList<T, SizeMin>::operator()
 (
     const label elemI
 )
@@ -421,139 +697,156 @@ inline T& Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::operator()
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::operator=
+template<class T, int SizeMin>
+inline void Foam::DynamicList<T, SizeMin>::operator=
 (
-    const T& t
+    const T& val
 )
 {
-    UList<T>::operator=(t);
+    UList<T>::operator=(val);
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::operator=
+template<class T, int SizeMin>
+inline void Foam::DynamicList<T, SizeMin>::operator=
 (
-    const DynamicList<T, SizeInc, SizeMult, SizeDiv>& lst
+    const zero
 )
 {
-    if (this == &lst)
-    {
-        FatalErrorInFunction
-            << "Attempted assignment to self" << abort(FatalError);
-    }
+    UList<T>::operator=(Zero);
+}
 
-    if (capacity_ >= lst.size())
-    {
-        // Can copy w/o reallocating, match initial size to avoid reallocation
-        List<T>::size(lst.size());
-        List<T>::operator=(lst);
-    }
-    else
-    {
-        // Make everything available for the copy operation
-        List<T>::size(capacity_);
 
-        List<T>::operator=(lst);
-        capacity_ = List<T>::size();
-    }
+template<class T, int SizeMin>
+inline void Foam::DynamicList<T, SizeMin>::operator=
+(
+    const UList<T>& lst
+)
+{
+    assignDynList(lst);
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::operator=
+template<class T, int SizeMin>
+template<unsigned FixedSize>
+inline void Foam::DynamicList<T, SizeMin>::operator=
 (
-    const UList<T>& lst
+    const FixedList<T, FixedSize>& lst
 )
 {
-    if (capacity_ >= lst.size())
-    {
-        // Can copy w/o reallocating, match initial size to avoid reallocation
-        List<T>::size(lst.size());
-        List<T>::operator=(lst);
-    }
-    else
-    {
-        // Make everything available for the copy operation
-        List<T>::size(capacity_);
+    setSize(lst.size());
 
-        List<T>::operator=(lst);
-        capacity_ = List<T>::size();
+    forAll(lst, i)
+    {
+        this->operator[](i) = lst[i];
     }
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::operator=
+template<class T, int SizeMin>
+inline void Foam::DynamicList<T, SizeMin>::operator=
 (
-    std::initializer_list<T> lst
+    const DynamicList<T, SizeMin>& lst
 )
 {
-    if (capacity_ >= lst.size())
+    if (this == &lst)
     {
-        // Can copy w/o reallocating, match initial size to avoid reallocation
-        List<T>::size(lst.size());
-        List<T>::operator=(lst);
+        FatalErrorInFunction
+            << "Attempted assignment to self" << abort(FatalError);
     }
-    else
-    {
-        // Make everything available for the copy operation
-        List<T>::size(capacity_);
 
-        List<T>::operator=(lst);
-        capacity_ = List<T>::size();
-    }
+    assignDynList(lst);
+}
+
+
+template<class T, int SizeMin>
+template<int SizeMin2>
+inline void Foam::DynamicList<T, SizeMin>::operator=
+(
+    const DynamicList<T, SizeMin2>& lst
+)
+{
+    assignDynList(lst);
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::operator=
+template<class T, int SizeMin>
+inline void Foam::DynamicList<T, SizeMin>::operator=
+(
+    std::initializer_list<T> lst
+)
+{
+    assignDynList(lst);
+}
+
+
+template<class T, int SizeMin>
+inline void Foam::DynamicList<T, SizeMin>::operator=
 (
     const UIndirectList<T>& lst
 )
 {
-    if (capacity_ >= lst.size())
+    assignDynList(lst);
+}
+
+
+template<class T, int SizeMin>
+inline void Foam::DynamicList<T, SizeMin>::operator=
+(
+    List<T>&& lst
+)
+{
+    clear();
+    transfer(lst);
+}
+
+
+template<class T, int SizeMin>
+inline void Foam::DynamicList<T, SizeMin>::operator=
+(
+    DynamicList<T, SizeMin>&& lst
+)
+{
+    if (this == &lst)
     {
-        // Can copy w/o reallocating, match initial size to avoid reallocation
-        List<T>::size(lst.size());
-        List<T>::operator=(lst);
+        FatalErrorInFunction
+            << "Attempted assignment to self" << abort(FatalError);
     }
-    else
-    {
-        // Make everything available for the copy operation
-        List<T>::size(capacity_);
 
-        List<T>::operator=(lst);
-        capacity_ = List<T>::size();
-    }
+    clear();
+    transfer(lst);
 }
 
 
-// * * * * * * * * * * * * * * STL Member Functions  * * * * * * * * * * * * //
-
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-typename Foam::UList<T>::iterator
-Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::erase
+template<class T, int SizeMin>
+template<int SizeMin2>
+inline void Foam::DynamicList<T, SizeMin>::operator=
 (
-    typename UList<T>::iterator curIter
+    DynamicList<T, SizeMin2>&& lst
 )
 {
-    typename Foam::UList<T>::iterator iter = curIter;
-    typename Foam::UList<T>::iterator nextIter = curIter;
+    clear();
+    transfer(lst);
+}
 
-    if (iter != this->end())
-    {
-        ++iter;
 
-        while (iter != this->end())
-        {
-            *nextIter++ = *iter++;
-        }
+template<class T, int SizeMin>
+inline void Foam::DynamicList<T, SizeMin>::operator=
+(
+    SortableList<T>&& lst
+)
+{
+    clear();
+    transfer(lst);
+}
 
-        this->setSize(this->size() - 1);
-    }
 
-    return curIter;
+// * * * * * * * * * * * * * * * Global Functions  * * * * * * * * * * * * * //
+
+template<class T, int SizeMin1, int SizeMin2>
+inline void Foam::Swap(DynamicList<T, SizeMin1>& a, DynamicList<T, SizeMin2>& b)
+{
+    a.swap(b);
 }
 
 
diff --git a/src/OpenFOAM/containers/Lists/FixedList/FixedList.C b/src/OpenFOAM/containers/Lists/FixedList/FixedList.C
index 19163402da0..2a10efe4116 100644
--- a/src/OpenFOAM/containers/Lists/FixedList/FixedList.C
+++ b/src/OpenFOAM/containers/Lists/FixedList/FixedList.C
@@ -3,7 +3,7 @@
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
     \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
-     \\/     M anipulation  |
+     \\/     M anipulation  | Copyright (C) 2017 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -26,19 +26,85 @@ License
 #include "FixedList.H"
 #include "ListLoopM.H"
 
-// * * * * * * * * * * * * * * STL Member Functions  * * * * * * * * * * * * //
+// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
 template<class T, unsigned Size>
-void Foam::FixedList<T, Size>::swap(FixedList<T, Size>& a)
+Foam::label Foam::FixedList<T, Size>::find
+(
+    const T& val,
+    const label start
+) const
 {
-    List_ACCESS(T, (*this), vp);
-    List_ACCESS(T, a, ap);
-    T tmp;
-    List_FOR_ALL((*this), i)
+    if (start >= 0)
     {
-        tmp = List_CELEM((*this), vp, i);
-        List_ELEM((*this), vp, i) = List_CELEM(a, ap, i);
-        List_ELEM(a, ap, i) = tmp;
+        List_CONST_ACCESS(T, *this, lst);
+
+        for (label i = start; i < label(Size); ++i)
+        {
+            if (lst[i] == val)
+            {
+                return i;
+            }
+        }
+    }
+
+    return -1;
+}
+
+
+template<class T, unsigned Size>
+void Foam::FixedList<T, Size>::swap(FixedList<T, Size>& lst)
+{
+    Foam::Swap(v_, lst.v_);
+}
+
+
+template<class T, unsigned Size>
+void Foam::FixedList<T, Size>::moveFirst(const label i)
+{
+    checkIndex(i);
+
+    for (label lower = 0; lower < i; ++lower)
+    {
+        Foam::Swap(v_[lower], v_[i]);
+    }
+}
+
+
+template<class T, unsigned Size>
+void Foam::FixedList<T, Size>::moveLast(const label i)
+{
+    checkIndex(i);
+
+    for (label upper = label(Size - 1); upper > i; --upper)
+    {
+        Foam::Swap(v_[i], v_[upper]);
+    }
+}
+
+
+template<class T, unsigned Size>
+void Foam::FixedList<T, Size>::swapFirst(const label i)
+{
+    checkIndex(i);
+
+    if (i > 0)
+    {
+        Foam::Swap(v_[0], v_[i]);
+    }
+}
+
+
+template<class T, unsigned Size>
+void Foam::FixedList<T, Size>::swapLast(const label i)
+{
+    checkIndex(i);
+
+    const label upper = label(Size - 1);
+
+    if (i < upper)
+    {
+        Foam::Swap(v_[i], v_[upper]);
     }
 }
 
@@ -53,9 +119,9 @@ bool Foam::FixedList<T, Size>::operator==(const FixedList<T, Size>& a) const
     List_CONST_ACCESS(T, (*this), vp);
     List_CONST_ACCESS(T, (a), ap);
 
-    List_FOR_ALL((*this), i)
+    for (unsigned i = 0; i < Size; ++i)
     {
-        equal = (List_ELEM((*this), vp, i) == List_ELEM((a), ap, i));
+        equal = (vp[i] == ap[i]);
         if (!equal) break;
     }
 
@@ -73,8 +139,8 @@ bool Foam::FixedList<T, Size>::operator!=(const FixedList<T, Size>& a) const
 template<class T, unsigned Size>
 bool Foam::FixedList<T, Size>::operator<(const FixedList<T, Size>& a) const
 {
-    const T* const __restrict__ ptr1 = this->begin();
-    const T* const __restrict__ ptr2 = a.begin();
+    List_CONST_ACCESS(T, *this, ptr1);
+    List_CONST_ACCESS(T, a, ptr2);
 
     for (unsigned i=0; i<Size; ++i)
     {
diff --git a/src/OpenFOAM/containers/Lists/FixedList/FixedList.H b/src/OpenFOAM/containers/Lists/FixedList/FixedList.H
index dce2cad0c63..8db0275bd4d 100644
--- a/src/OpenFOAM/containers/Lists/FixedList/FixedList.H
+++ b/src/OpenFOAM/containers/Lists/FixedList/FixedList.H
@@ -42,6 +42,8 @@ SourceFiles
 #include "uLabel.H"
 #include "Hash.H"
 #include "autoPtr.H"
+#include "Swap.H"
+
 #include <type_traits>
 #include <initializer_list>
 
@@ -125,11 +127,17 @@ public:
         inline FixedList();
 
         //- Construct from value
-        explicit inline FixedList(const T& t);
+        explicit inline FixedList(const T& val);
 
         //- Construct from C-array
         explicit inline FixedList(const T lst[Size]);
 
+        //- Copy constructor
+        inline FixedList(const FixedList<T, Size>& lst);
+
+        //- Move constructor
+        inline FixedList(FixedList<T, Size>&& lst);
+
         //- Construct given begin/end iterators
         //  Uses std::distance when verifying the size.
         template<class InputIterator>
@@ -144,9 +152,6 @@ public:
         //- Construct from SLList
         explicit inline FixedList(const SLList<T>& lst);
 
-        //- Copy constructor
-        inline FixedList(const FixedList<T, Size>& lst);
-
         //- Construct from Istream
         FixedList(Istream& is);
 
@@ -158,14 +163,26 @@ public:
 
         // Access
 
-            //- Return the forward circular index, i.e. the next index
+            //- Return the forward circular index, i.e. next index
             //  which returns to the first at the end of the list
             inline label fcIndex(const label i) const;
 
-            //- Return the reverse circular index, i.e. the previous index
+            //- Return forward circular value (ie, next value in the list)
+            inline const T& fcValue(const label i) const;
+
+            //- Return forward circular value (ie, next value in the list)
+            inline T& fcValue(const label i);
+
+            //- Return the reverse circular index, i.e. previous index
             //  which returns to the last at the beginning of the list
             inline label rcIndex(const label i) const;
 
+            //- Return reverse circular value (ie, previous value in the list)
+            inline const T& rcValue(const label i) const;
+
+            //- Return reverse circular value (ie, previous value in the list)
+            inline T& rcValue(const label i);
+
 
             //- Return a const pointer to the first data element,
             //  similar to the STL front() method and the string::data() method
@@ -202,19 +219,42 @@ public:
             inline void checkIndex(const label i) const;
 
 
+      // Search
+
+        //- Find index of the first occurence of the value.
+        //  Linear search.
+        //  \return -1 if not found.
+        label find(const T& val, const label start=0) const;
+
+        //- True if the value if found in the list. Linear search.
+        inline bool found(const T& val, const label start=0) const;
+
+
         // Edit
 
-            //- Dummy resize function
-            //  needed to make FixedList consistent with List
-            inline void resize(const label s);
+        //- Dummy resize function
+        //  needed to make FixedList consistent with List
+        inline void resize(const label s);
+
+        //- Dummy setSize function
+        //  needed to make FixedList consistent with List
+        inline void setSize(const label s);
+
+        //- Move element to the first position.
+        void moveFirst(const label i);
+
+        //- Move element to the last position.
+        void moveLast(const label i);
+
+        //- Swap element with the first element. Fatal on an empty list.
+        void swapFirst(const label i);
 
-            //- Dummy setSize function
-            //  needed to make FixedList consistent with List
-            inline void setSize(const label s);
+        //- Swap element with the last element. Fatal on an empty list.
+        void swapLast(const label i);
 
-            //- Copy (not transfer) the argument contents
-            //  needed to make FixedList consistent with List
-            void transfer(const FixedList<T, Size>& lst);
+        //- Copy (not transfer) the argument contents
+        //  needed to make FixedList consistent with List
+        void transfer(const FixedList<T, Size>& lst);
 
 
     // Member operators
@@ -238,7 +278,13 @@ public:
         inline void operator=(std::initializer_list<T> lst);
 
         //- Assignment of all entries to the given value
-        inline void operator=(const T& t);
+        inline void operator=(const T& val);
+
+        //- Copy assignment
+        inline void operator=(const FixedList<T, Size>& lst);
+
+        //- Move assignment
+        inline void operator=(FixedList<T, Size>&& lst);
 
 
     // STL type definitions
@@ -333,14 +379,14 @@ public:
         //- Always false since zero-sized FixedList is compile-time disabled.
         inline bool empty() const;
 
-        //- Swap two FixedLists of the same type in constant time
-        void swap(FixedList<T, Size>& a);
+        //- Swap content with another FixedList of the same type.
+        void swap(FixedList<T, Size>& lst);
 
 
     // STL member operators
 
         //- Equality operation on FixedLists of the same type.
-        //  Returns true when the FixedLists are elementwise equal
+        //  Returns true when the FixedLists are element-wise equal
         //  (using FixedList::value_type::operator==).  Takes linear time
         bool operator==(const FixedList<T, Size>& a) const;
 
@@ -388,6 +434,13 @@ public:
 };
 
 
+// Global Functions
+
+// Exchange contents of lists - see FixedList::swap().
+template<class T, unsigned Size>
+inline void Swap(FixedList<T,Size>& a, FixedList<T,Size>& b);
+
+
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 } // End namespace Foam
diff --git a/src/OpenFOAM/containers/Lists/FixedList/FixedListI.H b/src/OpenFOAM/containers/Lists/FixedList/FixedListI.H
index 1df4fb958a0..c9554231f45 100644
--- a/src/OpenFOAM/containers/Lists/FixedList/FixedListI.H
+++ b/src/OpenFOAM/containers/Lists/FixedList/FixedListI.H
@@ -3,7 +3,7 @@
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
     \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
-     \\/     M anipulation  |
+     \\/     M anipulation  | Copyright (C) 2017 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -27,6 +27,9 @@ License
 #include "SLList.H"
 #include "contiguous.H"
 
+#include <type_traits>
+#include <utility>
+
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
 template<class T, unsigned Size>
@@ -35,11 +38,11 @@ inline Foam::FixedList<T, Size>::FixedList()
 
 
 template<class T, unsigned Size>
-inline Foam::FixedList<T, Size>::FixedList(const T& t)
+inline Foam::FixedList<T, Size>::FixedList(const T& val)
 {
     for (unsigned i=0; i<Size; ++i)
     {
-        v_[i] = t;
+        v_[i] = val;
     }
 }
 
@@ -54,6 +57,29 @@ inline Foam::FixedList<T, Size>::FixedList(const T lst[Size])
 }
 
 
+template<class T, unsigned Size>
+inline Foam::FixedList<T, Size>::FixedList(const FixedList<T, Size>& lst)
+{
+    for (unsigned i=0; i<Size; ++i)
+    {
+        v_[i] = lst[i];
+    }
+}
+
+
+template<class T, unsigned Size>
+inline Foam::FixedList<T, Size>::FixedList(FixedList<T, Size>&& lst)
+{
+    // No significant speedup observed for copy assignment on simple types,
+    // use move assignment for generality with more complex types
+
+    for (unsigned i=0; i<Size; ++i)
+    {
+        v_[i] = std::move(lst.v_[i]);
+    }
+}
+
+
 template<class T, unsigned Size>
 template<class InputIterator>
 Foam::FixedList<T, Size>::FixedList
@@ -113,16 +139,6 @@ inline Foam::FixedList<T, Size>::FixedList(const SLList<T>& lst)
 }
 
 
-template<class T, unsigned Size>
-inline Foam::FixedList<T, Size>::FixedList(const FixedList<T, Size>& lst)
-{
-    for (unsigned i=0; i<Size; ++i)
-    {
-        v_[i] = lst[i];
-    }
-}
-
-
 template<class T, unsigned Size>
 inline Foam::autoPtr<Foam::FixedList<T, Size>>
 Foam::FixedList<T, Size>::clone() const
@@ -147,6 +163,20 @@ inline Foam::label Foam::FixedList<T, Size>::fcIndex(const label i) const
 }
 
 
+template<class T, unsigned Size>
+inline const T& Foam::FixedList<T, Size>::fcValue(const label i) const
+{
+    return this->operator[](this->fcIndex(i));
+}
+
+
+template<class T, unsigned Size>
+inline T& Foam::FixedList<T, Size>::fcValue(const label i)
+{
+    return this->operator[](this->fcIndex(i));
+}
+
+
 template<class T, unsigned Size>
 inline Foam::label Foam::FixedList<T, Size>::rcIndex(const label i) const
 {
@@ -154,6 +184,20 @@ inline Foam::label Foam::FixedList<T, Size>::rcIndex(const label i) const
 }
 
 
+template<class T, unsigned Size>
+inline const T& Foam::FixedList<T, Size>::rcValue(const label i) const
+{
+    return this->operator[](this->rcIndex(i));
+}
+
+
+template<class T, unsigned Size>
+inline T& Foam::FixedList<T, Size>::rcValue(const label i)
+{
+    return this->operator[](this->rcIndex(i));
+}
+
+
 template<class T, unsigned Size>
 inline void Foam::FixedList<T, Size>::checkStart(const label start) const
 {
@@ -190,6 +234,17 @@ inline void Foam::FixedList<T, Size>::checkIndex(const label i) const
 }
 
 
+template<class T, unsigned Size>
+inline bool Foam::FixedList<T, Size>::found
+(
+    const T& val,
+    const label start
+) const
+{
+    return (this->find(val, start) >= 0);
+}
+
+
 template<class T, unsigned Size>
 inline void Foam::FixedList<T, Size>::resize(const label s)
 {
@@ -206,6 +261,7 @@ inline void Foam::FixedList<T, Size>::setSize(const label s)
     #endif
 }
 
+
 template<class T, unsigned Size>
 inline void Foam::FixedList<T, Size>::transfer(const FixedList<T, Size>& lst)
 {
@@ -329,11 +385,31 @@ inline void Foam::FixedList<T, Size>::operator=(std::initializer_list<T> lst)
 }
 
 template<class T, unsigned Size>
-inline void Foam::FixedList<T, Size>::operator=(const T& t)
+inline void Foam::FixedList<T, Size>::operator=(const T& val)
 {
     for (unsigned i=0; i<Size; ++i)
     {
-        v_[i] = t;
+        v_[i] = val;
+    }
+}
+
+template<class T, unsigned Size>
+inline void Foam::FixedList<T, Size>::operator=(const FixedList<T, Size>& lst)
+{
+    for (unsigned i=0; i<Size; ++i)
+    {
+        v_[i] = lst.v_[i];
+    }
+}
+
+template<class T, unsigned Size>
+inline void Foam::FixedList<T, Size>::operator=(FixedList<T, Size>&& lst)
+{
+    // No significant speedup observed for copy assignment on simple types,
+    // use move assignment for generality with more complex types
+    for (unsigned i=0; i<Size; ++i)
+    {
+        v_[i] = std::move(lst.v_[i]);
     }
 }
 
@@ -485,4 +561,13 @@ inline unsigned Foam::FixedList<T, Size>::Hash<HashT>::operator()
 }
 
 
+// * * * * * * * * * * * * * * * Global Functions  * * * * * * * * * * * * * //
+
+template<class T, unsigned Size>
+void Foam::Swap(FixedList<T, Size>& a, FixedList<T, Size>& b)
+{
+    a.swap(b);
+}
+
+
 // ************************************************************************* //
diff --git a/src/OpenFOAM/containers/Lists/IndirectList/IndirectList.H b/src/OpenFOAM/containers/Lists/IndirectList/IndirectList.H
index a320682a60e..aa6c222ec26 100644
--- a/src/OpenFOAM/containers/Lists/IndirectList/IndirectList.H
+++ b/src/OpenFOAM/containers/Lists/IndirectList/IndirectList.H
@@ -3,7 +3,7 @@
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
     \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
-     \\/     M anipulation  |
+     \\/     M anipulation  | Copyright (C) 2017 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -62,10 +62,10 @@ class IndirectListAddressing
     // Private Member Functions
 
         //- Disallow default bitwise copy construct
-        IndirectListAddressing(const IndirectListAddressing&);
+        IndirectListAddressing(const IndirectListAddressing&) = delete;
 
         //- Disallow default bitwise assignment
-        void operator=(const IndirectListAddressing&);
+        void operator=(const IndirectListAddressing&) = delete;
 
 
 protected:
@@ -81,16 +81,16 @@ protected:
 
     // Member Functions
 
-        // Access
+      // Access
 
-            //- Return the list addressing
-            inline const List<label>& addressing() const;
+        //- Return the list addressing
+        inline const List<label>& addressing() const;
 
-        // Edit
+      // Edit
 
-            //- Reset addressing
-            inline void resetAddressing(const labelUList&);
-            inline void resetAddressing(const Xfer<List<label>>&);
+        //- Reset addressing
+        inline void resetAddressing(const labelUList& addr);
+        inline void resetAddressing(const Xfer<List<label>>& addr);
 
 };
 
@@ -108,10 +108,10 @@ class IndirectList
     // Private Member Functions
 
         //- Disallow default assignment operator
-        void operator=(const IndirectList<T>&);
+        void operator=(const IndirectList<T>&) = delete;
 
         //- Disallow assignment from UIndirectList
-        void operator=(const UIndirectList<T>&);
+        void operator=(const UIndirectList<T>&) = delete;
 
 
 public:
@@ -119,37 +119,45 @@ public:
     // Constructors
 
         //- Construct given the complete list and the addressing array
-        inline IndirectList(const UList<T>&, const labelUList&);
+        inline IndirectList
+        (
+            const UList<T>& completeList,
+            const labelUList& addr
+        );
 
         //- Construct given the complete list and by transferring addressing
-        inline IndirectList(const UList<T>&, const Xfer<List<label>>&);
+        inline IndirectList
+        (
+            const UList<T>& completeList,
+            const Xfer<List<label>>& addr
+        );
 
         //- Copy constructor
-        inline IndirectList(const IndirectList<T>&);
+        inline IndirectList(const IndirectList<T>& lst);
 
         //- Construct from UIndirectList
-        explicit inline IndirectList(const UIndirectList<T>&);
+        explicit inline IndirectList(const UIndirectList<T>& lst);
 
 
     // Member Functions
 
+      // Access
 
-        // Access
+        //- Return the list addressing
+        using UIndirectList<T>::addressing;
 
-            //- Return the list addressing
-            using UIndirectList<T>::addressing;
 
+      // Edit
 
-        // Edit
+        //- Reset addressing
+        using IndirectListAddressing::resetAddressing;
 
-            //- Reset addressing
-            using IndirectListAddressing::resetAddressing;
 
+    // Member Operators
 
-        // Member Operators
+        //- Assignment operator
+        using UIndirectList<T>::operator=;
 
-            //- Assignment operator
-            using UIndirectList<T>::operator=;
 };
 
 
diff --git a/src/OpenFOAM/containers/Lists/IndirectList/IndirectListI.H b/src/OpenFOAM/containers/Lists/IndirectList/IndirectListI.H
index 068b38ed9d2..1558c3a6611 100644
--- a/src/OpenFOAM/containers/Lists/IndirectList/IndirectListI.H
+++ b/src/OpenFOAM/containers/Lists/IndirectList/IndirectListI.H
@@ -25,7 +25,6 @@ License
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
-
 inline Foam::IndirectListAddressing::IndirectListAddressing
 (
     const labelUList& addr
diff --git a/src/OpenFOAM/containers/Lists/List/List.C b/src/OpenFOAM/containers/Lists/List/List.C
index 04f731f2119..556de7b6f35 100644
--- a/src/OpenFOAM/containers/Lists/List/List.C
+++ b/src/OpenFOAM/containers/Lists/List/List.C
@@ -33,6 +33,8 @@ License
 #include "BiIndirectList.H"
 #include "contiguous.H"
 
+#include <utility>
+
 // * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * * //
 
 template<class T>
@@ -52,7 +54,7 @@ Foam::List<T>::List(const label s)
 
 
 template<class T>
-Foam::List<T>::List(const label s, const T& a)
+Foam::List<T>::List(const label s, const T& val)
 :
     UList<T>(nullptr, s)
 {
@@ -70,7 +72,7 @@ Foam::List<T>::List(const label s, const T& a)
         List_ACCESS(T, (*this), vp);
         List_FOR_ALL((*this), i)
         {
-            List_ELEM((*this), vp, i) = a;
+            vp[i] = val;
         }
     }
 }
@@ -95,7 +97,7 @@ Foam::List<T>::List(const label s, const zero)
         List_ACCESS(T, (*this), vp);
         List_FOR_ALL((*this), i)
         {
-            List_ELEM((*this), vp, i) = Zero;
+            vp[i] = Zero;
         }
     }
 }
@@ -122,7 +124,7 @@ Foam::List<T>::List(const List<T>& a)
             List_CONST_ACCESS(T, a, ap);
             List_FOR_ALL((*this), i)
             {
-                List_ELEM((*this), vp, i) = List_ELEM(a, ap, i);
+                vp[i] = ap[i];
             }
         }
     }
@@ -143,19 +145,12 @@ Foam::List<T>::List(const List<T2>& a)
         List_CONST_ACCESS(T2, a, ap);
         List_FOR_ALL((*this), i)
         {
-            List_ELEM((*this), vp, i) = T(List_ELEM(a, ap, i));
+            vp[i] = T(ap[i]);
         }
     }
 }
 
 
-template<class T>
-Foam::List<T>::List(const Xfer<List<T>>& lst)
-{
-    transfer(lst());
-}
-
-
 template<class T>
 Foam::List<T>::List(List<T>& a, bool reuse)
 :
@@ -163,6 +158,7 @@ Foam::List<T>::List(List<T>& a, bool reuse)
 {
     if (reuse)
     {
+        // swap content
         this->v_ = a.v_;
         a.v_ = nullptr;
         a.size_ = 0;
@@ -183,7 +179,7 @@ Foam::List<T>::List(List<T>& a, bool reuse)
             List_CONST_ACCESS(T, a, ap);
             List_FOR_ALL((*this), i)
             {
-                List_ELEM((*this), vp, i) = List_ELEM(a, ap, i);
+                vp[i] = ap[i];
             }
         }
     }
@@ -191,19 +187,20 @@ Foam::List<T>::List(List<T>& a, bool reuse)
 
 
 template<class T>
-Foam::List<T>::List(const UList<T>& a, const labelUList& mapAddressing)
+Foam::List<T>::List(const UList<T>& lst, const labelUList& mapAddressing)
 :
     UList<T>(nullptr, mapAddressing.size())
 {
     if (this->size_)
     {
-        // Note: cannot use List_ELEM since third argument has to be index.
-
         alloc();
 
-        forAll(*this, i)
+        List_ACCESS(T, (*this), vp);
+
+        const label len = (*this).size();
+        for (label i=0; i < len; ++i)
         {
-            this->operator[](i) = a[mapAddressing[i]];
+            vp[i] = lst[mapAddressing[i]];
         }
     }
 }
@@ -268,6 +265,42 @@ Foam::List<T>::List(std::initializer_list<T> lst)
 {}
 
 
+template<class T>
+Foam::List<T>::List(const Xfer<List<T>>& lst)
+{
+    transfer(lst());
+}
+
+
+template<class T>
+Foam::List<T>::List(List<T>&& lst)
+:
+    UList<T>(nullptr, 0)
+{
+    // Can use transfer or swap to manage content
+    transfer(lst);
+}
+
+
+template<class T>
+template<int SizeMin>
+Foam::List<T>::List(DynamicList<T, SizeMin>&& lst)
+:
+    UList<T>(nullptr, 0)
+{
+    transfer(lst);
+}
+
+
+template<class T>
+Foam::List<T>::List(SortableList<T>&& lst)
+:
+    UList<T>(nullptr, 0)
+{
+    transfer(lst);
+}
+
+
 // * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * * //
 
 template<class T>
@@ -298,21 +331,24 @@ void Foam::List<T>::setSize(const label newSize)
         {
             T* nv = new T[label(newSize)];
 
-            if (this->size_)
-            {
-                label i = min(this->size_, newSize);
+            const label overlap = min(this->size_, newSize);
 
+            if (overlap)
+            {
                 #ifdef USEMEMCPY
                 if (contiguous<T>())
                 {
-                    memcpy(nv, this->v_, i*sizeof(T));
+                    memcpy(nv, this->v_, overlap*sizeof(T));
                 }
                 else
                 #endif
                 {
-                    T* vv = &this->v_[i];
-                    T* av = &nv[i];
-                    while (i--) *--av = *--vv;
+                    // No speedup observed for copy assignment on simple types
+                    List_ACCESS(T, *this, vp);
+                    for (label i = 0; i < overlap; ++i)
+                    {
+                        nv[i] = std::move(vp[i]);
+                    }
                 }
             }
 
@@ -329,49 +365,51 @@ void Foam::List<T>::setSize(const label newSize)
 
 
 template<class T>
-void Foam::List<T>::setSize(const label newSize, const T& a)
+void Foam::List<T>::setSize(const label newSize, const T& val)
 {
     const label oldSize = label(this->size_);
     this->setSize(newSize);
 
-    if (newSize > oldSize)
+    List_ACCESS(T, *this, vp);
+    for (label i = oldSize; i < newSize; ++i)
     {
-        label i = newSize - oldSize;
-        T* vv = &this->v_[newSize];
-        while (i--) *--vv = a;
+        vp[i] = val;
     }
 }
 
 
 template<class T>
-void Foam::List<T>::transfer(List<T>& a)
+void Foam::List<T>::transfer(List<T>& lst)
 {
+    // Clear and swap - could also check for self assignment
     clear();
-    this->size_ = a.size_;
-    this->v_ = a.v_;
+    this->size_ = lst.size_;
+    this->v_ = lst.v_;
 
-    a.size_ = 0;
-    a.v_ = nullptr;
+    lst.size_ = 0;
+    lst.v_ = nullptr;
 }
 
 
 template<class T>
-template<unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-void Foam::List<T>::transfer(DynamicList<T, SizeInc, SizeMult, SizeDiv>& a)
+template<int SizeMin>
+void Foam::List<T>::transfer(DynamicList<T, SizeMin>& lst)
 {
     // Shrink the allocated space to the number of elements used
-    a.shrink();
-    transfer(static_cast<List<T>&>(a));
-    a.clearStorage();
+    lst.shrink();
+    transfer(static_cast<List<T>&>(lst));
+
+    // Ensure DynamicList has proper capacity=0 too
+    lst.clearStorage();
 }
 
 
 template<class T>
-void Foam::List<T>::transfer(SortableList<T>& a)
+void Foam::List<T>::transfer(SortableList<T>& lst)
 {
     // Shrink away the sort indices
-    a.shrink();
-    transfer(static_cast<List<T>&>(a));
+    lst.shrink();
+    transfer(static_cast<List<T>&>(lst));
 }
 
 
@@ -396,7 +434,7 @@ void Foam::List<T>::operator=(const UList<T>& a)
             List_CONST_ACCESS(T, a, ap);
             List_FOR_ALL((*this), i)
             {
-                List_ELEM((*this), vp, i) = List_ELEM(a, ap, i);
+                vp[i] = ap[i];
             }
         }
     }
@@ -404,16 +442,16 @@ void Foam::List<T>::operator=(const UList<T>& a)
 
 
 template<class T>
-void Foam::List<T>::operator=(const List<T>& a)
+void Foam::List<T>::operator=(const List<T>& lst)
 {
-    if (this == &a)
+    if (this == &lst)
     {
         FatalErrorInFunction
             << "attempted assignment to self"
             << abort(FatalError);
     }
 
-    operator=(static_cast<const UList<T>&>(a));
+    operator=(static_cast<const UList<T>&>(lst));
 }
 
 
@@ -454,12 +492,40 @@ void Foam::List<T>::operator=(std::initializer_list<T> lst)
 {
     reAlloc(lst.size());
 
-    auto iter = lst.begin();
-    forAll(*this, i)
+    label i = 0;
+    for (const auto& val : lst)
+    {
+        this->operator[](i++) = val;
+    }
+}
+
+
+template<class T>
+void Foam::List<T>::operator=(List<T>&& lst)
+{
+    if (this == &lst)
     {
-        this->operator[](i) = *iter;
-        ++iter;
+        FatalErrorInFunction
+            << "attempted assignment to self"
+            << abort(FatalError);
     }
+
+    transfer(lst);
+}
+
+
+template<class T>
+template<int SizeMin>
+void Foam::List<T>::operator=(DynamicList<T, SizeMin>&& lst)
+{
+    transfer(lst);
+}
+
+
+template<class T>
+void Foam::List<T>::operator=(SortableList<T>&& lst)
+{
+    transfer(lst);
 }
 
 
diff --git a/src/OpenFOAM/containers/Lists/List/List.H b/src/OpenFOAM/containers/Lists/List/List.H
index c8e3219d992..d4ff38d488b 100644
--- a/src/OpenFOAM/containers/Lists/List/List.H
+++ b/src/OpenFOAM/containers/Lists/List/List.H
@@ -3,7 +3,7 @@
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
     \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
-     \\/     M anipulation  |
+     \\/     M anipulation  | Copyright (C) 2017 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -68,8 +68,7 @@ template<class LListBase, class T> class LList;
 template<class T>
 using SLList = LList<SLListBase, T>;
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-class DynamicList;
+template<class T, int SizeMin> class DynamicList;
 
 template<class T> class SortableList;
 template<class T> class IndirectList;
@@ -136,26 +135,25 @@ public:
         explicit List(const label s);
 
         //- Construct with given size and value for all elements
-        List(const label s, const T& a);
+        List(const label s, const T& val);
 
         //- Construct with given size initializing all elements to zero
         List(const label s, const zero);
 
-        //- Copy constructor
+        //- Copy constructor from list
         List(const List<T>& a);
 
-        //- Copy constructor from list containing another type
+        //- Copy constructor from list containing another type.
+        //  This is primarily useful to convert a list of ints into floats,
+        //  for example.
         template<class T2>
         explicit List(const List<T2>& a);
 
-        //- Construct by transferring the parameter contents
-        List(const Xfer<List<T>>& lst);
-
         //- Construct as copy or re-use as specified
         List(List<T>& a, bool reuse);
 
         //- Construct as subset
-        List(const UList<T>& a, const labelUList& mapAddressing);
+        List(const UList<T>& lst, const labelUList& mapAddressing);
 
         //- Construct given begin/end iterators.
         //  Uses std::distance to determine the size.
@@ -181,6 +179,19 @@ public:
         //- Construct from an initializer list
         List(std::initializer_list<T> lst);
 
+        //- Transfer (move) construct
+        List(const Xfer<List<T>>& lst);
+
+        //- Move construct from List
+        List(List<T>&& lst);
+
+        //- Move construct from DynamicList
+        template<int SizeMin>
+        List(DynamicList<T, SizeMin>&& lst);
+
+        //- Move construct from SortableList
+        List(SortableList<T>&& lst);
+
         //- Construct from Istream
         List(Istream& is);
 
@@ -210,19 +221,19 @@ public:
             inline void resize(const label newSize);
 
             //- Alias for setSize(const label, const T&)
-            inline void resize(const label newSize, const T& a);
+            inline void resize(const label newSize, const T& val);
 
             //- Reset size of List
             void setSize(const label newSize);
 
             //- Reset size of List and value for new elements
-            void setSize(const label newSize, const T& a);
+            void setSize(const label newSize, const T& val);
 
             //- Clear the list, i.e. set size to zero
             inline void clear();
 
             //- Append an element at the end of the list
-            inline void append(const T& t);
+            inline void append(const T& val);
 
             //- Append a List at the end of this list
             inline void append(const UList<T>& lst);
@@ -232,16 +243,16 @@ public:
 
             //- Transfer the contents of the argument List into this list
             //  and annul the argument list
-            void transfer(List<T>& a);
+            void transfer(List<T>& lst);
 
             //- Transfer the contents of the argument List into this list
             //  and annul the argument list
-            template<unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-            void transfer(DynamicList<T, SizeInc, SizeMult, SizeDiv>& a);
+            template<int SizeMin>
+            void transfer(DynamicList<T, SizeMin>& lst);
 
             //- Transfer the contents of the argument List into this list
             //  and annul the argument list
-            void transfer(SortableList<T>& a);
+            void transfer(SortableList<T>& lst);
 
             //- Transfer contents to the Xfer container
             inline Xfer<List<T>> xfer();
@@ -261,7 +272,7 @@ public:
         void operator=(const UList<T>& a);
 
         //- Assignment operator. Takes linear time
-        void operator=(const List<T>& a);
+        void operator=(const List<T>& lst);
 
         //- Assignment to SLList operator. Takes linear time
         void operator=(const SLList<T>& lst);
@@ -276,11 +287,21 @@ public:
         void operator=(std::initializer_list<T> lst);
 
         //- Assignment of all entries to the given value
-        inline void operator=(const T& t);
+        inline void operator=(const T& val);
 
         //- Assignment of all entries to zero
         inline void operator=(const zero);
 
+        //- Move assignment. Takes constant time
+        void operator=(List<T>&& lst);
+
+        //- Move assignment. Takes constant time.
+        template<int SizeMin>
+        void operator=(DynamicList<T, SizeMin>&& lst);
+
+        //- Move assignment. Takes constant time.
+        void operator=(SortableList<T>&& lst);
+
 
     // Istream operator
 
diff --git a/src/OpenFOAM/containers/Lists/List/ListI.H b/src/OpenFOAM/containers/Lists/List/ListI.H
index 8aa5bc016aa..d3549e131b1 100644
--- a/src/OpenFOAM/containers/Lists/List/ListI.H
+++ b/src/OpenFOAM/containers/Lists/List/ListI.H
@@ -89,7 +89,7 @@ inline Foam::List<T>::List
         alloc();
 
         InputIterator iter = begIter;
-        forAll(*this, i)
+        for (label i = 0; i < s; ++i)
         {
             this->operator[](i) = *iter;
             ++iter;
@@ -142,9 +142,9 @@ inline void Foam::List<T>::resize(const label newSize)
 
 
 template<class T>
-inline void Foam::List<T>::resize(const label newSize, const T& a)
+inline void Foam::List<T>::resize(const label newSize, const T& val)
 {
-    this->setSize(newSize, a);
+    this->setSize(newSize, val);
 }
 
 
@@ -182,9 +182,9 @@ inline Foam::Xfer<Foam::List<T>> Foam::List<T>::xfer()
 
 
 template<class T>
-inline void Foam::List<T>::append(const T& t)
+inline void Foam::List<T>::append(const T& val)
 {
-    setSize(size()+1, t);
+    setSize(size()+1, val);
 }
 
 
@@ -223,9 +223,9 @@ inline void Foam::List<T>::append(const UIndirectList<T>& lst)
 // * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
 
 template<class T>
-inline void Foam::List<T>::operator=(const T& t)
+inline void Foam::List<T>::operator=(const T& val)
 {
-    UList<T>::operator=(t);
+    UList<T>::operator=(val);
 }
 
 
diff --git a/src/OpenFOAM/containers/Lists/List/ListLoopM.H b/src/OpenFOAM/containers/Lists/List/ListLoopM.H
index 5f74321bc66..3a9b341837c 100644
--- a/src/OpenFOAM/containers/Lists/List/ListLoopM.H
+++ b/src/OpenFOAM/containers/Lists/List/ListLoopM.H
@@ -26,53 +26,26 @@ Description
 
 \*---------------------------------------------------------------------------*/
 
-#ifndef ListLoop_H
-#define ListLoop_H
+#ifndef ListLoopM_H
+#define ListLoopM_H
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+// Element access looping
 
-#ifdef vectorMachine
-
-// Element access looping using [] for vector machines
-
-#define List_FOR_ALL(f, i)                      \
-        const label _n##i = (f).size();         \
-        for (label i=0; i<_n##i; ++i)
-
-// Provide current element
-#define List_CELEM(f, fp, i)  (fp[i])
-
-// Provide current element
-#define List_ELEM(f, fp, i)  (fp[i])
-
-#define List_ACCESS(type, f, fp) \
+// Initial non-const access to list
+#define List_ACCESS(type, f, fp)                \
     type* const __restrict__ fp = (f).begin()
 
-#define List_CONST_ACCESS(type, f, fp) \
+// Initial const access to list
+#define List_CONST_ACCESS(type, f, fp)          \
     const type* const __restrict__ fp = (f).begin()
 
-#else
-
-// Pointer looping for scalar machines
-
 #define List_FOR_ALL(f, i)                      \
-        label i = (f).size();                   \
-        while (i--)
-
-// Provide current element without incrementing pointer
-#define List_CELEM(f, fp, i)  (*fp)
-
-// Provide current element and increment pointer
-#define List_ELEM(f, fp, i)  (*fp++)
-
-#define List_ACCESS(type, f, fp) \
-    type* __restrict__ fp = (f).begin()
-
-#define List_CONST_ACCESS(type, f, fp) \
-    const type* __restrict__ fp = (f).begin()
-
-#endif
+        const label _n##i = (f).size();         \
+        for (label i=0; i<_n##i; ++i)
 
+// Current element (non-const access)
+#define List_ELEM(fp, i)  (fp[i])
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/src/OpenFOAM/containers/Lists/ListOps/ListOpsTemplates.C b/src/OpenFOAM/containers/Lists/ListOps/ListOpsTemplates.C
index bf5af3080db..641aa4ade0e 100644
--- a/src/OpenFOAM/containers/Lists/ListOps/ListOpsTemplates.C
+++ b/src/OpenFOAM/containers/Lists/ListOps/ListOpsTemplates.C
@@ -890,7 +890,7 @@ void Foam::inplaceReverseList(ListType& list)
     label elemI = 0;
     while (elemI < nIterations)
     {
-        Swap(list[elemI], list[lastIndex - elemI]);
+        Foam::Swap(list[elemI], list[lastIndex - elemI]);
 
         elemI++;
     }
diff --git a/src/OpenFOAM/containers/Lists/SortableList/SortableList.C b/src/OpenFOAM/containers/Lists/SortableList/SortableList.C
index a35334507aa..fac433d7d75 100644
--- a/src/OpenFOAM/containers/Lists/SortableList/SortableList.C
+++ b/src/OpenFOAM/containers/Lists/SortableList/SortableList.C
@@ -3,7 +3,7 @@
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
     \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
-     \\/     M anipulation  |
+     \\/     M anipulation  | Copyright (C) 2017 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -33,43 +33,60 @@ inline Foam::SortableList<T>::SortableList()
 
 
 template<class T>
-Foam::SortableList<T>::SortableList(const UList<T>& values)
+inline Foam::SortableList<T>::SortableList(const label size)
 :
-    List<T>(values)
-{
-    sort();
-}
+    List<T>(size)
+{}
 
 
 template<class T>
-Foam::SortableList<T>::SortableList(const Xfer<List<T>>& values)
+inline Foam::SortableList<T>::SortableList(const label size, const T& val)
 :
-    List<T>(values)
-{
-    sort();
-}
+    List<T>(size, val)
+{}
 
 
 template<class T>
-inline Foam::SortableList<T>::SortableList(const label size)
+inline Foam::SortableList<T>::SortableList(const SortableList<T>& lst)
 :
-    List<T>(size)
+    List<T>(lst),
+    indices_(lst.indices())
 {}
 
 
 template<class T>
-inline Foam::SortableList<T>::SortableList(const label size, const T& val)
+inline Foam::SortableList<T>::SortableList(SortableList<T>&& lst)
 :
-    List<T>(size, val)
+    List<T>(std::move(lst)),
+    indices_(std::move(lst.indices_))
 {}
 
 
 template<class T>
-Foam::SortableList<T>::SortableList(const SortableList<T>& lst)
+Foam::SortableList<T>::SortableList(const UList<T>& values)
 :
-    List<T>(lst),
-    indices_(lst.indices())
-{}
+    List<T>(values)
+{
+    sort();
+}
+
+
+template<class T>
+Foam::SortableList<T>::SortableList(List<T>&& values)
+:
+    List<T>(std::move(values))
+{
+    sort();
+}
+
+
+template<class T>
+Foam::SortableList<T>::SortableList(const Xfer<List<T>>& values)
+:
+    List<T>(values)
+{
+    sort();
+}
 
 
 template<class T>
@@ -97,7 +114,6 @@ Foam::SortableList<T>::SortableList(std::initializer_list<T> values)
 
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
-
 template<class T>
 void Foam::SortableList<T>::clear()
 {
@@ -119,12 +135,7 @@ void Foam::SortableList<T>::sort()
 {
     sortedOrder(*this, indices_);
 
-    List<T> lst(this->size());
-    forAll(indices_, i)
-    {
-        lst[i] = this->operator[](indices_[i]);
-    }
-
+    List<T> lst(*this, indices_); // Copy with indices for mapping
     List<T>::transfer(lst);
 }
 
@@ -134,16 +145,18 @@ void Foam::SortableList<T>::reverseSort()
 {
     sortedOrder(*this, indices_, typename UList<T>::greater(*this));
 
-    List<T> lst(this->size());
-    forAll(indices_, i)
-    {
-        lst[i] = this->operator[](indices_[i]);
-    }
-
+    List<T> lst(*this, indices_); // Copy with indices for mapping
     List<T>::transfer(lst);
 }
 
 
+template<class T>
+void Foam::SortableList<T>::swap(SortableList<T>& lst)
+{
+    List<T>::swap(lst);
+    indices_.swap(lst.indices_);
+}
+
 template<class T>
 Foam::Xfer<Foam::List<T>> Foam::SortableList<T>::xfer()
 {
@@ -156,6 +169,7 @@ Foam::Xfer<Foam::List<T>> Foam::SortableList<T>::xfer()
 template<class T>
 inline void Foam::SortableList<T>::operator=(const T& val)
 {
+    indices_.clear();
     UList<T>::operator=(val);
 }
 
@@ -163,8 +177,8 @@ inline void Foam::SortableList<T>::operator=(const T& val)
 template<class T>
 inline void Foam::SortableList<T>::operator=(const UList<T>& lst)
 {
-    List<T>::operator=(lst);
     indices_.clear();
+    List<T>::operator=(lst);
 }
 
 
@@ -176,6 +190,22 @@ inline void Foam::SortableList<T>::operator=(const SortableList<T>& lst)
 }
 
 
+template<class T>
+inline void Foam::SortableList<T>::operator=(List<T>&& lst)
+{
+    indices_.clear();
+    List<T>::operator=(std::move(lst));
+}
+
+
+template<class T>
+inline void Foam::SortableList<T>::operator=(SortableList<T>&& lst)
+{
+    clear();
+    this->swap(lst);
+}
+
+
 template<class T>
 inline void Foam::SortableList<T>::operator=(std::initializer_list<T> lst)
 {
@@ -184,4 +214,13 @@ inline void Foam::SortableList<T>::operator=(std::initializer_list<T> lst)
 }
 
 
+// * * * * * * * * * * * * * * * Global Functions  * * * * * * * * * * * * * //
+
+template<class T>
+inline void Foam::Swap(SortableList<T>& a, SortableList<T>& b)
+{
+    a.swap(b);
+}
+
+
 // ************************************************************************* //
diff --git a/src/OpenFOAM/containers/Lists/SortableList/SortableList.H b/src/OpenFOAM/containers/Lists/SortableList/SortableList.H
index cd005a09c2f..8ef6aefa197 100644
--- a/src/OpenFOAM/containers/Lists/SortableList/SortableList.H
+++ b/src/OpenFOAM/containers/Lists/SortableList/SortableList.H
@@ -3,7 +3,7 @@
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
     \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
-     \\/     M anipulation  |
+     \\/     M anipulation  | Copyright (C) 2017 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -67,13 +67,7 @@ public:
         //- Null constructor, sort later (eg, after assignment or transfer)
         inline SortableList();
 
-        //- Construct from UList, sorting immediately
-        explicit SortableList(const UList<T>& values);
-
-        //- Construct from transferred List, sorting immediately
-        explicit SortableList(const Xfer<List<T>>& values);
-
-        //- Construct given size. Sort later on
+        //- Construct given size, sort later.
         //  The indices remain empty until the list is sorted
         explicit inline SortableList(const label size);
 
@@ -81,17 +75,29 @@ public:
         //  The indices remain empty until the list is sorted
         inline SortableList(const label size, const T& val);
 
+        //- Copy construct
+        inline SortableList(const SortableList<T>& lst);
+
+        //- Move construct
+        inline SortableList(SortableList<T>&& lst);
+
+        //- Copy construct from UList, sorting immediately
+        explicit SortableList(const UList<T>& values);
+
+        //- Move construct from List, sorting immediately
+        SortableList(List<T>&& values);
+
         //- Construct given begin/end iterators.
         //  Uses std::distance to determine the size.
         template<class InputIterator>
         inline SortableList(InputIterator begIter, InputIterator endIter);
 
-        //- Construct as copy
-        inline SortableList(const SortableList<T>& lst);
-
         //- Construct from an initializer list, sorting immediately
         SortableList(std::initializer_list<T> values);
 
+        //- Construct from transferred List, sorting immediately
+        explicit SortableList(const Xfer<List<T>>& values);
+
 
     // Member Functions
 
@@ -120,26 +126,42 @@ public:
         //- Reverse (stable) sort the list
         void reverseSort();
 
+        //- Swap content with another SortableList in constant time
+        inline void swap(SortableList<T>& lst);
+
         //- Transfer contents to the Xfer container as a plain List
         inline Xfer<List<T>> xfer();
 
 
     // Member Operators
 
-        //- Assignment of all entries to the given value
+        //- Assignment of all entries to the given value, removing indices.
         inline void operator=(const T& val);
 
-        //- Assignment to UList operator. Takes linear time
+        //- Assignment to UList operator, removing indices. Takes linear time
         inline void operator=(const UList<T>& lst);
 
         //- Assignment operator. Takes linear time
         inline void operator=(const SortableList<T>& lst);
 
+        //- Move assignment, removing indices. Takes linear time
+        inline void operator=(List<T>&& lst);
+
+        //- Move operator. Takes linear time
+        inline void operator=(SortableList<T>&& lst);
+
         //- Assignment to an initializer list
         void operator=(std::initializer_list<T> lst);
 };
 
 
+// Global Functions
+
+// Exchange contents of lists - see SortableList::swap().
+template<class T>
+inline void Swap(SortableList<T>& a, SortableList<T>& b);
+
+
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 } // End namespace Foam
diff --git a/src/OpenFOAM/containers/Lists/UIndirectList/UIndirectList.C b/src/OpenFOAM/containers/Lists/UIndirectList/UIndirectList.C
new file mode 100644
index 00000000000..931e93efb11
--- /dev/null
+++ b/src/OpenFOAM/containers/Lists/UIndirectList/UIndirectList.C
@@ -0,0 +1,87 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2017 OpenCFD Ltd.
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+License
+    This file is part of OpenFOAM.
+
+    OpenFOAM is free software: you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
+    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+    for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
+
+\*---------------------------------------------------------------------------*/
+
+// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
+
+template<class T>
+inline Foam::label Foam::UIndirectList<T>::find
+(
+    const T& val,
+    const label start
+) const
+{
+    if (start >= 0)
+    {
+        List_CONST_ACCESS(T, completeList_, lst);
+        List_CONST_ACCESS(label, addressing_, addr);
+
+        const label len = addressing_.size();
+
+        for (label i = start; i < len; ++i)
+        {
+            if (lst[addr[i]] == val)
+            {
+                return i;
+            }
+        }
+    }
+
+    return -1;
+}
+
+
+template<class T>
+inline Foam::label Foam::UIndirectList<T>::rfind
+(
+    const T& val,
+    const label pos
+) const
+{
+    List_CONST_ACCESS(T, completeList_, lst);
+    List_CONST_ACCESS(label, addressing_, addr);
+
+    for
+    (
+        label i =
+        (
+            pos < 0
+          ? (addressing_.size()-1)
+          : min(pos, (addressing_.size()-1))
+        );
+        i >= 0;
+        --i
+    )
+    {
+        if (lst[addr[i]] == val)
+        {
+            return i;
+        }
+    }
+
+    return -1;
+}
+
+
+// ************************************************************************* //
diff --git a/src/OpenFOAM/containers/Lists/UIndirectList/UIndirectList.H b/src/OpenFOAM/containers/Lists/UIndirectList/UIndirectList.H
index e39d899f899..61ddf3bed97 100644
--- a/src/OpenFOAM/containers/Lists/UIndirectList/UIndirectList.H
+++ b/src/OpenFOAM/containers/Lists/UIndirectList/UIndirectList.H
@@ -79,52 +79,70 @@ public:
 
     // Member Functions
 
-        // Access
+      // Access
 
-            //- Return the number of elements in the list
-            inline label size() const;
+        //- Return the number of elements in the list
+        inline label size() const;
 
-            //- Return true if the list is empty (ie, size() is zero).
-            inline bool empty() const;
+        //- Return true if the list is empty (ie, size() is zero).
+        inline bool empty() const;
 
-            //- Return the first element of the list.
-            inline T& first();
+        //- Return the first element of the list.
+        inline T& first();
 
-            //- Return first element of the list.
-            inline const T& first() const;
+        //- Return first element of the list.
+        inline const T& first() const;
 
-            //- Return the last element of the list.
-            inline T& last();
+        //- Return the last element of the list.
+        inline T& last();
 
-            //- Return the last element of the list.
-            inline const T& last() const;
+        //- Return the last element of the list.
+        inline const T& last() const;
 
-            //- Return the complete list
-            inline const UList<T>& completeList() const;
+        //- Return the complete list
+        inline const UList<T>& completeList() const;
 
-            //- Return the list addressing
-            inline const List<label>& addressing() const;
+        //- Return the list addressing
+        inline const List<label>& addressing() const;
 
 
-        // Member Operators
+      // Search
 
-            //- Return the addressed elements as a List
-            inline List<T> operator()() const;
+        //- Find index of the first occurence of the value.
+        //  When start is specified, any occurences before start are ignored.
+        //  Linear search.
+        //  \return -1 if not found.
+        label find(const T& val, const label start=0) const;
 
-            //- Return non-const access to an element
-            inline T& operator[](const label i);
+        //- Find index of the last occurence of the value.
+        //  When pos is specified, any occurences after pos are ignored.
+        //  Linear search.
+        //  \return -1 if not found.
+        label rfind(const T& val, const label pos=-1) const;
 
-            //- Return const access to an element
-            inline const T& operator[](const label i) const;
+        //- True if the value if found in the list. Linear search.
+        inline bool found(const T& val, const label start=0) const;
 
-            //- Assignment to UList of addressed elements
-            inline void operator=(const UList<T>& ae);
 
-            //- Assignment to UIndirectList of addressed elements
-            inline void operator=(const UIndirectList<T>& ae);
+    // Member Operators
 
-            //- Assignment of all entries to the given value
-            inline void operator=(const T& t);
+        //- Return the addressed elements as a List
+        inline List<T> operator()() const;
+
+        //- Return non-const access to an element
+        inline T& operator[](const label i);
+
+        //- Return const access to an element
+        inline const T& operator[](const label i) const;
+
+        //- Assignment to UList of addressed elements
+        inline void operator=(const UList<T>& ae);
+
+        //- Assignment to UIndirectList of addressed elements
+        inline void operator=(const UIndirectList<T>& ae);
+
+        //- Assignment of all entries to the given value
+        inline void operator=(const T& t);
 
 
     // STL type definitions
@@ -162,7 +180,7 @@ public:
         friend Ostream& operator<< <T>
         (
             Ostream& os,
-            const UIndirectList<T>& L
+            const UIndirectList<T>& lst
         );
 };
 
@@ -176,6 +194,7 @@ public:
 #include "UIndirectListI.H"
 
 #ifdef NoRepository
+    #include "UIndirectList.C"
     #include "UIndirectListIO.C"
 #endif
 
diff --git a/src/OpenFOAM/containers/Lists/UIndirectList/UIndirectListI.H b/src/OpenFOAM/containers/Lists/UIndirectList/UIndirectListI.H
index c26efd9ac74..15daa10969f 100644
--- a/src/OpenFOAM/containers/Lists/UIndirectList/UIndirectListI.H
+++ b/src/OpenFOAM/containers/Lists/UIndirectList/UIndirectListI.H
@@ -95,6 +95,17 @@ inline const Foam::List<Foam::label>& Foam::UIndirectList<T>::addressing() const
 }
 
 
+template<class T>
+inline bool Foam::UIndirectList<T>::found
+(
+    const T& val,
+    const label pos
+) const
+{
+    return this->find(val, pos) != -1;
+}
+
+
 // * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
 
 template<class T>
diff --git a/src/OpenFOAM/containers/Lists/UIndirectList/UIndirectListIO.C b/src/OpenFOAM/containers/Lists/UIndirectList/UIndirectListIO.C
index 5e711c07241..de49fc74a0c 100644
--- a/src/OpenFOAM/containers/Lists/UIndirectList/UIndirectListIO.C
+++ b/src/OpenFOAM/containers/Lists/UIndirectList/UIndirectListIO.C
@@ -131,10 +131,10 @@ template<class T>
 Foam::Ostream& Foam::operator<<
 (
     Foam::Ostream& os,
-    const Foam::UIndirectList<T>& L
+    const Foam::UIndirectList<T>& lst
 )
 {
-    return L.writeList(os, 10);
+    return lst.writeList(os, 10);
 }
 
 
diff --git a/src/OpenFOAM/containers/Lists/UList/UList.C b/src/OpenFOAM/containers/Lists/UList/UList.C
index 599dd0f9980..b87e524b593 100644
--- a/src/OpenFOAM/containers/Lists/UList/UList.C
+++ b/src/OpenFOAM/containers/Lists/UList/UList.C
@@ -49,18 +49,18 @@ Foam::labelRange Foam::UList<T>::validateRange(const labelRange& range) const
 template<class T>
 Foam::labelRange Foam::UList<T>::validateRange
 (
-    std::initializer_list<label> start_size_pair
+    std::initializer_list<label> start_size
 ) const
 {
-    if (start_size_pair.size() != 2)
+    if (start_size.size() != 2)
     {
         FatalErrorInFunction
-            << "range specified with " << start_size_pair.size()
+            << "range specified with " << start_size.size()
             << " elements instead of 2"
             << abort(FatalError);
     }
 
-    auto iter = start_size_pair.begin();
+    auto iter = start_size.begin();
 
     const label beg = *(iter++);
     const label sz  = *iter;
@@ -71,6 +71,56 @@ Foam::labelRange Foam::UList<T>::validateRange
 
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
+template<class T>
+void Foam::UList<T>::moveFirst(const label i)
+{
+    checkIndex(i);
+
+    for (label lower = 0; lower < i; ++lower)
+    {
+        Foam::Swap(this->operator[](lower), this->operator[](i));
+    }
+}
+
+
+template<class T>
+void Foam::UList<T>::moveLast(const label i)
+{
+    checkIndex(i);
+
+    for (label upper = size()-1; upper > i; --upper)
+    {
+        Foam::Swap(this->operator[](i), this->operator[](upper));
+    }
+}
+
+
+template<class T>
+void Foam::UList<T>::swapFirst(const label i)
+{
+    checkIndex(i);
+
+    if (i > 0)
+    {
+        Foam::Swap(this->operator[](0), this->operator[](i));
+    }
+}
+
+
+template<class T>
+void Foam::UList<T>::swapLast(const label i)
+{
+    checkIndex(i);
+
+    const label upper = size()-1;
+
+    if (i < upper)
+    {
+        Foam::Swap(this->operator[](i), this->operator[](upper));
+    }
+}
+
+
 template<class T>
 void Foam::UList<T>::deepCopy(const UList<T>& a)
 {
@@ -96,7 +146,7 @@ void Foam::UList<T>::deepCopy(const UList<T>& a)
             List_CONST_ACCESS(T, a, ap);
             List_FOR_ALL((*this), i)
             {
-                List_ELEM((*this), vp, i) = List_ELEM(a, ap, i);
+                vp[i] = ap[i];
             }
         }
     }
@@ -126,10 +176,10 @@ const Foam::UList<T> Foam::UList<T>::operator[](const labelRange& range) const
 template<class T>
 Foam::UList<T> Foam::UList<T>::operator[]
 (
-    std::initializer_list<label> start_size_pair
+    std::initializer_list<label> start_size
 )
 {
-    const labelRange slice = validateRange(start_size_pair);
+    const labelRange slice = validateRange(start_size);
 
     return UList<T>(&(this->v_[slice.start()]), slice.size()); // SubList
 }
@@ -138,23 +188,23 @@ Foam::UList<T> Foam::UList<T>::operator[]
 template<class T>
 const Foam::UList<T> Foam::UList<T>::operator[]
 (
-    std::initializer_list<label> start_size_range
+    std::initializer_list<label> start_size
 ) const
 {
     // Restricted range
-    const labelRange slice = validateRange(start_size_range);
+    const labelRange slice = validateRange(start_size);
 
     return UList<T>(&(this->v_[slice.start()]), slice.size()); // SubList
 }
 
 
 template<class T>
-void Foam::UList<T>::operator=(const T& t)
+void Foam::UList<T>::operator=(const T& val)
 {
     List_ACCESS(T, (*this), vp);
     List_FOR_ALL((*this), i)
     {
-        List_ELEM((*this), vp, i) = t;
+        vp[i] = val;
     }
 }
 
@@ -165,21 +215,11 @@ void Foam::UList<T>::operator=(const zero)
     List_ACCESS(T, (*this), vp);
     List_FOR_ALL((*this), i)
     {
-        List_ELEM((*this), vp, i) = Zero;
+        vp[i] = Zero;
     }
 }
 
 
-// * * * * * * * * * * * * * * STL Member Functions  * * * * * * * * * * * * //
-
-template<class T>
-void Foam::UList<T>::swap(UList<T>& a)
-{
-    Swap(size_, a.size_);
-    Swap(v_, a.v_);
-}
-
-
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
 template<class T>
@@ -197,6 +237,55 @@ std::streamsize Foam::UList<T>::byteSize() const
 }
 
 
+template<class T>
+Foam::label Foam::UList<T>::find(const T& val, const label start) const
+{
+    if (start >= 0)
+    {
+        List_CONST_ACCESS(T, (*this), vp);
+
+        const label len = this->size();
+
+        for (label i = start; i < len; ++i)
+        {
+            if (vp[i] == val)
+            {
+                return i;
+            }
+        }
+    }
+
+    return -1;
+}
+
+
+template<class T>
+Foam::label Foam::UList<T>::rfind(const T& val, const label pos) const
+{
+    List_CONST_ACCESS(T, (*this), vp);
+
+    for
+    (
+        label i =
+        (
+            pos < 0
+          ? (this->size()-1)
+          : min(pos, this->size()-1)
+        );
+        i >= 0;
+        --i
+    )
+    {
+        if (vp[i] == val)
+        {
+            return i;
+        }
+    }
+
+    return -1;
+}
+
+
 template<class T>
 void Foam::sort(UList<T>& a)
 {
@@ -248,7 +337,7 @@ bool Foam::UList<T>::operator==(const UList<T>& a) const
 
     List_FOR_ALL((*this), i)
     {
-        equal = (List_ELEM((*this), vp, i) == List_ELEM((a), ap, i));
+        equal = (vp[i] == ap[i]);
         if (!equal) break;
     }
 
diff --git a/src/OpenFOAM/containers/Lists/UList/UList.H b/src/OpenFOAM/containers/Lists/UList/UList.H
index 6b58437b36f..23fee6ab040 100644
--- a/src/OpenFOAM/containers/Lists/UList/UList.H
+++ b/src/OpenFOAM/containers/Lists/UList/UList.H
@@ -48,6 +48,8 @@ SourceFiles
 #include "nullObject.H"
 #include "zero.H"
 #include "stdFoam.H"
+#include "Swap.H"
+
 #include <initializer_list>
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -181,17 +183,28 @@ public:
 
     // Member Functions
 
-
         // Access
 
-            //- Return the forward circular index, i.e. the next index
+            //- Return the forward circular index, i.e. next index
             //  which returns to the first at the end of the list
             inline label fcIndex(const label i) const;
 
-            //- Return the reverse circular index, i.e. the previous index
+            //- Return forward circular value (ie, next value in the list)
+            inline const T& fcValue(const label i) const;
+
+            //- Return forward circular value (ie, next value in the list)
+            inline T& fcValue(const label i);
+
+            //- Return the reverse circular index, i.e. previous index
             //  which returns to the last at the beginning of the list
             inline label rcIndex(const label i) const;
 
+            //- Return reverse circular value (ie, previous value in the list)
+            inline const T& rcValue(const label i) const;
+
+            //- Return reverse circular value (ie, previous value in the list)
+            inline T& rcValue(const label i);
+
             //- Return the binary size in number of characters of the UList
             //  if the element is a primitive type
             //  i.e. contiguous<T>() == true.
@@ -234,6 +247,41 @@ public:
             inline void checkIndex(const label i) const;
 
 
+      // Search
+
+        //- Find index of the first occurence of the value.
+        //  When start is specified, any occurences before start are ignored.
+        //  Linear search.
+        //  \return -1 if not found.
+        label find(const T& val, const label start=0) const;
+
+        //- Find index of the last occurence of the value.
+        //  When pos is specified, any occurences after pos are ignored.
+        //  Linear search.
+        //  \return -1 if not found.
+        label rfind(const T& val, const label pos=-1) const;
+
+        //- True if the value if found in the list. Linear search.
+        inline bool found(const T& val, const label start=0) const;
+
+
+      // Edit
+
+        //- Move element to the first position.
+        void moveFirst(const label i);
+
+        //- Move element to the last position.
+        void moveLast(const label i);
+
+        //- Swap element with the first element. Fatal on an empty list.
+        void swapFirst(const label i);
+
+        //- Swap element with the last element. Fatal on an empty list.
+        void swapLast(const label i);
+
+
+      // Copy
+
         //- Copy the pointer held by the given UList
         inline void shallowCopy(const UList<T>& a);
 
@@ -264,21 +312,21 @@ public:
         //- Return (start,size) subset from UList with non-const access.
         //  The range is subsetted with the list size itself to ensure that the
         //  result always addresses a valid section of the list.
-        UList<T> operator[](std::initializer_list<label> start_size_range);
+        UList<T> operator[](std::initializer_list<label> start_size);
 
         //- Return (start,size) subset from UList with const access.
         //  The range is subsetted with the list size itself to ensure that the
         //  result always addresses a valid section of the list.
         const UList<T> operator[]
         (
-            std::initializer_list<label> start_size_range
+            std::initializer_list<label> start_size
         ) const;
 
         //- Allow cast to a const List<T>&
         inline operator const Foam::List<T>&() const;
 
         //- Assignment of all entries to the given value
-        void operator=(const T& t);
+        void operator=(const T& val);
 
         //- Assignment of all entries to zero
         void operator=(const zero);
@@ -374,8 +422,8 @@ public:
         //- Return true if the UList is empty (ie, size() is zero)
         inline bool empty() const;
 
-        //- Swap two ULists of the same type in constant time
-        void swap(UList<T>& a);
+        //- Swap content with another UList of the same type in constant time
+        inline void swap(UList<T>& lst);
 
 
     // STL member operators
@@ -429,6 +477,9 @@ public:
         );
 };
 
+
+// Global Functions
+
 template<class T>
 void sort(UList<T>& a);
 
@@ -446,11 +497,15 @@ void shuffle(UList<T>& a);
 
 // Reverse the first n elements of the list
 template<class T>
-inline void reverse(UList<T>& ul, const label n);
+inline void reverse(UList<T>& lst, const label n);
 
 // Reverse all the elements of the list
 template<class T>
-inline void reverse(UList<T>& ul);
+inline void reverse(UList<T>& lst);
+
+// Exchange contents of lists - see UList::swap().
+template<class T>
+inline void Swap(UList<T>& a, UList<T>& b);
 
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/OpenFOAM/containers/Lists/UList/UListI.H b/src/OpenFOAM/containers/Lists/UList/UListI.H
index 971fa7faa05..36c74ee28b5 100644
--- a/src/OpenFOAM/containers/Lists/UList/UListI.H
+++ b/src/OpenFOAM/containers/Lists/UList/UListI.H
@@ -61,6 +61,20 @@ inline Foam::label Foam::UList<T>::fcIndex(const label i) const
 }
 
 
+template<class T>
+inline const T& Foam::UList<T>::fcValue(const label i) const
+{
+    return this->operator[](this->fcIndex(i));
+}
+
+
+template<class T>
+inline T& Foam::UList<T>::fcValue(const label i)
+{
+    return this->operator[](this->fcIndex(i));
+}
+
+
 template<class T>
 inline Foam::label Foam::UList<T>::rcIndex(const label i) const
 {
@@ -68,6 +82,20 @@ inline Foam::label Foam::UList<T>::rcIndex(const label i) const
 }
 
 
+template<class T>
+inline const T& Foam::UList<T>::rcValue(const label i) const
+{
+    return this->operator[](this->rcIndex(i));
+}
+
+
+template<class T>
+inline T& Foam::UList<T>::rcValue(const label i)
+{
+    return this->operator[](this->rcIndex(i));
+}
+
+
 template<class T>
 inline void Foam::UList<T>::checkStart(const label start) const
 {
@@ -152,6 +180,13 @@ inline T* Foam::UList<T>::data()
 }
 
 
+template<class T>
+inline bool Foam::UList<T>::found(const T& val, const label start) const
+{
+    return (this->find(val, start) >= 0);
+}
+
+
 template<class T>
 inline void Foam::UList<T>::shallowCopy(const UList<T>& a)
 {
@@ -313,21 +348,37 @@ inline bool Foam::UList<T>::empty() const
 }
 
 
+template<class T>
+inline void Foam::UList<T>::swap(UList<T>& lst)
+{
+    Foam::Swap(size_, lst.size_);
+    Foam::Swap(v_, lst.v_);
+}
+
+
 // * * * * * * * * * * * * * * * Global Functions  * * * * * * * * * * * * * //
 
 template<class T>
-inline void Foam::reverse(UList<T>& ul, const label n)
+inline void Foam::reverse(UList<T>& lst, const label n)
 {
     for (int i=0; i<n/2; ++i)
     {
-        Swap(ul[i], ul[n-1-i]);
+        Foam::Swap(lst[i], lst[n-1-i]);
     }
 }
 
+
+template<class T>
+inline void Foam::reverse(UList<T>& lst)
+{
+    reverse(lst, lst.size());
+}
+
+
 template<class T>
-inline void Foam::reverse(UList<T>& ul)
+inline void Foam::Swap(UList<T>& a, UList<T>& b)
 {
-    reverse(ul, ul.size());
+    a.swap(b);
 }
 
 
diff --git a/src/OpenFOAM/fields/Fields/DynamicField/DynamicField.C b/src/OpenFOAM/fields/Fields/DynamicField/DynamicField.C
index 1626319fc0f..a18d76fc9eb 100644
--- a/src/OpenFOAM/fields/Fields/DynamicField/DynamicField.C
+++ b/src/OpenFOAM/fields/Fields/DynamicField/DynamicField.C
@@ -3,7 +3,7 @@
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
     \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
-     \\/     M anipulation  |
+     \\/     M anipulation  | Copyright (C) 2017 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -27,32 +27,32 @@ License
 
 // * * * * * * * * * * * * * * * IOstream Operators  * * * * * * * * * * * * //
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::DynamicField(Istream& is)
+template<class T, int SizeMin>
+Foam::DynamicField<T, SizeMin>::DynamicField(Istream& is)
 :
     Field<T>(is),
     capacity_(Field<T>::size())
 {}
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-Foam::tmp<Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>>
-Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::clone() const
+template<class T, int SizeMin>
+Foam::tmp<Foam::DynamicField<T, SizeMin>>
+Foam::DynamicField<T, SizeMin>::clone() const
 {
-    return tmp<DynamicField<T, SizeInc, SizeMult, SizeDiv>>
+    return tmp<DynamicField<T, SizeMin>>
     (
-        new DynamicField<T, SizeInc, SizeMult, SizeDiv>(*this)
+        new DynamicField<T, SizeMin>(*this)
     );
 }
 
 
 // * * * * * * * * * * * * * * * IOstream Operator * * * * * * * * * * * * * //
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
+template<class T, int SizeMin>
 Foam::Ostream& Foam::operator<<
 (
     Ostream& os,
-    const DynamicField<T, SizeInc, SizeMult, SizeDiv>& lst
+    const DynamicField<T, SizeMin>& lst
 )
 {
     os << static_cast<const Field<T>&>(lst);
@@ -60,11 +60,11 @@ Foam::Ostream& Foam::operator<<
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
+template<class T, int SizeMin>
 Foam::Istream& Foam::operator>>
 (
     Istream& is,
-    DynamicField<T, SizeInc, SizeMult, SizeDiv>& lst
+    DynamicField<T, SizeMin>& lst
 )
 {
     is >> static_cast<Field<T>&>(lst);
diff --git a/src/OpenFOAM/fields/Fields/DynamicField/DynamicField.H b/src/OpenFOAM/fields/Fields/DynamicField/DynamicField.H
index 178dff7c256..fd5b3a5486f 100644
--- a/src/OpenFOAM/fields/Fields/DynamicField/DynamicField.H
+++ b/src/OpenFOAM/fields/Fields/DynamicField/DynamicField.H
@@ -46,21 +46,20 @@ namespace Foam
 
 // Forward declaration of friend functions and operators
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-class DynamicField;
+template<class T, int SizeMin> class DynamicField;
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
+template<class T, int SizeMin>
 Ostream& operator<<
 (
     Ostream&,
-    const DynamicField<T, SizeInc, SizeMult, SizeDiv>&
+    const DynamicField<T, SizeMin>&
 );
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
+template<class T, int SizeMin>
 Istream& operator>>
 (
     Istream&,
-    DynamicField<T, SizeInc, SizeMult, SizeDiv>&
+    DynamicField<T, SizeMin>&
 );
 
 
@@ -68,16 +67,12 @@ Istream& operator>>
                            Class DynamicField Declaration
 \*---------------------------------------------------------------------------*/
 
-template<class T, unsigned SizeInc=0, unsigned SizeMult=2, unsigned SizeDiv=1>
+template<class T, int SizeMin=64>
 class DynamicField
 :
     public Field<T>
 {
-    static_assert
-    (
-        (SizeInc || SizeMult) && SizeDiv,
-        "Avoid invalid sizing parameters"
-    );
+    static_assert(SizeMin > 0, "Invalid min size parameter");
 
     // Private data
 
@@ -85,17 +80,20 @@ class DynamicField
         label capacity_;
 
 
+    // Private Member Functions
+
+        //- Copy assignment from another list
+        template<class ListType>
+        inline void assignDynField(const ListType& lst);
+
 public:
 
     // Static Member Functions
 
         //- Return a null field
-        inline static const DynamicField<T, SizeInc, SizeMult, SizeDiv>& null()
+        inline static const DynamicField<T, SizeMin>& null()
         {
-            return *reinterpret_cast
-            <
-                DynamicField<T, SizeInc, SizeMult, SizeDiv>*
-            >(0);
+            return *reinterpret_cast<DynamicField<T, SizeMin>*>(0);
         }
 
 
@@ -140,19 +138,19 @@ public:
         );
 
         //- Construct copy
-        inline DynamicField(const DynamicField<T, SizeInc, SizeMult, SizeDiv>&);
+        inline DynamicField(const DynamicField<T, SizeMin>&);
 
         //- Construct by transferring the Field contents
         inline DynamicField
         (
-            const Xfer<DynamicField<T, SizeInc, SizeMult, SizeDiv>>&
+            const Xfer<DynamicField<T, SizeMin>>&
         );
 
         //- Construct from Istream. Size set to size of list read.
         explicit DynamicField(Istream&);
 
         //- Clone
-        tmp<DynamicField<T, SizeInc, SizeMult, SizeDiv>> clone() const;
+        tmp<DynamicField<T, SizeMin>> clone() const;
 
 
     // Member Functions
@@ -188,7 +186,7 @@ public:
 
             //- Alter the addressed list size and fill new space with a
             //  constant.
-            inline void resize(const label, const T&);
+            inline void resize(const label, const T& val);
 
             //- Reserve allocation space for at least this size.
             //  Never shrinks the allocated size, use setCapacity() for that.
@@ -203,7 +201,7 @@ public:
 
             //- Shrink the allocated space to the number of elements used.
             //  Returns a reference to the DynamicField.
-            inline DynamicField<T, SizeInc, SizeMult, SizeDiv>& shrink();
+            inline DynamicField<T, SizeMin>& shrink();
 
             //- Transfer contents to the Xfer container as a plain List
             inline Xfer<List<T>> xfer();
@@ -212,16 +210,12 @@ public:
         // Member Operators
 
             //- Append an element at the end of the list
-            inline DynamicField<T, SizeInc, SizeMult, SizeDiv>& append
-            (
-                const T&
-            );
+            inline DynamicField<T, SizeMin>&
+            append(const T& val);
 
             //- Append a List at the end of this list
-            inline DynamicField<T, SizeInc, SizeMult, SizeDiv>& append
-            (
-                const UList<T>&
-            );
+            inline DynamicField<T, SizeMin>&
+            append(const UList<T>& lst);
 
             //- Remove and return the top element
             inline T remove();
@@ -236,7 +230,7 @@ public:
             //- Assignment to DynamicField
             inline void operator=
             (
-                const DynamicField<T, SizeInc, SizeMult, SizeDiv>&
+                const DynamicField<T, SizeMin>&
             );
 
             //- Assignment to UList
diff --git a/src/OpenFOAM/fields/Fields/DynamicField/DynamicFieldI.H b/src/OpenFOAM/fields/Fields/DynamicField/DynamicFieldI.H
index b29af8958e3..658c0b9d1cb 100644
--- a/src/OpenFOAM/fields/Fields/DynamicField/DynamicFieldI.H
+++ b/src/OpenFOAM/fields/Fields/DynamicField/DynamicFieldI.H
@@ -3,7 +3,7 @@
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
     \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
-     \\/     M anipulation  | Copyright (C) 2016 OpenCFD Ltd.
+     \\/     M anipulation  | Copyright (C) 2016-2017 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -23,18 +23,46 @@ License
 
 \*---------------------------------------------------------------------------*/
 
+// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+
+template<class T, int SizeMin>
+template<class ListType>
+inline void Foam::DynamicField<T, SizeMin>::assignDynField
+(
+    const ListType& lst
+)
+{
+    const label newSize = lst.size();
+
+    if (capacity_ >= newSize)
+    {
+        // Can copy w/o reallocating - adjust addressable size accordingly.
+        Field<T>::size(lst.size());
+        Field<T>::operator=(lst);
+    }
+    else
+    {
+        // Ensure list size consistency prior to copying.
+        Field<T>::size(capacity_);
+
+        Field<T>::operator=(lst);
+        capacity_ = Field<T>::size();
+    }
+}
+
+
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::DynamicField()
+template<class T, int SizeMin>
+inline Foam::DynamicField<T, SizeMin>::DynamicField()
 :
     Field<T>(0),
     capacity_(Field<T>::size())
 {}
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::DynamicField
+template<class T, int SizeMin>
+inline Foam::DynamicField<T, SizeMin>::DynamicField
 (
     const label nElem
 )
@@ -42,13 +70,13 @@ inline Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::DynamicField
     Field<T>(nElem),
     capacity_(Field<T>::size())
 {
-    // we could also enforce SizeInc granularity when (!SizeMult || !SizeDiv)
+    // We could also enforce sizing granularity
     Field<T>::size(0);
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::DynamicField
+template<class T, int SizeMin>
+inline Foam::DynamicField<T, SizeMin>::DynamicField
 (
     const UList<T>& lst
 )
@@ -58,8 +86,8 @@ inline Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::DynamicField
 {}
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::DynamicField
+template<class T, int SizeMin>
+inline Foam::DynamicField<T, SizeMin>::DynamicField
 (
     const Xfer<List<T>>& lst
 )
@@ -69,8 +97,8 @@ inline Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::DynamicField
 {}
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::DynamicField
+template<class T, int SizeMin>
+inline Foam::DynamicField<T, SizeMin>::DynamicField
 (
     const Xfer<Field<T>>& lst
 )
@@ -80,8 +108,8 @@ inline Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::DynamicField
 {}
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::DynamicField
+template<class T, int SizeMin>
+inline Foam::DynamicField<T, SizeMin>::DynamicField
 (
     const UList<T>& mapF,
     const labelList& mapAddressing
@@ -92,8 +120,8 @@ inline Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::DynamicField
 {}
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::DynamicField
+template<class T, int SizeMin>
+inline Foam::DynamicField<T, SizeMin>::DynamicField
 (
     const UList<T>& mapF,
     const labelListList& mapAddressing,
@@ -106,8 +134,8 @@ inline Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::DynamicField
 
 
 //- Construct by mapping from the given field
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::DynamicField
+template<class T, int SizeMin>
+inline Foam::DynamicField<T, SizeMin>::DynamicField
 (
     const UList<T>& mapF,
     const FieldMapper& map
@@ -118,10 +146,10 @@ inline Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::DynamicField
 {}
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::DynamicField
+template<class T, int SizeMin>
+inline Foam::DynamicField<T, SizeMin>::DynamicField
 (
-    const DynamicField<T, SizeInc, SizeMult, SizeDiv>& lst
+    const DynamicField<T, SizeMin>& lst
 )
 :
     Field<T>(lst),
@@ -129,10 +157,10 @@ inline Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::DynamicField
 {}
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::DynamicField
+template<class T, int SizeMin>
+inline Foam::DynamicField<T, SizeMin>::DynamicField
 (
-    const Xfer<DynamicField<T, SizeInc, SizeMult, SizeDiv>>& lst
+    const Xfer<DynamicField<T, SizeMin>>& lst
 )
 :
     Field<T>(lst),
@@ -142,16 +170,16 @@ inline Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::DynamicField
 
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline Foam::label Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::capacity()
+template<class T, int SizeMin>
+inline Foam::label Foam::DynamicField<T, SizeMin>::capacity()
 const
 {
     return capacity_;
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline void Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::setCapacity
+template<class T, int SizeMin>
+inline void Foam::DynamicField<T, SizeMin>::setCapacity
 (
     const label nElem
 )
@@ -164,107 +192,90 @@ inline void Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::setCapacity
         // truncate addressed sizes too
         nextFree = capacity_;
     }
-    // we could also enforce SizeInc granularity when (!SizeMult || !SizeDiv)
+
+    // We could also enforce sizing granularity
 
     Field<T>::setSize(capacity_);
     Field<T>::size(nextFree);
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline void Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::reserve
+template<class T, int SizeMin>
+inline void Foam::DynamicField<T, SizeMin>::reserve
 (
     const label nElem
 )
 {
-    // allocate more capacity?
+    // Allocate more capacity if necessary
     if (nElem > capacity_)
     {
-// TODO: convince the compiler that division by zero does not occur
-//        if (SizeInc && (!SizeMult || !SizeDiv))
-//        {
-//            // resize with SizeInc as the granularity
-//            capacity_ = nElem;
-//            unsigned pad = SizeInc - (capacity_ % SizeInc);
-//            if (pad != SizeInc)
-//            {
-//                capacity_ += pad;
-//            }
-//        }
-//        else
-        {
-            capacity_ = max
+        capacity_ = max
+        (
+            SizeMin,
+            max
             (
                 nElem,
-                label(SizeInc + capacity_ * SizeMult / SizeDiv)
-            );
-        }
+                // label(SizeInc + capacity_ * SizeMult / SizeDiv)
+                label(2*capacity_)
+            )
+        );
 
-        // adjust allocated size, leave addressed size untouched
-        label nextFree = Field<T>::size();
+        // Adjust allocated size, leave addressed size untouched
+        const label nextFree = Field<T>::size();
         Field<T>::setSize(capacity_);
         Field<T>::size(nextFree);
     }
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline void Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::setSize
+template<class T, int SizeMin>
+inline void Foam::DynamicField<T, SizeMin>::setSize
 (
     const label nElem
 )
 {
-    // allocate more capacity?
+    // Allocate more capacity if necessary
     if (nElem > capacity_)
     {
-// TODO: convince the compiler that division by zero does not occur
-//        if (SizeInc && (!SizeMult || !SizeDiv))
-//        {
-//            // resize with SizeInc as the granularity
-//            capacity_ = nElem;
-//            unsigned pad = SizeInc - (capacity_ % SizeInc);
-//            if (pad != SizeInc)
-//            {
-//                capacity_ += pad;
-//            }
-//        }
-//        else
-        {
-            capacity_ = max
+        capacity_ = max
+        (
+            SizeMin,
+            max
             (
                 nElem,
-                label(SizeInc + capacity_ * SizeMult / SizeDiv)
-            );
-        }
+                // label(SizeInc + capacity_ * SizeMult / SizeDiv)
+                label(2*capacity_)
+            )
+        );
 
         Field<T>::setSize(capacity_);
     }
 
-    // adjust addressed size
+    // Adjust addressed size
     Field<T>::size(nElem);
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline void Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::setSize
+template<class T, int SizeMin>
+inline void Foam::DynamicField<T, SizeMin>::setSize
 (
     const label nElem,
-    const T& t
+    const T& val
 )
 {
     label nextFree = Field<T>::size();
     setSize(nElem);
 
-    // set new elements to constant value
+    // Set new elements to constant value
     while (nextFree < nElem)
     {
-        this->operator[](nextFree++) = t;
+        this->operator[](nextFree++) = val;
     }
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline void Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::resize
+template<class T, int SizeMin>
+inline void Foam::DynamicField<T, SizeMin>::resize
 (
     const label nElem
 )
@@ -273,35 +284,35 @@ inline void Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::resize
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline void Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::resize
+template<class T, int SizeMin>
+inline void Foam::DynamicField<T, SizeMin>::resize
 (
     const label nElem,
-    const T& t
+    const T& val
 )
 {
-    this->setSize(nElem, t);
+    this->setSize(nElem, val);
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline void Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::clear()
+template<class T, int SizeMin>
+inline void Foam::DynamicField<T, SizeMin>::clear()
 {
     Field<T>::size(0);
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline void Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::clearStorage()
+template<class T, int SizeMin>
+inline void Foam::DynamicField<T, SizeMin>::clearStorage()
 {
     Field<T>::clear();
     capacity_ = 0;
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>&
-Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::shrink()
+template<class T, int SizeMin>
+inline Foam::DynamicField<T, SizeMin>&
+Foam::DynamicField<T, SizeMin>::shrink()
 {
     label nextFree = Field<T>::size();
     if (capacity_ > nextFree)
@@ -318,32 +329,32 @@ Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::shrink()
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
+template<class T, int SizeMin>
 inline Foam::Xfer<Foam::List<T>>
-Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::xfer()
+Foam::DynamicField<T, SizeMin>::xfer()
 {
     return xferMoveTo<List<T>>(*this);
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>&
-Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::append
+template<class T, int SizeMin>
+inline Foam::DynamicField<T, SizeMin>&
+Foam::DynamicField<T, SizeMin>::append
 (
-    const T& t
+    const T& val
 )
 {
-    const label elemI = List<T>::size();
-    setSize(elemI + 1);
+    const label idx = List<T>::size();
+    setSize(idx + 1);
 
-    this->operator[](elemI) = t;
+    this->operator[](idx) = val;
     return *this;
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>&
-Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::append
+template<class T, int SizeMin>
+inline Foam::DynamicField<T, SizeMin>&
+Foam::DynamicField<T, SizeMin>::append
 (
     const UList<T>& lst
 )
@@ -365,20 +376,21 @@ Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::append
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline T Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::remove()
+template<class T, int SizeMin>
+inline T Foam::DynamicField<T, SizeMin>::remove()
 {
-    const label elemI = List<T>::size() - 1;
+    // Location of last element and simultaneously the new size
+    const label idx = List<T>::size() - 1;
 
-    if (elemI < 0)
+    if (idx < 0)
     {
         FatalErrorInFunction
             << "List is empty" << abort(FatalError);
     }
 
-    const T& val = List<T>::operator[](elemI);
+    const T& val = List<T>::operator[](idx);
 
-    List<T>::size(elemI);
+    List<T>::size(idx);
 
     return val;
 }
@@ -386,8 +398,8 @@ inline T Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::remove()
 
 // * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline T& Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::operator()
+template<class T, int SizeMin>
+inline T& Foam::DynamicField<T, SizeMin>::operator()
 (
     const label elemI
 )
@@ -401,65 +413,39 @@ inline T& Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::operator()
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline void Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::operator=
+template<class T, int SizeMin>
+inline void Foam::DynamicField<T, SizeMin>::operator=
 (
-    const T& t
+    const T& val
 )
 {
-    UList<T>::operator=(t);
+    UList<T>::operator=(val);
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline void Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::operator=
+template<class T, int SizeMin>
+inline void Foam::DynamicField<T, SizeMin>::operator=
 (
-    const DynamicField<T, SizeInc, SizeMult, SizeDiv>& lst
+    const DynamicField<T, SizeMin>& lst
 )
 {
     if (this == &lst)
     {
         FatalErrorInFunction
-            << "attempted assignment to self" << abort(FatalError);
-    }
-
-    if (capacity_ >= lst.size())
-    {
-        // can copy w/o reallocating, match initial size to avoid reallocation
-        Field<T>::size(lst.size());
-        Field<T>::operator=(lst);
+            << "Attempted assignment to self" << abort(FatalError);
     }
-    else
-    {
-        // make everything available for the copy operation
-        Field<T>::size(capacity_);
 
-        Field<T>::operator=(lst);
-        capacity_ = Field<T>::size();
-    }
+    assignDynField(lst);
 }
 
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline void Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::operator=
+template<class T, int SizeMin>
+inline void Foam::DynamicField<T, SizeMin>::operator=
 (
     const UList<T>& lst
 )
 {
-    if (capacity_ >= lst.size())
-    {
-        // can copy w/o reallocating, match initial size to avoid reallocation
-        Field<T>::size(lst.size());
-        Field<T>::operator=(lst);
-    }
-    else
-    {
-        // make everything available for the copy operation
-        Field<T>::size(capacity_);
-
-        Field<T>::operator=(lst);
-        capacity_ = Field<T>::size();
-    }
+    assignDynField(lst);
 }
 
 
diff --git a/src/OpenFOAM/fields/Fields/Field/FieldM.H b/src/OpenFOAM/fields/Fields/Field/FieldM.H
index 46be4b350da..b1682bf6d7a 100644
--- a/src/OpenFOAM/fields/Fields/Field/FieldM.H
+++ b/src/OpenFOAM/fields/Fields/Field/FieldM.H
@@ -56,7 +56,8 @@ void checkFields
         FatalErrorInFunction
             << " Field<"<<pTraits<Type1>::typeName<<"> f1("<<f1.size()<<')'
             << " and Field<"<<pTraits<Type2>::typeName<<"> f2("<<f2.size()<<')'
-            << endl << " for operation " << op
+            << endl
+            << " for operation " << op
             << abort(FatalError);
     }
 }
@@ -76,7 +77,8 @@ void checkFields
             << " Field<"<<pTraits<Type1>::typeName<<"> f1("<<f1.size()<<')'
             << ", Field<"<<pTraits<Type2>::typeName<<"> f2("<<f2.size()<<')'
             << " and Field<"<<pTraits<Type3>::typeName<<"> f3("<<f3.size()<<')'
-            << endl << "    for operation " << op
+            << endl
+            << "    for operation " << op
             << abort(FatalError);
     }
 }
@@ -107,312 +109,305 @@ void checkFields
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-// member function : this f1 OP fUNC f2
+// Member function : f1 OP Func f2
 
 #define TFOR_ALL_F_OP_FUNC_F(typeF1, f1, OP, FUNC, typeF2, f2)                 \
                                                                                \
-    /* check the two fields have same Field<Type> mesh */                      \
+    /* Check fields have same size */                                          \
     checkFields(f1, f2, "f1 " #OP " " #FUNC "(f2)");                           \
                                                                                \
-    /* set access to f1, f2 and f3 at end of each field */                     \
+    /* Field access */                                                         \
     List_ACCESS(typeF1, f1, f1P);                                              \
     List_CONST_ACCESS(typeF2, f2, f2P);                                        \
                                                                                \
-    /* loop through fields performing f1 OP1 f2 OP2 f3 */                      \
+    /* Loop: f1 OP FUNC(f2) */                                                 \
     List_FOR_ALL(f1, i)                                                        \
     {                                                                          \
-        List_ELEM(f1, f1P, i) OP FUNC(List_ELEM(f2, f2P, i));                  \
+        (f1P[i]) OP FUNC(f2P[i]);                                              \
     }
 
 
 #define TFOR_ALL_F_OP_F_FUNC(typeF1, f1, OP, typeF2, f2, FUNC)                 \
                                                                                \
-    /* check the two fields have same Field<Type> mesh */                      \
+    /* Check fields have same size */                                          \
     checkFields(f1, f2, "f1 " #OP " f2" #FUNC);                                \
                                                                                \
-    /* set access to f1, f2 and f3 at end of each field */                     \
+    /* Field access */                                                         \
     List_ACCESS(typeF1, f1, f1P);                                              \
     List_CONST_ACCESS(typeF2, f2, f2P);                                        \
                                                                                \
-    /* loop through fields performing f1 OP1 f2 OP2 f3 */                      \
+    /* Loop: f1 OP f2.FUNC() */                                                \
     List_FOR_ALL(f1, i)                                                        \
     {                                                                          \
-        List_ELEM(f1, f1P, i) OP List_ELEM(f2, f2P, i).FUNC();                 \
+        (f1P[i]) OP (f2P[i]).FUNC();                                           \
     }
 
 
-// member function : this field f1 OP fUNC f2, f3
+// Member function : this field f1 OP FUNC(f2, f3)
 
 #define TFOR_ALL_F_OP_FUNC_F_F(typeF1, f1, OP, FUNC, typeF2, f2, typeF3, f3)   \
                                                                                \
-    /* check the three fields have same Field<Type> mesh */                    \
+    /* Check fields have same size */                                          \
     checkFields(f1, f2, f3, "f1 " #OP " " #FUNC "(f2, f3)");                   \
                                                                                \
-    /* set access to f1, f2 and f3 at end of each field */                     \
+    /* Field access */                                                         \
     List_ACCESS(typeF1, f1, f1P);                                              \
     List_CONST_ACCESS(typeF2, f2, f2P);                                        \
     List_CONST_ACCESS(typeF3, f3, f3P);                                        \
                                                                                \
-    /* loop through fields performing f1 OP1 f2 OP2 f3 */                      \
+    /* Loop: f1 OP FUNC(f2, f3) */                                             \
     List_FOR_ALL(f1, i)                                                        \
     {                                                                          \
-        List_ELEM(f1, f1P, i)                                                  \
-        OP FUNC(List_ELEM(f2, f2P, i), List_ELEM(f3, f3P, i));                 \
+        (f1P[i]) OP FUNC((f2P[i]), (f3P[i]));                                  \
     }
 
 
-// member function : this field f1 OP fUNC f2, f3
+// Member function : s OP FUNC(f1, f2)
 
 #define TFOR_ALL_S_OP_FUNC_F_F(typeS, s, OP, FUNC, typeF1, f1, typeF2, f2)     \
                                                                                \
-    /* check the two fields have same Field<Type> mesh */                      \
+    /* Check fields have same size */                                          \
     checkFields(f1, f2, "s " #OP " " #FUNC "(f1, f2)");                        \
                                                                                \
-    /* set access to f1 and f2 at end of each field */                         \
+    /* Field access */                                                         \
     List_CONST_ACCESS(typeF1, f1, f1P);                                        \
     List_CONST_ACCESS(typeF2, f2, f2P);                                        \
                                                                                \
-    /* loop through fields performing s OP FUNC(f1, f2) */                     \
+    /* Loop: s OP FUNC(f1, f2) */                                              \
     List_FOR_ALL(f1, i)                                                        \
     {                                                                          \
-        (s) OP FUNC(List_ELEM(f1, f1P, i), List_ELEM(f2, f2P, i));             \
+        (s) OP FUNC((f1P[i]), (f2P[i]));                                       \
     }
 
 
-// member function : this f1 OP fUNC f2, s
+// Member function : this f1 OP FUNC(f2, s)
 
 #define TFOR_ALL_F_OP_FUNC_F_S(typeF1, f1, OP, FUNC, typeF2, f2, typeS, s)     \
                                                                                \
-    /* check the two fields have same Field<Type> mesh */                      \
+    /* Check fields have same size */                                          \
     checkFields(f1, f2, "f1 " #OP " " #FUNC "(f2, s)");                        \
                                                                                \
-    /* set access to f1, f2 and f3 at end of each field */                     \
+    /* Field access */                                                         \
     List_ACCESS(typeF1, f1, f1P);                                              \
     List_CONST_ACCESS(typeF2, f2, f2P);                                        \
                                                                                \
-    /* loop through fields performing f1 OP1 f2 OP2 f3 */                      \
+    /* Loop: f1 OP FUNC(f2, s) */                                              \
     List_FOR_ALL(f1, i)                                                        \
     {                                                                          \
-        List_ELEM(f1, f1P, i) OP FUNC(List_ELEM(f2, f2P, i), (s));             \
+        (f1P[i]) OP FUNC((f2P[i]), (s));                                       \
     }
 
 
-// member function : s1 OP fUNC f, s2
+// Member function : s1 OP FUNC(f, s2)
 
 #define TFOR_ALL_S_OP_FUNC_F_S(typeS1, s1, OP, FUNC, typeF, f, typeS2, s2)     \
                                                                                \
-    /* set access to f at end of field */                                      \
+    /* Field access */                                                         \
     List_CONST_ACCESS(typeF, f, fP);                                           \
                                                                                \
-    /* loop through fields performing f1 OP1 f2 OP2 f3 */                      \
+    /* Loop: s1 OP FUNC(f, s2) */                                              \
     List_FOR_ALL(f, i)                                                         \
     {                                                                          \
-        (s1) OP FUNC(List_ELEM(f, fP, i), (s2));                               \
+        (s1) OP FUNC((fP[i]), (s2));                                           \
     }
 
 
-// member function : this f1 OP fUNC s, f2
+// Member function : this f1 OP FUNC(s, f2)
 
 #define TFOR_ALL_F_OP_FUNC_S_F(typeF1, f1, OP, FUNC, typeS, s, typeF2, f2)     \
                                                                                \
-    /* check the two fields have same Field<Type> mesh */                      \
+    /* Check fields have same size */                                          \
     checkFields(f1, f2, "f1 " #OP " " #FUNC "(s, f2)");                        \
                                                                                \
-    /* set access to f1, f2 and f3 at end of each field */                     \
+    /* Field access */                                                         \
     List_ACCESS(typeF1, f1, f1P);                                              \
     List_CONST_ACCESS(typeF2, f2, f2P);                                        \
                                                                                \
-    /* loop through fields performing f1 OP1 f2 OP2 f3 */                      \
+    /* Loop: f1 OP1 f2 OP2 f3 */                                               \
     List_FOR_ALL(f1, i)                                                        \
     {                                                                          \
-        List_ELEM(f1, f1P, i) OP FUNC((s), List_ELEM(f2, f2P, i));             \
+        (f1P[i]) OP FUNC((s), (f2P[i]));                                       \
     }
 
 
-// member function : this f1 OP fUNC s, f2
+// Member function : this f1 OP FUNC(s1, s2)
 
 #define TFOR_ALL_F_OP_FUNC_S_S(typeF1, f1, OP, FUNC, typeS1, s1, typeS2, s2)   \
                                                                                \
-    /* set access to f1 at end of field */                                     \
+    /* Field access */                                                         \
     List_ACCESS(typeF1, f1, f1P);                                              \
                                                                                \
-    /* loop through fields performing f1 OP1 FUNC(s1, s2) */                   \
+    /* Loop: f1 OP FUNC(s1, s2) */                                             \
     List_FOR_ALL(f1, i)                                                        \
     {                                                                          \
-        List_ELEM(f1, f1P, i) OP FUNC((s1), (s2));                             \
+        (f1P[i]) OP FUNC((s1), (s2));                                          \
     }
 
 
-// member function : this f1 OP1 f2 OP2 FUNC s
+// Member function : this f1 OP f2 FUNC(s)
 
 #define TFOR_ALL_F_OP_F_FUNC_S(typeF1, f1, OP, typeF2, f2, FUNC, typeS, s)     \
                                                                                \
-    /* check the two fields have same Field<Type> mesh */                      \
+    /* Check fields have same size */                                          \
     checkFields(f1, f2, "f1 " #OP " f2 " #FUNC "(s)");                         \
                                                                                \
-    /* set access to f1, f2 and f3 at end of each field */                     \
+    /* Field access */                                                         \
     List_ACCESS(typeF1, f1, f1P);                                              \
     List_CONST_ACCESS(typeF2, f2, f2P);                                        \
                                                                                \
-    /* loop through fields performing f1 OP1 f2 OP2 f3 */                      \
+    /* Loop: f1 OP f2 FUNC(s) */                                               \
     List_FOR_ALL(f1, i)                                                        \
     {                                                                          \
-        List_ELEM(f1, f1P, i) OP List_ELEM(f2, f2P, i) FUNC((s));              \
+        (f1P[i]) OP (f2P[i]) FUNC((s));                                        \
     }
 
 
-// define high performance macro functions for Field<Type> operations
-
-// member operator : this field f1 OP1 f2 OP2 f3
+// Member operator : this field f1 OP1 f2 OP2 f3
 
 #define TFOR_ALL_F_OP_F_OP_F(typeF1, f1, OP1, typeF2, f2, OP2, typeF3, f3)     \
                                                                                \
-    /* check the three fields have same Field<Type> mesh */                    \
+    /* Check fields have same size */                                          \
     checkFields(f1, f2, f3, "f1 " #OP1 " f2 " #OP2 " f3");                     \
                                                                                \
-    /* set access to f1, f2 and f3 at end of each field */                     \
+    /* Field access */                                                         \
     List_ACCESS(typeF1, f1, f1P);                                              \
     List_CONST_ACCESS(typeF2, f2, f2P);                                        \
     List_CONST_ACCESS(typeF3, f3, f3P);                                        \
                                                                                \
-    /* loop through fields performing f1 OP1 f2 OP2 f3 */                      \
+    /* Loop: f1 OP1 f2 OP2 f3 */                                               \
     List_FOR_ALL(f1, i)                                                        \
     {                                                                          \
-        List_ELEM(f1, f1P, i) OP1 List_ELEM(f2, f2P, i)                        \
-                              OP2 List_ELEM(f3, f3P, i);                       \
+        (f1P[i]) OP1 (f2P[i]) OP2 (f3P[i]);                                    \
     }
 
 
-// member operator : this field f1 OP1 s OP2 f2
+// Member operator : this field f1 OP1 s OP2 f2
 
 #define TFOR_ALL_F_OP_S_OP_F(typeF1, f1, OP1, typeS, s, OP2, typeF2, f2)       \
                                                                                \
-    /* check the two fields have same Field<Type> mesh */                      \
+    /* Check fields have same size */                                          \
     checkFields(f1, f2, "f1 " #OP1 " s " #OP2 " f2");                          \
                                                                                \
-    /* set access to f1 and f2 at end of each field */                         \
+    /* Field access */                                                         \
     List_ACCESS(typeF1, f1, f1P);                                              \
     List_CONST_ACCESS(typeF2, f2, f2P);                                        \
                                                                                \
-    /* loop through fields performing f1 OP1 s OP2 f2 */                       \
+    /* Loop: f1 OP1 s OP2 f2 */                                                \
     List_FOR_ALL(f1, i)                                                        \
     {                                                                          \
-        List_ELEM(f1, f1P, i) OP1 (s) OP2 List_ELEM(f2, f2P, i);               \
+        (f1P[i]) OP1 (s) OP2 (f2P[i]);                                         \
     }
 
 
-// member operator : this field f1 OP1 f2 OP2 s
+// Member operator : this field f1 OP1 f2 OP2 s
 
 #define TFOR_ALL_F_OP_F_OP_S(typeF1, f1, OP1, typeF2, f2, OP2, typeS, s)       \
                                                                                \
-    /* check the two fields have same Field<Type> mesh */                      \
+    /* Check fields have same size */                                          \
     checkFields(f1, f2, "f1 " #OP1 " f2 " #OP2 " s");                          \
                                                                                \
-    /* set access to f1 and f2 at end of each field */                         \
+    /* Field access */                                                         \
     List_ACCESS(typeF1, f1, f1P);                                              \
     List_CONST_ACCESS(typeF2, f2, f2P);                                        \
                                                                                \
-    /* loop through fields performing f1 OP1 s OP2 f2 */                       \
+    /* Loop f1 OP1 s OP2 f2 */                                                 \
     List_FOR_ALL(f1, i)                                                        \
     {                                                                          \
-        List_ELEM(f1, f1P, i) OP1 List_ELEM(f2, f2P, i) OP2 (s);               \
+        (f1P[i]) OP1 (f2P[i]) OP2 (s);                                         \
     }
 
 
-// member operator : this field f1 OP f2
+// Member operator : this field f1 OP f2
 
 #define TFOR_ALL_F_OP_F(typeF1, f1, OP, typeF2, f2)                            \
                                                                                \
-    /* check the two fields have same Field<Type> mesh */                      \
+    /* Check fields have same size */                                          \
     checkFields(f1, f2, "f1 " #OP " f2");                                      \
                                                                                \
-    /* set pointer to f1P at end of f1 and */                                  \
-    /* f2.p at end of f2 */                                                    \
+    /* Field access */                                                         \
     List_ACCESS(typeF1, f1, f1P);                                              \
     List_CONST_ACCESS(typeF2, f2, f2P);                                        \
                                                                                \
-    /* loop through fields performing f1 OP f2 */                              \
+    /* Loop: f1 OP f2 */                                                       \
     List_FOR_ALL(f1, i)                                                        \
     {                                                                          \
-        List_ELEM(f1, f1P, i) OP List_ELEM(f2, f2P, i);                        \
+        (f1P[i]) OP (f2P[i]);                                                  \
     }
 
-// member operator : this field f1 OP1 OP2 f2
+// Member operator : this field f1 OP1 OP2 f2
 
 #define TFOR_ALL_F_OP_OP_F(typeF1, f1, OP1, OP2, typeF2, f2)                   \
                                                                                \
-    /* check the two fields have same Field<Type> mesh */                      \
+    /* Check fields have same size */                                          \
     checkFields(f1, f2, #OP1 " " #OP2 " f2");                                  \
                                                                                \
-    /* set pointer to f1P at end of f1 and */                                  \
-    /* f2.p at end of f2 */                                                    \
+    /* Field access */                                                         \
     List_ACCESS(typeF1, f1, f1P);                                              \
     List_CONST_ACCESS(typeF2, f2, f2P);                                        \
                                                                                \
-    /* loop through fields performing f1 OP1 OP2 f2 */                         \
+    /* Loop: f1 OP1 OP2 f2 */                                                  \
     List_FOR_ALL(f1, i)                                                        \
     {                                                                          \
-        List_ELEM(f1, f1P, i) OP1 OP2 List_ELEM(f2, f2P, i);                   \
+        (f1P[i]) OP1 OP2 (f2P[i]);                                             \
     }
 
 
-// member operator : this field f OP s
+// Member operator : this field f OP s
 
 #define TFOR_ALL_F_OP_S(typeF, f, OP, typeS, s)                                \
                                                                                \
-    /* set access to f at end of field */                                      \
+    /* Field access */                                                         \
     List_ACCESS(typeF, f, fP);                                                 \
                                                                                \
-    /* loop through field performing f OP s */                                 \
+    /* Loop: f OP s */                                                         \
     List_FOR_ALL(f, i)                                                         \
     {                                                                          \
-        List_ELEM(f, fP, i) OP (s);                                            \
+        (fP[i]) OP (s);                                                        \
     }
 
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// define high performance macro functions for Field<Type> friend functions
 
-// friend operator function : s OP f, allocates storage for s
+// Friend operator function : s OP f, allocates storage for s
 
 #define TFOR_ALL_S_OP_F(typeS, s, OP, typeF, f)                                \
                                                                                \
-    /* set access to f at end of field */                                      \
+    /* Field access */                                                         \
     List_CONST_ACCESS(typeF, f, fP);                                           \
                                                                                \
-    /* loop through field performing s OP f */                                 \
+    /* Loop: s OP f */                                                         \
     List_FOR_ALL(f, i)                                                         \
     {                                                                          \
-        (s) OP List_ELEM(f, fP, i);                                            \
+        (s) OP (fP[i]);                                                        \
     }
 
 
-// friend operator function : s OP1 f1 OP2 f2, allocates storage for s
+// Friend operator function : s OP1 f1 OP2 f2, allocates storage for s
 
 #define TFOR_ALL_S_OP_F_OP_F(typeS, s, OP1, typeF1, f1, OP2, typeF2, f2)       \
                                                                                \
-    /* set access to f1 and f2 at end of each field */                         \
+    /* Field access */                                                         \
     List_CONST_ACCESS(typeF1, f1, f1P);                                        \
     List_CONST_ACCESS(typeF2, f2, f2P);                                        \
                                                                                \
-    /* loop through field performing s OP f */                                 \
+    /* Loop: s OP f */                                                         \
     List_FOR_ALL(f1, i)                                                        \
     {                                                                          \
-        (s) OP1 List_ELEM(f1, f1P, i) OP2 List_ELEM(f2, f2P, i);               \
+        (s) OP1 (f1P[i]) OP2 (f2P[i]);                                         \
     }
 
 
-// friend operator function : s OP FUNC(f), allocates storage for s
+// Friend operator function : s OP FUNC(f), allocates storage for s
 
 #define TFOR_ALL_S_OP_FUNC_F(typeS, s, OP, FUNC, typeF, f)                     \
                                                                                \
-    /* set access to f at end of field */                                      \
+    /* Field access */                                                         \
     List_CONST_ACCESS(typeF, f, fP);                                           \
                                                                                \
-    /* loop through field performing s OP f */                                 \
+    /* Loop: s OP FUNC(f) */                                                   \
     List_FOR_ALL(f, i)                                                         \
     {                                                                          \
-        (s) OP FUNC(List_ELEM(f, fP, i));                                      \
+        (s) OP FUNC(fP[i]);                                                    \
     }
 
 
diff --git a/src/OpenFOAM/meshes/meshShapes/face/face.H b/src/OpenFOAM/meshes/meshShapes/face/face.H
index 822e3c4f9a6..2c640ce5236 100644
--- a/src/OpenFOAM/meshes/meshShapes/face/face.H
+++ b/src/OpenFOAM/meshes/meshShapes/face/face.H
@@ -62,8 +62,7 @@ namespace Foam
 class face;
 class triFace;
 
-template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-class DynamicList;
+template<class T, int SizeMin> class DynamicList;
 
 inline Istream& operator>>(Istream& is, face& f);
 
@@ -344,11 +343,11 @@ public:
             //- Split into triangles using existing points.
             //  Append to DynamicList.
             //  Returns number of faces created.
-            template<unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
+            template<int SizeMin>
             label triangles
             (
                 const UList<point>& points,
-                DynamicList<face, SizeInc, SizeMult, SizeDiv>& triFaces
+                DynamicList<face, SizeMin>& triFaces
             ) const;
 
             //- Number of triangles and quads after splitting
diff --git a/src/OpenFOAM/meshes/meshShapes/face/faceI.H b/src/OpenFOAM/meshes/meshShapes/face/faceI.H
index d312560843c..17b58b83bd2 100644
--- a/src/OpenFOAM/meshes/meshShapes/face/faceI.H
+++ b/src/OpenFOAM/meshes/meshShapes/face/faceI.H
@@ -124,13 +124,13 @@ inline bool Foam::face::found(const label globalIndex) const
 
 inline Foam::label Foam::face::nextLabel(const label i) const
 {
-    return operator[](fcIndex(i));
+    return this->fcValue(i);
 }
 
 
 inline Foam::label Foam::face::prevLabel(const label i) const
 {
-    return operator[](rcIndex(i));
+    return this->rcValue(i);
 }
 
 
diff --git a/src/OpenFOAM/meshes/meshShapes/face/faceTemplates.C b/src/OpenFOAM/meshes/meshShapes/face/faceTemplates.C
index 112a5703fbe..9f9bb58844e 100644
--- a/src/OpenFOAM/meshes/meshShapes/face/faceTemplates.C
+++ b/src/OpenFOAM/meshes/meshShapes/face/faceTemplates.C
@@ -28,11 +28,11 @@ License
 
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
-template<unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
+template<int SizeMin>
 Foam::label Foam::face::triangles
 (
     const UList<point>& points,
-    DynamicList<face, SizeInc, SizeMult, SizeDiv>& triFaces
+    DynamicList<face, SizeMin>& triFaces
 ) const
 {
     label triI = triFaces.size();
diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshFromShapeMesh.C b/src/OpenFOAM/meshes/polyMesh/polyMeshFromShapeMesh.C
index ee160048be8..5603bda172b 100644
--- a/src/OpenFOAM/meshes/polyMesh/polyMeshFromShapeMesh.C
+++ b/src/OpenFOAM/meshes/polyMesh/polyMeshFromShapeMesh.C
@@ -38,8 +38,7 @@ Foam::labelListList Foam::polyMesh::cellShapePointCells
     const cellShapeList& c
 ) const
 {
-    List<DynamicList<label, primitiveMesh::cellsPerPoint_>>
-        pc(points().size());
+    List<DynamicList<label>> pc(points().size());
 
     // For each cell
     forAll(c, i)
@@ -51,8 +50,7 @@ Foam::labelListList Foam::polyMesh::cellShapePointCells
         {
             // Set working point label
             label curPoint = labels[j];
-            DynamicList<label, primitiveMesh::cellsPerPoint_>& curPointCells =
-                pc[curPoint];
+            DynamicList<label>& curPointCells = pc[curPoint];
 
             // Enter the cell label in the point's cell list
             curPointCells.append(i);
diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellEdges.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellEdges.C
index 1b56bd5268c..f130c8975bb 100644
--- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellEdges.C
+++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellEdges.C
@@ -60,7 +60,7 @@ void Foam::primitiveMesh::calcCellEdges() const
     else
     {
         // Set up temporary storage
-        List<DynamicList<label, edgesPerCell_>> ce(nCells());
+        List<DynamicList<label>> ce(nCells());
 
 
         // Get reference to faceCells and faceEdges
@@ -71,7 +71,7 @@ void Foam::primitiveMesh::calcCellEdges() const
         // loop through the list again and add edges; checking for duplicates
         forAll(own, facei)
         {
-            DynamicList<label, edgesPerCell_>& curCellEdges = ce[own[facei]];
+            DynamicList<label>& curCellEdges = ce[own[facei]];
 
             const labelList& curEdges = fe[facei];
 
@@ -87,7 +87,7 @@ void Foam::primitiveMesh::calcCellEdges() const
 
         forAll(nei, facei)
         {
-            DynamicList<label, edgesPerCell_>& curCellEdges = ce[nei[facei]];
+            DynamicList<label>& curCellEdges = ce[nei[facei]];
 
             const labelList& curEdges = fe[facei];
 
diff --git a/src/OpenFOAM/primitives/Swap/Swap.H b/src/OpenFOAM/primitives/Swap/Swap.H
index 85b0c7316da..0c2b20b1d4d 100644
--- a/src/OpenFOAM/primitives/Swap/Swap.H
+++ b/src/OpenFOAM/primitives/Swap/Swap.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2017 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -25,28 +25,56 @@ InNamespace
     Foam
 
 Description
-    Swap its arguments
+    Swap arguments as per std::swap, but in Foam namespace.
 
 \*---------------------------------------------------------------------------*/
 
 #ifndef Swap_H
 #define Swap_H
 
+#include <type_traits>
+#include <utility>
+
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 namespace Foam
 {
 
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
+//- Swap non-array types as per std::swap example, but in Foam namespace.
+//  \sa http://www.cplusplus.com/reference/utility/swap/
 template<class T>
-inline void Swap(T& a, T& b)
+void Swap(T& a, T& b)
+{
+    // compile-time resolution with std::enable_if not yet working
+    if (std::is_fundamental<T>::value || std::is_pointer<T>::value)
+    {
+        // Use copy/assign for simple types
+        const T tmp = a;
+        a = b;
+        b = tmp;
+    }
+    else
+    {
+        // Use move/assignment
+        T tmp(std::move(a));
+        a = std::move(b);
+        b = std::move(tmp);
+    }
+}
+
+
+//- Swap array types as per std::swap example, but in Foam namespace.
+//  \sa http://www.cplusplus.com/reference/utility/swap/
+template<class T, size_t N>
+void Swap(T (&a)[N], T (&b)[N])
 {
-    T tmp = a;
-    a = b;
-    b = tmp;
+    for (size_t i = 0; i < N; ++i)
+    {
+        Foam::Swap(a[i], b[i]);
+    }
 }
 
+
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 } // End namespace Foam
diff --git a/src/dynamicMesh/slidingInterface/enrichedPatch/enrichedPatchPointPoints.C b/src/dynamicMesh/slidingInterface/enrichedPatch/enrichedPatchPointPoints.C
index c0f8dd6fa7d..7a04712c027 100644
--- a/src/dynamicMesh/slidingInterface/enrichedPatch/enrichedPatchPointPoints.C
+++ b/src/dynamicMesh/slidingInterface/enrichedPatch/enrichedPatchPointPoints.C
@@ -46,8 +46,7 @@ void Foam::enrichedPatch::calcPointPoints() const
     // Go through all faces and add the previous and next point as the
     // neighbour for each point. While inserting points, reject the
     // duplicates (as every internal edge will be visited twice).
-    List<DynamicList<label, primitiveMesh::edgesPerPoint_>>
-        pp(meshPoints().size());
+    List<DynamicList<label>> pp(meshPoints().size());
 
     const faceList& lf = localFaces();
 
@@ -59,8 +58,7 @@ void Foam::enrichedPatch::calcPointPoints() const
 
         forAll(curFace, pointi)
         {
-            DynamicList<label, primitiveMesh::edgesPerPoint_>&
-                curPp = pp[curFace[pointi]];
+            DynamicList<label>& curPp = pp[curFace[pointi]];
 
             // Do next label
             label next = curFace.nextLabel(pointi);
diff --git a/src/meshTools/searchableSurfaces/searchableBox/searchableBox.C b/src/meshTools/searchableSurfaces/searchableBox/searchableBox.C
index dfe684bb4da..9a5f3a49842 100644
--- a/src/meshTools/searchableSurfaces/searchableBox/searchableBox.C
+++ b/src/meshTools/searchableSurfaces/searchableBox/searchableBox.C
@@ -503,7 +503,7 @@ void Foam::searchableBox::findLineAll
     info.setSize(start.size());
 
     // Work array
-    DynamicList<pointIndexHit, 1, 1> hits;
+    DynamicList<pointIndexHit> hits;
 
     // Tolerances:
     // To find all intersections we add a small vector to the last intersection
diff --git a/src/meshTools/searchableSurfaces/searchableRotatedBox/searchableRotatedBox.C b/src/meshTools/searchableSurfaces/searchableRotatedBox/searchableRotatedBox.C
index ffb8dc9c5dc..ab2329e744a 100644
--- a/src/meshTools/searchableSurfaces/searchableRotatedBox/searchableRotatedBox.C
+++ b/src/meshTools/searchableSurfaces/searchableRotatedBox/searchableRotatedBox.C
@@ -301,7 +301,7 @@ void Foam::searchableRotatedBox::findLineAll
     info.setSize(start.size());
 
     // Work array
-    DynamicList<pointIndexHit, 1, 1> hits;
+    DynamicList<pointIndexHit> hits;
 
     // Tolerances:
     // To find all intersections we add a small vector to the last intersection
diff --git a/src/meshTools/searchableSurfaces/triSurfaceMesh/triSurfaceMesh.H b/src/meshTools/searchableSurfaces/triSurfaceMesh/triSurfaceMesh.H
index 110ee7944b2..54af373a33d 100644
--- a/src/meshTools/searchableSurfaces/triSurfaceMesh/triSurfaceMesh.H
+++ b/src/meshTools/searchableSurfaces/triSurfaceMesh/triSurfaceMesh.H
@@ -131,7 +131,7 @@ class triSurfaceMesh
             const point& start,
             const point& end,
             const vector& smallVec,
-            DynamicList<pointIndexHit, 1, 1>& hits
+            DynamicList<pointIndexHit>& hits
         );
 
         //- Disallow default bitwise copy construct
diff --git a/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.C b/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.C
index 40edce3f2c3..fe699056547 100644
--- a/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.C
+++ b/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.C
@@ -33,7 +33,7 @@ License
 bool Foam::triSurfaceSearch::checkUniqueHit
 (
     const pointIndexHit& currHit,
-    const DynamicList<pointIndexHit, 1, 1>& hits,
+    const UList<pointIndexHit>& hits,
     const vector& lineVec
 ) const
 {
@@ -387,7 +387,7 @@ void Foam::triSurfaceSearch::findLineAll
     indexedOctree<treeDataTriSurface>::perturbTol() = tolerance();
 
     // Work array
-    DynamicList<pointIndexHit, 1, 1> hits;
+    DynamicList<pointIndexHit> hits;
 
     DynamicList<label> shapeMask;
 
diff --git a/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.H b/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.H
index b46e7589857..d42806a5639 100644
--- a/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.H
+++ b/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.H
@@ -80,7 +80,7 @@ class triSurfaceSearch
         bool checkUniqueHit
         (
             const pointIndexHit& currHit,
-            const DynamicList<pointIndexHit, 1, 1>& hits,
+            const UList<pointIndexHit>& hits,
             const vector& lineVec
         ) const;
 
diff --git a/wmake/rules/linux64GccKNL/c b/wmake/rules/linux64GccKNL/c
index a1cd9d6613e..d0eb3eab570 100644
--- a/wmake/rules/linux64GccKNL/c
+++ b/wmake/rules/linux64GccKNL/c
@@ -2,7 +2,7 @@ SUFFIXES += .c
 
 cWARN        = -Wall
 
-cc          = gcc -m64 -march=knl -DvectorMachine -DKNL
+cc          = gcc -m64 -march=knl
 
 include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION)
 
diff --git a/wmake/rules/linux64GccKNL/c++ b/wmake/rules/linux64GccKNL/c++
index cdc820c5568..199d72c0fdc 100644
--- a/wmake/rules/linux64GccKNL/c++
+++ b/wmake/rules/linux64GccKNL/c++
@@ -6,7 +6,7 @@ c++WARN     = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-para
 # Suppress some warnings for flex++ and CGAL
 c++LESSWARN = -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-array-bounds
 
-CC          = g++ -std=c++11 -m64 -march=knl -DvectorMachine
+CC          = g++ -std=c++11 -m64 -march=knl
 
 include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
 
diff --git a/wmake/rules/linux64IccKNL/c++ b/wmake/rules/linux64IccKNL/c++
index f0938a4da25..9b047d22caf 100644
--- a/wmake/rules/linux64IccKNL/c++
+++ b/wmake/rules/linux64IccKNL/c++
@@ -6,7 +6,7 @@ c++WARN     = -Wall -Wextra -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invali
 # Suppress some warnings for flex++ and CGAL
 c++LESSWARN = -diag-disable 1224,2026,2305
 
-CC          = icpc -std=c++11 -xmic-avx512 -DvectorMachine -fp-trap=common -fp-model precise -fp-speculation=safe
+CC          = icpc -std=c++11 -xmic-avx512 -fp-trap=common -fp-model precise -fp-speculation=safe
 
 include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
 
-- 
GitLab