39#ifndef snappyLayerDriver_H
40#define snappyLayerDriver_H
63class snappyLayerDriver
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,
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,
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
634 const layerParameters& layerParams,
641 const layerParameters& layerParams,
642 const label nLayerIter,
645 const label nRelaxedIter,
646 const label nAllowableErrors,
650 const List<labelPair>& baffles,
652 const label nIdealTotAddedCells,
654 const globalIndex& globalFaces,
666 List<extrudeMode>& extrudeStatus,
667 polyTopoChange& savedMeshMod,
675 const layerParameters& layerParams,
678 const label nAllowableErrors,
679 decompositionMethod& decomposer,
680 fvMeshDistribute& distributor
686 const layerParameters& layerParams,
689 const label nAllowableErrors,
690 decompositionMethod& decomposer,
691 fvMeshDistribute& distributor
699 const layerParameters& layerParams,
701 const bool preBalance,
702 decompositionMethod& decomposer,
703 fvMeshDistribute& distributor
709 meshRefinement& meshRefiner,
710 const globalIndex& globalFaces,
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Adds layers of cells to outside (or inside) of polyMesh. Can optionally create stand-alone extruded m...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Abstract base class for domain decomposition.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Virtual base class for mesh movers with externally provided displacement field giving the boundary co...
Sends/receives parts of mesh+fvfields to neighbouring processors. Used in load balancing.
Calculates a non-overlapping list of offsets based on an input size (eg, number of cells) from differ...
Simple container to keep together layer specific information.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Helper class which maintains intersections of (changing) mesh with (static) surfaces.
FaceMergeType
Enumeration for what to do with co-planar patch faces on a single.
Given a displacement moves the mesh by scaling the displacement back until there are no more mesh err...
Direct mesh changes based on v1.3 polyTopoChange syntax.
Removes selected points from mesh and updates faces using these points.
void addLayersSinglePass(const layerParameters &layerParams, const dictionary &motionDict, const labelList &patchIDs, const label nAllowableErrors, decompositionMethod &decomposer, fvMeshDistribute &distributor)
For debugging. Can be removed.
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...
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)
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.
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.
label mergePatchFacesUndo(const layerParameters &layerParams, const dictionary &motionDict, const meshRefinement::FaceMergeType mergeType)
Merge patch faces on same cell. Return total number of faces/edges changed.
ClassName("snappyLayerDriver")
Runtime type information.
extrudeMode
Extrusion controls.
@ NOEXTRUDE
Do not extrude. No layers added.
#define ClassName(TypeNameString)
Add typeName information from argument TypeNameString to a class.
List< edge > edgeList
List of edge.
List< labelPair > labelPairList
List of labelPair.
List< labelList > labelListList
List of labelList.
List< label > labelList
A List of labels.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
GeometricField< vector, pointPatchField, pointMesh > pointVectorField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
PrimitivePatch< IndirectList< face >, const pointField & > indirectPrimitivePatch
A PrimitivePatch with an IndirectList for the faces, const reference for the point field.
pointField vertices(const blockVertexList &bvl)
Field< vector > vectorField
Specialisation of Field<T> for vector.
List< bool > boolList
A List of bools.
vectorField pointField
pointField is a vectorField.
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &f1, const label comm)
IOField< scalar > scalarIOField
IO for a Field of scalar.