From 6c99006fe7a987e90ce257e0ffa3dfb75a31a981 Mon Sep 17 00:00:00 2001
From: mattijs <mattijs>
Date: Mon, 27 Aug 2018 12:44:37 +0100
Subject: [PATCH] ENH: polyMesh: allow *zones only at faces instance. Fixes
 #982.

---
 src/OpenFOAM/meshes/polyMesh/polyMesh.C | 49 +++++++++++++++----------
 1 file changed, 29 insertions(+), 20 deletions(-)

diff --git a/src/OpenFOAM/meshes/polyMesh/polyMesh.C b/src/OpenFOAM/meshes/polyMesh/polyMesh.C
index 374b2a9355b..6db8ff11fa0 100644
--- a/src/OpenFOAM/meshes/polyMesh/polyMesh.C
+++ b/src/OpenFOAM/meshes/polyMesh/polyMesh.C
@@ -3,7 +3,7 @@
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
     \\  /    A nd           | Copyright (C) 2011-2017 OpenFOAM Foundation
-     \\/     M anipulation  | Copyright (C) 2016 OpenCFD Ltd.
+     \\/     M anipulation  | Copyright (C) 2016-2018 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -216,7 +216,13 @@ Foam::polyMesh::polyMesh(const IOobject& io)
         IOobject
         (
             "boundary",
-            time().findInstance(meshDir(), "boundary"),
+            time().findInstance // allow 'newer' boundary file
+            (
+                meshDir(),
+                "boundary",
+                IOobject::MUST_READ,
+                faces_.instance()
+            ),
             meshSubDir,
             *this,
             IOobject::MUST_READ,
@@ -235,12 +241,13 @@ Foam::polyMesh::polyMesh(const IOobject& io)
         IOobject
         (
             "pointZones",
-            time().findInstance
-            (
-                meshDir(),
-                "pointZones",
-                IOobject::READ_IF_PRESENT
-            ),
+            //time().findInstance
+            //(
+            //    meshDir(),
+            //    "pointZones",
+            //    IOobject::READ_IF_PRESENT
+            //),
+            faces_.instance(),
             meshSubDir,
             *this,
             IOobject::READ_IF_PRESENT,
@@ -253,12 +260,13 @@ Foam::polyMesh::polyMesh(const IOobject& io)
         IOobject
         (
             "faceZones",
-            time().findInstance
-            (
-                meshDir(),
-                "faceZones",
-                IOobject::READ_IF_PRESENT
-            ),
+            //time().findInstance
+            //(
+            //    meshDir(),
+            //    "faceZones",
+            //    IOobject::READ_IF_PRESENT
+            //),
+            faces_.instance(),
             meshSubDir,
             *this,
             IOobject::READ_IF_PRESENT,
@@ -271,12 +279,13 @@ Foam::polyMesh::polyMesh(const IOobject& io)
         IOobject
         (
             "cellZones",
-            time().findInstance
-            (
-                meshDir(),
-                "cellZones",
-                IOobject::READ_IF_PRESENT
-            ),
+            //time().findInstance
+            //(
+            //    meshDir(),
+            //    "cellZones",
+            //    IOobject::READ_IF_PRESENT
+            //),
+            faces_.instance(),
             meshSubDir,
             *this,
             IOobject::READ_IF_PRESENT,
-- 
GitLab