From 3ebae288963939e7ae84b05128b661792bd8c589 Mon Sep 17 00:00:00 2001 From: Vuko Vukcevic Date: Fri, 8 Sep 2017 15:07:53 +0200 Subject: [PATCH] Generalisation of polyRef::getAnchorLevel The function now returns the correct anchor level for arbitrary polygonal faces, i.e. there is no assumption that the face comes from possibly spit hex cell. --- .../directTopoChange/directActions/polyRef.C | 37 +------------------ .../directTopoChange/directActions/polyRef.H | 4 +- 2 files changed, 5 insertions(+), 36 deletions(-) diff --git a/src/dynamicMesh/dynamicMesh/directTopoChange/directTopoChange/directActions/polyRef.C b/src/dynamicMesh/dynamicMesh/directTopoChange/directTopoChange/directActions/polyRef.C index 9c38356ce..4f8e2e89c 100644 --- a/src/dynamicMesh/dynamicMesh/directTopoChange/directTopoChange/directActions/polyRef.C +++ b/src/dynamicMesh/dynamicMesh/directTopoChange/directTopoChange/directActions/polyRef.C @@ -799,39 +799,6 @@ Foam::label Foam::polyRef::getAnchorLevel(const label faceI) const } } } - - if (debug) - { - // Print out number of points per level - Info<< "nPointsPerLevel: " << nPointsPerLevel << endl; - } - - // Find level with maximum number of points - const label maxLevelI = findMax(nPointsPerLevel); - - // Check whether there are at least three points with the level <= of this - // level with maximum number of occurences - label nPointsBelow = 0; - for (label belowLevelI = 0; belowLevelI <= maxLevelI; ++belowLevelI) - { - nPointsBelow += nPointsPerLevel[belowLevelI]; - } - - if (nPointsBelow < 3) - { - // For some reason, the minimum requirement that at least three points - // have level below the anchor level is not met - WarningIn("label polyRef::getAnchorLevel(const label faceI) const") - << "Found less than three points below an anchor level." - << nl - << "Face: " << faceI - << ", anchor level: " << allLevels[maxLevelI] - << ", n points below level: " << nPointsBelow - << ", n total points of this face: " << nPoints - << endl; - } - - return allLevels[maxLevelI]; } @@ -3842,8 +3809,8 @@ Foam::labelListList Foam::polyRef::setRefinement // Unsplit face that hasn't been handled. Add edge splits to // face. - const face& f = meshFaces[faceI]; - const labelList& fEdges = meshFaceEdges[faceI]; + const face& f = mesh_.faces()[faceI]; + const labelList& fEdges = mesh_.faceEdges()[faceI]; dynamicLabelList newFaceVerts(f.size()); diff --git a/src/dynamicMesh/dynamicMesh/directTopoChange/directTopoChange/directActions/polyRef.H b/src/dynamicMesh/dynamicMesh/directTopoChange/directTopoChange/directActions/polyRef.H index 5f5fd7574..73e97cb02 100644 --- a/src/dynamicMesh/dynamicMesh/directTopoChange/directTopoChange/directActions/polyRef.H +++ b/src/dynamicMesh/dynamicMesh/directTopoChange/directTopoChange/directActions/polyRef.H @@ -385,7 +385,9 @@ public: } // Refinement - //- Gets level such that the face has four points <= level. + + //- Gets level such that the face has n points <= level, where n is + // the number of points (or edges) for a face. label getAnchorLevel(const label faceI) const; //- Helper: get points of a cell without using cellPoints addressing