From 48247a3d625c4b43960648c43559fcac6bfb38c6 Mon Sep 17 00:00:00 2001
From: Mark Olesen <Mark.Olesen@Germany>
Date: Mon, 27 Apr 2009 10:08:29 +0200
Subject: [PATCH] consistency update

- DynamicList gets append methods as per List
- misc cosmetic changes
---
 .../test/DynamicList/DynamicListTest.C        | 23 ++++++--
 applications/test/HashTable/hashTableTest.C   | 24 +++++---
 .../StaticHashTable/staticHashTableTest.C     | 25 ++++++---
 .../UIndirectListTest/UIndirectListTest.C     | 24 +++++---
 .../HashTables/HashPtrTable/HashPtrTableIO.C  |  4 +-
 .../HashTables/HashTable/HashTable.H          |  7 +++
 .../HashTables/HashTable/HashTableIO.C        | 18 ++++--
 .../StaticHashTable/StaticHashTableIO.C       |  4 +-
 .../LinkedLists/accessTypes/ILList/ILListIO.C |  4 +-
 .../LinkedLists/accessTypes/LList/LListIO.C   |  4 +-
 .../accessTypes/LPtrList/LPtrListIO.C         |  4 +-
 .../Lists/DynamicList/DynamicList.H           | 14 +++--
 .../Lists/DynamicList/DynamicListI.H          | 34 ++++++++++--
 .../containers/Lists/FixedList/FixedListIO.C  |  4 +-
 src/OpenFOAM/containers/Lists/List/List.C     | 55 -------------------
 src/OpenFOAM/containers/Lists/List/List.H     | 13 ++---
 src/OpenFOAM/containers/Lists/List/ListI.H    | 36 +++++++++++-
 src/OpenFOAM/containers/Lists/List/ListIO.C   |  4 +-
 .../containers/Lists/PtrList/PtrListIO.C      |  4 +-
 .../SphericalTensor/SphericalTensorI.H        |  2 +-
 .../primitives/SymmTensor/SymmTensorI.H       | 28 +++-------
 .../SymmTensor/symmTensor/symmTensor.C        |  9 ++-
 src/OpenFOAM/primitives/Tensor/TensorI.H      | 30 +++-------
 .../primitives/Tensor/tensor/tensor.H         | 12 ++--
 24 files changed, 210 insertions(+), 176 deletions(-)

diff --git a/applications/test/DynamicList/DynamicListTest.C b/applications/test/DynamicList/DynamicListTest.C
index 324c5361bb7..355c65605fe 100644
--- a/applications/test/DynamicList/DynamicListTest.C
+++ b/applications/test/DynamicList/DynamicListTest.C
@@ -160,18 +160,33 @@ int main(int argc, char *argv[])
         << " " << lstB.size() << endl;
     Info<< "<dlD>" << dlD << "</dlD>" << nl << "sizes: "
         << " " << dlD.size() << "/" << dlD.capacity() << endl;
-    
+
     DynamicList<label,10> dlE1(10);
-    DynamicList<label> dlE2(dlE1);
+    DynamicList<label> dlE2(dlE1);   // construct dissimilar
 
     Info<< "<dlE1>" << dlE1 << "</dlE1>" << nl << "sizes: "
         << " " << dlE1.size() << "/" << dlE1.capacity() << endl;
     Info<< "<dlE2>" << dlE2 << "</dlE2>" << nl << "sizes: "
         << " " << dlE2.size() << "/" << dlE2.capacity() << endl;
 
-    dlE2.append(100);
+    for (label elemI=0; elemI < 5; ++elemI)
+    {
+        dlE1.append(4 - elemI);
+        dlE2.append(elemI);
+    }
+
     Info<< "<dlE2>" << dlE2 << "</dlE2>" << endl;
-    
+
+    DynamicList<label> dlE3(dlE2);   // construct identical
+    Info<< "<dlE3>" << dlE3 << "</dlE3>" << endl;
+
+    dlE3 = dlE1;   // assign dissimilar
+    Info<< "<dlE3>" << dlE3 << "</dlE3>" << endl;
+
+    dlE3 = dlE2;   // assign identical
+    Info<< "<dlE3>" << dlE3 << "</dlE3>" << endl;
+
+
     Info<< "\nEnd\n";
 
     return 0;
