diff --git a/src/mesh/snappyHexMesh/meshRefinement/meshRefinementRefine.C b/src/mesh/snappyHexMesh/meshRefinement/meshRefinementRefine.C index f4cf25096b..312cfa7df3 100644 --- a/src/mesh/snappyHexMesh/meshRefinement/meshRefinementRefine.C +++ b/src/mesh/snappyHexMesh/meshRefinement/meshRefinementRefine.C @@ -1109,7 +1109,6 @@ Foam::label Foam::meshRefinement::countMatches } -//XXXXXX //bool Foam::meshRefinement::highCurvature //( // const scalar minCosAngle, @@ -1143,7 +1142,7 @@ bool Foam::meshRefinement::highCurvature // Co-planar return false; } - else + else if (lengthScale > SMALL) { // Calculate radius of curvature @@ -1170,6 +1169,10 @@ bool Foam::meshRefinement::highCurvature return false; } } + else + { + return false; + } } //XXXXX @@ -1249,6 +1252,10 @@ Foam::label Foam::meshRefinement::markSurfaceCurvatureRefinement } + // If no curvature supplied behave as before + const bool hasCurvatureLevels = (max(surfaces_.maxCurvatureLevel()) > 0); + + // Test for all intersections (with surfaces of higher max level than // minLevel) and cache per cell the interesting inter labelListList cellSurfLevels(mesh_.nCells()); @@ -1296,6 +1303,69 @@ Foam::label Foam::meshRefinement::markSurfaceCurvatureRefinement pLevel = labelUIndList(pLevel, visitOrder); } + + //- At some point could just return the intersected surface+region + // and derive all the surface information (maxLevel, curvatureLevel) + // from that - we're now doing it inside refinementSurfaces itself. + //// Per segment the surfaces hit + //List hitSurface; + //List hitLocation; + //List hitRegion; + //List hitNormal; + //surfaces_.findAllIntersections + //( + // identity(surfaces_.surfaces()), // all refinement geometries + // start, + // end, + // + // hitSurface, + // hitLocation, + // hitRegion, + // hitNormal + //); + // + //// Filter out levels. minLevel = (mesh) cellLevel (on inbetween face). + //// Ignore any surface with higher level + //const auto& maxLevel = surfaces_.maxLevel(); + //labelList visitOrder; + //DynamicList