diff --git a/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappyRefineDriver.C b/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappyRefineDriver.C index 15fe6edf80ec62a2ff039b81d1d69e20ff154ec7..77dbedcecc347ddeab09ca3ba2ffe067e558dd96 100644 --- a/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappyRefineDriver.C +++ b/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappyRefineDriver.C @@ -1586,6 +1586,8 @@ Foam::label Foam::snappyRefineDriver::directionalShellRefine labelList& cellLevel = const_cast<labelIOList&>(meshRefiner_.meshCutter().cellLevel()); + labelList& pointLevel = + const_cast<labelIOList&>(meshRefiner_.meshCutter().pointLevel()); // Determine the minimum and maximum cell levels that are candidates for @@ -1705,6 +1707,17 @@ Foam::label Foam::snappyRefineDriver::directionalShellRefine dirCellLevel ); + // Note: edges will have been split. The points might have + // inherited pointLevel from either side of the edge which + // might not be the same for coupled edges so sync + syncTools::syncPointList + ( + mesh, + pointLevel, + maxEqOp<label>(), + labelMin + ); + forAll(map().cellMap(), celli) { if (isRefineCell[map().cellMap()[celli]]) @@ -1712,6 +1725,18 @@ Foam::label Foam::snappyRefineDriver::directionalShellRefine dirCellLevel[celli][dir]++; } } + + // Do something with the pointLevel. See discussion about the + // cellLevel. Do we keep min/max ? + forAll(map().pointMap(), pointi) + { + label oldPointi = map().pointMap()[pointi]; + if (map().reversePointMap()[oldPointi] != pointi) + { + // Is added point (splitting an edge) + pointLevel[pointi]++; + } + } } } diff --git a/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappyRefineDriver.H b/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappyRefineDriver.H index dc0936ae48a41bac7431a8d2442c7cb126cce05c..3ac28db62b0cbaab5e9625e00947988ca0b41f87 100644 --- a/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappyRefineDriver.H +++ b/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappyRefineDriver.H @@ -146,26 +146,6 @@ class snappyRefineDriver // Directional refinement - //- Calculate direction of face (using geometry) - List<direction> faceDirection() const; - - //- Check if level across (directed) face obeys 2:1 - label faceConsistentRefinement - ( - const PackedBoolList& isDirFace, - const List<labelVector>& dirCellLevel, - const direction dir, - const bool maxSet, - PackedBoolList& refineCell - ) const; - //- Make sure 2:1 refinement in given direction - labelList consistentDirectionalRefinement - ( - const direction dir, - const List<labelVector>& dirCellLevel, - const labelUList& candidateCells, - const bool maxSet - ) const; //- Refine (directional) all cells inside/outside shell label directionalShellRefine (