From 525a0b3e0f9996af399a740ddec0002a129d1df1 Mon Sep 17 00:00:00 2001
From: Henry <Henry>
Date: Thu, 12 Feb 2015 21:59:17 +0000
Subject: [PATCH] decomposePar: Do not register Lagrangian IOFields as the
 names may conflict with those of volFields Required change to IOobjectList to
 support the optional no-registration specification

---
 .../parallelProcessing/decomposePar/decomposePar.C | 13 ++++++++++---
 .../dimFieldDecomposerDecomposeFields.C            |  5 +++--
 .../decomposePar/domainDecomposition.C             |  3 +--
 .../lagrangianFieldDecomposerDecomposeFields.C     |  8 +++++---
 .../pointFieldDecomposerDecomposeFields.C          |  7 +++----
 src/OpenFOAM/db/IOobjectList/IOobjectList.C        | 14 +++++++++-----
 src/OpenFOAM/db/IOobjectList/IOobjectList.H        |  7 +++++--
 7 files changed, 36 insertions(+), 21 deletions(-)

diff --git a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C
index 05d136a058a..04a222a5a8e 100644
--- a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C
+++ b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C
@@ -123,7 +123,8 @@ const labelIOList& procAddressing
                     procMesh.meshSubDir,
                     procMesh,
                     IOobject::MUST_READ,
-                    IOobject::NO_WRITE
+                    IOobject::NO_WRITE,
+                    false
                 )
             )
         );
@@ -582,7 +583,10 @@ int main(int argc, char *argv[])
                 (
                     mesh,
                     runTime.timeName(),
-                    cloud::prefix/cloudDirs[i]
+                    cloud::prefix/cloudDirs[i],
+                    IOobject::MUST_READ,
+                    IOobject::NO_WRITE,
+                    false
                 );
 
                 IOobject* positionsPtr = sprayObjs.lookup(word("positions"));
@@ -664,7 +668,10 @@ int main(int argc, char *argv[])
                     (
                         mesh,
                         runTime.timeName(),
-                        cloud::prefix/cloudDirs[cloudI]
+                        cloud::prefix/cloudDirs[cloudI],
+                        IOobject::MUST_READ,
+                        IOobject::NO_WRITE,
+                        false
                     );
 
                     lagrangianFieldDecomposer::readFields
diff --git a/applications/utilities/parallelProcessing/decomposePar/dimFieldDecomposerDecomposeFields.C b/applications/utilities/parallelProcessing/decomposePar/dimFieldDecomposerDecomposeFields.C
index bbe06248895..701f91780d7 100644
--- a/applications/utilities/parallelProcessing/decomposePar/dimFieldDecomposerDecomposeFields.C
+++ b/applications/utilities/parallelProcessing/decomposePar/dimFieldDecomposerDecomposeFields.C
@@ -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) 2011-2015 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -48,7 +48,8 @@ Foam::dimFieldDecomposer::decomposeField
                 procMesh_.time().timeName(),
                 procMesh_,
                 IOobject::NO_READ,
-                IOobject::NO_WRITE
+                IOobject::NO_WRITE,
+                false
             ),
             procMesh_,
             field.dimensions(),
diff --git a/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C b/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C
index 923d9ae1cf4..7d863693983 100644
--- a/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C
+++ b/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2013 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -69,7 +69,6 @@ void Foam::domainDecomposition::mark
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
-// from components
 Foam::domainDecomposition::domainDecomposition(const IOobject& io)
 :
     fvMesh(io),
diff --git a/applications/utilities/parallelProcessing/decomposePar/lagrangianFieldDecomposerDecomposeFields.C b/applications/utilities/parallelProcessing/decomposePar/lagrangianFieldDecomposerDecomposeFields.C
index f40de9a50ff..0b1cbcec134 100644
--- a/applications/utilities/parallelProcessing/decomposePar/lagrangianFieldDecomposerDecomposeFields.C
+++ b/applications/utilities/parallelProcessing/decomposePar/lagrangianFieldDecomposerDecomposeFields.C
@@ -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) 2011-2015 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -140,7 +140,8 @@ Foam::lagrangianFieldDecomposer::decomposeField
                 cloud::prefix/cloudName,
                 procMesh_,
                 IOobject::NO_READ,
-                IOobject::NO_WRITE
+                IOobject::NO_WRITE,
+                false
             ),
             procField
         )
@@ -171,7 +172,8 @@ Foam::lagrangianFieldDecomposer::decomposeFieldField
                 cloud::prefix/cloudName,
                 procMesh_,
                 IOobject::NO_READ,
-                IOobject::NO_WRITE
+                IOobject::NO_WRITE,
+                false
             ),
             procField
         )
diff --git a/applications/utilities/parallelProcessing/decomposePar/pointFieldDecomposerDecomposeFields.C b/applications/utilities/parallelProcessing/decomposePar/pointFieldDecomposerDecomposeFields.C
index 12760da2ae9..6992180b11d 100644
--- a/applications/utilities/parallelProcessing/decomposePar/pointFieldDecomposerDecomposeFields.C
+++ b/applications/utilities/parallelProcessing/decomposePar/pointFieldDecomposerDecomposeFields.C
@@ -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) 2011-2015 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -83,7 +83,8 @@ Foam::pointFieldDecomposer::decomposeField
                 procMesh_().time().timeName(),
                 procMesh_(),
                 IOobject::NO_READ,
-                IOobject::NO_WRITE
+                IOobject::NO_WRITE,
+                false
             ),
             procMesh_,
             field.dimensions(),
@@ -107,6 +108,4 @@ void Foam::pointFieldDecomposer::decomposeFields
 }
 
 
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
 // ************************************************************************* //
diff --git a/src/OpenFOAM/db/IOobjectList/IOobjectList.C b/src/OpenFOAM/db/IOobjectList/IOobjectList.C
index 4c15c59ebd6..b1f2643c9ec 100644
--- a/src/OpenFOAM/db/IOobjectList/IOobjectList.C
+++ b/src/OpenFOAM/db/IOobjectList/IOobjectList.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2013 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -40,7 +40,10 @@ Foam::IOobjectList::IOobjectList
 (
     const objectRegistry& db,
     const fileName& instance,
-    const fileName& local
+    const fileName& local,
+    IOobject::readOption r,
+    IOobject::writeOption w,
+    bool registerObject
 )
 :
     HashPtrTable<IOobject>()
@@ -69,8 +72,9 @@ Foam::IOobjectList::IOobjectList
             newInstance,
             local,
             db,
-            IOobject::MUST_READ,
-            IOobject::NO_WRITE
+            r,
+            w,
+            registerObject
         );
 
         if (objectPtr->headerOk())
@@ -91,7 +95,7 @@ Foam::IOobjectList::IOobjectList(const IOobjectList& ioOL)
 {}
 
 
-// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
+// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
 
 Foam::IOobjectList::~IOobjectList()
 {}
diff --git a/src/OpenFOAM/db/IOobjectList/IOobjectList.H b/src/OpenFOAM/db/IOobjectList/IOobjectList.H
index 76edfe4f677..e5a3c20cb3c 100644
--- a/src/OpenFOAM/db/IOobjectList/IOobjectList.H
+++ b/src/OpenFOAM/db/IOobjectList/IOobjectList.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2013 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -70,7 +70,10 @@ public:
         (
             const objectRegistry& db,
             const fileName& instance,
-            const fileName& local = ""
+            const fileName& local = "",
+            IOobject::readOption r = IOobject::MUST_READ,
+            IOobject::writeOption w = IOobject::NO_WRITE,
+            bool registerObject = true
         );
 
         //- Construct as copy
-- 
GitLab