From 7805fb45cf14fdcd14c3a84039f5c2d68c94053e Mon Sep 17 00:00:00 2001
From: Mark Olesen <Mark.Olesen@esi-group.com>
Date: Tue, 9 Jul 2019 12:46:40 +0200
Subject: [PATCH] ENH: support different iso-algorithms (#1374)

- add an 'isoAlgorithm' keyword to distance surface and cutting plane
  to advance further testing of the isoSurfaceTopo algorithm.

  Does not yet handle the full spectrum of bound boxes, cellZones etc.
---
 src/sampling/Make/files                       |   1 +
 .../distanceSurface/sampledDistanceSurface.H  |  24 ++--
 .../sampledCuttingPlane/sampledCuttingPlane.C |  85 ++++++++----
 .../sampledCuttingPlane/sampledCuttingPlane.H |  89 +++++++++---
 .../sampledCuttingPlaneTemplates.C            |  29 +++-
 .../sampledThresholdCellFaces.H               |   4 +-
 .../surface/distanceSurface/distanceSurface.C |  92 +++++++++++--
 .../surface/distanceSurface/distanceSurface.H |  67 +++++----
 .../distanceSurfaceTemplates.C                |  12 +-
 src/sampling/surface/isoSurface/isoSurface.C  |   4 +-
 src/sampling/surface/isoSurface/isoSurface.H  |  36 +----
 .../surface/isoSurface/isoSurfaceBase.C       |  56 ++++++++
 .../surface/isoSurface/isoSurfaceBase.H       | 129 ++++++++++++++++++
 .../surface/isoSurface/isoSurfaceCell.C       |   5 +-
 .../surface/isoSurface/isoSurfaceCell.H       |  36 +----
 .../surface/isoSurface/isoSurfaceTopo.C       |  37 ++++-
 .../surface/isoSurface/isoSurfaceTopo.H       |  36 ++---
 17 files changed, 544 insertions(+), 198 deletions(-)
 create mode 100644 src/sampling/surface/isoSurface/isoSurfaceBase.C
 create mode 100644 src/sampling/surface/isoSurface/isoSurfaceBase.H

diff --git a/src/sampling/Make/files b/src/sampling/Make/files
index b36eca5a4fd..2cde386cea7 100644
--- a/src/sampling/Make/files
+++ b/src/sampling/Make/files
@@ -29,6 +29,7 @@ surface/cutting/cuttingSurfaceBase.C
 surface/cutting/cuttingSurfaceBaseSelection.C
 surface/distanceSurface/distanceSurface.C
 surface/isoSurface/isoSurface.C
+surface/isoSurface/isoSurfaceBase.C
 surface/isoSurface/isoSurfaceCell.C
 surface/isoSurface/isoSurfaceTopo.C
 surface/thresholdCellFaces/thresholdCellFaces.C
diff --git a/src/sampling/sampledSurface/distanceSurface/sampledDistanceSurface.H b/src/sampling/sampledSurface/distanceSurface/sampledDistanceSurface.H
index 2a10e19cba6..a9d37e74649 100644
--- a/src/sampling/sampledSurface/distanceSurface/sampledDistanceSurface.H
+++ b/src/sampling/sampledSurface/distanceSurface/sampledDistanceSurface.H
@@ -37,25 +37,27 @@ Usage
     (
         surface1
         {
-            type        dDistanceSurface;
+            type        distanceSurface;
         }
     );
     \endverbatim
 
     Where the sub-entries comprise:
     \table
-        Property | Description                             | Required | Default
-        type     | distanceSurface                         | yes      |
-        distance | distance from surface                   | yes      |
-        signed   | apply sign for +ve/-ve distance         | yes      |
-        cell     | use isoSurfaceCell algorithm            | no       | true
-        regularise | point snapping                        | yes      |
-        average  | cell values from averaged point values  | no       | false
-        bounds   | limit with bounding box                 | no       |
-        surfaceType | type of surface                      | yes      |
-        surfaceName | name of surface in triSurface/       | no  | dict name
+        Property | Description                              | Required | Default
+        type     | distanceSurface                          | yes |
+        distance | Distance from surface                    | yes |
+        signed   | Use sign when distance is positive       | partly |
+        isoAlgorithm | (cell/topo/point)                    | no  | cell
+        regularise | Point snapping for iso-surface         | no  | true
+        average  | Cell values from averaged point values   | no  | false
+        bounds   | Limit with bounding box                  | no  |
+        surfaceType | Type of surface                       | yes |
+        surfaceName | Name of surface in \c triSurface/     | no  | dict name
     \endtable
 
+Note
+    For compatibility, the keyword 'cell' (as a bool) is accepted
 
 SourceFiles
     sampledDistanceSurface.C
diff --git a/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlane.C b/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlane.C
index b8d7cb1537c..56a32ae27ac 100644
--- a/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlane.C
+++ b/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlane.C
@@ -102,7 +102,9 @@ void Foam::sampledCuttingPlane::createGeometry()
     }
 
     // Clear any stored topologies
-    isoSurfPtr_.ptr();
+    isoSurfPtr_.clear();
+    isoSurfCellPtr_.clear();
+    isoSurfTopoPtr_.clear();
     pointDistance_.clear();
     cellDistancePtr_.clear();
 
@@ -291,28 +293,54 @@ void Foam::sampledCuttingPlane::createGeometry()
         pDist.write();
     }
 
