From 8969110f2a52b2006b656b3f20a1fb3577de4fe0 Mon Sep 17 00:00:00 2001
From: Mark Olesen <Mark.Olesen@esi-group.com>
Date: Mon, 16 Nov 2020 09:59:28 +0100
Subject: [PATCH] ENH: distinguish between face zone topoSetSource (#1060)

- add intermediate class topoSetFaceZoneSource
  and corresponding New() factories
---
 src/meshTools/Make/files                      |   3 +
 .../topoSetCellSource/topoSetCellSource.C     |  13 +-
 .../topoSetCellSource/topoSetCellSource.H     |   3 -
 .../setToCellZone/setToCellZone.C             |  12 +-
 .../setToCellZone/setToCellZone.H             |  10 +-
 .../topoSetCellZoneSource.C                   |  99 ++++++++++++
 .../topoSetCellZoneSource.H                   | 147 ++++++++++++++++++
 .../topoSetFaceSource/topoSetFaceSource.C     |  13 +-
 .../topoSetFaceSource/topoSetFaceSource.H     |   3 -
 .../sets/faceSources/zoneToFace/zoneToFace.C  |   1 +
 .../faceZoneToFaceZone/faceZoneToFaceZone.C   |  22 ++-
 .../faceZoneToFaceZone/faceZoneToFaceZone.H   |  16 +-
 .../planeToFaceZone/planeToFaceZone.C         |  53 +++++--
 .../planeToFaceZone/planeToFaceZone.H         |  24 +--
 .../searchableSurfaceToFaceZone.C             |  17 +-
 .../searchableSurfaceToFaceZone.H             |  11 +-
 .../setAndNormalToFaceZone.C                  |  22 ++-
 .../setAndNormalToFaceZone.H                  |  10 +-
 .../setToFaceZone/setToFaceZone.C             |  12 +-
 .../setToFaceZone/setToFaceZone.H             |  10 +-
 .../setsToFaceZone/setsToFaceZone.C           |  10 +-
 .../setsToFaceZone/setsToFaceZone.H           |  10 +-
 .../topoSetFaceZoneSource.C                   |  99 ++++++++++++
 .../topoSetFaceZoneSource.H                   | 147 ++++++++++++++++++
 .../topoSetPointSource/topoSetPointSource.C   |  10 +-
 .../topoSetPointSource/topoSetPointSource.H   |   3 -
 .../pointSources/zoneToPoint/zoneToPoint.C    |   1 +
 .../setToPointZone/setToPointZone.C           |  10 +-
 .../setToPointZone/setToPointZone.H           |  10 +-
 .../topoSetPointZoneSource.C                  |  99 ++++++++++++
 .../topoSetPointZoneSource.H                  | 147 ++++++++++++++++++
 src/meshTools/sets/topoSets/topoSet.C         |  11 +-
 32 files changed, 909 insertions(+), 149 deletions(-)
 create mode 100644 src/meshTools/sets/cellZoneSources/topoSetCellZoneSource/topoSetCellZoneSource.C
 create mode 100644 src/meshTools/sets/cellZoneSources/topoSetCellZoneSource/topoSetCellZoneSource.H
 create mode 100644 src/meshTools/sets/faceZoneSources/topoSetFaceZoneSource/topoSetFaceZoneSource.C
 create mode 100644 src/meshTools/sets/faceZoneSources/topoSetFaceZoneSource/topoSetFaceZoneSource.H
 create mode 100644 src/meshTools/sets/pointZoneSources/topoSetPointZoneSource/topoSetPointZoneSource.C
 create mode 100644 src/meshTools/sets/pointZoneSources/topoSetPointZoneSource/topoSetPointZoneSource.H

diff --git a/src/meshTools/Make/files b/src/meshTools/Make/files
index c383e52fdae..8b95ab2952d 100644
--- a/src/meshTools/Make/files
+++ b/src/meshTools/Make/files
@@ -206,6 +206,7 @@ $(pointSources)/surfaceToPoint/surfaceToPoint.C
 $(pointSources)/zoneToPoint/zoneToPoint.C
 
 faceZoneSources = sets/faceZoneSources
+$(faceZoneSources)/topoSetFaceZoneSource/topoSetFaceZoneSource.C
 $(faceZoneSources)/faceZoneToFaceZone/faceZoneToFaceZone.C
 $(faceZoneSources)/setsToFaceZone/setsToFaceZone.C
 $(faceZoneSources)/setToFaceZone/setToFaceZone.C
@@ -214,9 +215,11 @@ $(faceZoneSources)/searchableSurfaceToFaceZone/searchableSurfaceToFaceZone.C
 $(faceZoneSources)/planeToFaceZone/planeToFaceZone.C
 
 cellZoneSources = sets/cellZoneSources
+$(cellZoneSources)/topoSetCellZoneSource/topoSetCellZoneSource.C
 $(cellZoneSources)/setToCellZone/setToCellZone.C
 
 pointZoneSources = sets/pointZoneSources
+$(pointZoneSources)/topoSetPointZoneSource/topoSetPointZoneSource.C
 $(pointZoneSources)/setToPointZone/setToPointZone.C
 
 momentOfInertia/momentOfInertia.C
diff --git a/src/meshTools/sets/cellSources/topoSetCellSource/topoSetCellSource.C b/src/meshTools/sets/cellSources/topoSetCellSource/topoSetCellSource.C
index c62f23f1a4a..3ffdac89bb5 100644
--- a/src/meshTools/sets/cellSources/topoSetCellSource/topoSetCellSource.C
+++ b/src/meshTools/sets/cellSources/topoSetCellSource/topoSetCellSource.C
@@ -5,7 +5,7 @@
     \\  /    A nd           | www.openfoam.com
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
-    Copyright (C) 2018-2019 OpenCFD Ltd.
+    Copyright (C) 2018-2020 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -32,7 +32,6 @@ License
 
 namespace Foam
 {
-    defineTypeNameAndDebug(topoSetCellSource, 0);
     defineRunTimeSelectionTable(topoSetCellSource, word);
     defineRunTimeSelectionTable(topoSetCellSource, istream);
 }
@@ -48,7 +47,8 @@ Foam::topoSetCellSource::topoSetCellSource(const polyMesh& mesh)
 
 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
 
-Foam::autoPtr<Foam::topoSetCellSource> Foam::topoSetCellSource::New
+Foam::autoPtr<Foam::topoSetCellSource>
+Foam::topoSetCellSource::New
 (
     const word& sourceType,
     const polyMesh& mesh,
@@ -62,7 +62,7 @@ Foam::autoPtr<Foam::topoSetCellSource> Foam::topoSetCellSource::New
         FatalIOErrorInLookup
         (
             dict,
-            "topoSetCellSource",
+            "cellSetSource",
             sourceType,
             *wordConstructorTablePtr_
         ) << exit(FatalIOError);
@@ -72,7 +72,8 @@ Foam::autoPtr<Foam::topoSetCellSource> Foam::topoSetCellSource::New
 }
 
 
-Foam::autoPtr<Foam::topoSetCellSource> Foam::topoSetCellSource::New
+Foam::autoPtr<Foam::topoSetCellSource>
+Foam::topoSetCellSource::New
 (
     const word& sourceType,
     const polyMesh& mesh,
@@ -85,7 +86,7 @@ Foam::autoPtr<Foam::topoSetCellSource> Foam::topoSetCellSource::New
     {
         FatalErrorInLookup
         (
-            "topoSetCellSource",
+            "cellSetSource",
             sourceType,
             *istreamConstructorTablePtr_
         ) << exit(FatalError);
diff --git a/src/meshTools/sets/cellSources/topoSetCellSource/topoSetCellSource.H b/src/meshTools/sets/cellSources/topoSetCellSource/topoSetCellSource.H
index ac658a10fc1..087b5a115b5 100644
--- a/src/meshTools/sets/cellSources/topoSetCellSource/topoSetCellSource.H
+++ b/src/meshTools/sets/cellSources/topoSetCellSource/topoSetCellSource.H
@@ -58,9 +58,6 @@ class topoSetCellSource
 {
 public:
 
-    //- Runtime type information
-    TypeName("topoSetCellSource");
-
     // Declare run-time constructor selection table
 
         // For the dictionary constructor
diff --git a/src/meshTools/sets/cellZoneSources/setToCellZone/setToCellZone.C b/src/meshTools/sets/cellZoneSources/setToCellZone/setToCellZone.C
index ba425724d69..e269b316ef5 100644
--- a/src/meshTools/sets/cellZoneSources/setToCellZone/setToCellZone.C
+++ b/src/meshTools/sets/cellZoneSources/setToCellZone/setToCellZone.C
@@ -6,7 +6,7 @@
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
     Copyright (C) 2011-2017 OpenFOAM Foundation
-    Copyright (C) 2018 OpenCFD Ltd.
+    Copyright (C) 2018-2020 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -38,6 +38,9 @@ namespace Foam
     defineTypeNameAndDebug(setToCellZone, 0);
     addToRunTimeSelectionTable(topoSetSource, setToCellZone, word);
     addToRunTimeSelectionTable(topoSetSource, setToCellZone, istream);
+
+    addToRunTimeSelectionTable(topoSetCellZoneSource, setToCellZone, word);
+    addToRunTimeSelectionTable(topoSetCellZoneSource, setToCellZone, istream);
 }
 
 
@@ -57,7 +60,7 @@ Foam::setToCellZone::setToCellZone
     const word& setName
 )
 :
-    topoSetSource(mesh),
+    topoSetCellZoneSource(mesh),
     setName_(setName)
 {}
 
@@ -68,7 +71,7 @@ Foam::setToCellZone::setToCellZone
     const dictionary& dict
 )
 :
-    topoSetSource(mesh),
+    topoSetCellZoneSource(mesh),
     setName_(dict.get<word>("set"))
 {}
 
@@ -79,7 +82,7 @@ Foam::setToCellZone::setToCellZone
     Istream& is
 )
 :
