39 #ifndef snappyLayerDriver_H 40 #define snappyLayerDriver_H 54 class addPatchCellLayer;
56 class layerParameters;
57 class externalDisplacementMeshMover;
107 meshRefinement& meshRefiner_;
124 static void dumpDisplacement
129 const List<extrudeMode>&
133 static tmp<scalarField> avgPointData
141 static void checkManifold
144 pointSet& nonManifoldPoints
148 void checkMeshManifold()
const;
154 static bool unmarkExtrusion
156 const label patchPointi,
159 List<extrudeMode>& extrudeStatus
163 static bool unmarkExtrusion
165 const face& localFace,
168 List<extrudeMode>& extrudeStatus
172 static label constrainFp(
const label sz,
const label fp);
175 void countCommonPoints
184 bool checkCommonOrder
193 void checkCommonOrder
197 const Map<label>& nCommonPoints,
200 List<extrudeMode>& extrudeStatus
205 void handleNonStringConnected
210 List<extrudeMode>& extrudeStatus
214 void handleNonManifolds
221 List<extrudeMode>& extrudeStatus
226 void handleFeatureAngle
230 const scalar minAngle,
233 List<extrudeMode>& extrudeStatus
237 void handleWarpedFaces
240 const scalar faceRatio,
242 const scalar edge0Len,
246 List<extrudeMode>& extrudeStatus
251 static void setNumLayers
253 meshRefinement& meshRefiner,
259 List<extrudeMode>& extrudeStatus,
260 label& nIdealAddedCells
265 label setPointNumLayers
267 const layerParameters& layerParams,
278 autoPtr<externalDisplacementMeshMover> makeMeshMover
280 const layerParameters& layerParams,
281 const dictionary& motionDict,
289 const mapPolyMesh& map,
290 autoPtr<indirectPrimitivePatch>&
pp,
302 static tmp<pointVectorField> makeLayerDisplacementField
304 const pointMesh& pMesh,
314 List<extrudeMode>& extrudeStatus
319 void mergeFaceZonePoints
332 void calculateLayerThickness
336 const layerParameters& layerParams,
339 const scalar edge0Len,
350 static void syncPatchDisplacement
357 List<extrudeMode>& extrudeStatus
361 void getPatchDisplacement
370 List<extrudeMode>& extrudeStatus
374 bool sameEdgeNeighbour
377 const label myGlobalFacei,
378 const label nbrGlobFacei,
389 const label myGlobFacei,
390 const label nbrGlobFacei,
399 label truncateDisplacement
401 const globalIndex& globalFaces,
405 const faceSet& illegalPatchFaces,
408 List<extrudeMode>& extrudeStatus
417 void setupLayerInfoTruncation
421 const List<extrudeMode>& extrudeStatus,
422 const label nBufferCellsNoExtrude,
428 static bool cellsUseFace
430 const polyMesh&
mesh,
438 static label checkAndUnmark
440 const addPatchCellLayer& addLayer,
441 const dictionary& motionDict,
442 const bool additionalReporting,
443 const List<labelPair>& baffles,
449 List<extrudeMode>& extrudeStatus
453 static label countExtrusion
456 const List<extrudeMode>& extrudeStatus
460 static List<labelPair> getBafflesOnAddedMesh
462 const polyMesh&
mesh,
464 const List<labelPair>& baffles
469 static void getLayerCellsFaces
472 const addPatchCellLayer&,
487 const layerParameters& layerParams
516 static void averageNeighbours
518 const polyMesh&
mesh,
519 const bitSet& isMasterEdge,
524 const Field<Type>& data,
531 const bitSet& isMasterEdge,
541 const motionSmoother& meshMover,
542 const bitSet& isMasterPoint,
543 const bitSet& isMasterEdge,
546 const label nSmoothDisp,
551 void smoothPatchNormals
553 const motionSmoother& meshMover,
554 const bitSet& isMasterPoint,
555 const bitSet& isMasterEdge,
557 const label nSmoothDisp,
564 const label nSmoothDisp,
565 const bitSet& isMasterPoint,
566 const bitSet& isMasterEdge,
573 void handleFeatureAngleLayerTerminations
576 const bitSet& isMasterPoint,
580 List<extrudeMode>& extrudeStatus,
589 void findIsolatedRegions
591 const scalar minCosLayerTermination,
592 const bitSet& isMasterPoint,
593 const bitSet& isMasterEdge,
598 List<extrudeMode>& extrudeStatus,
605 snappyLayerDriver(
const snappyLayerDriver&) =
delete;
608 void operator=(
const snappyLayerDriver&) =
delete;
621 meshRefinement& meshRefiner,
624 const bool dryRun =
false 633 const layerParameters& layerParams,
634 const dictionary& motionDict,
640 const layerParameters& layerParams,
641 const label nLayerIter,
643 const dictionary& motionDict,
644 const label nRelaxedIter,
645 const label nAllowableErrors,
649 const List<labelPair>& baffles,
651 const label nIdealTotAddedCells,
653 const globalIndex& globalFaces,
665 List<extrudeMode>& extrudeStatus,
666 polyTopoChange& savedMeshMod,
674 const layerParameters& layerParams,
675 const dictionary& motionDict,
677 const label nAllowableErrors,
678 decompositionMethod& decomposer,
679 fvMeshDistribute& distributor
685 const layerParameters& layerParams,
686 const dictionary& motionDict,
688 const label nAllowableErrors,
689 decompositionMethod& decomposer,
690 fvMeshDistribute& distributor
696 const dictionary& shrinkDict,
697 const dictionary& motionDict,
698 const layerParameters& layerParams,
700 const bool preBalance,
701 decompositionMethod& decomposer,
702 fvMeshDistribute& distributor
708 meshRefinement& meshRefiner,
709 const globalIndex& globalFaces,
724 meshRefinement& meshRefiner,
727 List<labelPair> baffles,
734 meshRefinement& meshRefiner,
735 const mapPolyMesh& map,
const labelList patchIDs(pbm.indices(polyPatchNames, true))
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &f1)
List< edge > edgeList
List of edge.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
GeometricField< vector, pointPatchField, pointMesh > pointVectorField
List< labelPair > labelPairList
List of labelPair.
ClassName("snappyLayerDriver")
Runtime type information.
IOField< scalar > scalarIOField
IO for a Field of scalar.
PrimitivePatch< IndirectList< face >, const pointField & > indirectPrimitivePatch
A PrimitivePatch with an IndirectList for the faces, const reference for the point field...
List< labelList > labelListList
List of labelList.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
pointField vertices(const blockVertexList &bvl)
void addLayersSinglePass(const layerParameters &layerParams, const dictionary &motionDict, const labelList &patchIDs, const label nAllowableErrors, decompositionMethod &decomposer, fvMeshDistribute &distributor)
For debugging. Can be removed.
vectorField pointField
pointField is a vectorField.
FaceMergeType
Enumeration for what to do with co-planar patch faces on a single.
Do not extrude. No layers added.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
static void mapFaceZonePoints(meshRefinement &meshRefiner, const mapPolyMesh &map, labelPairList &baffles, labelList &pointToMaster)
Map numbering after adding cell layers.
void doLayers(const dictionary &shrinkDict, const dictionary &motionDict, const layerParameters &layerParams, const meshRefinement::FaceMergeType mergeType, const bool preBalance, decompositionMethod &decomposer, fvMeshDistribute &distributor)
Add layers according to the dictionary settings.
void mergePatchFacesUndo(const layerParameters &layerParams, const dictionary &motionDict, const meshRefinement::FaceMergeType mergeType)
Merge patch faces on same cell.
All to do with adding layers.
static void determineSidePatches(meshRefinement &meshRefiner, const globalIndex &globalFaces, const labelListList &edgeGlobalFaces, const indirectPrimitivePatch &pp, labelList &edgePatchID, labelList &edgeZoneID, boolList &edgeFlip, labelList &inflateFaceID)
Helper: see what zones and patches edges should be extruded into.
extrudeMode
Extrusion controls.
Field< vector > vectorField
Specialisation of Field<T> for vector.
void addLayers(const layerParameters &layerParams, const label nLayerIter, const dictionary &motionDict, const label nRelaxedIter, const label nAllowableErrors, const labelList &patchIDs, const labelList &internalFaceZones, const List< labelPair > &baffles, const labelList &numLayers, const label nIdealTotAddedCells, const globalIndex &globalFaces, indirectPrimitivePatch &pp, const labelListList &edgeGlobalFaces, const labelList &edgePatchID, const labelList &edgeZoneID, const boolList &edgeFlip, const labelList &inflateFaceID, const scalarField &thickness, const scalarIOField &minThickness, const scalarField &expansionRatio, vectorField &patchDisp, labelList &patchNLayers, List< extrudeMode > &extrudeStatus, polyTopoChange &savedMeshMod, labelList &cellNLayers, scalarField &faceRealThickness)
List< label > labelList
A List of labels.
static autoPtr< mapPolyMesh > dupFaceZonePoints(meshRefinement &meshRefiner, const labelList &patchIDs, const labelList &numLayers, List< labelPair > baffles, labelList &pointToMaster)
Duplicate points on faceZones with layers. Re-used when adding buffer layers. Can be made private aga...
List< bool > boolList
A List of bools.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())