diff --git a/src/sampling/Make/files b/src/sampling/Make/files index 7d3665f9a4..5e6a2e2ac6 100644 --- a/src/sampling/Make/files +++ b/src/sampling/Make/files @@ -21,7 +21,7 @@ sampledSet/shortestPath/shortestPathSet.C surface/cutting/cuttingPlane.C surface/cutting/cuttingPlaneCuts.C -surface/cutting/cuttingPlaneWalk.C +surface/cutting/cuttingSurfaceBase.C surface/distanceSurface/distanceSurface.C surface/isoSurface/isoSurface.C surface/isoSurface/isoSurfaceCell.C diff --git a/src/sampling/surface/cutting/cuttingPlane.C b/src/sampling/surface/cutting/cuttingPlane.C index 46f41212d9..30d6e29fe7 100644 --- a/src/sampling/surface/cutting/cuttingPlane.C +++ b/src/sampling/surface/cutting/cuttingPlane.C @@ -25,11 +25,6 @@ License #include "cuttingPlane.H" -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -int Foam::cuttingPlane::debug(Foam::debug::debugSwitch("cuttingPlane", 0)); - - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::cuttingPlane::cuttingPlane(const plane& pln) @@ -89,6 +84,9 @@ void Foam::cuttingPlane::performCut bitSet&& cellIdLabels ) { + const plane& pln = *this; + const pointField& pts = mesh.points(); + MeshStorage::clear(); meshCells_.clear(); @@ -107,57 +105,40 @@ void Foam::cuttingPlane::performCut // - some ambiguity when plane is exactly between cells const label nFaceCuts = calcCellCuts(mesh, sides, cellCuts); - // Find closed loop from cell cuts - walkCellCuts(mesh, cellCuts, sides, triangulate, nFaceCuts); -} + // Walk cell cuts to create faces -void Foam::cuttingPlane::performCut -( - const primitiveMesh& mesh, - const bool triangulate, - const bitSet& cellIdLabels -) -{ - bitSet subsetCells(cellIdLabels); - - performCut(mesh, triangulate, std::move(subsetCells)); -} - - -void Foam::cuttingPlane::performCut -( - const primitiveMesh& mesh, - const bool triangulate, - const labelUList& cellIdLabels -) -{ - bitSet subsetCells; - - if (notNull(cellIdLabels)) - { - // Pre-populate with restriction - subsetCells.resize(mesh.nCells()); - subsetCells.set(cellIdLabels); - } - - performCut(mesh, triangulate, std::move(subsetCells)); -} - - -void Foam::cuttingPlane::remapFaces(const labelUList& faceMap) -{ - if (notNull(faceMap) && !faceMap.empty()) - { - MeshStorage::remapFaces(faceMap); - - List