diff --git a/applications/test/HashTable/hashTableTest.C b/applications/test/HashTable/hashTableTest.C
index 8e3db2c9d7a..25338a2bb7f 100644
--- a/applications/test/HashTable/hashTableTest.C
+++ b/applications/test/HashTable/hashTableTest.C
@@ -39,7 +39,7 @@ using namespace Foam;
 
 int main()
 {
-    HASHTABLE_CLASS<double> table1(100);
+    HASHTABLE_CLASS<double> table1(13);
 
     table1.insert("aaa", 1.0);
     table1.insert("aba", 2.0);
@@ -56,7 +56,8 @@ int main()
     table1.erase("abs");
 
     Info<< "\ntable1 toc: " << table1.toc() << endl;
-    Info<< "\ntable1 [" << table1.size() << "] " << endl;
+    table1.printInfo(Info)
+        << "table1 [" << table1.size() << "] " << endl;
     forAllIter(HASHTABLE_CLASS<double>, table1, iter)
     {
         Info<< iter.key() << " => " << iter() << nl;
@@ -97,7 +98,7 @@ int main()
         << "transfer table1 -> table3 via the xfer() method" << nl;
 
     Info<< "\ntable1" << table1 << nl
-        << "\ntable2" << table1 << nl
+        << "\ntable2" << table2 << nl
         << "\ntable3" << table3 << nl;
 
     Info<< "\nerase table2 by iterator" << nl;
@@ -113,10 +114,14 @@ int main()
         << "\ntable3" << table3 << nl;
 
     table3.resize(1);
-    Info<< "\nresize(1) table3" << table3 << nl;
+    Info<< "\nresize(1) table3" << nl;
+    table3.printInfo(Info)
+        << table3 << nl;
 
     table3.resize(10000);
-    Info<< "\nresize(10000) table3" << table3 << nl;
+    Info<< "\nresize(10000) table3" << nl;
+    table3.printInfo(Info)
+        << table3 << nl;
 
     HASHTABLE_CLASS<double> table4;
 
@@ -134,26 +139,27 @@ int main()
     table1.erase(table1.begin());
     Info<< "removed an element - test table1 != table3 : "
         << (table1 != table3) << nl;
-    
+
     // insert a few things into table2
     table2.set("ada", 14.0);
     table2.set("aeq", 15.0);
     table2.set("aaw", 16.0);
     table2.set("abs", 17.0);
     table2.set("adx", 20.0);
-    
+
     Info<< "\ntable1" << table1 << nl
         << "\ntable2" << table2 << nl;
 
     label nErased = table1.erase(table2);
-    
+
     Info<< "\nerase table2 keys from table1 (removed "
         << nErased << " elements)" << nl
         << "\ntable1" << table1 << nl
         << "\ntable2" << table2 << nl;
 
 
-    Info<< "\nclearStorage table3 ... ";
+    Info<< "\ntable3" << table3
+        << "\nclearStorage table3 ... ";
     table3.clearStorage();
     Info<< table3 << nl;
 
diff --git a/applications/test/StaticHashTable/staticHashTableTest.C b/applications/test/StaticHashTable/staticHashTableTest.C
index 2060ec582c2..c283fe9ba56 100644
--- a/applications/test/StaticHashTable/staticHashTableTest.C
+++ b/applications/test/StaticHashTable/staticHashTableTest.C
@@ -39,7 +39,7 @@ using namespace Foam;
 
 int main()
 {
-    HASHTABLE_CLASS<double> table1(100);
+    HASHTABLE_CLASS<double> table1(13);
 
     table1.insert("aaa", 1.0);
     table1.insert("aba", 2.0);
@@ -56,7 +56,8 @@ int main()
     table1.erase("abs");
 
     Info<< "\ntable1 toc: " << table1.toc() << endl;
-    Info<< "\ntable1 [" << table1.size() << "] " << endl;
+    table1.printInfo(Info)
+        << "table1 [" << table1.size() << "] " << endl;
     forAllIter(HASHTABLE_CLASS<double>, table1, iter)
     {
         Info<< iter.key() << " => " << iter() << nl;
@@ -97,7 +98,7 @@ int main()
         << "transfer table1 -> table3 via the xfer() method" << nl;
 
     Info<< "\ntable1" << table1 << nl
-        << "\ntable2" << table1 << nl
+        << "\ntable2" << table2 << nl
         << "\ntable3" << table3 << nl;
 
     Info<< "\nerase table2 by iterator" << nl;
@@ -113,10 +114,14 @@ int main()
         << "\ntable3" << table3 << nl;
 
     table3.resize(1);
-    Info<< "\nresize(1) table3" << table3 << nl;
+    Info<< "\nresize(1) table3" << nl;
+    table3.printInfo(Info)
+        << table3 << nl;
 
     table3.resize(10000);
-    Info<< "\nresize(10000) table3" << table3 << nl;
+    Info<< "\nresize(10000) table3" << nl;
+    table3.printInfo(Info)
+        << table3 << nl;
 
     HASHTABLE_CLASS<double> table4;
 
@@ -134,26 +139,27 @@ int main()
     table1.erase(table1.begin());
     Info<< "removed an element - test table1 != table3 : "
         << (table1 != table3) << nl;
-    
+
     // insert a few things into table2
     table2.set("ada", 14.0);
     table2.set("aeq", 15.0);
     table2.set("aaw", 16.0);
     table2.set("abs", 17.0);
     table2.set("adx", 20.0);
-    
+
     Info<< "\ntable1" << table1 << nl
         << "\ntable2" << table2 << nl;
 
     label nErased = table1.erase(table2);
-    
+
     Info<< "\nerase table2 keys from table1 (removed "
         << nErased << " elements)" << nl
         << "\ntable1" << table1 << nl
         << "\ntable2" << table2 << nl;
 
 
-    Info<< "\nclearStorage table3 ... ";
+    Info<< "\ntable3" << table3
+        << "\nclearStorage table3 ... ";
     table3.clearStorage();
     Info<< table3 << nl;
 
@@ -162,4 +168,5 @@ int main()
     return 0;
 }
 
+
 // ************************************************************************* //
diff --git a/applications/test/UIndirectListTest/UIndirectListTest.C b/applications/test/UIndirectListTest/UIndirectListTest.C
index 9c619a4b991..6902f47eeab 100644
--- a/applications/test/UIndirectListTest/UIndirectListTest.C
+++ b/applications/test/UIndirectListTest/UIndirectListTest.C
@@ -27,6 +27,7 @@ Description
 \*---------------------------------------------------------------------------*/
 
 #include "UIndirectList.H"
+#include "DynamicList.H"
 #include "IOstreams.H"
 #include "ListOps.H"
 #include "OFstream.H"
@@ -58,11 +59,11 @@ int main(int argc, char *argv[])
 
     idl[1] = -666;
 
-    Info<< "idl[1] changed:" << idl << endl;
+    Info<< "idl[1] changed: " << idl << endl;
 
     idl = -999;
 
-    Info<< "idl changed:" << idl << endl;
+    Info<< "idl changed: " << idl << endl;
 
     UIndirectList<double> idl2(idl);
 
@@ -79,17 +80,26 @@ int main(int argc, char *argv[])
         idl = ident;
     }
 
-    Info<< "idl assigned from UList:" << idl << endl;
+    Info<< "idl assigned from UList: " << idl << endl;
 
-    List<double> realList = UIndirectList<double>(completeList, addresses);
+    // test List operations
 
-    Info<< "realList:" << realList << endl;
+    List<double> flatList = UIndirectList<double>(completeList, addresses);
+    Info<< "List assigned from UIndirectList: " << flatList << endl;
 
-    List<double> realList2(UIndirectList<double>(completeList, addresses));
+    List<double> flatList2(UIndirectList<double>(completeList, addresses));
+    Info<< "List constructed from UIndirectList: " << flatList2 << endl;
 
-    Info<< "realList2:" << realList2 << endl;
+    flatList.append(UIndirectList<double>(completeList, addresses));
+    Info<< "List::append(UIndirectList): " << flatList << endl;
 
 
+    DynamicList<double> dynList(UIndirectList<double>(completeList, addresses));
+    Info<< "DynamicList constructed from UIndirectList: " << dynList << endl;
+
+    dynList.append(UIndirectList<double>(completeList, addresses));
+    Info<< "DynamicList::append(UIndirectList): " << dynList << endl;
+
     Info << "\nEnd\n" << endl;
 
     return 0;
diff --git a/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTableIO.C b/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTableIO.C
index d113a99ee1c..e4eb63f06e6 100644
--- a/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTableIO.C
+++ b/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTableIO.C
@@ -50,7 +50,7 @@ void Foam::HashPtrTable<T, Key, Hash>::read(Istream& is, const INew& inewt)
         label s = firstToken.labelToken();
 
         // Read beginning of contents
-        char listDelimiter = is.readBeginList("HashPtrTable<T, Key, Hash>");
+        char delimiter = is.readBeginList("HashPtrTable<T, Key, Hash>");
 
         if (s)
         {
@@ -59,7 +59,7 @@ void Foam::HashPtrTable<T, Key, Hash>::read(Istream& is, const INew& inewt)
                 this->resize(2*s);
             }
 
-            if (listDelimiter == token::BEGIN_LIST)
+            if (delimiter == token::BEGIN_LIST)
             {
                 for (label i=0; i<s; i++)
                 {
diff --git a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H
index 5112f6fb7dc..826bb95741b 100644
--- a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H
+++ b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H
@@ -28,6 +28,13 @@ Class
 Description
     An STL-conforming hash table.
 
+Note
+    Hashing index collisions are handled via chaining using a singly-linked
+    list with the colliding entry being added to the head of the linked
+    list. Thus copying the hash table (or indeed even resizing it) will
+    often result in a different hash order. Use a sorted table-of-contents
+    when the hash order is important.
+
 SourceFiles
     HashTableI.H
     HashTable.C
diff --git a/src/OpenFOAM/containers/HashTables/HashTable/HashTableIO.C b/src/OpenFOAM/containers/HashTables/HashTable/HashTableIO.C
index 2a407b44a5a..bef0cf50bca 100644
--- a/src/OpenFOAM/containers/HashTables/HashTable/HashTableIO.C
+++ b/src/OpenFOAM/containers/HashTables/HashTable/HashTableIO.C
@@ -81,7 +81,7 @@ Foam::HashTable<T, Key, Hash>::printInfo(Ostream& os) const
 
     os  << "HashTable<T,Key,Hash>"
         << " elements:" << size() << " slots:" << used << "/" << tableSize_
-        << " chaining(avg/max):" << (used ? float(avgChain/used) : 0)
+        << " chaining(avg/max):" << (used ? (float(avgChain)/used) : 0)
         << "/" << maxChain << endl;
 
     return os;
@@ -91,7 +91,11 @@ Foam::HashTable<T, Key, Hash>::printInfo(Ostream& os) const
 // * * * * * * * * * * * * * * * IOstream Operators  * * * * * * * * * * * * //
 
 template<class T, class Key, class Hash>
-Foam::Istream& Foam::operator>>(Istream& is, HashTable<T, Key, Hash>& L)
+Foam::Istream& Foam::operator>>
+(
+    Istream& is,
+    HashTable<T, Key, Hash>& L
+)
 {
     is.fatalCheck("operator>>(Istream&, HashTable<T, Key, Hash>&)");
 
@@ -113,7 +117,7 @@ Foam::Istream& Foam::operator>>(Istream& is, HashTable<T, Key, Hash>& L)
         label s = firstToken.labelToken();
 
         // Read beginning of contents
-        char listDelimiter = is.readBeginList("HashTable<T, Key, Hash>");
+        char delimiter = is.readBeginList("HashTable<T, Key, Hash>");
 
         if (s)
         {
@@ -122,7 +126,7 @@ Foam::Istream& Foam::operator>>(Istream& is, HashTable<T, Key, Hash>& L)
                 L.resize(2*s);
             }
 
-            if (listDelimiter == token::BEGIN_LIST)
+            if (delimiter == token::BEGIN_LIST)
             {
                 for (label i=0; i<s; i++)
                 {
@@ -209,7 +213,11 @@ Foam::Istream& Foam::operator>>(Istream& is, HashTable<T, Key, Hash>& L)
 
 
 template<class T, class Key, class Hash>
-Foam::Ostream& Foam::operator<<(Ostream& os, const HashTable<T, Key, Hash>& L)
+Foam::Ostream& Foam::operator<<
+(
+    Ostream& os,
+    const HashTable<T, Key, Hash>& L
+)
 {
     // Write size and start delimiter
     os << nl << L.size() << nl << token::BEGIN_LIST << nl;
diff --git a/src/OpenFOAM/containers/HashTables/StaticHashTable/StaticHashTableIO.C b/src/OpenFOAM/containers/HashTables/StaticHashTable/StaticHashTableIO.C
index 3939851fc57..3280ad73899 100644
--- a/src/OpenFOAM/containers/HashTables/StaticHashTable/StaticHashTableIO.C
+++ b/src/OpenFOAM/containers/HashTables/StaticHashTable/StaticHashTableIO.C
@@ -117,7 +117,7 @@ Foam::Istream& Foam::operator>>(Istream& is, StaticHashTable<T, Key, Hash>& L)
         label s = firstToken.labelToken();
 
         // Read beginning of contents
-        char listDelimiter = is.readBeginList("StaticHashTable<T, Key, Hash>");
+        char delimiter = is.readBeginList("StaticHashTable<T, Key, Hash>");
 
         if (s)
         {
@@ -126,7 +126,7 @@ Foam::Istream& Foam::operator>>(Istream& is, StaticHashTable<T, Key, Hash>& L)
                 L.resize(2*s);
             }
 
-            if (listDelimiter == token::BEGIN_LIST)
+            if (delimiter == token::BEGIN_LIST)
             {
                 for (label i=0; i<s; i++)
                 {
diff --git a/src/OpenFOAM/containers/LinkedLists/accessTypes/ILList/ILListIO.C b/src/OpenFOAM/containers/LinkedLists/accessTypes/ILList/ILListIO.C
index 18ad4c0f20a..e9c489169c9 100644
--- a/src/OpenFOAM/containers/LinkedLists/accessTypes/ILList/ILListIO.C
+++ b/src/OpenFOAM/containers/LinkedLists/accessTypes/ILList/ILListIO.C
@@ -50,11 +50,11 @@ void Foam::ILList<LListBase, T>::read(Istream& is, const INew& iNew)
         label s = firstToken.labelToken();
 
         // Read beginning of contents
-        char listDelimiter = is.readBeginList("ILList<LListBase, T>");
+        char delimiter = is.readBeginList("ILList<LListBase, T>");
 
         if (s)
         {
-            if (listDelimiter == token::BEGIN_LIST)
+            if (delimiter == token::BEGIN_LIST)
             {
                 for (label i=0; i<s; i++)
                 {
diff --git a/src/OpenFOAM/containers/LinkedLists/accessTypes/LList/LListIO.C b/src/OpenFOAM/containers/LinkedLists/accessTypes/LList/LListIO.C
index 1fed57da16e..eba21661ea0 100644
--- a/src/OpenFOAM/containers/LinkedLists/accessTypes/LList/LListIO.C
+++ b/src/OpenFOAM/containers/LinkedLists/accessTypes/LList/LListIO.C
@@ -61,11 +61,11 @@ Foam::Istream& Foam::operator>>(Istream& is, LList<LListBase, T>& L)
         label s = firstToken.labelToken();
 
         // Read beginning of contents
-        char listDelimiter = is.readBeginList("LList<LListBase, T>");
+        char delimiter = is.readBeginList("LList<LListBase, T>");
 
         if (s)
         {
-            if (listDelimiter == token::BEGIN_LIST)
+            if (delimiter == token::BEGIN_LIST)
             {
                 for (register label i=0; i<s; i++)
                 {
diff --git a/src/OpenFOAM/containers/LinkedLists/accessTypes/LPtrList/LPtrListIO.C b/src/OpenFOAM/containers/LinkedLists/accessTypes/LPtrList/LPtrListIO.C
index 588da22cc94..735dd8d31b7 100644
--- a/src/OpenFOAM/containers/LinkedLists/accessTypes/LPtrList/LPtrListIO.C
+++ b/src/OpenFOAM/containers/LinkedLists/accessTypes/LPtrList/LPtrListIO.C
@@ -53,11 +53,11 @@ void Foam::LPtrList<LListBase, T>::read(Istream& is, const INew& iNew)
         label s = firstToken.labelToken();
 
         // Read beginning of contents
-        char listDelimiter = is.readBeginList("LPtrList<LListBase, T>");
+        char delimiter = is.readBeginList("LPtrList<LListBase, T>");
 
         if (s)
         {
-            if (listDelimiter == token::BEGIN_LIST)
+            if (delimiter == token::BEGIN_LIST)
             {
                 for (label i=0; i<s; i++)
                 {
diff --git a/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H b/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H
index 6ad83c809a4..460d325006d 100644
--- a/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H
+++ b/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H
@@ -111,8 +111,11 @@ public:
         //  Also constructs from DynamicList with different sizing parameters.
         explicit inline DynamicList(const UList<T>&);
 
+        //- Construct from UIndirectList. Size set to UIndirectList size.
+        explicit inline DynamicList(const UIndirectList<T>&);
+
         //- Construct by transferring the parameter contents
-        explicit inline DynamicList(const Xfer<List<T> >&);
+        explicit inline DynamicList(const Xfer< List<T> >&);
 
         //- Construct from Istream. Size set to size of read list.
         explicit DynamicList(Istream&);
@@ -173,16 +176,19 @@ public:
         inline void transfer(DynamicList<T, SizeInc, SizeMult, SizeDiv>&);
 
         //- Transfer contents to the Xfer container as a plain List
-        inline Xfer<List<T> > xfer();
+        inline Xfer< List<T> > xfer();
 
     // Member Operators
 
         //- Append an element at the end of the list
-        inline void append(const T& e);
+        inline void append(const T&);
 
         //- Append a List at the end of this list
         inline void append(const UList<T>&);
 
+        //- Append a UIndirectList at the end of this list
+        inline void append(const UIndirectList<T>&);
+
         //- Remove and return the top element
         inline T remove();
 
@@ -198,7 +204,7 @@ public:
             const DynamicList<T, SizeInc, SizeMult, SizeDiv>&
         );
 
-        //- Assignment from List<T>.
+        //- Assignment from UList
         inline void operator=(const UList<T>&);
 
     // IOstream operators
diff --git a/src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H b/src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H
index 5ee9a3ce870..4e0ffbd1fde 100644
--- a/src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H
+++ b/src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H
@@ -72,6 +72,17 @@ 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
+(
+    const UIndirectList<T>& lst
+)
+:
+    List<T>(lst),
+    capacity_(lst.size())
+{}
+
+
 template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
 inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList
 (
@@ -287,10 +298,10 @@ Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::transfer
 
 
 template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
-inline Foam::Xfer<Foam::List<T> >
+inline Foam::Xfer< Foam::List<T> >
 Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::xfer()
 {
-    return xferMoveTo<List<T> >(*this);
+    return xferMoveTo< List<T> >(*this);
 }
 
 
@@ -313,8 +324,6 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::append
     const UList<T>& lst
 )
 {
-    label nextFree = List<T>::size();
-
     if (this == &lst)
     {
         FatalErrorIn
@@ -324,6 +333,23 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::append
         )   << "attempted appending to self" << abort(FatalError);
     }
 
+    label nextFree = List<T>::size();
+    setSize(nextFree + lst.size());
+
+    forAll(lst, elemI)
+    {
+        this->operator[](nextFree++) = lst[elemI];
+    }
+}
+
+
+template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
+inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::append
+(
+    const UIndirectList<T>& lst
+)
+{
+    label nextFree = List<T>::size();
     setSize(nextFree + lst.size());
 
     forAll(lst, elemI)
diff --git a/src/OpenFOAM/containers/Lists/FixedList/FixedListIO.C b/src/OpenFOAM/containers/Lists/FixedList/FixedListIO.C
index aab7376e059..77e8ebab6a6 100644
--- a/src/OpenFOAM/containers/Lists/FixedList/FixedListIO.C
+++ b/src/OpenFOAM/containers/Lists/FixedList/FixedListIO.C
@@ -82,9 +82,9 @@ Foam::Istream& Foam::operator>>(Foam::Istream& is, FixedList<T, Size>& L)
         }
 
         // Read beginning of contents
-        char listDelimiter = is.readBeginList("FixedList");
+        char delimiter = is.readBeginList("FixedList");
 
-        if (listDelimiter == token::BEGIN_LIST)
+        if (delimiter == token::BEGIN_LIST)
         {
             for (register unsigned i=0; i<Size; i++)
             {
diff --git a/src/OpenFOAM/containers/Lists/List/List.C b/src/OpenFOAM/containers/Lists/List/List.C
index 429c91f8206..3fa3dcc8748 100644
--- a/src/OpenFOAM/containers/Lists/List/List.C
+++ b/src/OpenFOAM/containers/Lists/List/List.C
@@ -404,61 +404,6 @@ void Foam::List<T>::clear()
 }
 
 
-template<class T>
-void Foam::List<T>::append(const UList<T>& lst)
-{
-    if (this == &lst)
-    {
-        FatalErrorIn
-        (
-            "List<T>::append(const UList<T>&)"
-        )   << "attempted appending to self" << abort(FatalError);
-    }
-
-    label nextFree = this->size_;
-    setSize(nextFree + lst.size());
-
-    forAll(lst, elemI)
-    {
-        this->operator[](nextFree++) = lst[elemI];
-    }
-}
-
-
-template<class T>
-void Foam::List<T>::append(const UIndirectList<T>& lst)
-{
-    label nextFree = this->size_;
-    setSize(nextFree + lst.size());
-
-    forAll(lst, elemI)
-    {
-        this->operator[](nextFree++) = lst[elemI];
-    }
-}
-
-
-template<class T>
-void Foam::List<T>::append(const SLList<T>& lst)
-{
-    if (lst.size())
-    {
-        label nextFree = this->size_;
-        setSize(nextFree + lst.size());
-
-        for
-        (
-            typename SLList<T>::const_iterator iter = lst.begin();
-            iter != lst.end();
-            ++iter
-        )
-        {
-            this->operator[](nextFree++) = iter();
-        }
-    }
-}
-
-
 // Transfer the contents of the argument List into this List
 // and anull the argument list
 template<class T>
diff --git a/src/OpenFOAM/containers/Lists/List/List.H b/src/OpenFOAM/containers/Lists/List/List.H
index 5961ff17479..639db9bbd20 100644
--- a/src/OpenFOAM/containers/Lists/List/List.H
+++ b/src/OpenFOAM/containers/Lists/List/List.H
@@ -182,24 +182,21 @@ public:
             void clear();
 
             //- Append a List at the end of this list
-            void append(const UList<T>&);
+            inline void append(const UList<T>&);
 
             //- Append a UIndirectList at the end of this list
-            void append(const UIndirectList<T>&);
+            inline void append(const UIndirectList<T>&);
 
-            //- Append a SLList at the end of this list
-            void append(const SLList<T>&);
-
-            //- Transfer the contents of the argument List into this List
+            //- Transfer the contents of the argument List into this list
             //  and annull the argument list.
             void transfer(List<T>&);
 
-            //- Transfer the contents of the argument List into this List
+            //- Transfer the contents of the argument List into this list
             //  and annull the argument list.
             template<unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
             void transfer(DynamicList<T, SizeInc, SizeMult, SizeDiv>&);
 
-            //- Transfer the contents of the argument List into this List
+            //- Transfer the contents of the argument List into this list
             //  and annull the argument list.
             void transfer(SortableList<T>&);
 
diff --git a/src/OpenFOAM/containers/Lists/List/ListI.H b/src/OpenFOAM/containers/Lists/List/ListI.H
index c3c6ebe4fb6..58e5576f303 100644
--- a/src/OpenFOAM/containers/Lists/List/ListI.H
+++ b/src/OpenFOAM/containers/Lists/List/ListI.H
@@ -88,12 +88,46 @@ inline Foam::label Foam::List<T>::size() const
 
 
 template<class T>
-inline Foam::Xfer<Foam::List<T> > Foam::List<T>::xfer()
+inline Foam::Xfer< Foam::List<T> > Foam::List<T>::xfer()
 {
     return xferMove(*this);
 }
 
 
+template<class T>
+inline void Foam::List<T>::append(const UList<T>& lst)
+{
+    if (this == &lst)
+    {
+        FatalErrorIn
+        (
+            "List<T>::append(const UList<T>&)"
+        )   << "attempted appending to self" << abort(FatalError);
+    }
+
+    label nextFree = this->size();
+    setSize(nextFree + lst.size());
+
+    forAll(lst, elemI)
+    {
+        this->operator[](nextFree++) = lst[elemI];
+    }
+}
+
+
+template<class T>
+inline void Foam::List<T>::append(const UIndirectList<T>& lst)
+{
+    label nextFree = this->size();
+    setSize(nextFree + lst.size());
+
+    forAll(lst, elemI)
+    {
+        this->operator[](nextFree++) = lst[elemI];
+    }
+}
+
+
 // * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
 
 template<class T>
diff --git a/src/OpenFOAM/containers/Lists/List/ListIO.C b/src/OpenFOAM/containers/Lists/List/ListIO.C
index 7cfdfb0397f..d6238ae0910 100644
--- a/src/OpenFOAM/containers/Lists/List/ListIO.C
+++ b/src/OpenFOAM/containers/Lists/List/ListIO.C
@@ -76,11 +76,11 @@ Foam::Istream& Foam::operator>>(Istream& is, List<T>& L)
         if (is.format() == IOstream::ASCII || !contiguous<T>())
         {
             // Read beginning of contents
-            char listDelimiter = is.readBeginList("List");
+            char delimiter = is.readBeginList("List");
 
             if (s)
             {
-                if (listDelimiter == token::BEGIN_LIST)
+                if (delimiter == token::BEGIN_LIST)
                 {
                     for (register label i=0; i<s; i++)
                     {
diff --git a/src/OpenFOAM/containers/Lists/PtrList/PtrListIO.C b/src/OpenFOAM/containers/Lists/PtrList/PtrListIO.C
index e427f68d8d4..564b22c2bcc 100644
--- a/src/OpenFOAM/containers/Lists/PtrList/PtrListIO.C
+++ b/src/OpenFOAM/containers/Lists/PtrList/PtrListIO.C
@@ -54,11 +54,11 @@ void Foam::PtrList<T>::read(Istream& is, const INew& inewt)
         setSize(s);
 
         // Read beginning of contents
-        char listDelimiter = is.readBeginList("PtrList");
+        char delimiter = is.readBeginList("PtrList");
 
         if (s)
         {
-            if (listDelimiter == token::BEGIN_LIST)
+            if (delimiter == token::BEGIN_LIST)
             {
                 forAll(*this, i)
                 {
diff --git a/src/OpenFOAM/primitives/SphericalTensor/SphericalTensorI.H b/src/OpenFOAM/primitives/SphericalTensor/SphericalTensorI.H
index 5768717db4a..28b7b8b9d30 100644
--- a/src/OpenFOAM/primitives/SphericalTensor/SphericalTensorI.H
+++ b/src/OpenFOAM/primitives/SphericalTensor/SphericalTensorI.H
@@ -177,7 +177,7 @@ inline Cmpt det(const SphericalTensor<Cmpt>& st)
 }
 
 
-//- Return the inverse of a symmetric tensor
+//- Return the inverse of a spherical tensor
 template <class Cmpt>
 inline SphericalTensor<Cmpt> inv(const SphericalTensor<Cmpt>& st)
 {
diff --git a/src/OpenFOAM/primitives/SymmTensor/SymmTensorI.H b/src/OpenFOAM/primitives/SymmTensor/SymmTensorI.H
index f59dd16754f..5a2de5dbbda 100644
--- a/src/OpenFOAM/primitives/SymmTensor/SymmTensorI.H
+++ b/src/OpenFOAM/primitives/SymmTensor/SymmTensorI.H
@@ -256,7 +256,7 @@ inline Cmpt magSqr(const SymmTensor<Cmpt>& st)
 }
 
 
-//- Return the strace of a symmetric tensor
+//- Return the trace of a symmetric tensor
 template <class Cmpt>
 inline Cmpt tr(const SymmTensor<Cmpt>& st)
 {
@@ -280,7 +280,7 @@ inline const SymmTensor<Cmpt>& symm(const SymmTensor<Cmpt>& st)
 }
 
 
-//- Return the stwice the symmetric part of a symmetric tensor
+//- Return twice the symmetric part of a symmetric tensor
 template <class Cmpt>
 inline SymmTensor<Cmpt> twoSymm(const SymmTensor<Cmpt>& st)
 {
@@ -361,7 +361,7 @@ inline SymmTensor<Cmpt> inv(const SymmTensor<Cmpt>& st)
 }
 
 
-//- Return the 1spt invariant of a symmetric tensor
+//- Return the 1st invariant of a symmetric tensor
 template <class Cmpt>
 inline Cmpt invariantI(const SymmTensor<Cmpt>& st)
 {
@@ -453,14 +453,9 @@ operator&(const SphericalTensor<Cmpt>& spt1, const SymmTensor<Cmpt>& st2)
 {
     return SymmTensor<Cmpt>
     (
-        spt1.ii()*st2.xx(),
-        spt1.ii()*st2.xy(),
-        spt1.ii()*st2.xz(),
-
-                          spt1.ii()*st2.yy(),
-                          spt1.ii()*st2.yz(),
-
-                                            spt1.ii()*st2.zz()
+        spt1.ii()*st2.xx(), spt1.ii()*st2.xy(), spt1.ii()*st2.xz(),
+                            spt1.ii()*st2.yy(), spt1.ii()*st2.yz(),
+                                                spt1.ii()*st2.zz()
     );
 }
 
@@ -472,14 +467,9 @@ operator&(const SymmTensor<Cmpt>& st1, const SphericalTensor<Cmpt>& spt2)
 {
     return SymmTensor<Cmpt>
     (
-        st1.xx()*spt2.ii(),
-                          st1.xy()*spt2.ii(),
-                                            st1.xz()*spt2.ii(),
-
-                          st1.yy()*spt2.ii(),
-                                            st1.yz()*spt2.ii(),
-
-                                            st1.zz()*spt2.ii()
+        st1.xx()*spt2.ii(), st1.xy()*spt2.ii(), st1.xz()*spt2.ii(),
+                            st1.yy()*spt2.ii(), st1.yz()*spt2.ii(),
+                                                st1.zz()*spt2.ii()
     );
 }
 
diff --git a/src/OpenFOAM/primitives/SymmTensor/symmTensor/symmTensor.C b/src/OpenFOAM/primitives/SymmTensor/symmTensor/symmTensor.C
index f5a56a3d86e..730d728f716 100644
--- a/src/OpenFOAM/primitives/SymmTensor/symmTensor/symmTensor.C
+++ b/src/OpenFOAM/primitives/SymmTensor/symmTensor/symmTensor.C
@@ -25,7 +25,6 @@ License
 \*---------------------------------------------------------------------------*/
 
 #include "symmTensor.H"
-#include "mathematicalConstants.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -65,16 +64,16 @@ template<>
 const symmTensor symmTensor::max
 (
     VGREAT, VGREAT, VGREAT,
-       VGREAT, VGREAT,
-          VGREAT
+            VGREAT, VGREAT,
+                    VGREAT
 );
 
 template<>
 const symmTensor symmTensor::min
 (
     -VGREAT, -VGREAT, -VGREAT,
-       -VGREAT, -VGREAT,
-          -VGREAT
+             -VGREAT, -VGREAT,
+                      -VGREAT
 );
 
 
diff --git a/src/OpenFOAM/primitives/Tensor/TensorI.H b/src/OpenFOAM/primitives/Tensor/TensorI.H
index 453f79185ca..7ca9958aa18 100644
--- a/src/OpenFOAM/primitives/Tensor/TensorI.H
+++ b/src/OpenFOAM/primitives/Tensor/TensorI.H
@@ -402,7 +402,7 @@ inline SymmTensor<Cmpt> symm(const Tensor<Cmpt>& t)
 }
 
 
-//- Return the twice the symmetric part of a tensor
+//- Return twice the symmetric part of a tensor
 template <class Cmpt>
 inline SymmTensor<Cmpt> twoSymm(const Tensor<Cmpt>& t)
 {
@@ -609,17 +609,9 @@ operator&(const SphericalTensor<Cmpt>& st1, const Tensor<Cmpt>& t2)
 {
     return Tensor<Cmpt>
     (
-        st1.ii()*t2.xx(),
-        st1.ii()*t2.xy(),
-        st1.ii()*t2.xz(),
-
-                          st1.ii()*t2.yx(),
-                          st1.ii()*t2.yy(),
-                          st1.ii()*t2.yz(),
-
-                                            st1.ii()*t2.zx(),
-                                            st1.ii()*t2.zy(),
-                                            st1.ii()*t2.zz()
+        st1.ii()*t2.xx(), st1.ii()*t2.xy(), st1.ii()*t2.xz(),
+        st1.ii()*t2.yx(), st1.ii()*t2.yy(), st1.ii()*t2.yz(),
+        st1.ii()*t2.zx(), st1.ii()*t2.zy(), st1.ii()*t2.zz()
     );
 }
 
@@ -631,17 +623,9 @@ operator&(const Tensor<Cmpt>& t1, const SphericalTensor<Cmpt>& st2)
 {
     return Tensor<Cmpt>
     (
-        t1.xx()*st2.ii(),
-                          t1.xy()*st2.ii(),
-                                            t1.xz()*st2.ii(),
-
-        t1.yx()*st2.ii(),
-                          t1.yy()*st2.ii(),
-                                            t1.yz()*st2.ii(),
-
-        t1.zx()*st2.ii(),
-                          t1.zy()*st2.ii(),
-                                            t1.zz()*st2.ii()
+        t1.xx()*st2.ii(), t1.xy()*st2.ii(), t1.xz()*st2.ii(),
+        t1.yx()*st2.ii(), t1.yy()*st2.ii(), t1.yz()*st2.ii(),
+        t1.zx()*st2.ii(), t1.zy()*st2.ii(), t1.zz()*st2.ii()
     );
 }
 
diff --git a/src/OpenFOAM/primitives/Tensor/tensor/tensor.H b/src/OpenFOAM/primitives/Tensor/tensor/tensor.H
index 297b8b47b9f..36ed4df0294 100644
--- a/src/OpenFOAM/primitives/Tensor/tensor/tensor.H
+++ b/src/OpenFOAM/primitives/Tensor/tensor/tensor.H
@@ -51,13 +51,13 @@ namespace Foam
 
 typedef Tensor<scalar> tensor;
 
-vector eigenValues(const tensor& t);
-vector eigenVector(const tensor& t, const scalar lambda);
-tensor eigenVectors(const tensor& t);
+vector eigenValues(const tensor&);
+vector eigenVector(const tensor&, const scalar lambda);
+tensor eigenVectors(const tensor&);
 
-vector eigenValues(const symmTensor& t);
-vector eigenVector(const symmTensor& t, const scalar lambda);
-tensor eigenVectors(const symmTensor& t);
+vector eigenValues(const symmTensor&);
+vector eigenVector(const symmTensor&, const scalar lambda);
+tensor eigenVectors(const symmTensor&);
 
 //- Data associated with tensor type are contiguous
 template<>
-- 
GitLab