-    //- Direct from cell field and point field.
-    isoSurfPtr_.reset
-    (
-        new isoSurface
+
+    // Direct from cell field and point field.
+    if (isoAlgo_ == isoSurfaceBase::ALGO_CELL)
+    {
+        isoSurfCellPtr_.reset
         (
-            cellDistance,
-            pointDistance_,
-            0.0,
-            regularise_,
-            bounds_,
-            mergeTol_
-        )
-        //new isoSurfaceCell
-        //(
-        //    mesh,
-        //    cellDistance,
-        //    pointDistance_,
-        //    0.0,
-        //    regularise_,
-        //    mergeTol_
-        //)
-    );
+            new isoSurfaceCell
+            (
+                fvm,
+                cellDistance,
+                pointDistance_,
+                0,
+                regularise_,
+                bounds_,
+                mergeTol_
+            )
+        );
+    }
+    else if (isoAlgo_ == isoSurfaceBase::ALGO_TOPO)
+    {
+        isoSurfTopoPtr_.reset
+        (
+            new isoSurfaceTopo
+            (
+                fvm,
+                cellDistance,
+                pointDistance_,
+                0,
+                (regularise_ ? isoSurfaceTopo::DIAGCELL : isoSurfaceTopo::NONE),
+                bounds_
+            )
+        );
+    }
+    else
+    {
+        isoSurfPtr_.reset
+        (
+            new isoSurface
+            (
+                cellDistance,
+                pointDistance_,
+                0,
+                regularise_,
+                bounds_,
+                mergeTol_
+            )
+        );
+    }
 
     if (debug)
     {
@@ -337,12 +365,23 @@ Foam::sampledCuttingPlane::sampledCuttingPlane
     mergeTol_(dict.lookupOrDefault("mergeTol", 1e-6)),
     regularise_(dict.lookupOrDefault("regularise", true)),
     average_(dict.lookupOrDefault("average", false)),
+    isoAlgo_
+    (
+        isoSurfaceBase::algorithmNames.getOrDefault
+        (
+            "isoAlgorithm",
+            dict,
+            isoSurfaceBase::ALGO_POINT
+        )
+    ),
     zoneNames_(),
     exposedPatchName_(),
     needsUpdate_(true),
     subMeshPtr_(nullptr),
     cellDistancePtr_(nullptr),
-    isoSurfPtr_(nullptr)
+    isoSurfPtr_(nullptr),
+    isoSurfCellPtr_(nullptr),
+    isoSurfTopoPtr_(nullptr)
 {
     if (!dict.readIfPresent("zones", zoneNames_) && dict.found("zone"))
     {
diff --git a/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlane.H b/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlane.H
index fbd7315c9b2..3eee9eef806 100644
--- a/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlane.H
+++ b/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlane.H
@@ -27,7 +27,7 @@ Class
     Foam::sampledCuttingPlane
 
 Description
-    A sampledSurface defined by a plane using the iso-surface algorithm
+    A sampledSurface defined by a plane using an iso-surface algorithm
     to \a cut the mesh.
 
     This is often embedded as part of a sampled surfaces function object.
@@ -51,15 +51,16 @@ Usage
 
     Where the sub-entries comprise:
     \table
-        Property | Description                             | Required | Default
-        type     | cuttingPlane                            | yes      |
-        planeType | plane description (pointAndNormal etc) | yes      |
-        mergeTol | tolerance for merging points            | no       | 1e-6
-        regularise | point snapping                        | no       | true
-        bounds   | limit with bounding box                 | no       |
-        zone     | limit to cell zone (name or regex)      | no       |
-        zones    | limit to cell zones (names, regexs)     | no       |
-        exposedPatchName | name for zone subset            | partly   |
+        Property | Description                              | Required | Default
+        type     | cuttingPlane                             | yes |
+        planeType | plane description (pointAndNormal etc)  | yes |
+        mergeTol | tolerance for merging points             | no  | 1e-6
+        isoAlgorithm | (cell/topo/point)                    | no  | point
+        regularise | point snapping                         | no  | true
+        bounds   | limit with bounding box                  | no  |
+        zone     | limit to cell zone (name or regex)       | no  |
+        zones    | limit to cell zones (names, regexs)      | no  |
+        exposedPatchName | name for zone subset             | partly |
     \endtable
 
 Note
@@ -77,10 +78,11 @@ SourceFiles
 #define sampledCuttingPlane_H
 
 #include "sampledSurface.H"
-#include "isoSurface.H"
-//#include "isoSurfaceCell.H"
 #include "plane.H"
 #include "fvMeshSubset.H"
+#include "isoSurface.H"
+#include "isoSurfaceCell.H"
+#include "isoSurfaceTopo.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -112,6 +114,9 @@ class sampledCuttingPlane
         //- Whether to recalculate cell values as average of point values
         const bool average_;
 
+        //- The iso-surface algorithm type
+        const isoSurfaceBase::algorithmType isoAlgo_;
+
         //- The zone or zones in which cutting is to occur
         wordRes zoneNames_;
 
@@ -131,10 +136,15 @@ class sampledCuttingPlane
         //- Distance to points
         scalarField pointDistance_;
 
-        //- Constructed iso surface
-        //autoPtr<isoSurfaceCell> isoSurfCellPtr_;
+        //- Constructed iso surface (ALGO_POINT)
         autoPtr<isoSurface> isoSurfPtr_;
 
+        //- Constructed iso surface (ALGO_CELL)
+        autoPtr<isoSurfaceCell> isoSurfCellPtr_;
+
+        //- Constructed iso surface (ALGO_TOPO)
+        autoPtr<isoSurfaceTopo> isoSurfTopoPtr_;
+
 
     // Private Member Functions
 
@@ -162,6 +172,13 @@ class sampledCuttingPlane
             const interpolation<Type>& interpolator
         ) const;
 
+        //- Interpolates cCoords,pCoords.
+        template<class Type>
+        tmp<Field<Type>> isoSurfaceInterpolate
+        (
+            const GeometricField<Type, fvPatchField, volMesh>& cCoords,
+            const Field<Type>& pCoords
+        ) const;
 
 public:
 
@@ -186,12 +203,6 @@ public:
 
     // Member Functions
 
-        //const isoSurfaceCell& surface() const
-        const isoSurface& surface() const
-        {
-            return *isoSurfPtr_;
-        }
-
         //- Does the surface need an update?
         virtual bool needsUpdate() const;
 
@@ -241,21 +252,59 @@ public:
         }
 
 
+        //- The underlying surface
+        const meshedSurface& surface() const
+        {
+            if (isoSurfCellPtr_)
+            {
+                return *isoSurfCellPtr_;
+            }
+            else if (isoSurfTopoPtr_)
+            {
+                return *isoSurfTopoPtr_;
+            }
+            return *isoSurfPtr_;
+        }
+
         //- The underlying surface
         meshedSurface& surface()
         {
+            if (isoSurfCellPtr_)
+            {
+                return *isoSurfCellPtr_;
+            }
+            else if (isoSurfTopoPtr_)
+            {
+                return *isoSurfTopoPtr_;
+            }
             return *isoSurfPtr_;
         }
 
         //- For each face, the original cell in mesh
         const labelList& meshCells() const
         {
+            if (isoSurfCellPtr_)
+            {
+                return isoSurfCellPtr_->meshCells();
+            }
+            else if (isoSurfTopoPtr_)
+            {
+                return isoSurfTopoPtr_->meshCells();
+            }
             return isoSurfPtr_->meshCells();
         }
 
         //- For each face, the original cell in mesh
         labelList& meshCells()
         {
+            if (isoSurfCellPtr_)
+            {
+                return isoSurfCellPtr_->meshCells();
+            }
+            else if (isoSurfTopoPtr_)
+            {
+                return isoSurfTopoPtr_->meshCells();
+            }
             return isoSurfPtr_->meshCells();
         }
 
diff --git a/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlaneTemplates.C b/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlaneTemplates.C
index 2c02aae665e..20f602604b6 100644
--- a/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlaneTemplates.C
+++ b/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlaneTemplates.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2018 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2018-2019 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
                             | Copyright (C) 2011-2016 OpenFOAM Foundation
@@ -67,7 +67,7 @@ Foam::sampledCuttingPlane::sampleOnPoints
         auto tpointFld =
             volPointInterpolation::New(volSubFld.mesh()).interpolate(volSubFld);
 
-        return surface().interpolate
+        return this->isoSurfaceInterpolate
         (
             (average_ ? pointAverage(tpointFld())() : volSubFld),
             tpointFld()
@@ -78,7 +78,7 @@ Foam::sampledCuttingPlane::sampleOnPoints
     auto tpointFld =
         volPointInterpolation::New(volFld.mesh()).interpolate(volFld);
 
-    return surface().interpolate
+    return this->isoSurfaceInterpolate
     (
         (average_ ? pointAverage(tpointFld())() : volFld),
         tpointFld()
@@ -86,4 +86,27 @@ Foam::sampledCuttingPlane::sampleOnPoints
 }
 
 
+template<class Type>
+Foam::tmp<Foam::Field<Type>>
+Foam::sampledCuttingPlane::isoSurfaceInterpolate
+(
+    const GeometricField<Type, fvPatchField, volMesh>& cCoords,
+    const Field<Type>& pCoords
+) const
+{
+    if (isoSurfCellPtr_)
+    {
+        return isoSurfCellPtr_->interpolate(cCoords, pCoords);
+    }
+    else if (isoSurfTopoPtr_)
+    {
+        return isoSurfTopoPtr_->interpolate(cCoords, pCoords);
+    }
+    else
+    {
+        return isoSurfPtr_->interpolate(cCoords, pCoords);
+    }
+}
+
+
 // ************************************************************************* //
diff --git a/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.H b/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.H
index 8cc31a5bd07..01a3524a05b 100644
--- a/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.H
+++ b/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.H
@@ -87,12 +87,12 @@ class sampledThresholdCellFaces
     public sampledSurface,
     public MeshedSurface<face>
 {
-    //- Private typedefs for convenience
+        //- Private typedefs for convenience
         typedef MeshedSurface<face> MeshStorage;
 
     // Private data
 
-        //- Field to get isoSurface of
+        //- Threshold field
         const word fieldName_;
 
         //- Threshold value
diff --git a/src/sampling/surface/distanceSurface/distanceSurface.C b/src/sampling/surface/distanceSurface/distanceSurface.C
index 2f1c9a511d0..f32caab6ee8 100644
--- a/src/sampling/surface/distanceSurface/distanceSurface.C
+++ b/src/sampling/surface/distanceSurface/distanceSurface.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2016-2018 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2016-2019 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
                             | Copyright (C) 2011-2016 OpenFOAM Foundation
@@ -40,6 +40,48 @@ namespace Foam
 }
 
 
+// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+    static isoSurfaceBase::algorithmType getIsoAlgorithm(const dictionary& dict)
+    {
+        // Previously 'cell' (bool), but now 'isoAlgorithm' (enum)
+
+        // Default (bool) for 1906 and earlier
+        bool useCell = true;
+
+        // Default (enum) after 1906
+        isoSurfaceBase::algorithmType algo = isoSurfaceBase::ALGO_CELL;
+
+        if
+        (
+            !isoSurfaceBase::algorithmNames.readIfPresent
+            (
+                "isoAlgorithm", dict, algo
+            )
+            // When above fails, use 'compat' to also get upgrade messages
+         && dict.readIfPresentCompat
+            (
+                "isoAlgorithm", {{"cell", 1906}}, useCell
+            )
+        )
+        {
+            return
+            (
+                useCell
+              ? isoSurfaceBase::ALGO_CELL
+              : isoSurfaceBase::ALGO_POINT
+            );
+        }
+
+        return algo;
+    }
+
+
+} // End namespace Foam
+
+
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
 Foam::distanceSurface::distanceSurface
@@ -57,7 +99,7 @@ Foam::distanceSurface::distanceSurface
             dict.get<word>("surfaceType"),
             IOobject
             (
-                dict.lookupOrDefault("surfaceName", defaultSurfaceName),
+                dict.getOrDefault("surfaceName", defaultSurfaceName),
                 mesh.time().constant(), // directory
                 "triSurface",           // instance
                 mesh.time(),            // registry
@@ -72,11 +114,12 @@ Foam::distanceSurface::distanceSurface
     (
         distance_ < 0 || equal(distance_, Zero) || dict.get<bool>("signed")
     ),
-    cell_(dict.lookupOrDefault("cell", true)),
-    regularise_(dict.lookupOrDefault("regularise", true)),
-    bounds_(dict.lookupOrDefault("bounds", boundBox::invertedBox)),
+    regularise_(dict.getOrDefault("regularise", true)),
+    isoAlgo_(getIsoAlgorithm(dict)),
+    bounds_(dict.getOrDefault("bounds", boundBox::invertedBox)),
+    isoSurfPtr_(nullptr),
     isoSurfCellPtr_(nullptr),
-    isoSurfPtr_(nullptr)
+    isoSurfTopoPtr_(nullptr)
 {}
 
 
@@ -88,7 +131,7 @@ Foam::distanceSurface::distanceSurface
     const word& surfaceName,
     const scalar distance,
     const bool signedDistance,
-    const bool cell,
+    const isoSurfaceBase::algorithmType algo,
     const bool regularise,
     const boundBox& bounds
 )
@@ -116,11 +159,12 @@ Foam::distanceSurface::distanceSurface
     (
         signedDistance || distance_ < 0 || equal(distance_, Zero)
     ),
-    cell_(cell),
     regularise_(regularise),
+    isoAlgo_(algo),
     bounds_(bounds),
+    isoSurfPtr_(nullptr),
     isoSurfCellPtr_(nullptr),
-    isoSurfPtr_(nullptr)
+    isoSurfTopoPtr_(nullptr)
 {}
 
 
@@ -134,8 +178,9 @@ void Foam::distanceSurface::createGeometry()
     }
 
     // Clear any stored topologies
