From 9e34a1e234dbe678749837c73e3c12e08cc3ebb7 Mon Sep 17 00:00:00 2001 From: Vuko Vukcevic Date: Fri, 12 Jan 2018 15:59:24 +0100 Subject: [PATCH] Updates to polyhedralRefinement.? --- .../polyhedralRefinement.C | 3832 +++++++++++++++-- .../polyhedralRefinement.H | 142 +- 2 files changed, 3604 insertions(+), 370 deletions(-) diff --git a/src/dynamicMesh/dynamicMesh/polyMeshModifiers/polyhedralRefinement/polyhedralRefinement.C b/src/dynamicMesh/dynamicMesh/polyMeshModifiers/polyhedralRefinement/polyhedralRefinement.C index e15066faa..a2345579c 100644 --- a/src/dynamicMesh/dynamicMesh/polyMeshModifiers/polyhedralRefinement/polyhedralRefinement.C +++ b/src/dynamicMesh/dynamicMesh/polyMeshModifiers/polyhedralRefinement/polyhedralRefinement.C @@ -21,12 +21,16 @@ License You should have received a copy of the GNU General Public License along with foam-extend. If not, see . -Description - Cell layer addition/removal mesh modifier +Author + Vuko Vukcevic, Wikki Ltd. All rights reserved. + +Notes + Generalisation of hexRef8 for polyhedral cells and refactorisation into mesh + modifier engine. \*---------------------------------------------------------------------------*/ -#include "layerAdditionRemoval.H" +#include "polyhedralRefinement.H" #include "polyTopoChanger.H" #include "polyMesh.H" #include "foamTime.H" @@ -38,128 +42,3196 @@ Description namespace Foam { - defineTypeNameAndDebug(layerAdditionRemoval, 0); + defineTypeNameAndDebug(polyhedralRefinement, 0); addToRunTimeSelectionTable ( polyMeshModifier, - layerAdditionRemoval, + polyhedralRefinement, dictionary ); } -const Foam::scalar Foam::layerAdditionRemoval::addDelta_ = 0.3; -const Foam::scalar Foam::layerAdditionRemoval::removeDelta_ = 0.1; - - // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -void Foam::layerAdditionRemoval::checkDefinition() +void Foam::polyhedralRefinement::setFaceInfo +( + const label faceI, + label& patchID, + label& zoneID, + label& zoneFlip +) const { - if (!faceZoneID_.active()) + patchID = -1; + + if (!mesh_.isInternalFace(faceI)) { - FatalErrorIn - ( - "void Foam::layerAdditionRemoval::checkDefinition()" - ) << "Master face zone named " << faceZoneID_.name() - << " cannot be found." + patchID = mesh_.boundaryMesh().whichPatch(faceI); + } + + zoneID = mesh_.faceZones().whichZone(faceI); + + zoneFlip = false; + + if (zoneID > -1) + { + const faceZone& fZone = mesh_.faceZones()[zoneID]; + + zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)]; + } +} + + +Foam::label Foam::polyhedralRefinement::getAnchorLevel +( + const label faceI +) const +{ + const face& f = mesh_.faces()[faceI]; + + if (f.size() <= 3) + { + return pointLevel_[f[findMinMaxLevel(f, maxOp