From 916d0a0624cddca40f41202908815a67103de344 Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Fri, 12 Jul 2019 10:36:37 +0100 Subject: [PATCH] isoSurface: Additional fixes for isoSurface 'eroding' surfaces down to nothing This is a slight rework of commit c81abfef. Instead of adapting tet base points cell-by-cell, the dangling points are pre-computed and then the adaptations to the base points are made face-by-face. This correctly adapts faces which have different dangling points relative to the owner and neighbour cells. --- .../sampledSurface/isoSurface/isoSurface.C | 152 ++++++++---------- 1 file changed, 71 insertions(+), 81 deletions(-) diff --git a/src/sampling/sampledSurface/isoSurface/isoSurface.C b/src/sampling/sampledSurface/isoSurface/isoSurface.C index 67cd7aebc7..5f1fbdc24b 100644 --- a/src/sampling/sampledSurface/isoSurface/isoSurface.C +++ b/src/sampling/sampledSurface/isoSurface/isoSurface.C @@ -108,13 +108,7 @@ Foam::isoSurface::cellCutType Foam::isoSurface::calcCutType break; } - label fp0 = tetBasePtIs_[facei]; - - // Fall back for problem decompositions - if (fp0 < 0) - { - fp0 = 0; - } + const label fp0 = tetBasePtIs_[facei] < 0 ? 0 : tetBasePtIs_[facei]; label fp = f.fcIndex(fp0); for (label i = 2; i < f.size(); i++) @@ -247,37 +241,31 @@ void Foam::isoSurface::fixTetBasePtIs() tetBasePtIs_ = mesh_.tetBasePtIs(); - // Pre-filter: mark all cells with illegal base points - labelHashSet problemCells(cells.size()/128); + // Mark all cells with illegal base points as potentially problematic + PackedBoolList problemCells(cells.size(), false); forAll(tetBasePtIs_, facei) { if (tetBasePtIs_[facei] == -1) { - problemCells.insert(faceOwner[facei]); + problemCells[faceOwner[facei]] = true; if (mesh_.isInternalFace(facei)) { - problemCells.insert(faceNeighbour[facei]); + problemCells[faceNeighbour[facei]] = true; } } } - label nAdapted = 0; - - - // Number of times a point occurs in a cell. Used to detect dangling - // vertices (count = 2) - Map