-    isoSurfCellPtr_.clear();
     isoSurfPtr_.clear();
+    isoSurfCellPtr_.clear();
+    isoSurfTopoPtr_.clear();
 
     const fvMesh& fvm = static_cast<const fvMesh&>(mesh_);
 
@@ -165,7 +210,11 @@ void Foam::distanceSurface::createGeometry()
     // to limit the extent of open edges.
 
     const bool isZeroDist  = equal(distance_, Zero);
-    const bool filterCells = (cell_ && isZeroDist);
+    const bool filterCells =
+    (
+        isZeroDist
+     && isoAlgo_ != isoSurfaceBase::ALGO_POINT
+    );
 
     bitSet ignoreCells;
     if (filterCells)
@@ -209,6 +258,9 @@ void Foam::distanceSurface::createGeometry()
                     cellBb.clear();
                     cellBb.add(fvm.points(), fvm.cellPoints(i));
 
+                    // Expand slightly to catch corners
+                    cellBb.inflate(0.1);
+
                     if (!cellBb.contains(nearest[i].hitPoint()))
                     {
                         ignoreCells.set(i);
@@ -349,7 +401,7 @@ void Foam::distanceSurface::createGeometry()
 
 
     // Direct from cell field and point field.
-    if (cell_)
+    if (isoAlgo_ == isoSurfaceBase::ALGO_CELL)
     {
         isoSurfCellPtr_.reset
         (
@@ -366,6 +418,22 @@ void Foam::distanceSurface::createGeometry()
             )
         );
     }
