Go to the documentation of this file.
35 #ifndef autoLayerDriver_H
36 #define autoLayerDriver_H
49 class addPatchCellLayer;
51 class layerParameters;
147 const label patchPointI,
156 const face& localFace,
189 const scalar faceRatio,
190 const scalar edge0Len,
207 label& nIdealAddedCells
257 const scalar edge0Len,
292 const label myGlobalFaceI,
293 const label nbrGlobFaceI,
304 const label myGlobFaceI,
305 const label nbrGlobFaceI,
320 const faceSet& illegalPatchFaces,
337 const label nBufferCellsNoExtrude,
357 const bool additionalReporting,
460 const label nSmoothDisp,
471 const label nSmoothDisp,
478 const label nSmoothDisp,
505 const scalar minCosLayerTermination,
521 const label nSmoothNormals,
522 const label nSmoothSurfaceNormals,
523 const scalar minMedialAxisAngleCos,
524 const scalar featureAngle,
538 const label nSmoothPatchThickness,
539 const label nSmoothDisplacement,
540 const scalar maxThicknessToMedialRatio,
541 const label nAllowableErrors,
543 const scalar minCosLayerTermination,
598 const label nAllowableErrors,
610 const bool preBalance,
void mergePatchFacesUndo(const layerParameters &layerParams, const dictionary &motionDict)
Merge patch faces on same cell.
void doLayers(const dictionary &shrinkDict, const dictionary &motionDict, const layerParameters &layerParams, const bool mergePatchFaces, const bool preBalance, decompositionMethod &decomposer, fvMeshDistribute &distributor)
Add layers according to the dictionary settings.
void shrinkMeshMedialDistance(motionSmoother &meshMover, const dictionary &meshQualityDict, const List< labelPair > &baffles, const label nSmoothPatchThickness, const label nSmoothDisplacement, const scalar maxThicknessToMedialRatio, const label nAllowableErrors, const label nSnap, const scalar minCosLayerTermination, const scalarField &layerThickness, const scalarField &minThickness, const pointVectorField &dispVec, const pointScalarField &medialRatio, const pointScalarField &medialDist, const pointVectorField &medialVec, List< extrudeMode > &extrudeStatus, pointField &patchDisp, labelList &patchNLayers) const
Main routine to shrink mesh.
static void getLayerCellsFaces(const polyMesh &, const addPatchCellLayer &, const scalarField &oldRealThickness, labelList &cellStatus, scalarField &faceRealThickness)
Collect layer faces and layer cells into bools.
void determineSidePatches(const globalIndex &globalFaces, const labelListList &edgeGlobalFaces, const indirectPrimitivePatch &pp, labelList &edgePatchID, labelList &edgeZoneID, boolList &edgeFlip, labelList &inflateFaceID)
See what zones and patches edges should be extruded into.
bool sameEdgeNeighbour(const labelListList &globalEdgeFaces, const label myGlobalFaceI, const label nbrGlobFaceI, const label edgeI) const
For truncateDisplacement: find strings of edges.
void growNoExtrusion(const indirectPrimitivePatch &pp, pointField &patchDisp, labelList &patchNLayers, List< extrudeMode > &extrudeStatus) const
Grow no-extrusion layer.
void operator=(const autoLayerDriver &)
Disallow default bitwise assignment.
A class for handling file names.
A class for managing temporary objects.
void checkMeshManifold() const
Check that mesh outside is not multiply connected.
void operator()(vector &x, const vector &y) const
label truncateDisplacement(const globalIndex &globalFaces, const labelListList &edgeGlobalFaces, const indirectPrimitivePatch &pp, const scalarField &minThickness, const faceSet &illegalPatchFaces, pointField &patchDisp, labelList &patchNLayers, List< extrudeMode > &extrudeStatus) const
Truncates displacement.
static bool unmarkExtrusion(const label patchPointI, pointField &patchDisp, labelList &patchNLayers, List< extrudeMode > &extrudeStatus)
Unset extrusion on point. Returns true if anything unset.
extrudeMode
Extrusion controls.
void handleFeatureAngleLayerTerminations(const scalar minCos, const PackedBoolList &isMasterPoint, const indirectPrimitivePatch &pp, const labelList &meshEdges, List< extrudeMode > &extrudeStatus, pointField &patchDisp, labelList &patchNLayers, label &nPointCounter) const
Stop layer growth where mesh wraps around edge with a.
void addLayers(const layerParameters &layerParams, const dictionary &motionDict, const labelList &patchIDs, const label nAllowableErrors, decompositionMethod &decomposer, fvMeshDistribute &distributor)
Add cell layers.
const labelList globalToSlavePatch_
From surface region to patch.
void setupLayerInfoTruncation(const indirectPrimitivePatch &pp, const labelList &patchNLayers, const List< extrudeMode > &extrudeStatus, const label nBufferCellsNoExtrude, labelList &nPatchPointLayers, labelList &nPatchFaceLayers) const
Setup layer information (at points and faces) to.
void calculateLayerThickness(const indirectPrimitivePatch &pp, const labelList &patchIDs, const layerParameters &layerParams, const labelList &cellLevel, const labelList &patchNLayers, const scalar edge0Len, scalarField &thickness, scalarField &minThickness, scalarField &expansionRatio) const
Calculate pointwise wanted and minimum thickness.
faceList mergePatchFaces(const List< DynList< label > > &pfcs, const pointField &polyPoints)
Mesh consisting of general polyhedral cells.
void smoothPatchNormals(const motionSmoother &meshMover, const PackedBoolList &isMasterPoint, const PackedBoolList &isMasterEdge, const labelList &meshEdges, const label nSmoothDisp, pointField &normals) const
Smooth normals on patch.
void syncPatchDisplacement(const indirectPrimitivePatch &pp, const scalarField &minThickness, pointField &patchDisp, labelList &patchNLayers, List< extrudeMode > &extrudeStatus) const
Synchronize displacement among coupled patches.
static tmp< scalarField > avgPointData(const indirectPrimitivePatch &, const scalarField &pointFld)
Average point wise data to face wise.
static void averageNeighbours(const polyMesh &mesh, const PackedBoolList &isMasterEdge, const labelList &meshEdges, const labelList &meshPoints, const edgeList &edges, const scalarField &invSumWeight, const Field< Type > &data, Field< Type > &average)
Average field (over all subset of mesh points) by.
void getPatchDisplacement(const indirectPrimitivePatch &pp, const scalarField &thickness, const scalarField &minThickness, pointField &patchDisp, labelList &patchNLayers, List< extrudeMode > &extrudeStatus) const
Get nearest point on surface to snap to.
static void dumpDisplacement(const fileName &, const indirectPrimitivePatch &, const vectorField &, const List< extrudeMode > &)
For debugging: Dump displacement to .obj files.
bool writeLayerSets(const fvMesh &mesh, const labelList &cellNLayers, const scalarField &faceRealThickness) const
Write cellSet,faceSet for layers.
bool writeLayerData(const fvMesh &mesh, const labelList &patchIDs, const labelList &cellNLayers, const scalarField &faceWantedThickness, const scalarField &faceRealThickness) const
Write volFields,cellSet,faceSet for layers depending.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void smoothField(const motionSmoother &meshMover, const PackedBoolList &isMasterPoint, const PackedBoolList &isMasterEdge, const labelList &meshEdges, const scalarField &fieldMin, const label nSmoothDisp, scalarField &field) const
Smooth scalar field on patch.
void medialAxisSmoothingInfo(const motionSmoother &meshMover, const label nSmoothNormals, const label nSmoothSurfaceNormals, const scalar minMedialAxisAngleCos, const scalar featureAngle, pointVectorField &dispVec, pointScalarField &medialRatio, pointScalarField &medialDist, pointVectorField &medialVec) const
Pre-declare SubField and related Field type.
void getVertexString(const indirectPrimitivePatch &pp, const labelListList &globalEdgeFaces, const label faceI, const label edgeI, const label myGlobFaceI, const label nbrGlobFaceI, DynamicList< label > &vertices) const
For truncateDisplacement: find strings of edges.
static label countExtrusion(const indirectPrimitivePatch &pp, const List< extrudeMode > &extrudeStatus)
Count global number of extruded faces.
ClassName("autoLayerDriver")
Runtime type information.
Given a displacement moves the mesh by scaling the displacement back until there are no more mesh err...
static label checkAndUnmark(const addPatchCellLayer &addLayer, const dictionary &motionDict, const bool additionalReporting, const List< labelPair > &baffles, const indirectPrimitivePatch &pp, const fvMesh &, pointField &patchDisp, labelList &patchNLayers, List< extrudeMode > &extrudeStatus)
Checks the newly added cells and locally unmarks points.
static List< labelPair > getBafflesOnAddedMesh(const polyMesh &mesh, const labelList &newToOldFaces, const List< labelPair > &baffles)
After adding to mesh get the new baffles.
Simple container to keep together layer specific information.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Adds layers of cells to outside of polyPatch. Can optionally create stand-alone extruded mesh (addToM...
void handleWarpedFaces(const indirectPrimitivePatch &pp, const scalar faceRatio, const scalar edge0Len, const labelList &cellLevel, pointField &patchDisp, labelList &patchNLayers, List< extrudeMode > &extrudeStatus) const
No extrusion on warped faces.
autoLayerDriver(const autoLayerDriver &)
Disallow default bitwise copy construct.
Abstract base class for decomposition.
Mesh data needed to do the Finite Volume discretisation.
Mesh representing a set of points created from polyMesh.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
meshRefinement & meshRefiner_
Mesh+surface.
void sumWeights(const PackedBoolList &isMasterEdge, const labelList &meshEdges, const labelList &meshPoints, const edgeList &edges, scalarField &invSumWeight) const
Calculate inverse sum of edge weights (currently always 1.0)
All to do with adding layers.
void handleNonManifolds(const indirectPrimitivePatch &pp, const labelList &meshEdges, const labelListList &edgeGlobalFaces, pointField &patchDisp, labelList &patchNLayers, List< extrudeMode > &extrudeStatus) const
No extrusion at non-manifold points.
static tmp< pointVectorField > makeLayerDisplacementField(const pointMesh &pMesh, const labelList &numLayers)
Helper function to make a pointVectorField with correct.
void smoothNormals(const label nSmoothDisp, const PackedBoolList &isMasterPoint, const PackedBoolList &isMasterEdge, const labelList &fixedPoints, pointVectorField &normals) const
Smooth normals in interior.
static bool cellsUseFace(const polyMesh &mesh, const labelList &cellLabels, const labelHashSet &faces)
Does any of the cells use a face from faces?
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void findIsolatedRegions(const scalar minCosLayerTermination, const PackedBoolList &isMasterPoint, const PackedBoolList &isMasterEdge, const indirectPrimitivePatch &pp, const labelList &meshEdges, const scalarField &minThickness, List< extrudeMode > &extrudeStatus, pointField &patchDisp, labelList &patchNLayers) const
Find isolated islands (points, edges and faces and.
Helper class which maintains intersections of (changing) mesh with (static) surfaces.
static void checkManifold(const indirectPrimitivePatch &, pointSet &nonManifoldPoints)
Check that primitivePatch is not multiply connected.
void printLayerData(const fvMesh &mesh, const labelList &patchIDs, const labelList &cellNLayers, const scalarField &faceWantedThickness, const scalarField &faceRealThickness) const
Print layer coverage table.
A face is a list of labels corresponding to mesh vertices.
void handleFeatureAngle(const indirectPrimitivePatch &pp, const labelList &meshEdges, const scalar minCos, pointField &patchDisp, labelList &patchNLayers, List< extrudeMode > &extrudeStatus) const
No extrusion on feature edges. Assumes non-manifold.
Combine operator class to combine normal with other normal.
Generic GeometricField class.
void setNumLayers(const labelList &patchToNLayers, const labelList &patchIDs, const indirectPrimitivePatch &pp, pointField &patchDisp, labelList &patchNLayers, List< extrudeMode > &extrudeStatus, label &nIdealAddedCells) const
Determine the number of layers per point from the number of.
const labelList globalToMasterPatch_
From surface region to patch.
Sends/receives parts of mesh+fvfields to neighbouring processors. Used in load balancing.
Database for solution data, solver performance and other reduced data.
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
A list of faces which address into the list of points.