From 6300cd4eeeae3c43b4980ffd5cba5dab0b3156d6 Mon Sep 17 00:00:00 2001
From: Mark Olesen <Mark.Olesen@esi-group.com>
Date: Tue, 9 Apr 2019 09:05:38 +0200
Subject: [PATCH] ENH: add PDRblock::null() member - reference to NullObject

---
 src/mesh/blockMesh/PDRblockMesh/PDRblock.C |  6 ++++++
 src/mesh/blockMesh/PDRblockMesh/PDRblock.H | 16 ++++++++++++++--
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/src/mesh/blockMesh/PDRblockMesh/PDRblock.C b/src/mesh/blockMesh/PDRblockMesh/PDRblock.C
index b591fa42e94..a667d89bcf3 100644
--- a/src/mesh/blockMesh/PDRblockMesh/PDRblock.C
+++ b/src/mesh/blockMesh/PDRblockMesh/PDRblock.C
@@ -72,6 +72,12 @@ bool Foam::PDRblock::checkMonotonic
 }
 
 
+const Foam::PDRblock& Foam::PDRblock::null()
+{
+    return NullObjectRef<PDRblock>();
+}
+
+
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
 
 void Foam::PDRblock::adjustSizes()
diff --git a/src/mesh/blockMesh/PDRblockMesh/PDRblock.H b/src/mesh/blockMesh/PDRblockMesh/PDRblock.H
index 5f85f21ca9d..456909c5d28 100644
--- a/src/mesh/blockMesh/PDRblockMesh/PDRblock.H
+++ b/src/mesh/blockMesh/PDRblockMesh/PDRblock.H
@@ -94,10 +94,12 @@ public:
         //- Grid locations in an axis direction.
         //  The number of points is one larger than the number of elements
         //  it represents
-        struct location
+        class location
         :
             public scalarList
         {
+        public:
+
             //- The locations are valid if they contain 2 or more points
             inline bool valid() const;
 
@@ -187,7 +189,11 @@ private:
     // Private Member Functions
 
         //- Check that points increase monotonically
-        static bool checkMonotonic(const direction cmpt, const UList<scalar>& pts);
+        static bool checkMonotonic
+        (
+            const direction cmpt,
+            const UList<scalar>& pts
+        );
 
         //- Adjust sizing for updated grid points
         void adjustSizes();
@@ -242,6 +248,12 @@ private:
 
 public:
 
+    // Static Member Functions
+
+        //- Return a PDRblock reference to a nullObject
+        static const PDRblock& null();
+
+
     // Constructors
 
         //- Construct zero-size
-- 
GitLab