+    else if (isoAlgo_ == isoSurfaceBase::ALGO_TOPO)
+    {
+        isoSurfTopoPtr_.reset
+        (
+            new isoSurfaceTopo
+            (
+                fvm,
+                cellDistance,
+                pointDistance_,
+                distance_,
+                (regularise_ ? isoSurfaceTopo::DIAGCELL : isoSurfaceTopo::NONE),
+                bounds_,
+                ignoreCells
+            )
+        );
+    }
     else
     {
         isoSurfPtr_.reset
diff --git a/src/sampling/surface/distanceSurface/distanceSurface.H b/src/sampling/surface/distanceSurface/distanceSurface.H
index a534f3b4db5..899e138a8ba 100644
--- a/src/sampling/surface/distanceSurface/distanceSurface.H
+++ b/src/sampling/surface/distanceSurface/distanceSurface.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2016-2018 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2016-2019 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
                             | Copyright (C) 2011-2016 OpenFOAM Foundation
@@ -28,20 +28,20 @@ Class
 
 Description
     A surface defined by a distance from an input searchable surface.
-    Uses an isoSurfaceCell or an isoSurface algorithm for constructing the
+    Uses an iso-surface algorithm (cell, topo, point) for constructing the
     distance surface.
 
 Usage
     Dictionary controls:
     \table
-        Property | Description                             | Required | Default
-        distance | distance from surface                   | yes      |
-        signed   | Use sign when distance is positive      | partly   |
-        cell     | use isoSurfaceCell algorithm            | no       | true
-        regularise | Point snapping for iso-surface        | yes      |
-        bounds   | Limit with bounding box                 | no       |
-        surfaceType | Type of surface                      | yes      |
-        surfaceName | Name of surface in \c triSurface/    | no  | dict name
+        Property | Description                              | Required | Default
+        distance | distance from surface                    | yes |
+        signed   | Use sign when distance is positive       | partly |
+        isoAlgorithm | (cell/topo/point)                    | no  | cell
+        regularise | Point snapping for iso-surface         | no  | true
+        bounds   | Limit with bounding box                  | no  |
+        surfaceType | Type of surface                       | yes |
+        surfaceName | Name of surface in \c triSurface/     | no  | dict name
     \endtable
 
 Note
@@ -53,6 +53,8 @@ Note
       surface. The resulting surface elements will not, however, contain
       partial cell coverage.
 
+    For compatibility, the keyword 'cell' (as a bool) is accepted
+
 SourceFiles
     distanceSurface.C
 
@@ -63,8 +65,9 @@ SourceFiles
 
 #include "sampledSurface.H"
 #include "searchableSurface.H"
-#include "isoSurfaceCell.H"
 #include "isoSurface.H"
+#include "isoSurfaceCell.H"
+#include "isoSurfaceTopo.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -91,12 +94,12 @@ class distanceSurface
         //- Signed distance
         const bool signed_;
 
-        //- Use isoSurfaceCell (true) or isoSurface (false) algorithm
-        const bool cell_;
-
         //- Whether to coarsen iso-surface triangles
         const bool regularise_;
 
+        //- The iso-surface algorithm type
+        const isoSurfaceBase::algorithmType isoAlgo_;
+
         //- Optional bounding box to trim against
         const boundBox bounds_;
 
@@ -106,12 +109,14 @@ class distanceSurface
         //- Distance to points
         scalarField pointDistance_;
 
-        //- Constructed iso surface
-        autoPtr<isoSurfaceCell> isoSurfCellPtr_;
-
-        //- Constructed iso surface
+        //- Constructed iso surface (ALGO_POINT)
         autoPtr<isoSurface> isoSurfPtr_;
 
+        //- Constructed iso surface (ALGO_CELL)
+        autoPtr<isoSurfaceCell> isoSurfCellPtr_;
+
+        //- Constructed iso surface (ALGO_TOPO)
+        autoPtr<isoSurfaceTopo> isoSurfTopoPtr_;
 
 public:
 
@@ -138,7 +143,7 @@ public:
             const word& surfaceName,
             const scalar distance,
             const bool signedDistance,
-            const bool cell,
+            const isoSurfaceBase::algorithmType algo,
             const bool regularise,
             const boundBox& bounds = boundBox::invertedBox
         );