-    topoSetSource(mesh),
+    topoSetCellZoneSource(mesh),
     setName_(checkIs(is))
 {}
 
@@ -96,6 +99,7 @@ void Foam::setToCellZone::applyToSet
     {
         WarningInFunction
             << "Operation only allowed on a cellZoneSet." << endl;
+        return;
     }
     else
     {
diff --git a/src/meshTools/sets/cellZoneSources/setToCellZone/setToCellZone.H b/src/meshTools/sets/cellZoneSources/setToCellZone/setToCellZone.H
index 8ae418164d9..a5769511ccb 100644
--- a/src/meshTools/sets/cellZoneSources/setToCellZone/setToCellZone.H
+++ b/src/meshTools/sets/cellZoneSources/setToCellZone/setToCellZone.H
@@ -82,7 +82,7 @@ SourceFiles
 #ifndef setToCellZone_H
 #define setToCellZone_H
 
-#include "topoSetSource.H"
+#include "topoSetCellZoneSource.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -95,7 +95,7 @@ namespace Foam
 
 class setToCellZone
 :
-    public topoSetSource
+    public topoSetCellZoneSource
 {
     // Private Data
 
@@ -130,12 +130,6 @@ public:
 
     // Member Functions
 
-        //- The source category is a cellZone
-        virtual topoSetSource::sourceType setType() const
-        {
-            return CELLZONE_SOURCE;
-        }
-
         virtual void applyToSet
         (
             const topoSetSource::setAction action,
diff --git a/src/meshTools/sets/cellZoneSources/topoSetCellZoneSource/topoSetCellZoneSource.C b/src/meshTools/sets/cellZoneSources/topoSetCellZoneSource/topoSetCellZoneSource.C
new file mode 100644
index 00000000000..c4123bab6ee
--- /dev/null
+++ b/src/meshTools/sets/cellZoneSources/topoSetCellZoneSource/topoSetCellZoneSource.C
@@ -0,0 +1,99 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | www.openfoam.com
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+    Copyright (C) 2020 OpenCFD Ltd.
+-------------------------------------------------------------------------------
+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/>.
+
+\*---------------------------------------------------------------------------*/
+
+#include "topoSetCellZoneSource.H"
+#include "polyMesh.H"
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+namespace Foam
+{
+    defineRunTimeSelectionTable(topoSetCellZoneSource, word);
+    defineRunTimeSelectionTable(topoSetCellZoneSource, istream);
+}
+
+
+// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
+
+Foam::topoSetCellZoneSource::topoSetCellZoneSource(const polyMesh& mesh)
+:
+    topoSetSource(mesh)
+{}
+
+
+// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
+
+Foam::autoPtr<Foam::topoSetCellZoneSource>
+Foam::topoSetCellZoneSource::New
+(
+    const word& sourceType,
+    const polyMesh& mesh,
+    const dictionary& dict
+)
+{
+    auto cstrIter = wordConstructorTablePtr_->cfind(sourceType);
+
+    if (!cstrIter.found())
+    {
+        FatalIOErrorInLookup
+        (
+            dict,
+            "cellZoneSource",
+            sourceType,
+            *wordConstructorTablePtr_
+        ) << exit(FatalIOError);
+    }
+
+    return autoPtr<topoSetCellZoneSource>(cstrIter()(mesh, dict));
+}
+
+
+Foam::autoPtr<Foam::topoSetCellZoneSource>
+Foam::topoSetCellZoneSource::New
+(
+    const word& sourceType,
+    const polyMesh& mesh,
+    Istream& is
+)
+{
+    auto cstrIter = istreamConstructorTablePtr_->cfind(sourceType);
+
+    if (!cstrIter.found())
+    {
+        FatalErrorInLookup
+        (
+            "cellZoneSource",
+            sourceType,
+            *istreamConstructorTablePtr_
+        ) << exit(FatalError);
+    }
+
+    return autoPtr<topoSetCellZoneSource>(cstrIter()(mesh, is));
+}
+
+
+// ************************************************************************* //
diff --git a/src/meshTools/sets/cellZoneSources/topoSetCellZoneSource/topoSetCellZoneSource.H b/src/meshTools/sets/cellZoneSources/topoSetCellZoneSource/topoSetCellZoneSource.H
new file mode 100644
index 00000000000..73784f1a500
--- /dev/null
+++ b/src/meshTools/sets/cellZoneSources/topoSetCellZoneSource/topoSetCellZoneSource.H
@@ -0,0 +1,147 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | www.openfoam.com
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+    Copyright (C) 2020 OpenCFD Ltd.
+-------------------------------------------------------------------------------
+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/>.
+
+Class
+    Foam::topoSetCellZoneSource
+
+Description
+    The \c topoSetCellZoneSource is a intermediate class
+    for handling \c topoSet sources for selecting cell zones.
+
+    The class is not an executable \c topoSet itself,
+    yet a provider for common entries to its derived \c topoSet.
+
+SourceFiles
+    topoSetCellZoneSource.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef topoSetCellZoneSource_H
+#define topoSetCellZoneSource_H
+
+#include "topoSetSource.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// Forward Declarations
+class cellZoneSet;
+
+/*---------------------------------------------------------------------------*\
+                    Class topoSetCellZoneSource Declaration
+\*---------------------------------------------------------------------------*/
+
+class topoSetCellZoneSource
+:
+    public topoSetSource
+{
+public:
+
+    // Declare run-time constructor selection table
+
+        // For the dictionary constructor
+        declareRunTimeSelectionTable
+        (
+            autoPtr,
+            topoSetCellZoneSource,
+            word,
+            (
+                const polyMesh& mesh,
+                const dictionary& dict
+            ),
+            (mesh, dict)
+        );
+
+        // For the Istream constructor
+        declareRunTimeSelectionTable
+        (
+            autoPtr,
+            topoSetCellZoneSource,
+            istream,
+            (
+                const polyMesh& mesh,
+                Istream& is
+            ),
+            (mesh, is)
+        );
+
+
+    // Constructors
+
+        //- Construct from components
+        explicit topoSetCellZoneSource(const polyMesh& mesh);
+
+        //- Clone (disallowed)
+        autoPtr<topoSetCellZoneSource> clone() const
+        {
+            NotImplemented;
+            return nullptr;
+        }
+
+
+    // Selectors
+
+        //- Return a reference to the selected source type
+        static autoPtr<topoSetCellZoneSource> New
+        (
+            const word& sourceType,
+            const polyMesh& mesh,
+            const dictionary& dict
+        );
+
+        //- Return a reference to the selected source type
+        static autoPtr<topoSetCellZoneSource> New
+        (
+            const word& sourceType,
+            const polyMesh& mesh,
+            Istream& is
+        );
+
+
+    //- Destructor
+    virtual ~topoSetCellZoneSource() = default;
+
+
+    // Member Functions
+
+        //- The source category is a cellZone
+        virtual topoSetSource::sourceType setType() const
+        {
+            return CELLZONE_SOURCE;
+        }
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/meshTools/sets/faceSources/topoSetFaceSource/topoSetFaceSource.C b/src/meshTools/sets/faceSources/topoSetFaceSource/topoSetFaceSource.C
index beb9a2f8b4a..f7c9cc19180 100644
--- a/src/meshTools/sets/faceSources/topoSetFaceSource/topoSetFaceSource.C
+++ b/src/meshTools/sets/faceSources/topoSetFaceSource/topoSetFaceSource.C
@@ -5,7 +5,7 @@
     \\  /    A nd           | www.openfoam.com
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
-    Copyright (C) 2018-2019 OpenCFD Ltd.
+    Copyright (C) 2018-2020 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -32,7 +32,6 @@ License
 
 namespace Foam
 {
-    defineTypeNameAndDebug(topoSetFaceSource, 0);
     defineRunTimeSelectionTable(topoSetFaceSource, word);
     defineRunTimeSelectionTable(topoSetFaceSource, istream);
 }
@@ -48,7 +47,8 @@ Foam::topoSetFaceSource::topoSetFaceSource(const polyMesh& mesh)
 
 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
 
-Foam::autoPtr<Foam::topoSetFaceSource> Foam::topoSetFaceSource::New
+Foam::autoPtr<Foam::topoSetFaceSource>
+Foam::topoSetFaceSource::New
 (
     const word& sourceType,
     const polyMesh& mesh,
@@ -62,7 +62,7 @@ Foam::autoPtr<Foam::topoSetFaceSource> Foam::topoSetFaceSource::New
         FatalIOErrorInLookup
         (
             dict,
-            "topoSetFaceSource",
+            "faceSetSource",
             sourceType,
             *wordConstructorTablePtr_
         ) << exit(FatalIOError);
@@ -72,7 +72,8 @@ Foam::autoPtr<Foam::topoSetFaceSource> Foam::topoSetFaceSource::New
 }
 
 
-Foam::autoPtr<Foam::topoSetFaceSource> Foam::topoSetFaceSource::New
+Foam::autoPtr<Foam::topoSetFaceSource>
+Foam::topoSetFaceSource::New
 (
     const word& sourceType,
     const polyMesh& mesh,
@@ -85,7 +86,7 @@ Foam::autoPtr<Foam::topoSetFaceSource> Foam::topoSetFaceSource::New
     {
         FatalErrorInLookup
         (
-            "topoSetFaceSource",
+            "faceSetSource",
             sourceType,
             *istreamConstructorTablePtr_
         ) << exit(FatalError);
diff --git a/src/meshTools/sets/faceSources/topoSetFaceSource/topoSetFaceSource.H b/src/meshTools/sets/faceSources/topoSetFaceSource/topoSetFaceSource.H
index 10455d5032a..aeed1ffb374 100644
--- a/src/meshTools/sets/faceSources/topoSetFaceSource/topoSetFaceSource.H
+++ b/src/meshTools/sets/faceSources/topoSetFaceSource/topoSetFaceSource.H
@@ -58,9 +58,6 @@ class topoSetFaceSource
 {
 public:
 
-    //- Runtime type information
-    TypeName("topoSetFaceSource");
-
     // Declare run-time constructor selection table
 
         // For the dictionary constructor
diff --git a/src/meshTools/sets/faceSources/zoneToFace/zoneToFace.C b/src/meshTools/sets/faceSources/zoneToFace/zoneToFace.C
index 3a73f2bd093..5475d90018a 100644
--- a/src/meshTools/sets/faceSources/zoneToFace/zoneToFace.C
+++ b/src/meshTools/sets/faceSources/zoneToFace/zoneToFace.C
@@ -37,6 +37,7 @@ namespace Foam
     defineTypeNameAndDebug(zoneToFace, 0);
     addToRunTimeSelectionTable(topoSetSource, zoneToFace, word);
     addToRunTimeSelectionTable(topoSetSource, zoneToFace, istream);
+
     addToRunTimeSelectionTable(topoSetFaceSource, zoneToFace, word);
     addToRunTimeSelectionTable(topoSetFaceSource, zoneToFace, istream);
     addNamedToRunTimeSelectionTable
diff --git a/src/meshTools/sets/faceZoneSources/faceZoneToFaceZone/faceZoneToFaceZone.C b/src/meshTools/sets/faceZoneSources/faceZoneToFaceZone/faceZoneToFaceZone.C
index cc9623d4646..01017b20a90 100644
--- a/src/meshTools/sets/faceZoneSources/faceZoneToFaceZone/faceZoneToFaceZone.C
+++ b/src/meshTools/sets/faceZoneSources/faceZoneToFaceZone/faceZoneToFaceZone.C
@@ -6,7 +6,7 @@
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
     Copyright (C) 2011-2017 OpenFOAM Foundation
-    Copyright (C) 2018 OpenCFD Ltd.
+    Copyright (C) 2018-2020 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -38,6 +38,19 @@ namespace Foam
     defineTypeNameAndDebug(faceZoneToFaceZone, 0);
     addToRunTimeSelectionTable(topoSetSource, faceZoneToFaceZone, word);
     addToRunTimeSelectionTable(topoSetSource, faceZoneToFaceZone, istream);
+
+    addToRunTimeSelectionTable
+    (
+        topoSetFaceZoneSource,
+        faceZoneToFaceZone,
+        word
+    );
+    addToRunTimeSelectionTable
+    (
+        topoSetFaceZoneSource,
+        faceZoneToFaceZone,
+        istream
+    );
 }
 
 
@@ -57,7 +70,7 @@ Foam::faceZoneToFaceZone::faceZoneToFaceZone
     const word& setName
 )
 :
-    topoSetSource(mesh),
+    topoSetFaceZoneSource(mesh),
     setName_(setName)
 {}
 
@@ -68,7 +81,7 @@ Foam::faceZoneToFaceZone::faceZoneToFaceZone
     const dictionary& dict
 )
 :
-    topoSetSource(mesh),
+    topoSetFaceZoneSource(mesh),
     setName_(dict.get<word>("zone"))
 {}
 
@@ -79,7 +92,7 @@ Foam::faceZoneToFaceZone::faceZoneToFaceZone
     Istream& is
 )
 :
-    topoSetSource(mesh),
+    topoSetFaceZoneSource(mesh),
     setName_(checkIs(is))
 {}
 
@@ -96,6 +109,7 @@ void Foam::faceZoneToFaceZone::applyToSet
     {
         WarningInFunction
             << "Operation only allowed on a faceZoneSet." << endl;
+        return;
     }
     else
     {
diff --git a/src/meshTools/sets/faceZoneSources/faceZoneToFaceZone/faceZoneToFaceZone.H b/src/meshTools/sets/faceZoneSources/faceZoneToFaceZone/faceZoneToFaceZone.H
index afbcaf086ae..ad67b644014 100644
--- a/src/meshTools/sets/faceZoneSources/faceZoneToFaceZone/faceZoneToFaceZone.H
+++ b/src/meshTools/sets/faceZoneSources/faceZoneToFaceZone/faceZoneToFaceZone.H
@@ -81,7 +81,7 @@ SourceFiles
 #ifndef faceZoneToFaceZone_H
 #define faceZoneToFaceZone_H
 
-#include "topoSetSource.H"
+#include "topoSetFaceZoneSource.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -94,7 +94,7 @@ namespace Foam
 
 class faceZoneToFaceZone
 :
-    public topoSetSource
+    public topoSetFaceZoneSource
 {
     // Private Data
 
@@ -114,11 +114,7 @@ public:
     // Constructors
 
         //- Construct from components
-        faceZoneToFaceZone
-        (
-            const polyMesh& mesh,
-            const word& setName
-        );
+        faceZoneToFaceZone(const polyMesh& mesh, const word& setName);
 
         //- Construct from dictionary
         faceZoneToFaceZone(const polyMesh& mesh, const dictionary& dict);
@@ -133,12 +129,6 @@ public:
 
     // Member Functions
 
-        //- The source category is a faceZone
-        virtual topoSetSource::sourceType setType() const
-        {
-            return FACEZONE_SOURCE;
-        }
-
         virtual void applyToSet
         (
             const topoSetSource::setAction action,
diff --git a/src/meshTools/sets/faceZoneSources/planeToFaceZone/planeToFaceZone.C b/src/meshTools/sets/faceZoneSources/planeToFaceZone/planeToFaceZone.C
index 2fbd45576d0..e1b8a872747 100644
--- a/src/meshTools/sets/faceZoneSources/planeToFaceZone/planeToFaceZone.C
+++ b/src/meshTools/sets/faceZoneSources/planeToFaceZone/planeToFaceZone.C
@@ -41,6 +41,24 @@ namespace Foam
     defineTypeNameAndDebug(planeToFaceZone, 0);
     addToRunTimeSelectionTable(topoSetSource, planeToFaceZone, word);
     addToRunTimeSelectionTable(topoSetSource, planeToFaceZone, istream);
+
+    addToRunTimeSelectionTable(topoSetFaceZoneSource, planeToFaceZone, word);
+    addToRunTimeSelectionTable(topoSetFaceZoneSource, planeToFaceZone, istream);
+
+    addNamedToRunTimeSelectionTable
+    (
+        topoSetFaceZoneSource,
+        planeToFaceZone,
+        word,
+        plane
+    );
+    addNamedToRunTimeSelectionTable
+    (
+        topoSetFaceZoneSource,
+        planeToFaceZone,
+        istream,
+        plane
+    );
 }
 
 
@@ -352,7 +370,7 @@ Foam::planeToFaceZone::planeToFaceZone
     const dictionary& dict
 )
 :
-    topoSetSource(mesh),
+    topoSetFaceZoneSource(mesh),
     point_(dict.get<vector>("point")),
     normal_(dict.get<vector>("normal")),
     option_
@@ -368,7 +386,7 @@ Foam::planeToFaceZone::planeToFaceZone
     Istream& is
 )
 :
-    topoSetSource(mesh),
+    topoSetFaceZoneSource(mesh),
     point_(checkIs(is)),
     normal_(checkIs(is)),
     option_(faceZoneActionNames_.read(checkIs(is)))
@@ -387,25 +405,30 @@ void Foam::planeToFaceZone::applyToSet
     {
         WarningInFunction
             << "Operation only allowed on a faceZoneSet." << endl;
+        return;
     }
-    else
-    {
-        faceZoneSet& fzSet = refCast<faceZoneSet>(set);
 
-        if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD))
-        {
-            Info<< "    Adding faces which form a plane at " << point_
-                << " with normal " << normal_ << endl;
+    faceZoneSet& zoneSet = refCast<faceZoneSet>(set);
 
-            combine(fzSet, true);
-        }
-        else if (action == topoSetSource::DELETE)
+    if (action == topoSetSource::NEW || action == topoSetSource::ADD)
+    {
+        if (verbose_)
         {
-            Info<< "    Removing faces which form a plane at " << point_
-                << " with normal " << normal_ << endl;
+            Info<< "    Adding faces that form a plane at "
+                << point_ << " with normal " << normal_ << endl;
+        }
 
-            combine(fzSet, false);
+        combine(zoneSet, true);
+    }
+    else if (action == topoSetSource::SUBTRACT)
+    {
+        if (verbose_)
+        {
+            Info<< "    Removing faces that form a plane at "
+                << point_ << " with normal " << normal_ << endl;
         }
+
+        combine(zoneSet, false);
     }
 }
 
diff --git a/src/meshTools/sets/faceZoneSources/planeToFaceZone/planeToFaceZone.H b/src/meshTools/sets/faceZoneSources/planeToFaceZone/planeToFaceZone.H
index c63cc8199a8..0a7548f8f3a 100644
--- a/src/meshTools/sets/faceZoneSources/planeToFaceZone/planeToFaceZone.H
+++ b/src/meshTools/sets/faceZoneSources/planeToFaceZone/planeToFaceZone.H
@@ -101,23 +101,20 @@ SourceFiles
 #ifndef planeToFaceZone_H
 #define planeToFaceZone_H
 
-#include "topoSetSource.H"
-#include "Enum.H"
+#include "topoSetFaceZoneSource.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 namespace Foam
 {
 
-class faceZoneSet;
-
 /*---------------------------------------------------------------------------*\
                          Class planeToFaceZone Declaration
 \*---------------------------------------------------------------------------*/
 
 class planeToFaceZone
 :
-    public topoSetSource
+    public topoSetFaceZoneSource
 {
 public:
 
@@ -166,18 +163,10 @@ public:
         planeToFaceZone() = delete;
 
         //- Construct from dictionary
-        planeToFaceZone
-        (
-            const polyMesh& mesh,
-            const dictionary& dict
-        );
+        planeToFaceZone(const polyMesh& mesh, const dictionary& dict);
 
         //- Construct from Istream
-        planeToFaceZone
-        (
-            const polyMesh& mesh,
-            Istream&
-        );
+        planeToFaceZone(const polyMesh& mesh, Istream& is);
 
 
     //- Destructor
@@ -186,11 +175,6 @@ public:
 
     // Member Functions
 
-        virtual sourceType setType() const
-        {
-            return FACESETSOURCE;
-        }
-
         virtual void applyToSet
         (
             const topoSetSource::setAction action,
diff --git a/src/meshTools/sets/faceZoneSources/searchableSurfaceToFaceZone/searchableSurfaceToFaceZone.C b/src/meshTools/sets/faceZoneSources/searchableSurfaceToFaceZone/searchableSurfaceToFaceZone.C
index 854a6b655bc..ab008e5d6c8 100644
--- a/src/meshTools/sets/faceZoneSources/searchableSurfaceToFaceZone/searchableSurfaceToFaceZone.C
+++ b/src/meshTools/sets/faceZoneSources/searchableSurfaceToFaceZone/searchableSurfaceToFaceZone.C
@@ -45,6 +45,20 @@ namespace Foam
         searchableSurfaceToFaceZone,
         word
     );
+    addToRunTimeSelectionTable
+    (
+        topoSetFaceZoneSource,
+        searchableSurfaceToFaceZone,
+        word
+    );
+    addNamedToRunTimeSelectionTable
+    (
+        topoSetFaceZoneSource,
+        searchableSurfaceToFaceZone,
+        word,
+        surface
+    );
+
 }
 
 
@@ -92,7 +106,7 @@ Foam::searchableSurfaceToFaceZone::searchableSurfaceToFaceZone
     const dictionary& dict
 )
 :
-    topoSetSource(mesh),
+    topoSetFaceZoneSource(mesh),
     surfacePtr_
     (
         searchableSurface::New
@@ -140,6 +154,7 @@ void Foam::searchableSurfaceToFaceZone::applyToSet
     {
         WarningInFunction
             << "Operation only allowed on a faceZoneSet." << endl;
+        return;
     }
     else
     {
diff --git a/src/meshTools/sets/faceZoneSources/searchableSurfaceToFaceZone/searchableSurfaceToFaceZone.H b/src/meshTools/sets/faceZoneSources/searchableSurfaceToFaceZone/searchableSurfaceToFaceZone.H
index 15bdae2d212..de400b95684 100644
--- a/src/meshTools/sets/faceZoneSources/searchableSurfaceToFaceZone/searchableSurfaceToFaceZone.H
+++ b/src/meshTools/sets/faceZoneSources/searchableSurfaceToFaceZone/searchableSurfaceToFaceZone.H
@@ -86,13 +86,14 @@ SourceFiles
 #ifndef searchableSurfaceToFaceZone_H
 #define searchableSurfaceToFaceZone_H
 
-#include "topoSetSource.H"
+#include "topoSetFaceZoneSource.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 namespace Foam
 {
 
+// Forward Declarations
 class searchableSurface;
 
 /*---------------------------------------------------------------------------*\
@@ -101,7 +102,7 @@ class searchableSurface;
 
 class searchableSurfaceToFaceZone
 :
-    public topoSetSource
+    public topoSetFaceZoneSource
 {
     // Private Data
 
@@ -155,12 +156,6 @@ public:
 
     // Member Functions
 
-        //- The source category is a faceZone
-        virtual topoSetSource::sourceType setType() const
-        {
-            return FACEZONE_SOURCE;
-        }
-
         virtual void applyToSet
         (
             const topoSetSource::setAction action,
diff --git a/src/meshTools/sets/faceZoneSources/setAndNormalToFaceZone/setAndNormalToFaceZone.C b/src/meshTools/sets/faceZoneSources/setAndNormalToFaceZone/setAndNormalToFaceZone.C
index da4b3aca219..8110ea597b2 100644
--- a/src/meshTools/sets/faceZoneSources/setAndNormalToFaceZone/setAndNormalToFaceZone.C
+++ b/src/meshTools/sets/faceZoneSources/setAndNormalToFaceZone/setAndNormalToFaceZone.C
@@ -6,7 +6,7 @@
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
     Copyright (C) 2013-2016 OpenFOAM Foundation
-    Copyright (C) 2018 OpenCFD Ltd.
+    Copyright (C) 2018-2020 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -38,6 +38,19 @@ namespace Foam
     defineTypeNameAndDebug(setAndNormalToFaceZone, 0);
     addToRunTimeSelectionTable(topoSetSource, setAndNormalToFaceZone, word);
     addToRunTimeSelectionTable(topoSetSource, setAndNormalToFaceZone, istream);
+
+    addToRunTimeSelectionTable
+    (
+        topoSetFaceZoneSource,
+        setAndNormalToFaceZone,
+        word
+    );
+    addToRunTimeSelectionTable
+    (
+        topoSetFaceZoneSource,
+        setAndNormalToFaceZone,
+        istream
+    );
 }
 
 
@@ -58,7 +71,7 @@ Foam::setAndNormalToFaceZone::setAndNormalToFaceZone
     const vector& normal
 )
 :
-    topoSetSource(mesh),
+    topoSetFaceZoneSource(mesh),
     setName_(setName),
     normal_(normal)
 {}
@@ -70,7 +83,7 @@ Foam::setAndNormalToFaceZone::setAndNormalToFaceZone
     const dictionary& dict
 )
 :
-    topoSetSource(mesh),
+    topoSetFaceZoneSource(mesh),
     setName_(dict.get<word>("faceSet")),
     normal_(dict.get<vector>("normal"))
 {}
@@ -82,7 +95,7 @@ Foam::setAndNormalToFaceZone::setAndNormalToFaceZone
     Istream& is
 )
 :
-    topoSetSource(mesh),
+    topoSetFaceZoneSource(mesh),
     setName_(checkIs(is)),
     normal_(checkIs(is))
 {}
@@ -100,6 +113,7 @@ void Foam::setAndNormalToFaceZone::applyToSet
     {
         WarningInFunction
             << "Operation only allowed on a faceZoneSet." << endl;
+        return;
     }
     else
     {
diff --git a/src/meshTools/sets/faceZoneSources/setAndNormalToFaceZone/setAndNormalToFaceZone.H b/src/meshTools/sets/faceZoneSources/setAndNormalToFaceZone/setAndNormalToFaceZone.H
index 784e00338b4..3eb5e9aceb4 100644
--- a/src/meshTools/sets/faceZoneSources/setAndNormalToFaceZone/setAndNormalToFaceZone.H
+++ b/src/meshTools/sets/faceZoneSources/setAndNormalToFaceZone/setAndNormalToFaceZone.H
@@ -80,7 +80,7 @@ SourceFiles
 #ifndef setAndNormalToFaceZone_H
 #define setAndNormalToFaceZone_H
 
-#include "topoSetSource.H"
+#include "topoSetFaceZoneSource.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -93,7 +93,7 @@ namespace Foam
 
 class setAndNormalToFaceZone
 :
-    public topoSetSource
+    public topoSetFaceZoneSource
 {
     // Private Data
 
@@ -135,12 +135,6 @@ public:
 
     // Member Functions
 
-        //- The source category is a faceZone
-        virtual topoSetSource::sourceType setType() const
-        {
-            return FACEZONE_SOURCE;
-        }
-
         virtual void applyToSet
         (
             const topoSetSource::setAction action,
diff --git a/src/meshTools/sets/faceZoneSources/setToFaceZone/setToFaceZone.C b/src/meshTools/sets/faceZoneSources/setToFaceZone/setToFaceZone.C
index 5de25727508..8cd3d3646c9 100644
--- a/src/meshTools/sets/faceZoneSources/setToFaceZone/setToFaceZone.C
+++ b/src/meshTools/sets/faceZoneSources/setToFaceZone/setToFaceZone.C
@@ -6,7 +6,7 @@
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
     Copyright (C) 2011-2017 OpenFOAM Foundation
-    Copyright (C) 2018-2019 OpenCFD Ltd.
+    Copyright (C) 2018-2020 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -38,6 +38,9 @@ namespace Foam
     defineTypeNameAndDebug(setToFaceZone, 0);
     addToRunTimeSelectionTable(topoSetSource, setToFaceZone, word);
     addToRunTimeSelectionTable(topoSetSource, setToFaceZone, istream);
+
+    addToRunTimeSelectionTable(topoSetFaceZoneSource, setToFaceZone, word);
+    addToRunTimeSelectionTable(topoSetFaceZoneSource, setToFaceZone, istream);
 }
 
 
@@ -58,7 +61,7 @@ Foam::setToFaceZone::setToFaceZone
     const word& setName
 )
 :
-    topoSetSource(mesh),
+    topoSetFaceZoneSource(mesh),
     setName_(setName)
 {}
 
@@ -69,7 +72,7 @@ Foam::setToFaceZone::setToFaceZone
     const dictionary& dict
 )
 :
-    topoSetSource(mesh),
+    topoSetFaceZoneSource(mesh),
     setName_(dict.get<word>("faceSet"))
 {
     if (dict.found("cellSet"))
@@ -87,7 +90,7 @@ Foam::setToFaceZone::setToFaceZone
     Istream& is
 )
 :
-    topoSetSource(mesh),
+    topoSetFaceZoneSource(mesh),
     setName_(checkIs(is))
 {}
 
@@ -104,6 +107,7 @@ void Foam::setToFaceZone::applyToSet
     {
         WarningInFunction
             << "Operation only allowed on a faceZoneSet." << endl;
+        return;
     }
     else
     {
diff --git a/src/meshTools/sets/faceZoneSources/setToFaceZone/setToFaceZone.H b/src/meshTools/sets/faceZoneSources/setToFaceZone/setToFaceZone.H
index bf072d4f016..657458c5639 100644
--- a/src/meshTools/sets/faceZoneSources/setToFaceZone/setToFaceZone.H
+++ b/src/meshTools/sets/faceZoneSources/setToFaceZone/setToFaceZone.H
@@ -87,7 +87,7 @@ SourceFiles
 #ifndef setToFaceZone_H
 #define setToFaceZone_H
 
-#include "topoSetSource.H"
+#include "topoSetFaceZoneSource.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -100,7 +100,7 @@ namespace Foam
 
 class setToFaceZone
 :
-    public topoSetSource
+    public topoSetFaceZoneSource
 {
     // Private Data
 
@@ -139,12 +139,6 @@ public:
 
     // Member Functions
 
-        //- The source category is a faceZone
-        virtual topoSetSource::sourceType setType() const
-        {
-            return FACEZONE_SOURCE;
-        }
-
         virtual void applyToSet
         (
             const topoSetSource::setAction action,
diff --git a/src/meshTools/sets/faceZoneSources/setsToFaceZone/setsToFaceZone.C b/src/meshTools/sets/faceZoneSources/setsToFaceZone/setsToFaceZone.C
index 451a8f61cae..b630a7f1512 100644
--- a/src/meshTools/sets/faceZoneSources/setsToFaceZone/setsToFaceZone.C
+++ b/src/meshTools/sets/faceZoneSources/setsToFaceZone/setsToFaceZone.C
@@ -39,6 +39,9 @@ namespace Foam
     defineTypeNameAndDebug(setsToFaceZone, 0);
     addToRunTimeSelectionTable(topoSetSource, setsToFaceZone, word);
     addToRunTimeSelectionTable(topoSetSource, setsToFaceZone, istream);
+
+    addToRunTimeSelectionTable(topoSetFaceZoneSource, setsToFaceZone, word);
+    addToRunTimeSelectionTable(topoSetFaceZoneSource, setsToFaceZone, istream);
 }
 
 
@@ -61,7 +64,7 @@ Foam::setsToFaceZone::setsToFaceZone
     const bool flip
 )
 :
-    topoSetSource(mesh),
+    topoSetFaceZoneSource(mesh),
     faceSetName_(faceSetName),
     cellSetName_(cellSetName),
     flip_(flip)
@@ -74,7 +77,7 @@ Foam::setsToFaceZone::setsToFaceZone
     const dictionary& dict
 )
 :
-    topoSetSource(mesh),
+    topoSetFaceZoneSource(mesh),
     faceSetName_(dict.get<word>("faceSet")),
     cellSetName_(dict.get<word>("cellSet")),
     flip_(dict.getOrDefault("flip", false))
@@ -87,7 +90,7 @@ Foam::setsToFaceZone::setsToFaceZone
     Istream& is
 )
 :
-    topoSetSource(mesh),
+    topoSetFaceZoneSource(mesh),
     faceSetName_(checkIs(is)),
     cellSetName_(checkIs(is)),
     flip_(false)
@@ -106,6 +109,7 @@ void Foam::setsToFaceZone::applyToSet
     {
         WarningInFunction
             << "Operation only allowed on a faceZoneSet." << endl;
+        return;
     }
     else
     {
diff --git a/src/meshTools/sets/faceZoneSources/setsToFaceZone/setsToFaceZone.H b/src/meshTools/sets/faceZoneSources/setsToFaceZone/setsToFaceZone.H
index 6c4aec63a05..fc965df8a9e 100644
--- a/src/meshTools/sets/faceZoneSources/setsToFaceZone/setsToFaceZone.H
+++ b/src/meshTools/sets/faceZoneSources/setsToFaceZone/setsToFaceZone.H
@@ -89,7 +89,7 @@ SourceFiles
 #ifndef setsToFaceZone_H
 #define setsToFaceZone_H
 
-#include "topoSetSource.H"
+#include "topoSetFaceZoneSource.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -102,7 +102,7 @@ namespace Foam
 
 class setsToFaceZone
 :
-    public topoSetSource
+    public topoSetFaceZoneSource
 {
     // Private Data
 
@@ -149,12 +149,6 @@ public:
 
     // Member Functions
 
-        //- The source category is a pointSet
-        virtual topoSetSource::sourceType setType() const
-        {
-            return FACEZONE_SOURCE;
-        }
-
         virtual void applyToSet
         (
             const topoSetSource::setAction action,
diff --git a/src/meshTools/sets/faceZoneSources/topoSetFaceZoneSource/topoSetFaceZoneSource.C b/src/meshTools/sets/faceZoneSources/topoSetFaceZoneSource/topoSetFaceZoneSource.C
new file mode 100644
index 00000000000..0ae4dc9befb
--- /dev/null
+++ b/src/meshTools/sets/faceZoneSources/topoSetFaceZoneSource/topoSetFaceZoneSource.C
@@ -0,0 +1,99 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | www.openfoam.com
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+    Copyright (C) 2020 OpenCFD Ltd.
+-------------------------------------------------------------------------------
+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/>.
+
+\*---------------------------------------------------------------------------*/
+
+#include "topoSetFaceZoneSource.H"
+#include "polyMesh.H"
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+namespace Foam
+{
+    defineRunTimeSelectionTable(topoSetFaceZoneSource, word);
+    defineRunTimeSelectionTable(topoSetFaceZoneSource, istream);
+}
+
+
+// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
+
+Foam::topoSetFaceZoneSource::topoSetFaceZoneSource(const polyMesh& mesh)
+:
+    topoSetSource(mesh)
+{}
+
+
+// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
+
+Foam::autoPtr<Foam::topoSetFaceZoneSource>
+Foam::topoSetFaceZoneSource::New
+(
+    const word& sourceType,
+    const polyMesh& mesh,
+    const dictionary& dict
+)
+{
+    auto cstrIter = wordConstructorTablePtr_->cfind(sourceType);
+
+    if (!cstrIter.found())
+    {
+        FatalIOErrorInLookup
+        (
+            dict,
+            "faceZoneSource",
+            sourceType,
+            *wordConstructorTablePtr_
+        ) << exit(FatalIOError);
+    }
+
+    return autoPtr<topoSetFaceZoneSource>(cstrIter()(mesh, dict));
+}
+
+
+Foam::autoPtr<Foam::topoSetFaceZoneSource>
+Foam::topoSetFaceZoneSource::New
+(
+    const word& sourceType,
+    const polyMesh& mesh,
+    Istream& is
+)
+{
+    auto cstrIter = istreamConstructorTablePtr_->cfind(sourceType);
+
+    if (!cstrIter.found())
+    {
+        FatalErrorInLookup
+        (
+            "faceZoneSource",
+            sourceType,
+            *istreamConstructorTablePtr_
+        ) << exit(FatalError);
+    }
+
+    return autoPtr<topoSetFaceZoneSource>(cstrIter()(mesh, is));
+}
+
+
+// ************************************************************************* //
diff --git a/src/meshTools/sets/faceZoneSources/topoSetFaceZoneSource/topoSetFaceZoneSource.H b/src/meshTools/sets/faceZoneSources/topoSetFaceZoneSource/topoSetFaceZoneSource.H
new file mode 100644
index 00000000000..5d651eb281b
--- /dev/null
+++ b/src/meshTools/sets/faceZoneSources/topoSetFaceZoneSource/topoSetFaceZoneSource.H
@@ -0,0 +1,147 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | www.openfoam.com
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+    Copyright (C) 2020 OpenCFD Ltd.
+-------------------------------------------------------------------------------
+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/>.
+
+Class
+    Foam::topoSetFaceZoneSource
+
+Description
+    The \c topoSetFaceZoneSource is a intermediate class
+    for handling \c topoSet sources for selecting face zones.
+
+    The class is not an executable \c topoSet itself,
+    yet a provider for common entries to its derived \c topoSet.
+
+SourceFiles
+    topoSetFaceZoneSource.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef topoSetFaceZoneSource_H
+#define topoSetFaceZoneSource_H
+
+#include "topoSetSource.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// Forward Declarations
+class faceZoneSet;
+
+/*---------------------------------------------------------------------------*\
+                    Class topoSetFaceZoneSource Declaration
+\*---------------------------------------------------------------------------*/
+
+class topoSetFaceZoneSource
+:
+    public topoSetSource
+{
+public:
+
+    // Declare run-time constructor selection table
+
+        // For the dictionary constructor
+        declareRunTimeSelectionTable
+        (
+            autoPtr,
+            topoSetFaceZoneSource,
+            word,
+            (
+                const polyMesh& mesh,
+                const dictionary& dict
+            ),
+            (mesh, dict)
+        );
+
+        // For the Istream constructor
+        declareRunTimeSelectionTable
+        (
+            autoPtr,
+            topoSetFaceZoneSource,
+            istream,
+            (
+                const polyMesh& mesh,
+                Istream& is
+            ),
+            (mesh, is)
+        );
+
+
+    // Constructors
+
+        //- Construct from components
+        explicit topoSetFaceZoneSource(const polyMesh& mesh);
+
+        //- Clone (disallowed)
+        autoPtr<topoSetFaceZoneSource> clone() const
+        {
+            NotImplemented;
+            return nullptr;
+        }
+
+
+    // Selectors
+
+        //- Return a reference to the selected source type
+        static autoPtr<topoSetFaceZoneSource> New
+        (
+            const word& sourceType,
+            const polyMesh& mesh,
+            const dictionary& dict
+        );
+
+        //- Return a reference to the selected source type
+        static autoPtr<topoSetFaceZoneSource> New
+        (
+            const word& sourceType,
+            const polyMesh& mesh,
+            Istream& is
+        );
+
+
+    //- Destructor
+    virtual ~topoSetFaceZoneSource() = default;
+
+
+    // Member Functions
+
+        //- The source category is a faceZone
+        virtual topoSetSource::sourceType setType() const
+        {
+            return FACEZONE_SOURCE;
+        }
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/meshTools/sets/pointSources/topoSetPointSource/topoSetPointSource.C b/src/meshTools/sets/pointSources/topoSetPointSource/topoSetPointSource.C
index 67e828e373c..b57fa617cfa 100644
--- a/src/meshTools/sets/pointSources/topoSetPointSource/topoSetPointSource.C
+++ b/src/meshTools/sets/pointSources/topoSetPointSource/topoSetPointSource.C
@@ -5,7 +5,7 @@
     \\  /    A nd           | www.openfoam.com
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
-    Copyright (C) 2018-2019 OpenCFD Ltd.
+    Copyright (C) 2018-2020 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -32,7 +32,6 @@ License
 
 namespace Foam
 {
-    defineTypeNameAndDebug(topoSetPointSource, 0);
     defineRunTimeSelectionTable(topoSetPointSource, word);
     defineRunTimeSelectionTable(topoSetPointSource, istream);
 }
@@ -48,7 +47,8 @@ Foam::topoSetPointSource::topoSetPointSource(const polyMesh& mesh)
 
 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
 
-Foam::autoPtr<Foam::topoSetPointSource> Foam::topoSetPointSource::New
+Foam::autoPtr<Foam::topoSetPointSource>
+Foam::topoSetPointSource::New
 (
     const word& sourceType,
     const polyMesh& mesh,
@@ -62,7 +62,7 @@ Foam::autoPtr<Foam::topoSetPointSource> Foam::topoSetPointSource::New
         FatalIOErrorInLookup
         (
             dict,
-            "topoSetPointSource",
+            "pointSetSource",
             sourceType,
             *wordConstructorTablePtr_
         ) << exit(FatalIOError);
@@ -85,7 +85,7 @@ Foam::autoPtr<Foam::topoSetPointSource> Foam::topoSetPointSource::New
     {
         FatalErrorInLookup
         (
-            "topoSetPointSource",
+            "pointSetSource",
             sourceType,
             *istreamConstructorTablePtr_
         ) << exit(FatalError);
diff --git a/src/meshTools/sets/pointSources/topoSetPointSource/topoSetPointSource.H b/src/meshTools/sets/pointSources/topoSetPointSource/topoSetPointSource.H
index a0af5cd906b..aac0aee5d9a 100644
--- a/src/meshTools/sets/pointSources/topoSetPointSource/topoSetPointSource.H
+++ b/src/meshTools/sets/pointSources/topoSetPointSource/topoSetPointSource.H
@@ -58,9 +58,6 @@ class topoSetPointSource
 {
 public:
 
-    //- Runtime type information
-    TypeName("topoSetPointSource");
-
     // Declare run-time constructor selection table
 
         // For the dictionary constructor
diff --git a/src/meshTools/sets/pointSources/zoneToPoint/zoneToPoint.C b/src/meshTools/sets/pointSources/zoneToPoint/zoneToPoint.C
index 56e891f6f2b..8952f2baf9a 100644
--- a/src/meshTools/sets/pointSources/zoneToPoint/zoneToPoint.C
+++ b/src/meshTools/sets/pointSources/zoneToPoint/zoneToPoint.C
@@ -37,6 +37,7 @@ namespace Foam
     defineTypeNameAndDebug(zoneToPoint, 0);
     addToRunTimeSelectionTable(topoSetSource, zoneToPoint, word);
     addToRunTimeSelectionTable(topoSetSource, zoneToPoint, istream);
+
     addToRunTimeSelectionTable(topoSetPointSource, zoneToPoint, word);
     addToRunTimeSelectionTable(topoSetPointSource, zoneToPoint, istream);
     addNamedToRunTimeSelectionTable
diff --git a/src/meshTools/sets/pointZoneSources/setToPointZone/setToPointZone.C b/src/meshTools/sets/pointZoneSources/setToPointZone/setToPointZone.C
index 2fe5b7de3a3..d711a8e5754 100644
--- a/src/meshTools/sets/pointZoneSources/setToPointZone/setToPointZone.C
+++ b/src/meshTools/sets/pointZoneSources/setToPointZone/setToPointZone.C
@@ -38,6 +38,9 @@ namespace Foam
     defineTypeNameAndDebug(setToPointZone, 0);
     addToRunTimeSelectionTable(topoSetSource, setToPointZone, word);
     addToRunTimeSelectionTable(topoSetSource, setToPointZone, istream);
+
+    addToRunTimeSelectionTable(topoSetPointZoneSource, setToPointZone, word);
+    addToRunTimeSelectionTable(topoSetPointZoneSource, setToPointZone, istream);
 }
 
 
@@ -57,7 +60,7 @@ Foam::setToPointZone::setToPointZone
     const word& setName
 )
 :
-    topoSetSource(mesh),
+    topoSetPointZoneSource(mesh),
     setName_(setName)
 {}
 
@@ -68,7 +71,7 @@ Foam::setToPointZone::setToPointZone
     const dictionary& dict
 )
 :
-    topoSetSource(mesh),
+    topoSetPointZoneSource(mesh),
     setName_(dict.get<word>("set"))
 {}
 
@@ -79,7 +82,7 @@ Foam::setToPointZone::setToPointZone
     Istream& is
 )
 :
-    topoSetSource(mesh),
+    topoSetPointZoneSource(mesh),
     setName_(checkIs(is))
 {}
 
@@ -96,6 +99,7 @@ void Foam::setToPointZone::applyToSet
     {
         WarningInFunction
             << "Operation only allowed on a pointZoneSet." << endl;
+        return;
     }
     else
     {
diff --git a/src/meshTools/sets/pointZoneSources/setToPointZone/setToPointZone.H b/src/meshTools/sets/pointZoneSources/setToPointZone/setToPointZone.H
index 7110a417492..6c165b32983 100644
--- a/src/meshTools/sets/pointZoneSources/setToPointZone/setToPointZone.H
+++ b/src/meshTools/sets/pointZoneSources/setToPointZone/setToPointZone.H
@@ -83,7 +83,7 @@ SourceFiles
 #ifndef setToPointZone_H
 #define setToPointZone_H
 
-#include "topoSetSource.H"
+#include "topoSetPointZoneSource.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -96,7 +96,7 @@ namespace Foam
 
 class setToPointZone
 :
-    public topoSetSource
+    public topoSetPointZoneSource
 {
     // Private Data
 
@@ -135,12 +135,6 @@ public:
 
     // Member Functions
 
-        //- The source category is a pointZone
-        virtual topoSetSource::sourceType setType() const
-        {
-            return POINTZONE_SOURCE;
-        }
-
         virtual void applyToSet
         (
             const topoSetSource::setAction action,
diff --git a/src/meshTools/sets/pointZoneSources/topoSetPointZoneSource/topoSetPointZoneSource.C b/src/meshTools/sets/pointZoneSources/topoSetPointZoneSource/topoSetPointZoneSource.C
new file mode 100644
index 00000000000..e1ded575c78
--- /dev/null
+++ b/src/meshTools/sets/pointZoneSources/topoSetPointZoneSource/topoSetPointZoneSource.C
@@ -0,0 +1,99 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | www.openfoam.com
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+    Copyright (C) 2020 OpenCFD Ltd.
+-------------------------------------------------------------------------------
+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/>.
+
+\*---------------------------------------------------------------------------*/
+
+#include "topoSetPointZoneSource.H"
+#include "polyMesh.H"
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+namespace Foam
+{
+    defineRunTimeSelectionTable(topoSetPointZoneSource, word);
+    defineRunTimeSelectionTable(topoSetPointZoneSource, istream);
+}
+
+
+// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
+
+Foam::topoSetPointZoneSource::topoSetPointZoneSource(const polyMesh& mesh)
+:
+    topoSetSource(mesh)
+{}
+
+
+// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
+
+Foam::autoPtr<Foam::topoSetPointZoneSource>
+Foam::topoSetPointZoneSource::New
+(
+    const word& sourceType,
+    const polyMesh& mesh,
+    const dictionary& dict
+)
+{
+    auto cstrIter = wordConstructorTablePtr_->cfind(sourceType);
+
+    if (!cstrIter.found())
+    {
+        FatalIOErrorInLookup
+        (
+            dict,
+            "pointZoneSource",
+            sourceType,
+            *wordConstructorTablePtr_
+        ) << exit(FatalIOError);
+    }
+
+    return autoPtr<topoSetPointZoneSource>(cstrIter()(mesh, dict));
+}
+
+
+Foam::autoPtr<Foam::topoSetPointZoneSource>
+Foam::topoSetPointZoneSource::New
+(
+    const word& sourceType,
+    const polyMesh& mesh,
+    Istream& is
+)
+{
+    auto cstrIter = istreamConstructorTablePtr_->cfind(sourceType);
+
+    if (!cstrIter.found())
+    {
+        FatalErrorInLookup
+        (
+            "pointZoneSource",
+            sourceType,
+            *istreamConstructorTablePtr_
+        ) << exit(FatalError);
+    }
+
+    return autoPtr<topoSetPointZoneSource>(cstrIter()(mesh, is));
+}
+
+
+// ************************************************************************* //
diff --git a/src/meshTools/sets/pointZoneSources/topoSetPointZoneSource/topoSetPointZoneSource.H b/src/meshTools/sets/pointZoneSources/topoSetPointZoneSource/topoSetPointZoneSource.H
new file mode 100644
index 00000000000..ab0ea3d0722
--- /dev/null
+++ b/src/meshTools/sets/pointZoneSources/topoSetPointZoneSource/topoSetPointZoneSource.H
@@ -0,0 +1,147 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | www.openfoam.com
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+    Copyright (C) 2020 OpenCFD Ltd.
+-------------------------------------------------------------------------------
+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/>.
+
+Class
+    Foam::topoSetPointZoneSource
+
+Description
+    The \c topoSetPointZoneSource is a intermediate class
+    for handling \c topoSet sources for selecting point zones.
+
+    The class is not an executable \c topoSet itself,
+    yet a provider for common entries to its derived \c topoSet.
+
+SourceFiles
+    topoSetPointZoneSource.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef topoSetPointZoneSource_H
+#define topoSetPointZoneSource_H
+
+#include "topoSetSource.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// Forward Declarations
+class pointZoneSet;
+
+/*---------------------------------------------------------------------------*\
+                    Class topoSetPointZoneSource Declaration
+\*---------------------------------------------------------------------------*/
+
+class topoSetPointZoneSource
+:
+    public topoSetSource
+{
+public:
+
+    // Declare run-time constructor selection table
+
+        // For the dictionary constructor
+        declareRunTimeSelectionTable
+        (
+            autoPtr,
+            topoSetPointZoneSource,
+            word,
+            (
+                const polyMesh& mesh,
+                const dictionary& dict
+            ),
+            (mesh, dict)
+        );
+
+        // For the Istream constructor
+        declareRunTimeSelectionTable
+        (
+            autoPtr,
+            topoSetPointZoneSource,
+            istream,
+            (
+                const polyMesh& mesh,
+                Istream& is
+            ),
+            (mesh, is)
+        );
+
+
+    // Constructors
+
+        //- Construct from components
+        explicit topoSetPointZoneSource(const polyMesh& mesh);
+
+        //- Clone (disallowed)
+        autoPtr<topoSetPointZoneSource> clone() const
+        {
+            NotImplemented;
+            return nullptr;
+        }
+
+
+    // Selectors
+
+        //- Return a reference to the selected source type
+        static autoPtr<topoSetPointZoneSource> New
+        (
+            const word& sourceType,
+            const polyMesh& mesh,
+            const dictionary& dict
+        );
+
+        //- Return a reference to the selected source type
+        static autoPtr<topoSetPointZoneSource> New
+        (
+            const word& sourceType,
+            const polyMesh& mesh,
+            Istream& is
+        );
+
+
+    //- Destructor
+    virtual ~topoSetPointZoneSource() = default;
+
+
+    // Member Functions
+
+        //- The source category is a pointZone
+        virtual topoSetSource::sourceType setType() const
+        {
+            return POINTZONE_SOURCE;
+        }
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/meshTools/sets/topoSets/topoSet.C b/src/meshTools/sets/topoSets/topoSet.C
index 9584631a239..80e6415f927 100644
--- a/src/meshTools/sets/topoSets/topoSet.C
+++ b/src/meshTools/sets/topoSets/topoSet.C
@@ -6,7 +6,7 @@
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
     Copyright (C) 2011-2016 OpenFOAM Foundation
-    Copyright (C) 2016-2019 OpenCFD Ltd.
+    Copyright (C) 2016-2020 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -50,7 +50,8 @@ namespace Foam
 
 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
 
-Foam::autoPtr<Foam::topoSet> Foam::topoSet::New
+Foam::autoPtr<Foam::topoSet>
+Foam::topoSet::New
 (
     const word& setType,
     const polyMesh& mesh,
@@ -75,7 +76,8 @@ Foam::autoPtr<Foam::topoSet> Foam::topoSet::New
 }
 
 
-Foam::autoPtr<Foam::topoSet> Foam::topoSet::New
+Foam::autoPtr<Foam::topoSet>
+Foam::topoSet::New
 (
     const word& setType,
     const polyMesh& mesh,
@@ -100,7 +102,8 @@ Foam::autoPtr<Foam::topoSet> Foam::topoSet::New
 }
 
 
-Foam::autoPtr<Foam::topoSet> Foam::topoSet::New
+Foam::autoPtr<Foam::topoSet>
+Foam::topoSet::New
 (
     const word& setType,
     const polyMesh& mesh,
-- 
GitLab