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
258 List<extrudeMode>& extrudeStatus,
259 label& nIdealAddedCells
264 label setPointNumLayers
266 const layerParameters& layerParams,
277 autoPtr<externalDisplacementMeshMover> makeMeshMover
279 const layerParameters& layerParams,
280 const dictionary& motionDict,
285 void mapFaceZonePoints
287 const mapPolyMesh& map,
294 const mapPolyMesh& map,
295 autoPtr<indirectPrimitivePatch>&
pp,
307 static tmp<pointVectorField> makeLayerDisplacementField
309 const pointMesh& pMesh,
319 List<extrudeMode>& extrudeStatus
323 void dupFaceZonePoints
327 List<labelPair> baffles,
333 void mergeFaceZonePoints
342 void determineSidePatches
344 const globalIndex& globalFaces,
359 void calculateLayerThickness
363 const layerParameters& layerParams,
366 const scalar edge0Len,
377 void syncPatchDisplacement
383 List<extrudeMode>& extrudeStatus
387 void getPatchDisplacement
396 List<extrudeMode>& extrudeStatus
400 bool sameEdgeNeighbour
403 const label myGlobalFacei,
404 const label nbrGlobFacei,
415 const label myGlobFacei,
416 const label nbrGlobFacei,
425 label truncateDisplacement
427 const globalIndex& globalFaces,
431 const faceSet& illegalPatchFaces,
434 List<extrudeMode>& extrudeStatus
443 void setupLayerInfoTruncation
447 const List<extrudeMode>& extrudeStatus,
448 const label nBufferCellsNoExtrude,
454 static bool cellsUseFace
456 const polyMesh&
mesh,
464 static label checkAndUnmark
466 const addPatchCellLayer& addLayer,
467 const dictionary& motionDict,
468 const bool additionalReporting,
469 const List<labelPair>& baffles,
475 List<extrudeMode>& extrudeStatus
479 static label countExtrusion
482 const List<extrudeMode>& extrudeStatus
486 static List<labelPair> getBafflesOnAddedMesh
488 const polyMesh&
mesh,
490 const List<labelPair>& baffles
495 static void getLayerCellsFaces
498 const addPatchCellLayer&,
513 const layerParameters& layerParams
542 static void averageNeighbours
544 const polyMesh&
mesh,
545 const bitSet& isMasterEdge,
550 const Field<Type>& data,
557 const bitSet& isMasterEdge,
567 const motionSmoother& meshMover,
568 const bitSet& isMasterPoint,
569 const bitSet& isMasterEdge,
572 const label nSmoothDisp,
577 void smoothPatchNormals
579 const motionSmoother& meshMover,
580 const bitSet& isMasterPoint,
581 const bitSet& isMasterEdge,
583 const label nSmoothDisp,
590 const label nSmoothDisp,
591 const bitSet& isMasterPoint,
592 const bitSet& isMasterEdge,
599 void handleFeatureAngleLayerTerminations
602 const bitSet& isMasterPoint,
606 List<extrudeMode>& extrudeStatus,
615 void findIsolatedRegions
617 const scalar minCosLayerTermination,
618 const bitSet& isMasterPoint,
619 const bitSet& isMasterEdge,
624 List<extrudeMode>& extrudeStatus,
631 snappyLayerDriver(
const snappyLayerDriver&) =
delete;
634 void operator=(
const snappyLayerDriver&) =
delete;
647 meshRefinement& meshRefiner,
650 const bool dryRun =
false 659 const layerParameters& layerParams,
660 const dictionary& motionDict,
666 const layerParameters& layerParams,
667 const label nLayerIter,
669 const dictionary& motionDict,
670 const label nRelaxedIter,
671 const label nAllowableErrors,
675 const List<labelPair>& baffles,
677 const label nIdealTotAddedCells,
679 const globalIndex& globalFaces,
691 List<extrudeMode>& extrudeStatus,
692 polyTopoChange& savedMeshMod,
700 const layerParameters& layerParams,
701 const dictionary& motionDict,
703 const label nAllowableErrors,
704 decompositionMethod& decomposer,
705 fvMeshDistribute& distributor
711 const layerParameters& layerParams,
712 const dictionary& motionDict,
714 const label nAllowableErrors,
715 decompositionMethod& decomposer,
716 fvMeshDistribute& distributor
722 const dictionary& shrinkDict,
723 const dictionary& motionDict,
724 const layerParameters& layerParams,
726 const bool preBalance,
727 decompositionMethod& decomposer,
728 fvMeshDistribute& distributor
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...
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.
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.
List< bool > boolList
A List of bools.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())