@@ -169,10 +174,14 @@ public:
         //- The underlying surface
         const meshedSurface& surface() const
         {
-            if (cell_)
+            if (isoSurfCellPtr_)
             {
                 return *isoSurfCellPtr_;
             }
+            else if (isoSurfTopoPtr_)
+            {
+                return *isoSurfTopoPtr_;
+            }
             return *isoSurfPtr_;
         }
 
@@ -180,30 +189,42 @@ public:
         //- The underlying surface
         meshedSurface& surface()
         {
-            if (cell_)
+            if (isoSurfCellPtr_)
             {
                 return *isoSurfCellPtr_;
             }
+            else if (isoSurfTopoPtr_)
+            {
+                return *isoSurfTopoPtr_;
+            }
             return *isoSurfPtr_;
         }
 
         //- For each face, the original cell in mesh
         const labelList& meshCells() const
         {
-            if (cell_)
+            if (isoSurfCellPtr_)
             {
                 return isoSurfCellPtr_->meshCells();
             }
+            else if (isoSurfTopoPtr_)
+            {
+                return isoSurfTopoPtr_->meshCells();
+            }
             return isoSurfPtr_->meshCells();
         }
 
         //- For each face, the original cell in mesh
         labelList& meshCells()
         {
-            if (cell_)
+            if (isoSurfCellPtr_)
             {
                 return isoSurfCellPtr_->meshCells();
             }
+            else if (isoSurfTopoPtr_)
+            {
+                return isoSurfTopoPtr_->meshCells();
+            }
             return isoSurfPtr_->meshCells();
         }
 
diff --git a/src/sampling/surface/distanceSurface/distanceSurfaceTemplates.C b/src/sampling/surface/distanceSurface/distanceSurfaceTemplates.C
index 40ebd4fa446..b4a6d2de32f 100644
--- a/src/sampling/surface/distanceSurface/distanceSurfaceTemplates.C
+++ b/src/sampling/surface/distanceSurface/distanceSurfaceTemplates.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2018 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2004-2019 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -35,13 +35,17 @@ Foam::distanceSurface::interpolate
     const Field<Type>& pointValues
 ) const
 {
-    if (cell_)
+    if (isoSurfCellPtr_)
     {
-        return isoSurfCellPtr_().interpolate(cellValues, pointValues);
+        return isoSurfCellPtr_->interpolate(cellValues, pointValues);
+    }
+    else if (isoSurfTopoPtr_)
+    {
+        return isoSurfTopoPtr_->interpolate(cellValues, pointValues);
     }
     else
     {
-        return isoSurfPtr_().interpolate(cellValues, pointValues);
+        return isoSurfPtr_->interpolate(cellValues, pointValues);
     }
 }
 
diff --git a/src/sampling/surface/isoSurface/isoSurface.C b/src/sampling/surface/isoSurface/isoSurface.C
index e1a8eb0dd4f..9b213fa7996 100644
--- a/src/sampling/surface/isoSurface/isoSurface.C
+++ b/src/sampling/surface/isoSurface/isoSurface.C
@@ -1344,12 +1344,10 @@ Foam::isoSurface::isoSurface
     const scalar mergeTol
 )
 :
-    MeshStorage(),
+    isoSurfaceBase(iso, bounds),
     mesh_(cellValues.mesh()),
     pVals_(pointValues),
-    iso_(iso),
     regularise_(regularise),
-    bounds_(bounds),
     mergeDistance_(mergeTol*mesh_.bounds().mag())
 {
     if (debug)
diff --git a/src/sampling/surface/isoSurface/isoSurface.H b/src/sampling/surface/isoSurface/isoSurface.H
index 164163d693e..336aad5780e 100644
--- a/src/sampling/surface/isoSurface/isoSurface.H
+++ b/src/sampling/surface/isoSurface/isoSurface.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2016-2018 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2016-2019 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
                             | Copyright (C) 2011-2016 OpenFOAM Foundation
@@ -68,8 +68,7 @@ SourceFiles
 #include "bitSet.H"
 #include "volFields.H"
 #include "slicedVolFields.H"
-#include "MeshedSurface.H"
-#include "MeshedSurfacesFwd.H"
+#include "isoSurfaceBase.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -89,12 +88,8 @@ class triSurface;
 
 class isoSurface
 :
-    public meshedSurface
+    public isoSurfaceBase
 {
-    // Private typedefs for convenience
-    typedef meshedSurface MeshStorage;
-
-
     // Private data
 
         enum segmentCutType
@@ -120,15 +115,9 @@ class isoSurface
         //- Input volScalarField with separated coupled patches rewritten
         autoPtr<slicedVolScalarField> cValsPtr_;
 
-        //- Isosurface value
-        const scalar iso_;
-
         //- Regularise?
         const bool regularise_;
 
-        //- Optional bounds
-        const boundBox bounds_;
-
         //- When to merge points
         const scalar mergeDistance_;
 
@@ -141,9 +130,6 @@ class isoSurface
         //- Estimated number of cut cells
         label nCutCells_;
 
-        //- For every triangle the original cell in mesh
-        labelList meshCells_;
-
         //- For every unmerged triangle point the point in the triSurface
         labelList triPointMergeMap_;
 
@@ -395,8 +381,9 @@ class isoSurface
 
 public:
 
-    //- Declare friendship with isoSurfaceCell to share some functionality
+    //- Declare friendship to share some functionality
     friend class isoSurfaceCell;
+    friend class isoSurfaceTopo;
 
 
     //- Runtime type information
@@ -424,19 +411,6 @@ public:
 
     // Member Functions
 
-        //- For each face, the original cell in mesh
-        const labelList& meshCells() const
-        {
-            return meshCells_;
-        }
-
-        //- For each face, the original cell in mesh
-        labelList& meshCells()
-        {
-            return meshCells_;
-        }
-
-
         //- Interpolates cCoords, pCoords.
         //  Uses the references to the original fields used to create the
         //  iso surface.
diff --git a/src/sampling/surface/isoSurface/isoSurfaceBase.C b/src/sampling/surface/isoSurface/isoSurfaceBase.C
new file mode 100644
index 00000000000..8552fe1ad34
--- /dev/null
+++ b/src/sampling/surface/isoSurface/isoSurfaceBase.C
@@ -0,0 +1,56 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2019 OpenCFD Ltd.
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+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 "isoSurfaceBase.H"
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+const Foam::Enum
+<
+    Foam::isoSurfaceBase::algorithmType
+>
+Foam::isoSurfaceBase::algorithmNames
+({
+    { algorithmType::ALGO_CELL, "cell" },
+    { algorithmType::ALGO_TOPO, "topo" },
+    { algorithmType::ALGO_POINT, "point" },
+});
+
+
+// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
+
+Foam::isoSurfaceBase::isoSurfaceBase
+(
+    const scalar iso,
+    const boundBox& bounds
+)
+:
+    meshedSurface(),
+    iso_(iso),
+    bounds_(bounds)
+{}
+
+
+// ************************************************************************* //
diff --git a/src/sampling/surface/isoSurface/isoSurfaceBase.H b/src/sampling/surface/isoSurface/isoSurfaceBase.H
new file mode 100644
index 00000000000..f919f38ab4a
--- /dev/null
+++ b/src/sampling/surface/isoSurface/isoSurfaceBase.H
@@ -0,0 +1,129 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2019 OpenCFD Ltd.
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+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::isoSurfaceBase
+
+Description
+    Low-level components common to various iso-surface algorithms.
+
+SourceFiles
+    isoSurfaceBase.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef isoSurfaceBase_H
+#define isoSurfaceBase_H
+
+#include "scalar.H"
+#include "Enum.H"
+#include "boundBox.H"
+#include "MeshedSurface.H"
+#include "MeshedSurfacesFwd.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+/*---------------------------------------------------------------------------*\
+                       Class isoSurfaceBase Declaration
+\*---------------------------------------------------------------------------*/
+
+class isoSurfaceBase
+:
+    public meshedSurface
+{
+protected:
+
+    // Protected typedefs for convenience
+    typedef meshedSurface MeshStorage;
+
+    // Protected Data
+
+        //- Iso value
+        const scalar iso_;
+
+        //- Optional bounds
+        const boundBox bounds_;
+
+        //- For every face, the original cell in mesh
+        labelList meshCells_;
+
+
+public:
+
+    //- The algorithm types
+    enum algorithmType : uint8_t
+    {
+        ALGO_POINT,
+        ALGO_CELL,
+        ALGO_TOPO
+    };
+
+
+    // Public Data
+
+        //- Names for the iso-surface algorithms
+        static const Enum<algorithmType> algorithmNames;
+
+
+    //- Construct with iso value
+    explicit isoSurfaceBase
+    (
+        const scalar iso,
+        const boundBox& bounds = boundBox::invertedBox
+    );
+
+
+    // Member Functions
+
+        //- The iso-value associated with the surface
+        inline scalar isoValue() const
+        {
+            return iso_;
+        }
+
+        //- For each face, the original cell in mesh
+        const labelList& meshCells() const
+        {
+            return meshCells_;
+        }
+
+        //- For each face, the original cell in mesh
+        labelList& meshCells()
+        {
+            return meshCells_;
+        }
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/sampling/surface/isoSurface/isoSurfaceCell.C b/src/sampling/surface/isoSurface/isoSurfaceCell.C
index 64ac1d03644..80676558169 100644
--- a/src/sampling/surface/isoSurface/isoSurfaceCell.C
+++ b/src/sampling/surface/isoSurface/isoSurfaceCell.C
@@ -36,7 +36,6 @@ License
 #include "triSurfaceTools.H"
 #include "Time.H"
 #include "triPoints.H"
-#include "addToRunTimeSelectionTable.H"
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
@@ -1291,12 +1290,10 @@ Foam::isoSurfaceCell::isoSurfaceCell
     const bitSet& ignoreCells
 )
 :
-    MeshStorage(),
+    isoSurfaceBase(iso, bounds),
     mesh_(mesh),
     cVals_(cellValues),
     pVals_(pointValues),
-    iso_(iso),
-    bounds_(bounds),
     ignoreCells_(ignoreCells),
     mergeDistance_(mergeTol*mesh.bounds().mag())
 {
diff --git a/src/sampling/surface/isoSurface/isoSurfaceCell.H b/src/sampling/surface/isoSurface/isoSurfaceCell.H
index e59af0ece9f..93995ff6a0f 100644
--- a/src/sampling/surface/isoSurface/isoSurfaceCell.H
+++ b/src/sampling/surface/isoSurface/isoSurfaceCell.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2016-2017 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2016-2019 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
                             | Copyright (C) 2011-2016 OpenFOAM Foundation
@@ -50,9 +50,7 @@ SourceFiles
 #include "labelPair.H"
 #include "pointIndexHit.H"
 #include "bitSet.H"
-#include "boundBox.H"
-#include "MeshedSurface.H"
-#include "MeshedSurfacesFwd.H"
+#include "isoSurfaceBase.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -70,12 +68,8 @@ class triSurface;
 
 class isoSurfaceCell
 :
-    public meshedSurface
+    public isoSurfaceBase
 {
-    // Private typedefs for convenience
-    typedef meshedSurface MeshStorage;
-
-
     // Private data
 
         enum segmentCutType
@@ -100,13 +94,7 @@ class isoSurfaceCell
 
         const scalarField& pVals_;
 
-        //- isoSurfaceCell value
-        const scalar iso_;
-
-        //- Optional bounds
-        const boundBox bounds_;
-
-        //- Optional cells to ignore.
+        //- Optional cells to ignore
         const bitSet& ignoreCells_;
 
         //- When to merge points
@@ -118,9 +106,6 @@ class isoSurfaceCell
         //- Estimated number of cut cells
         label nCutCells_;
 
-        //- For every triangle the original cell in mesh
-        labelList meshCells_;
-
         //- For every unmerged triangle point the point in the triSurface
         labelList triPointMergeMap_;
 
@@ -349,19 +334,6 @@ public:
 
     // Member Functions
 
-        //- For each face, the original cell in mesh
-        const labelList& meshCells() const
-        {
-            return meshCells_;
-        }
-
-        //- For each face, the original cell in mesh
-        labelList& meshCells()
-        {
-            return meshCells_;
-        }
-
-
         //- Interpolates cCoords, pCoords.
         template<class Type>
         tmp<Field<Type>> interpolate
diff --git a/src/sampling/surface/isoSurface/isoSurfaceTopo.C b/src/sampling/surface/isoSurface/isoSurfaceTopo.C
index 283e924f9c3..bf964ef8405 100644
--- a/src/sampling/surface/isoSurface/isoSurfaceTopo.C
+++ b/src/sampling/surface/isoSurface/isoSurfaceTopo.C
@@ -26,6 +26,7 @@ License
 \*---------------------------------------------------------------------------*/
 
 #include "isoSurfaceTopo.H"
+#include "isoSurface.H"
 #include "polyMesh.H"
 #include "tetMatcher.H"
 #include "tetPointRef.H"
@@ -63,6 +64,11 @@ Foam::isoSurfaceTopo::cellCutType Foam::isoSurfaceTopo::calcCutType
     const label celli
 ) const
 {
+    if (ignoreCells_.test(celli))
+    {
+        return NOTCUT;
+    }
+
     const cell& cFaces = mesh_.cells()[celli];
 
     if (isTet)
@@ -1154,17 +1160,32 @@ Foam::isoSurfaceTopo::isoSurfaceTopo
     const scalarField& cVals,
     const scalarField& pVals,
     const scalar iso,
-    const filterType filter
+    const filterType filter,
+    const boundBox& bounds,
+    const bitSet& ignoreCells
 )
 :
+    isoSurfaceBase(iso, bounds),
     mesh_(mesh),
     cVals_(cVals),
     pVals_(pVals),
-    iso_(iso)
+    ignoreCells_(ignoreCells)
 {
     if (debug)
     {
-        Pout<< "isoSurfaceTopo : iso:" << iso_ << " filter:" << filter << endl;
+        Pout<< "isoSurfaceTopo::"
+            << "    cell min/max  : "
+            << min(cVals_) << " / "
+            << max(cVals_) << nl
+            << "    point min/max : "
+            << min(pVals_) << " / "
+            << max(pVals_) << nl
+            << "    isoValue      : " << iso << nl
+            << "    filter        : " << filter << nl
+            << "    mesh span     : " << mesh.bounds().mag() << nl
+            << "    ignoreCells   : " << ignoreCells_.count()
+            << " / " << cVals_.size() << nl
+            << endl;
     }
 
     fixTetBasePtIs();
@@ -1314,8 +1335,11 @@ Foam::isoSurfaceTopo::isoSurfaceTopo
         }
 
 
-        if (filter == DIAGCELL)
+        if (filter == DIAGCELL && ignoreCells_.empty())
         {
+            // Note that the following only works without cell subsets
+            // thus we skip this when ignoreCells_ is non-empty
+
             // We remove verts on face diagonals. This is in fact just
             // straightening the edges of the face through the cell. This can
             // close off 'pockets' of triangles and create open or
@@ -1324,10 +1348,9 @@ Foam::isoSurfaceTopo::isoSurfaceTopo
             // Solved by eroding open-edges
             // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-
             // Mark points on mesh outside. Note that we extend with nCells
             // so we can easily index with pointToVerts_.
-            PackedBoolList isBoundaryPoint(mesh.nPoints() + mesh.nCells());
+            bitSet isBoundaryPoint(mesh.nPoints() + mesh.nCells());
             for
             (
                 label facei = mesh.nInternalFaces();
@@ -1343,7 +1366,7 @@ Foam::isoSurfaceTopo::isoSurfaceTopo
             {
                 const labelList& mp = meshPoints();
 
-                PackedBoolList removeFace(this->size());
+                bitSet removeFace(this->size());
                 label nFaces = 0;
                 {
                     const labelListList& edgeFaces =
diff --git a/src/sampling/surface/isoSurface/isoSurfaceTopo.H b/src/sampling/surface/isoSurface/isoSurfaceTopo.H
index 29ae7533fd2..ae5eedd2689 100644
--- a/src/sampling/surface/isoSurface/isoSurfaceTopo.H
+++ b/src/sampling/surface/isoSurface/isoSurfaceTopo.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           |
+    \\  /    A nd           | Copyright (C) 2019 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
                             | Copyright (C) 2011-2019 OpenFOAM Foundation
@@ -39,10 +39,9 @@ SourceFiles
 #define isoSurfaceTopo_H
 
 #include "labelPair.H"
-#include "pointIndexHit.H"
-#include "PackedBoolList.H"
-#include "MeshedSurface.H"
+#include "bitSet.H"
 #include "edgeList.H"
+#include "isoSurfaceBase.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -58,11 +57,8 @@ class tetMatcher;
 
 class isoSurfaceTopo
 :
-    public MeshedSurface<face>
+    public isoSurfaceBase
 {
-    // Private typedefs for convenience
-    typedef MeshedSurface<face> MeshStorage;
-
 public:
 
         enum filterType
@@ -80,9 +76,9 @@ private:
 
         enum cellCutType
         {
-            NOTCUT,     // Not cut
-            SPHERE,     // All edges to cell centre cut
-            CUT         // Normal cut
+            NOTCUT,     //!< Not cut
+            SPHERE,     //!< All edges to cell centre cut
+            CUT         //!< Normal cut
         };
 
 
@@ -93,8 +89,8 @@ private:
 
         const scalarField& pVals_;
 
-        //- Iso value
-        const scalar iso_;
+        //- Optional cells to ignore
+        const bitSet& ignoreCells_;
 
         //- Corrected version of tetBasePtIs
         labelList tetBasePtIs_;
@@ -102,9 +98,6 @@ private:
         //- Per point: originating mesh vertex/cc. See encoding above
         edgeList pointToVerts_;
 
-        //- For every face the original cell in mesh
-        labelList meshCells_;
-
         //- For every point the originating face in mesh
         labelList pointToFace_;
 
@@ -134,6 +127,7 @@ private:
         ) const;
 
         //- Determine for all mesh whether cell is cut
+        //  \return number of cells cut
         label calcCutTypes
         (
             tetMatcher& tet,
@@ -227,18 +221,14 @@ public:
             const scalarField& cellValues,
             const scalarField& pointValues,
             const scalar iso,
-            const filterType filter = DIAGCELL
+            const filterType filter = DIAGCELL,
+            const boundBox& bounds = boundBox::invertedBox,
+            const bitSet& ignoreCells = bitSet()
         );
 
 
     // Member Functions
 
-        //- For every face original cell in mesh
-        const labelList& meshCells() const
-        {
-            return meshCells_;
-        }
-
         //- For every point originating face (pyramid) in mesh
         const labelList& pointToFace() const
         {
-- 
GitLab