Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes
meshRefinement Class Reference

Helper class which maintains intersections of (changing) mesh with (static) surfaces. More...

Collaboration diagram for meshRefinement:
Collaboration graph
[legend]

Public Types

enum  IOdebugType {
  IOMESH, IOOBJINTERSECTIONS, IOFEATURESEEDS, IOATTRACTION,
  IOLAYERINFO
}
 Enumeration for what to debug. More...
 
enum  debugType {
  MESH = 1<<IOMESH, OBJINTERSECTIONS = 1<<IOOBJINTERSECTIONS, FEATURESEEDS = 1<<IOFEATURESEEDS, ATTRACTION = 1<< IOATTRACTION,
  LAYERINFO = 1<<IOLAYERINFO
}
 
enum  IOoutputType { IOOUTPUTLAYERINFO }
 Enumeration for what to output. More...
 
enum  outputType { OUTPUTLAYERINFO = 1<<IOOUTPUTLAYERINFO }
 
enum  IOwriteType { IOWRITEMESH, IOWRITELEVELS, IOWRITELAYERSETS, IOWRITELAYERFIELDS }
 Enumeration for what to write. More...
 
enum  writeType { WRITEMESH = 1<<IOWRITEMESH, WRITELEVELS = 1<<IOWRITELEVELS, WRITELAYERSETS = 1<<IOWRITELAYERSETS, WRITELAYERFIELDS = 1<<IOWRITELAYERFIELDS }
 
enum  mapType { MASTERONLY = 1, KEEPALL = 2, REMOVE = 4 }
 Enumeration for how the userdata is to be mapped upon refinement. More...
 

Public Member Functions

 ClassName ("meshRefinement")
 Runtime type information. More...
 
 meshRefinement (fvMesh &mesh, const scalar mergeDistance, const bool overwrite, const refinementSurfaces &, const refinementFeatures &, const shellSurfaces &, const shellSurfaces &)
 Construct from components. More...
 
const fvMeshmesh () const
 Reference to mesh. More...
 
fvMeshmesh ()
 
scalar mergeDistance () const
 
bool overwrite () const
 Overwrite the mesh? More...
 
const wordoldInstance () const
 (points)instance of mesh upon construction More...
 
const refinementSurfacessurfaces () const
 Reference to surface search engines. More...
 
const refinementFeaturesfeatures () const
 Reference to feature edge mesh. More...
 
const shellSurfacesshells () const
 Reference to refinement shells (regions) More...
 
const hexRef8meshCutter () const
 Reference to meshcutting engine. More...
 
const labelListsurfaceIndex () const
 Per start-end edge the index of the surface hit. More...
 
labelListsurfaceIndex ()
 
const Map< label > & faceToCoupledPatch () const
 For faces originating from processor faces store the original. More...
 
const List< Tuple2< mapType, labelList > > & userFaceData () const
 Additional face data that is maintained across. More...
 
List< Tuple2< mapType, labelList > > & userFaceData ()
 
label countHits () const
 Count number of intersections (local) More...
 
autoPtr< mapDistributePolyMeshbalance (const bool keepZoneFaces, const bool keepBaffles, const scalarField &cellWeights, decompositionMethod &decomposer, fvMeshDistribute &distributor)
 Redecompose according to cell count. More...
 
labelList intersectedFaces () const
 Get faces with intersection. More...
 
labelList intersectedPoints () const
 Get points on surfaces with intersection and boundary faces. More...
 
bool isGap (const scalar, const vector &, const vector &, const vector &, const vector &) const
 Is local topology a small gap? More...
 
bool isNormalGap (const scalar, const vector &, const vector &, const vector &, const vector &) const
 Is local topology a small gap normal to the test vector. More...
 
labelList refineCandidates (const pointField &keepPoints, const scalar curvature, const scalar planarAngle, const bool featureRefinement, const bool featureDistanceRefinement, const bool internalRefinement, const bool surfaceRefinement, const bool curvatureRefinement, const bool smallFeatureRefinement, const bool gapRefinement, const bool bigGapRefinement, const bool spreadGapSize, const label maxGlobalCells, const label maxLocalCells) const
 Calculate list of cells to refine. More...
 
autoPtr< mapPolyMeshrefine (const labelList &cellsToRefine)
 Refine some cells. More...
 
autoPtr< mapDistributePolyMeshrefineAndBalance (const string &msg, decompositionMethod &decomposer, fvMeshDistribute &distributor, const labelList &cellsToRefine, const scalar maxLoadUnbalance)
 Refine some cells and rebalance. More...
 
autoPtr< mapDistributePolyMeshbalanceAndRefine (const string &msg, decompositionMethod &decomposer, fvMeshDistribute &distributor, const labelList &cellsToRefine, const scalar maxLoadUnbalance)
 Balance before refining some cells. More...
 
void baffleAndSplitMesh (const bool handleSnapProblems, const snapParameters &snapParams, const bool useTopologicalSnapDetection, const bool removeEdgeConnectedCells, const scalarField &perpendicularAngle, const dictionary &motionDict, Time &runTime, const labelList &globalToMasterPatch, const labelList &globalToSlavePatch, const pointField &locationsInMesh, const wordList &regionsInMesh, const pointField &locationsOutsideMesh)
 Split off unreachable areas of mesh. More...
 
void mergeFreeStandingBaffles (const snapParameters &snapParams, const bool useTopologicalSnapDetection, const bool removeEdgeConnectedCells, const scalarField &perpendicularAngle, const scalar planarAngle, const dictionary &motionDict, Time &runTime, const labelList &globalToMasterPatch, const labelList &globalToSlavePatch, const pointField &locationsInMesh, const pointField &locationsOutsideMesh)
 Merge free-standing baffles. More...
 
autoPtr< mapPolyMeshsplitMesh (const label nBufferLayers, const labelList &globalToMasterPatch, const labelList &globalToSlavePatch, const pointField &locationsInMesh, const wordList &regionsInMesh, const pointField &locationsOutsideMesh)
 Split off (with optional buffer layers) unreachable areas. More...
 
autoPtr< mapPolyMeshdupNonManifoldPoints (const localPointRegion &)
 Find boundary points that connect to more than one cell. More...
 
autoPtr< mapPolyMeshdupNonManifoldPoints ()
 Find boundary points that connect to more than one cell. More...
 
autoPtr< mapPolyMeshdupNonManifoldBoundaryPoints ()
 Find boundary points that are on faceZones of type boundary. More...
 
autoPtr< mapPolyMeshmergePoints (const labelList &pointToDuplicate)
 Merge duplicate points. More...
 
autoPtr< mapPolyMeshcreateBaffles (const labelList &ownPatch, const labelList &neiPatch)
 Create baffle for every internal face where ownPatch != -1. More...
 
labelList getZones (const List< surfaceZonesInfo::faceZoneType > &fzTypes) const
 Get zones of given type. More...
 
autoPtr< mapPolyMeshcreateZoneBaffles (const labelList &zoneIDs, List< labelPair > &baffles, labelList &originatingFaceZone)
 Create baffles for faces on faceZones. Return created baffles. More...
 
autoPtr< mapPolyMeshmergeBaffles (const List< labelPair > &, const Map< label > &faceToPatch)
 Merge baffles. Gets pairs of faces and boundary faces to move. More...
 
autoPtr< mapPolyMeshmergeZoneBaffles (const bool doInternalZones, const bool doBaffleZones)
 Merge all baffles on faceZones. More...
 
autoPtr< mapPolyMeshzonify (const bool allowFreeStandingZoneFaces, const pointField &locationsInMesh, const wordList &regionsInMesh, wordPairHashTable &zonesToFaceZone)
 Put faces/cells into zones according to surface specification. More...
 
label addMeshedPatch (const word &name, const dictionary &)
 Add patch originating from meshing. Update meshedPatches_. More...
 
labelList meshedPatches () const
 Get patchIDs for patches added in addMeshedPatch. More...
 
label addFaceZone (const word &fzName, const word &masterPatch, const word &slavePatch, const surfaceZonesInfo::faceZoneType &fzType)
 Add/lookup faceZone and update information. Return index of. More...
 
bool getFaceZoneInfo (const word &fzName, label &masterPatchID, label &slavePatchID, surfaceZonesInfo::faceZoneType &fzType) const
 Lookup faceZone information. Return false if no information. More...
 
void selectSeparatedCoupledFaces (boolList &) const
 Select coupled faces that are not collocated. More...
 
void updateIntersections (const labelList &changedFaces)
 Find any intersection of surface. Store in surfaceIndex_. More...
 
autoPtr< mapPolyMeshsplitMeshRegions (const labelList &globalToMasterPatch, const labelList &globalToSlavePatch, const pointField &locationsInMesh, const pointField &locationsOutsideMesh)
 Split mesh. Keep part containing point. Return empty map if. More...
 
void doSplitFaces (const labelList &splitFaces, const labelPairList &splits, polyTopoChange &meshMod) const
 Split faces into two. More...
 
label splitFacesUndo (const labelList &splitFaces, const labelPairList &splits, const dictionary &motionDict, labelList &duplicateFace, List< labelPair > &baffles)
 Split faces along diagonal. Maintain mesh quality. Return. More...
 
void distribute (const mapDistributePolyMesh &)
 Update local numbering for mesh redistribution. More...
 
void updateMesh (const mapPolyMesh &, const labelList &changedFaces)
 Update for external change to mesh. changedFaces are in new mesh. More...
 
void storeData (const labelList &pointsToStore, const labelList &facesToStore, const labelList &cellsToStore)
 Signal points/face/cells for which to store data. More...
 
void updateMesh (const mapPolyMesh &, const labelList &changedFaces, const Map< label > &pointsToRestore, const Map< label > &facesToRestore, const Map< label > &cellsToRestore)
 Update local numbering + undo. More...
 
label mergePatchFaces (const scalar minCos, const scalar concaveCos, const label mergeSize, const labelList &patchIDs)
 Merge coplanar faces if sets are of size mergeSize. More...
 
label mergePatchFacesUndo (const scalar minCos, const scalar concaveCos, const labelList &patchIDs, const dictionary &motionDict, const labelList &preserveFaces)
 Merge coplanar faces. preserveFaces is != -1 for faces. More...
 
autoPtr< mapPolyMeshdoRemovePoints (removePoints &pointRemover, const boolList &pointCanBeDeleted)
 
autoPtr< mapPolyMeshdoRestorePoints (removePoints &pointRemover, const labelList &facesToRestore)
 
labelList collectFaces (const labelList &candidateFaces, const labelHashSet &set) const
 
labelList growFaceCellFace (const labelHashSet &set) const
 
label mergeEdgesUndo (const scalar minCos, const dictionary &motionDict)
 Merge edges, maintain mesh quality. Return global number. More...
 
void checkData ()
 Debugging: check that all faces still obey start()>end() More...
 
template<class T >
void testSyncBoundaryFaceList (const scalar mergeDistance, const string &, const UList< T > &, const UList< T > &) const
 Compare two lists over all boundary faces. More...
 
void printMeshInfo (const bool, const string &) const
 Print some mesh stats. More...
 
word timeName () const
 Replacement for Time::timeName() : return oldInstance (if. More...
 
void setInstance (const fileName &)
 Set instance of all local IOobjects. More...
 
bool write () const
 Write mesh and all data. More...
 
void dumpRefinementLevel () const
 Write refinement level as volScalarFields for postprocessing. More...
 
void dumpIntersections (const fileName &prefix) const
 Debug: Write intersection information to OBJ format. More...
 
void write (const debugType debugFlags, const writeType writeFlags, const fileName &) const
 Do any one of above IO functions. More...
 

Static Public Member Functions

static autoPtr< indirectPrimitivePatchmakePatch (const polyMesh &, const labelList &)
 Create patch from set of patches. More...
 
static tmp< pointVectorFieldmakeDisplacementField (const pointMesh &pMesh, const labelList &adaptPatchIDs)
 Helper function to make a pointVectorField with correct. More...
 
static void checkCoupledFaceZones (const polyMesh &)
 Helper function: check that face zones are synced. More...
 
static void calculateEdgeWeights (const polyMesh &mesh, const PackedBoolList &isMasterEdge, const labelList &meshPoints, const edgeList &edges, scalarField &edgeWeights, scalarField &invSumWeight)
 Helper: calculate edge weights (1/length) More...
 
template<class Type >
static void weightedSum (const polyMesh &mesh, const PackedBoolList &isMasterEdge, const labelList &meshPoints, const edgeList &edges, const scalarField &edgeWeights, const Field< Type > &data, Field< Type > &sum)
 Helper: weighted sum (over all subset of mesh points) by. More...
 
static List< labelPairsubsetBaffles (const polyMesh &mesh, const labelList &zoneIDs, const List< labelPair > &baffles)
 Subset baffles according to zones. More...
 
static label appendPatch (fvMesh &, const label insertPatchI, const word &, const dictionary &)
 Helper:append patch to end of mesh. More...
 
static label addPatch (fvMesh &, const word &name, const dictionary &)
 Helper:add patch to mesh. Update all registered fields. More...
 
static label findRegion (const polyMesh &, const labelList &cellRegion, const vector &perturbVec, const point &p)
 Find region point is in. Uses optional perturbation to re-test. More...
 
static void findRegions (const polyMesh &, const vector &perturbVec, const pointField &locationsInMesh, const pointField &locationsOutsideMesh, const label nRegions, labelList &cellRegion)
 
template<class T >
static void updateList (const labelList &newToOld, const T &nullValue, List< T > &elems)
 Helper: reorder list according to map. More...
 
static void testSyncPointList (const string &msg, const polyMesh &mesh, const List< scalar > &fld)
 
static void testSyncPointList (const string &msg, const polyMesh &mesh, const List< point > &fld)
 
template<class T >
static void collectAndPrint (const UList< point > &points, const UList< T > &data)
 Print list according to (collected and) sorted coordinate. More...
 
static PackedBoolList getMasterPoints (const polyMesh &mesh, const labelList &meshPoints)
 Determine master point for subset of points. If coupled. More...
 
static PackedBoolList getMasterEdges (const polyMesh &mesh, const labelList &meshEdges)
 Determine master edge for subset of edges. If coupled. More...
 
template<class T >
static T gAverage (const PackedBoolList &isMasterElem, const UList< T > &values)
 Helper: calculate average. More...
 
static writeType writeLevel ()
 Get/set write level. More...
 
static void writeLevel (const writeType)
 
static outputType outputLevel ()
 Get/set output level. More...
 
static void outputLevel (const outputType)
 
template<class Enum >
static int readFlags (const Enum &namedEnum, const wordList &)
 Helper: convert wordList into bit pattern using provided. More...
 

Static Public Attributes

static const NamedEnum< IOdebugType, 5 > IOdebugTypeNames
 
static const NamedEnum< IOoutputType, 1 > IOoutputTypeNames
 
static const NamedEnum< IOwriteType, 4 > IOwriteTypeNames
 

Private Member Functions

void calcNeighbourData (labelList &neiLevel, pointField &neiCc) const
 Calculate coupled boundary end vector and refinement level. More...
 
void calcCellCellRays (const pointField &neiCc, const labelList &neiLevel, const labelList &testFaces, pointField &start, pointField &end, labelList &minLevel) const
 Calculate rays from cell-centre to cell-centre and corresponding. More...
 
autoPtr< mapPolyMeshdoRemoveCells (const labelList &cellsToRemove, const labelList &exposedFaces, const labelList &exposedPatchIDs, removeCells &cellRemover)
 Remove cells. Put exposedFaces into exposedPatchIDs. More...
 
labelList getInsideCells (const word &) const
 Get cells which are inside any closed surface. Note that. More...
 
autoPtr< mapPolyMeshremoveInsideCells (const string &msg, const label exposedPatchI)
 Do all to remove inside cells. More...
 
void markFeatureCellLevel (const pointField &keepPoints, labelList &maxFeatureLevel) const
 Mark every cell with level of feature passing through it. More...
 
label markFeatureRefinement (const pointField &keepPoints, const label nAllowRefine, labelList &refineCell, label &nRefine) const
 Calculate list of cells to refine based on intersection of. More...
 
label markInternalDistanceToFeatureRefinement (const label nAllowRefine, labelList &refineCell, label &nRefine) const
 Mark cells for distance-to-feature based refinement. More...
 
label markInternalRefinement (const label nAllowRefine, labelList &refineCell, label &nRefine) const
 Mark cells for refinement-shells based refinement. More...
 
label unmarkInternalRefinement (labelList &refineCell, label &nRefine) const
 Unmark cells for refinement based on limit-shells. Return number. More...
 
labelList getRefineCandidateFaces (const labelList &refineCell) const
 Collect faces that are intersected and whose neighbours aren't. More...
 
label markSurfaceRefinement (const label nAllowRefine, const labelList &neiLevel, const pointField &neiCc, labelList &refineCell, label &nRefine) const
 Mark cells for surface intersection based refinement. More...
 
label markSurfaceGapRefinement (const scalar planarCos, const label nAllowRefine, const labelList &neiLevel, const pointField &neiCc, labelList &refineCell, label &nRefine) const
 Mark cells intersected by the surface if they are inside. More...
 
label generateRays (const point &nearPoint, const vector &nearNormal, const FixedList< label, 3 > &gapInfo, const volumeType &mode, const label cLevel, DynamicField< point > &start, DynamicField< point > &end) const
 Generate single ray from nearPoint in direction of nearNormal. More...
 
label generateRays (const bool useSurfaceNormal, const point &nearPoint, const vector &nearNormal, const FixedList< label, 3 > &gapInfo, const volumeType &mode, const point &cc, const label cLevel, DynamicField< point > &start, DynamicField< point > &end, DynamicField< scalar > &gapSize, DynamicField< point > &start2, DynamicField< point > &end2, DynamicField< scalar > &gapSize2) const
 Generate pairs of rays through cell centre. More...
 
void selectGapCandidates (const labelList &refineCell, const label nRefine, labelList &cellMap, List< FixedList< label, 3 > > &shellGapInfo, List< volumeType > &shellGapMode) const
 Select candidate cells (cells inside a shell with gapLevel. More...
 
void mergeGapInfo (const FixedList< label, 3 > &shellGapInfo, const volumeType shellGapMode, const FixedList< label, 3 > &surfGapInfo, const volumeType surfGapMode, FixedList< label, 3 > &gapInfo, volumeType &gapMode) const
 Merge gap information coming from shell and from surface. More...
 
label markInternalGapRefinement (const scalar planarCos, const bool spreadGapSize, const label nAllowRefine, labelList &refineCell, label &nRefine, labelList &numGapCells, scalarField &gapSize) const
 Mark cells for non-surface intersection based gap refinement. More...
 
label markSmallFeatureRefinement (const scalar planarCos, const label nAllowRefine, const labelList &neiLevel, const pointField &neiCc, labelList &refineCell, label &nRefine) const
 Refine cells containing small gaps. More...
 
label countMatches (const List< point > &normals1, const List< point > &normals2, const scalar tol=1e-6) const
 Helper: count number of normals1 that are in normals2. More...
 
label markSurfaceCurvatureRefinement (const scalar curvature, const label nAllowRefine, const labelList &neiLevel, const pointField &neiCc, labelList &refineCell, label &nRefine) const
 Mark cells for surface curvature based refinement. Marks if. More...
 
bool checkProximity (const scalar planarCos, const label nAllowRefine, const label surfaceLevel, const vector &surfaceLocation, const vector &surfaceNormal, const label cellI, label &cellMaxLevel, vector &cellMaxLocation, vector &cellMaxNormal, labelList &refineCell, label &nRefine) const
 Mark cell if local a gap topology or. More...
 
label markProximityRefinement (const scalar curvature, const label nAllowRefine, const labelList &neiLevel, const pointField &neiCc, labelList &refineCell, label &nRefine) const
 Mark cells for surface proximity based refinement. More...
 
Map< labelPairgetZoneBafflePatches (const bool allowBoundary, const labelList &globalToMasterPatch, const labelList &globalToSlavePatch) const
 Get faces to repatch. Returns map from face to patch. More...
 
void getIntersections (const labelList &surfacesToTest, const pointField &neiCc, const labelList &testFaces, labelList &globalRegion1, labelList &globalRegion2) const
 Calculate intersections. Return per face -1 or the global. More...
 
void getIntersections (const labelList &surfacesToTest, const pointField &neiCc, const labelList &testFaces, labelList &namedSurfaceIndex, PackedBoolList &posOrientation) const
 Calculate intersections on zoned faces. Return per face -1. More...
 
void getBafflePatches (const labelList &globalToMasterPatch, const pointField &locationsInMesh, const wordList &regionsInMesh, const labelList &neiLevel, const pointField &neiCc, labelList &ownPatch, labelList &neiPatch) const
 Determine patches for baffles. More...
 
label createBaffle (const label faceI, const label ownPatch, const label neiPatch, polyTopoChange &meshMod) const
 Repatches external face or creates baffle for internal face. More...
 
void markBoundaryFace (const label faceI, boolList &isBoundaryFace, boolList &isBoundaryEdge, boolList &isBoundaryPoint) const
 Helper function to mark face as being on 'boundary'. Used by. More...
 
void findNearest (const labelList &meshFaces, List< pointIndexHit > &nearestInfo, labelList &nearestSurface, labelList &nearestRegion, vectorField &nearestNormal) const
 
Map< labelfindEdgeConnectedProblemCells (const scalarField &perpendicularAngle, const labelList &) const
 
bool isCollapsedFace (const pointField &, const pointField &neiCc, const scalar minFaceArea, const scalar maxNonOrtho, const label faceI) const
 
bool isCollapsedCell (const pointField &, const scalar volFraction, const label cellI) const
 
labelList markFacesOnProblemCells (const dictionary &motionDict, const bool removeEdgeConnectedCells, const scalarField &perpendicularAngle, const labelList &globalToMasterPatch) const
 Returns list with for every internal face -1 or the patch. More...
 
labelList nearestPatch (const labelList &adaptPatchIDs) const
 Returns list with for every face the label of the nearest. More...
 
labelList markFacesOnProblemCellsGeometric (const snapParameters &snapParams, const dictionary &motionDict, const labelList &globalToMasterPatch, const labelList &globalToSlavePatch) const
 Returns list with for every internal face -1 or the patch. More...
 
List< labelPairfreeStandingBaffles (const List< labelPair > &, const scalar freeStandingAngle) const
 Extract those baffles (duplicate) faces that are on the edge. More...
 
void findCellZoneGeometric (const pointField &neiCc, const labelList &closedNamedSurfaces, labelList &namedSurfaceIndex, const labelList &surfaceToCellZone, labelList &cellToZone) const
 Finds zone per cell for cells inside closed named surfaces. More...
 
void findCellZoneInsideWalk (const pointField &locationsInMesh, const labelList &zonesInMesh, const labelList &blockedFace, labelList &cellToZone) const
 Finds zone per cell for cells inside region for which name. More...
 
void findCellZoneInsideWalk (const pointField &locationsInMesh, const wordList &zoneNamesInMesh, const labelList &faceToZone, labelList &cellToZone) const
 Finds zone per cell for cells inside region for which name. More...
 
bool calcRegionToZone (const label surfZoneI, const label ownRegion, const label neiRegion, labelList &regionToCellZone) const
 Determines cell zone from cell region information. More...
 
void findCellZoneTopo (const pointField &locationsInMesh, const labelList &allSurfaceIndex, const labelList &namedSurfaceIndex, const labelList &surfaceToCellZone, labelList &cellToZone) const
 Finds zone per cell. Uses topological walk with all faces. More...
 
void makeConsistentFaceIndex (const labelList &zoneToNamedSurface, const labelList &cellToZone, labelList &namedSurfaceIndex) const
 Make namedSurfaceIndex consistent with cellToZone. More...
 
void zonify (const bool allowFreeStandingZoneFaces, const pointField &locationsInMesh, const wordList &zonesInMesh, labelList &cellToZone, labelList &namedSurfaceIndex, PackedBoolList &posOrientation) const
 Calculate cellZone allocation. More...
 
void zonify (const PackedBoolList &isMasterFace, const labelList &cellToZone, const labelList &neiCellZone, const labelList &faceToZone, const PackedBoolList &meshFlipMap, polyTopoChange &meshMod) const
 Put cells into cellZone, faces into faceZone. More...
 
void allocateInterRegionFaceZone (const label ownZone, const label neiZone, wordPairHashTable &zonesToFaceZone, HashTable< word, labelPair, labelPair::Hash<> > &) const
 Allocate faceZoneName. More...
 
void handleSnapProblems (const snapParameters &snapParams, const bool useTopologicalSnapDetection, const bool removeEdgeConnectedCells, const scalarField &perpendicularAngle, const dictionary &motionDict, Time &runTime, const labelList &globalToMasterPatch, const labelList &globalToSlavePatch)
 Remove any loose standing cells. More...
 
labelList freeStandingBaffleFaces (const labelList &faceToZone, const labelList &cellToZone, const labelList &neiCellZone) const
 Get all faces in faceToZone that have no cellZone on. More...
 
void calcPatchNumMasterFaces (const PackedBoolList &isMasterFace, const indirectPrimitivePatch &patch, labelList &nMasterFaces) const
 Determine per patch edge the number of master faces. Used. More...
 
label markPatchZones (const indirectPrimitivePatch &patch, const labelList &nMasterFaces, labelList &faceToZone) const
 Determine per patch face the (singly-) connected zone it. More...
 
void consistentOrientation (const PackedBoolList &isMasterFace, const indirectPrimitivePatch &patch, const labelList &nMasterFaces, const labelList &faceToZone, const Map< label > &zoneToOrientation, PackedBoolList &meshFlipMap) const
 Make faces consistent. More...
 
 meshRefinement (const meshRefinement &)
 Disallow default bitwise copy construct. More...
 
void operator= (const meshRefinement &)
 Disallow default bitwise assignment. More...
 

Static Private Member Functions

template<class GeoField >
static void addPatchFields (fvMesh &, const word &patchFieldType)
 Add patchfield of given type to all fields on mesh. More...
 
template<class GeoField >
static void reorderPatchFields (fvMesh &, const labelList &oldToNew)
 Reorder patchfields of all fields on mesh. More...
 
static labelList getChangedFaces (const mapPolyMesh &, const labelList &oldCellsToRefine)
 Find out which faces have changed given cells (old mesh labels) More...
 
static bool markForRefine (const label markValue, const label nAllowRefine, label &cellValue, label &nRefine)
 Mark cell for refinement (if not already marked). Return false. More...
 

Private Attributes

fvMeshmesh_
 Reference to mesh. More...
 
const scalar mergeDistance_
 Tolerance used for sorting coordinates (used in 'less' routine) More...
 
const bool overwrite_
 Overwrite the mesh? More...
 
const word oldInstance_
 Instance of mesh upon construction. Used when in overwrite_ mode. More...
 
const refinementSurfacessurfaces_
 All surface-intersection interaction. More...
 
const refinementFeaturesfeatures_
 All feature-edge interaction. More...
 
const shellSurfacesshells_
 All shell-refinement interaction. More...
 
const shellSurfaceslimitShells_
 All limit-refinement interaction. More...
 
hexRef8 meshCutter_
 Refinement engine. More...
 
labelIOList surfaceIndex_
 Per cc-cc vector the index of the surface hit. More...
 
Map< labelfaceToCoupledPatch_
 Original patch for baffle faces that used to be on. More...
 
List< Tuple2< mapType, labelList > > userFaceData_
 User supplied face based data. More...
 
wordList meshedPatches_
 Meshed patches - are treated differently. Stored as wordList since. More...
 
HashTable< word, wordfaceZoneToMasterPatch_
 FaceZone to master patch name. More...
 
HashTable< word, wordfaceZoneToSlavePatch_
 FaceZone to slave patch name. More...
 
HashTable< surfaceZonesInfo::faceZoneType, wordfaceZoneToType_
 FaceZone to method to handle faces. More...
 

Static Private Attributes

static writeType writeLevel_
 Control of writing level. More...
 
static outputType outputLevel_
 Control of output/log level. More...
 

Detailed Description

Helper class which maintains intersections of (changing) mesh with (static) surfaces.

Maintains

Source files

Definition at line 82 of file meshRefinement.H.

Member Enumeration Documentation

◆ IOdebugType

Enumeration for what to debug.

Enumerator
IOMESH 
IOOBJINTERSECTIONS 
IOFEATURESEEDS 
IOATTRACTION 
IOLAYERINFO 

Definition at line 90 of file meshRefinement.H.

◆ debugType

enum debugType
Enumerator
MESH 
OBJINTERSECTIONS 
FEATURESEEDS 
ATTRACTION 
LAYERINFO 

Definition at line 100 of file meshRefinement.H.

◆ IOoutputType

Enumeration for what to output.

Enumerator
IOOUTPUTLAYERINFO 

Definition at line 111 of file meshRefinement.H.

◆ outputType

enum outputType
Enumerator
OUTPUTLAYERINFO 

Definition at line 116 of file meshRefinement.H.

◆ IOwriteType

Enumeration for what to write.

Enumerator
IOWRITEMESH 
IOWRITELEVELS 
IOWRITELAYERSETS 
IOWRITELAYERFIELDS 

Definition at line 122 of file meshRefinement.H.

◆ writeType

enum writeType
Enumerator
WRITEMESH 
WRITELEVELS 
WRITELAYERSETS 
WRITELAYERFIELDS 

Definition at line 130 of file meshRefinement.H.

◆ mapType

enum mapType

Enumeration for how the userdata is to be mapped upon refinement.

Enumerator
MASTERONLY 

maintain master only

KEEPALL 

have slaves (upon refinement) from master

REMOVE 

set value to -1 any face that was refined

Definition at line 139 of file meshRefinement.H.

Constructor & Destructor Documentation

◆ meshRefinement() [1/2]

meshRefinement ( const meshRefinement )
private

Disallow default bitwise copy construct.

◆ meshRefinement() [2/2]

meshRefinement ( fvMesh mesh,
const scalar  mergeDistance,
const bool  overwrite,
const refinementSurfaces surfaces,
const refinementFeatures features,
const shellSurfaces shells,
const shellSurfaces limitShells 
)

Construct from components.

Definition at line 1227 of file meshRefinement.C.

References Foam::identity().

Here is the call graph for this function:

Member Function Documentation

◆ addPatchFields()

void addPatchFields ( fvMesh mesh,
const word patchFieldType 
)
staticprivate

Add patchfield of given type to all fields on mesh.

Definition at line 205 of file meshRefinementTemplates.C.

References fld(), forAllIter, mesh, and Foam::compressible::New().

Here is the call graph for this function:

◆ reorderPatchFields()

void reorderPatchFields ( fvMesh mesh,
const labelList oldToNew 
)
staticprivate

Reorder patchfields of all fields on mesh.

Definition at line 239 of file meshRefinementTemplates.C.

References fld(), forAllIter, and mesh.

Here is the call graph for this function:

◆ getChangedFaces()

Foam::labelList getChangedFaces ( const mapPolyMesh map,
const labelList oldCellsToRefine 
)
staticprivate

Find out which faces have changed given cells (old mesh labels)

that were marked for refinement.

Definition at line 117 of file meshRefinementRefine.C.

References mapPolyMesh::cellMap(), cells, Foam::endl(), Foam::findIndices(), forAll, PackedList::get(), mesh, MESH, mapPolyMesh::mesh(), IOobject::name(), mapPolyMesh::nOldCells(), Foam::Pout, Foam::returnReduce(), PackedBoolList::set(), List::size(), polyPatch::start(), and regIOobject::write().

Here is the call graph for this function:

◆ calcNeighbourData()

void calcNeighbourData ( labelList neiLevel,
pointField neiCc 
) const
private

Calculate coupled boundary end vector and refinement level.

Definition at line 125 of file meshRefinement.C.

References Foam::abort(), polyPatch::coupled(), polyPatch::faceAreas(), polyPatch::faceCells(), polyPatch::faceCentres(), Foam::FatalError, FatalErrorInFunction, forAll, HashTable::found(), Foam::mag(), patches, List::size(), and polyPatch::start().

Referenced by meshRefinement::updateIntersections().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ calcCellCellRays()

void calcCellCellRays ( const pointField neiCc,
const labelList neiLevel,
const labelList testFaces,
pointField start,
pointField end,
labelList minLevel 
) const
private

Calculate rays from cell-centre to cell-centre and corresponding.

min cell refinement level

Definition at line 219 of file meshRefinement.C.

References forAll, Foam::min(), List::setSize(), and List::size().

Here is the call graph for this function:

◆ doRemoveCells()

Foam::autoPtr< Foam::mapPolyMesh > doRemoveCells ( const labelList cellsToRemove,
const labelList exposedFaces,
const labelList exposedPatchIDs,
removeCells cellRemover 
)
private

Remove cells. Put exposedFaces into exposedPatchIDs.

Definition at line 680 of file meshRefinement.C.

References polyTopoChange::changeMesh(), Foam::renumber(), removeCells::setRefinement(), timeName, and removeCells::updateMesh().

Here is the call graph for this function:

◆ getInsideCells()

labelList getInsideCells ( const word ) const
private

Get cells which are inside any closed surface. Note that.

all closed surfaces will have already been oriented to have keepPoint outside.

◆ removeInsideCells()

autoPtr<mapPolyMesh> removeInsideCells ( const string msg,
const label  exposedPatchI 
)
private

Do all to remove inside cells.

◆ markForRefine()

bool markForRefine ( const label  markValue,
const label  nAllowRefine,
label cellValue,
label nRefine 
)
staticprivate

Mark cell for refinement (if not already marked). Return false.

if refinelimit hit. Keeps running count (in nRefine) of cells marked for refinement

Definition at line 297 of file meshRefinementRefine.C.

◆ markFeatureCellLevel()

void markFeatureCellLevel ( const pointField keepPoints,
labelList maxFeatureLevel 
) const
private

◆ markFeatureRefinement()

Foam::label markFeatureRefinement ( const pointField keepPoints,
const label  nAllowRefine,
labelList refineCell,
label nRefine 
) const
private

Calculate list of cells to refine based on intersection of.

features.

Definition at line 656 of file meshRefinementRefine.C.

References Foam::endl(), forAll, Foam::Info, and Foam::returnReduce().

Here is the call graph for this function:

◆ markInternalDistanceToFeatureRefinement()

Foam::label markInternalDistanceToFeatureRefinement ( const label  nAllowRefine,
labelList refineCell,
label nRefine 
) const
private

Mark cells for distance-to-feature based refinement.

Definition at line 712 of file meshRefinementRefine.C.

References Foam::endl(), forAll, Foam::Info, Foam::Pout, Foam::returnReduce(), and List::size().

Here is the call graph for this function:

◆ markInternalRefinement()

Foam::label markInternalRefinement ( const label  nAllowRefine,
labelList refineCell,
label nRefine 
) const
private

Mark cells for refinement-shells based refinement.

Definition at line 796 of file meshRefinementRefine.C.

References Foam::endl(), forAll, Foam::Info, Foam::Pout, Foam::returnReduce(), and List::size().

Here is the call graph for this function:

◆ unmarkInternalRefinement()

Foam::label unmarkInternalRefinement ( labelList refineCell,
label nRefine 
) const
private

Unmark cells for refinement based on limit-shells. Return number.

of limited cells.

Definition at line 873 of file meshRefinementRefine.C.

References forAll, and Foam::returnReduce().

Here is the call graph for this function:

◆ getRefineCandidateFaces()

Foam::labelList getRefineCandidateFaces ( const labelList refineCell) const
private

Collect faces that are intersected and whose neighbours aren't.

yet marked for refinement.

Definition at line 925 of file meshRefinementRefine.C.

References forAll, and List::setSize().

Here is the call graph for this function:

◆ markSurfaceRefinement()

Foam::label markSurfaceRefinement ( const label  nAllowRefine,
const labelList neiLevel,
const pointField neiCc,
labelList refineCell,
label nRefine 
) const
private

Mark cells for surface intersection based refinement.

Definition at line 965 of file meshRefinementRefine.C.

References Foam::endl(), forAll, Foam::Info, Foam::returnReduce(), and List::size().

Here is the call graph for this function:

◆ markSurfaceGapRefinement()

Foam::label markSurfaceGapRefinement ( const scalar  planarCos,
const label  nAllowRefine,
const labelList neiLevel,
const pointField neiCc,
labelList refineCell,
label nRefine 
) const
private

Mark cells intersected by the surface if they are inside.

close gaps

Definition at line 43 of file meshRefinementGapRefine.C.

References DynamicList::append(), DynamicField::append(), DynamicField::capacity(), List::clear(), Foam::endl(), forAll, Foam::identity(), Foam::Info, Foam::mag(), Foam::magSqr(), Foam::max(), Foam::returnReduce(), DynamicList::shrink(), DynamicField::shrink(), List::size(), and Foam::sqr().

Here is the call graph for this function:

◆ generateRays() [1/2]

Foam::label generateRays ( const point nearPoint,
const vector nearNormal,
const FixedList< label, 3 > &  gapInfo,
const volumeType mode,
const label  cLevel,
DynamicField< point > &  start,
DynamicField< point > &  end 
) const
private

Generate single ray from nearPoint in direction of nearNormal.

Definition at line 686 of file meshRefinementGapRefine.C.

References DynamicField::append(), Foam::constant::electromagnetic::e, Foam::mode(), n, and Foam::pow().

Here is the call graph for this function:

◆ generateRays() [2/2]

Foam::label generateRays ( const bool  useSurfaceNormal,
const point nearPoint,
const vector nearNormal,
const FixedList< label, 3 > &  gapInfo,
const volumeType mode,
const point cc,
const label  cLevel,
DynamicField< point > &  start,
DynamicField< point > &  end,
DynamicField< scalar > &  gapSize,
DynamicField< point > &  start2,
DynamicField< point > &  end2,
DynamicField< scalar > &  gapSize2 
) const
private

Generate pairs of rays through cell centre.

Each ray pair has start, end, and expected gap size

Definition at line 737 of file meshRefinementGapRefine.C.

References DynamicField::append(), Foam::constant::electromagnetic::e, Foam::mag(), Foam::mode(), n, Foam::pow(), and s().

Here is the call graph for this function:

◆ selectGapCandidates()

void selectGapCandidates ( const labelList refineCell,
const label  nRefine,
labelList cellMap,
List< FixedList< label, 3 > > &  shellGapInfo,
List< volumeType > &  shellGapMode 
) const
private

Select candidate cells (cells inside a shell with gapLevel.

specified)

Definition at line 995 of file meshRefinementGapRefine.C.

References Foam::endl(), forAll, Foam::Info, Foam::returnReduce(), List::setSize(), and List::size().

Here is the call graph for this function:

◆ mergeGapInfo()

void mergeGapInfo ( const FixedList< label, 3 > &  shellGapInfo,
const volumeType  shellGapMode,
const FixedList< label, 3 > &  surfGapInfo,
const volumeType  surfGapMode,
FixedList< label, 3 > &  gapInfo,
volumeType gapMode 
) const
private

Merge gap information coming from shell and from surface.

(surface wins)

Definition at line 1057 of file meshRefinementGapRefine.C.

◆ markInternalGapRefinement()

Foam::label markInternalGapRefinement ( const scalar  planarCos,
const bool  spreadGapSize,
const label  nAllowRefine,
labelList refineCell,
label nRefine,
labelList numGapCells,
scalarField gapSize 
) const
private

◆ markSmallFeatureRefinement()

Foam::label markSmallFeatureRefinement ( const scalar  planarCos,
const label  nAllowRefine,
const labelList neiLevel,
const pointField neiCc,
labelList refineCell,
label nRefine 
) const
private

Refine cells containing small gaps.

Force calculation of tetBasePt

Option 1: use octree nearest searching inside polyMesh

label cellI = mesh_.findCell(pt);

Option 2: use octree 'inside' searching inside polyMesh. Is

much faster.

Definition at line 1464 of file meshRefinementGapRefine.C.

References DynamicList::append(), indexedOctree::bb(), searchableSurface::boundingSpheres(), List::clear(), treeBoundBox::contains(), Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, indexedOctree::findInside(), searchableSurface::findNearest(), forAll, searchableSurface::getNormal(), searchableSurface::getRegion(), Foam::Info, Foam::mag(), Foam::max(), IOobject::name(), indexedOctree::nodes(), Foam::returnReduce(), DynamicList::shrink(), and DynamicField::shrink().

Here is the call graph for this function:

◆ countMatches()

Foam::label countMatches ( const List< point > &  normals1,
const List< point > &  normals2,
const scalar  tol = 1e-6 
) const
private

Helper: count number of normals1 that are in normals2.

Definition at line 1097 of file meshRefinementRefine.C.

References forAll, and Foam::magSqr().

Here is the call graph for this function:

◆ markSurfaceCurvatureRefinement()

Foam::label markSurfaceCurvatureRefinement ( const scalar  curvature,
const label  nAllowRefine,
const labelList neiLevel,
const pointField neiCc,
labelList refineCell,
label nRefine 
) const
private

Mark cells for surface curvature based refinement. Marks if.

local curvature > curvature or if on different regions (markDifferingRegions)

Definition at line 1127 of file meshRefinementRefine.C.

References List::append(), List::clear(), Foam::endl(), forAll, Foam::Info, Foam::max(), Foam::min(), Foam::Pout, Foam::reduce(), Foam::returnReduce(), List::size(), Foam::sortedOrder(), and Foam::Swap().

Here is the call graph for this function:

◆ checkProximity()

bool checkProximity ( const scalar  planarCos,
const label  nAllowRefine,
const label  surfaceLevel,
const vector surfaceLocation,
const vector surfaceNormal,
const label  cellI,
label cellMaxLevel,
vector cellMaxLocation,
vector cellMaxNormal,
labelList refineCell,
label nRefine 
) const
private

Mark cell if local a gap topology or.

<< " location:" << cellMaxLocation

Definition at line 1657 of file meshRefinementRefine.C.

◆ markProximityRefinement()

Foam::label markProximityRefinement ( const scalar  curvature,
const label  nAllowRefine,
const labelList neiLevel,
const pointField neiCc,
labelList refineCell,
label nRefine 
) const
private

Mark cells for surface proximity based refinement.

Definition at line 1740 of file meshRefinementRefine.C.

References List::clear(), Foam::endl(), forAll, Foam::Info, Foam::Pout, Foam::returnReduce(), and List::size().

Here is the call graph for this function:

◆ getZoneBafflePatches()

Foam::Map< Foam::labelPair > getZoneBafflePatches ( const bool  allowBoundary,
const labelList globalToMasterPatch,
const labelList globalToSlavePatch 
) const
private

Get faces to repatch. Returns map from face to patch.

Definition at line 467 of file meshRefinementBaffles.C.

References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, ZoneMesh::findZoneID(), faceZone::flipMap(), forAll, Foam::Info, zone::name(), patches, and Foam::reverse().

Here is the call graph for this function:

◆ getIntersections() [1/2]

void getIntersections ( const labelList surfacesToTest,
const pointField neiCc,
const labelList testFaces,
labelList globalRegion1,
labelList globalRegion2 
) const
private

Calculate intersections. Return per face -1 or the global.

surface region

Definition at line 173 of file meshRefinementBaffles.C.

References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::mkDir(), Foam::nl, Foam::Pout, autoPtr::reset(), List::setSize(), List::size(), timeName, and autoPtr::valid().

Here is the call graph for this function:

◆ getIntersections() [2/2]

void getIntersections ( const labelList surfacesToTest,
const pointField neiCc,
const labelList testFaces,
labelList namedSurfaceIndex,
PackedBoolList posOrientation 
) const
private

Calculate intersections on zoned faces. Return per face -1.

or the index of the surface and the orientation w.r.t. surface

Definition at line 2163 of file meshRefinementBaffles.C.

References Foam::endl(), forAll, Foam::magSqr(), Foam::nl, Foam::Pout, List::setSize(), PackedList::setSize(), and List::size().

Here is the call graph for this function:

◆ getBafflePatches()

void getBafflePatches ( const labelList globalToMasterPatch,
const pointField locationsInMesh,
const wordList regionsInMesh,
const labelList neiLevel,
const pointField neiCc,
labelList ownPatch,
labelList neiPatch 
) const
private

Determine patches for baffles.

Definition at line 283 of file meshRefinementBaffles.C.

References forAll, and List::setSize().

Here is the call graph for this function:

◆ createBaffle()

Foam::label createBaffle ( const label  faceI,
const label  ownPatch,
const label  neiPatch,
polyTopoChange meshMod 
) const
private

Repatches external face or creates baffle for internal face.

with user specified patches (might be different for both sides). Returns label of added face.

Definition at line 60 of file meshRefinementBaffles.C.

References Foam::abort(), f(), Foam::FatalError, FatalErrorInFunction, faceZone::flipMap(), polyTopoChange::setAction(), and faceZone::whichFace().

Here is the call graph for this function:

◆ markBoundaryFace()

void markBoundaryFace ( const label  faceI,
boolList isBoundaryFace,
boolList isBoundaryEdge,
boolList isBoundaryPoint 
) const
private

Helper function to mark face as being on 'boundary'. Used by.

markFacesOnProblemCells

Definition at line 49 of file meshRefinementProblemCells.C.

References f(), and forAll.

Here is the call graph for this function:

◆ findNearest()

void findNearest ( const labelList meshFaces,
List< pointIndexHit > &  nearestInfo,
labelList nearestSurface,
labelList nearestRegion,
vectorField nearestNormal 
) const
private

Definition at line 75 of file meshRefinementProblemCells.C.

References DynamicList::append(), forAll, Foam::identity(), scalarField(), List::setSize(), List::size(), and Foam::sqr().

Here is the call graph for this function:

◆ findEdgeConnectedProblemCells()

Foam::Map< Foam::label > findEdgeConnectedProblemCells ( const scalarField perpendicularAngle,
const labelList globalToPatch 
) const
private

◆ isCollapsedFace()

bool isCollapsedFace ( const pointField points,
const pointField neiCc,
const scalar  minFaceArea,
const scalar  maxNonOrtho,
const label  faceI 
) const
private

Definition at line 287 of file meshRefinementProblemCells.C.

References Foam::cos(), Foam::degToRad(), Foam::mag(), points, and s().

Here is the call graph for this function:

◆ isCollapsedCell()

bool isCollapsedCell ( const pointField points,
const scalar  volFraction,
const label  cellI 
) const
private

Definition at line 358 of file meshRefinementProblemCells.C.

References points.

◆ markFacesOnProblemCells()

Foam::labelList markFacesOnProblemCells ( const dictionary motionDict,
const bool  removeEdgeConnectedCells,
const scalarField perpendicularAngle,
const labelList globalToMasterPatch 
) const
private

◆ nearestPatch()

Foam::labelList nearestPatch ( const labelList adaptPatchIDs) const
private

Returns list with for every face the label of the nearest.

patch. Any unreached face (disconnected mesh?) becomes adaptPatchIDs[0]

Definition at line 378 of file meshRefinementProblemCells.C.

References FaceCellWave< Type, TrackingData >::data(), Foam::endl(), forAll, patches, patchFaces(), List::setSize(), List::size(), polyPatch::start(), and WarningInFunction.

Here is the call graph for this function:

◆ markFacesOnProblemCellsGeometric()

Foam::labelList markFacesOnProblemCellsGeometric ( const snapParameters snapParams,
const dictionary motionDict,
const labelList globalToMasterPatch,
const labelList globalToSlavePatch 
) const
private

◆ freeStandingBaffles()

Foam::List< Foam::labelPair > freeStandingBaffles ( const List< labelPair > &  couples,
const scalar  freeStandingAngle 
) const
private

Extract those baffles (duplicate) faces that are on the edge.

of a baffle region. These are candidates for merging.

Definition at line 944 of file meshRefinementBaffles.C.

References Foam::cos(), polyPatch::coupled(), Foam::degToRad(), Foam::endl(), f1, Pair::first(), forAll, Foam::identity(), Foam::Info, Foam::mag(), n, Foam::nl, patches, Foam::returnReduce(), Pair::second(), List::setSize(), List::size(), and polyPatch::start().

Here is the call graph for this function:

◆ findCellZoneGeometric()

void findCellZoneGeometric ( const pointField neiCc,
const labelList closedNamedSurfaces,
labelList namedSurfaceIndex,
const labelList surfaceToCellZone,
labelList cellToZone 
) const
private

Finds zone per cell for cells inside closed named surfaces.

(uses geometric test for insideness) Adapts namedSurfaceIndex so all faces on boundary of cellZone have corresponding faceZone.

Definition at line 1426 of file meshRefinementBaffles.C.

References polyPatch::coupled(), Foam::constant::electromagnetic::e, Foam::findIndex(), forAll, Foam::min(), patches, and polyPatch::start().

Here is the call graph for this function:

◆ findCellZoneInsideWalk() [1/2]

void findCellZoneInsideWalk ( const pointField locationsInMesh,
const labelList zonesInMesh,
const labelList blockedFace,
labelList cellToZone 
) const
private

Finds zone per cell for cells inside region for which name.

is specified.

Definition at line 1667 of file meshRefinementBaffles.C.

References List::clear(), Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::Info, Foam::nl, regionSplit::nRegions(), and WarningInFunction.

Here is the call graph for this function:

◆ findCellZoneInsideWalk() [2/2]

void findCellZoneInsideWalk ( const pointField locationsInMesh,
const wordList zoneNamesInMesh,
const labelList faceToZone,
labelList cellToZone 
) const
private

Finds zone per cell for cells inside region for which name.

is specified.

Definition at line 1788 of file meshRefinementBaffles.C.

References ZoneMesh::findZoneID(), forAll, and List::size().

Here is the call graph for this function:

◆ calcRegionToZone()

bool calcRegionToZone ( const label  surfZoneI,
const label  ownRegion,
const label  neiRegion,
labelList regionToCellZone 
) const
private

Determines cell zone from cell region information.

Definition at line 1814 of file meshRefinementBaffles.C.

◆ findCellZoneTopo()

void findCellZoneTopo ( const pointField locationsInMesh,
const labelList allSurfaceIndex,
const labelList namedSurfaceIndex,
const labelList surfaceToCellZone,
labelList cellToZone 
) const
private

Finds zone per cell. Uses topological walk with all faces.

marked in namedSurfaceIndex regarded as blocked.

Definition at line 1872 of file meshRefinementBaffles.C.

References List::clear(), polyPatch::coupled(), Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::Info, Foam::nl, regionSplit::nRegions(), patches, Foam::Pout, Foam::returnReduce(), and polyPatch::start().

Here is the call graph for this function:

◆ makeConsistentFaceIndex()

void makeConsistentFaceIndex ( const labelList zoneToNamedSurface,
const labelList cellToZone,
labelList namedSurfaceIndex 
) const
private

Make namedSurfaceIndex consistent with cellToZone.

  • clear out any blocked faces inbetween same cell zone.

Definition at line 2077 of file meshRefinementBaffles.C.

References polyPatch::coupled(), forAll, patches, and polyPatch::start().

Here is the call graph for this function:

◆ zonify() [1/3]

void zonify ( const bool  allowFreeStandingZoneFaces,
const pointField locationsInMesh,
const wordList zonesInMesh,
labelList cellToZone,
labelList namedSurfaceIndex,
PackedBoolList posOrientation 
) const
private

◆ zonify() [2/3]

void zonify ( const PackedBoolList isMasterFace,
const labelList cellToZone,
const labelList neiCellZone,
const labelList faceToZone,
const PackedBoolList meshFlipMap,
polyTopoChange meshMod 
) const
private

Put cells into cellZone, faces into faceZone.

Definition at line 3224 of file meshRefinementBaffles.C.

References forAll, patches, polyTopoChange::setAction(), and polyPatch::start().

Here is the call graph for this function:

◆ allocateInterRegionFaceZone()

void allocateInterRegionFaceZone ( const label  ownZone,
const label  neiZone,
wordPairHashTable zonesToFaceZone,
HashTable< word, labelPair, labelPair::Hash<> > &  zoneIDsToFaceZone 
) const
private

Allocate faceZoneName.

Definition at line 3364 of file meshRefinementBaffles.C.

References HashTable::find(), Pair::first(), HashTable::insert(), Pair::second(), and Foam::Swap().

Here is the call graph for this function:

◆ handleSnapProblems()

void handleSnapProblems ( const snapParameters snapParams,
const bool  useTopologicalSnapDetection,
const bool  removeEdgeConnectedCells,
const scalarField perpendicularAngle,
const dictionary motionDict,
Time runTime,
const labelList globalToMasterPatch,
const labelList globalToSlavePatch 
)
private

◆ freeStandingBaffleFaces()

Foam::labelList freeStandingBaffleFaces ( const labelList faceToZone,
const labelList cellToZone,
const labelList neiCellZone 
) const
private

Get all faces in faceToZone that have no cellZone on.

either side.

Definition at line 2719 of file meshRefinementBaffles.C.

References DynamicList::append(), forAll, patches, DynamicList::shrink(), and polyPatch::start().

Here is the call graph for this function:

◆ calcPatchNumMasterFaces()

void calcPatchNumMasterFaces ( const PackedBoolList isMasterFace,
const indirectPrimitivePatch patch,
labelList nMasterFaces 
) const
private

Determine per patch edge the number of master faces. Used.

to detect non-manifold situations.

Definition at line 2783 of file meshRefinementBaffles.C.

References PrimitivePatch< Face, FaceList, PointField, PointType >::faceEdges(), forAll, PrimitivePatch< Face, FaceList, PointField, PointType >::meshEdges(), PrimitivePatch< Face, FaceList, PointField, PointType >::nEdges(), and List::setSize().

Here is the call graph for this function:

◆ markPatchZones()

Foam::label markPatchZones ( const indirectPrimitivePatch patch,
const labelList nMasterFaces,
labelList faceToZone 
) const
private

◆ consistentOrientation()

void consistentOrientation ( const PackedBoolList isMasterFace,
const indirectPrimitivePatch patch,
const labelList nMasterFaces,
const labelList faceToZone,
const Map< label > &  zoneToOrientation,
PackedBoolList meshFlipMap 
) const
private

◆ operator=()

void operator= ( const meshRefinement )
private

Disallow default bitwise assignment.

◆ ClassName()

ClassName ( "meshRefinement"  )

Runtime type information.

◆ mesh() [1/2]

const fvMesh& mesh ( ) const
inline

◆ mesh() [2/2]

fvMesh& mesh ( )
inline

Definition at line 821 of file meshRefinement.H.

References meshRefinement::mesh_.

◆ mergeDistance()

scalar mergeDistance ( ) const
inline

Definition at line 826 of file meshRefinement.H.

References meshRefinement::mergeDistance_.

◆ overwrite()

bool overwrite ( ) const
inline

Overwrite the mesh?

Definition at line 832 of file meshRefinement.H.

References meshRefinement::overwrite_.

◆ oldInstance()

const word& oldInstance ( ) const
inline

(points)instance of mesh upon construction

Definition at line 838 of file meshRefinement.H.

References meshRefinement::oldInstance_.

◆ surfaces()

const refinementSurfaces& surfaces ( ) const
inline

Reference to surface search engines.

Definition at line 844 of file meshRefinement.H.

References meshRefinement::surfaces_.

Referenced by autoSnapDriver::calcNearestSurface().

Here is the caller graph for this function:

◆ features()

const refinementFeatures& features ( ) const
inline

Reference to feature edge mesh.

Definition at line 850 of file meshRefinement.H.

References meshRefinement::features_.

◆ shells()

const shellSurfaces& shells ( ) const
inline

Reference to refinement shells (regions)

Definition at line 856 of file meshRefinement.H.

References meshRefinement::shells_.

◆ meshCutter()

const hexRef8& meshCutter ( ) const
inline

Reference to meshcutting engine.

Definition at line 862 of file meshRefinement.H.

References meshRefinement::meshCutter_.

Referenced by autoSnapDriver::smoothInternalDisplacement().

Here is the caller graph for this function:

◆ surfaceIndex() [1/2]

const labelList& surfaceIndex ( ) const
inline

Per start-end edge the index of the surface hit.

Definition at line 868 of file meshRefinement.H.

References meshRefinement::surfaceIndex_.

◆ surfaceIndex() [2/2]

labelList& surfaceIndex ( )
inline

Definition at line 873 of file meshRefinement.H.

References meshRefinement::surfaceIndex_.

◆ faceToCoupledPatch()

const Map<label>& faceToCoupledPatch ( ) const
inline

For faces originating from processor faces store the original.

patch

Definition at line 880 of file meshRefinement.H.

◆ userFaceData() [1/2]

const List<Tuple2<mapType, labelList> >& userFaceData ( ) const
inline

Additional face data that is maintained across.

topo changes. Every entry is a list over all faces. Bit of a hack. Additional flag to say whether to maintain master only (false) or increase set to account for face-from-face.

Definition at line 889 of file meshRefinement.H.

◆ userFaceData() [2/2]

List<Tuple2<mapType, labelList> >& userFaceData ( )
inline

Definition at line 894 of file meshRefinement.H.

References meshRefinement::userFaceData_.

◆ countHits()

Foam::label countHits ( ) const

Count number of intersections (local)

Definition at line 1273 of file meshRefinement.C.

References forAll, PackedList::get(), and syncTools::getMasterFaces().

Referenced by meshRefinement::updateIntersections().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ balance()

Foam::autoPtr< Foam::mapDistributePolyMesh > balance ( const bool  keepZoneFaces,
const bool  keepBaffles,
const scalarField cellWeights,
decompositionMethod decomposer,
fvMeshDistribute distributor 
)

◆ intersectedFaces()

Foam::labelList intersectedFaces ( ) const

Get faces with intersection.

Definition at line 1548 of file meshRefinement.C.

References forAll.

◆ intersectedPoints()

Foam::labelList intersectedPoints ( ) const

Get points on surfaces with intersection and boundary faces.

Definition at line 1575 of file meshRefinement.C.

References f(), forAll, PackedList::get(), and PackedBoolList::set().

Here is the call graph for this function:

◆ makePatch()

Foam::autoPtr< Foam::indirectPrimitivePatch > makePatch ( const polyMesh mesh,
const labelList patchIDs 
)
static

Create patch from set of patches.

Definition at line 1644 of file meshRefinement.C.

References polyMesh::boundaryMesh(), polyMesh::faces(), forAll, mesh, patches, polyMesh::points(), and polyPatch::start().

Referenced by autoLayerDriver::addLayers(), and autoSnapDriver::doSnap().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeDisplacementField()

Foam::tmp< Foam::pointVectorField > makeDisplacementField ( const pointMesh pMesh,
const labelList adaptPatchIDs 
)
static

Helper function to make a pointVectorField with correct.

bcs for mesh movement:

  • adaptPatchIDs : fixedValue
  • processor : calculated (so free to move)
  • cyclic/wedge/symmetry : slip
  • other : slip

Definition at line 1690 of file meshRefinement.C.

References IOobject::AUTO_WRITE, pointMesh::boundary(), Foam::dimLength, forAll, mesh, IOobject::NO_READ, PtrList::size(), fvMesh::time(), Time::timeName(), and Vector< scalar >::zero.

Referenced by autoSnapDriver::doSnap().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkCoupledFaceZones()

void checkCoupledFaceZones ( const polyMesh mesh)
static

Helper function: check that face zones are synced.

Definition at line 1747 of file meshRefinement.C.

References Foam::abort(), Foam::exit(), polyMesh::faceZones(), Foam::FatalError, FatalErrorInFunction, forAll, Pstream::gatherList(), mesh, UPstream::myProcNo(), zone::name(), ZoneMesh::names(), primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), Foam::nl, UPstream::nProcs(), Pstream::scatterList(), and syncTools::swapBoundaryFaceList().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ calculateEdgeWeights()

void calculateEdgeWeights ( const polyMesh mesh,
const PackedBoolList isMasterEdge,
const labelList meshPoints,
const edgeList edges,
scalarField edgeWeights,
scalarField invSumWeight 
)
static

Helper: calculate edge weights (1/length)

Definition at line 1835 of file meshRefinement.C.

References Foam::e, forAll, Foam::mag(), Foam::max(), mesh, polyMesh::points(), List::size(), PackedList::size(), and w().

Referenced by fieldSmoother::smoothLambdaMuDisplacement(), fieldSmoother::smoothNormals(), and fieldSmoother::smoothPatchNormals().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ weightedSum()

void weightedSum ( const polyMesh mesh,
const PackedBoolList isMasterEdge,
const labelList meshPoints,
const edgeList edges,
const scalarField edgeWeights,
const Field< Type > &  data,
Field< Type > &  sum 
)
static

Helper: weighted sum (over all subset of mesh points) by.

summing contribution from (master) edges

Definition at line 280 of file meshRefinementTemplates.C.

References Foam::abort(), Foam::constant::electromagnetic::e, Foam::FatalError, FatalErrorInFunction, forAll, mesh, List::size(), PackedList::size(), and Foam::sum().

Referenced by fieldSmoother::smoothLambdaMuDisplacement(), fieldSmoother::smoothNormals(), and fieldSmoother::smoothPatchNormals().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isGap()

bool isGap ( const scalar  planarCos,
const vector point0,
const vector normal0,
const vector point1,
const vector normal1 
) const

Is local topology a small gap?

Hits differ and angles are oppositeish and

hits have a normal distance

Definition at line 1543 of file meshRefinementRefine.C.

References Foam::mag().

Here is the call graph for this function:

◆ isNormalGap()

bool isNormalGap ( const scalar  planarCos,
const vector point0,
const vector normal0,
const vector point1,
const vector normal1 
) const

Is local topology a small gap normal to the test vector.

Hits differ and angles are oppositeish and

hits have a normal distance

Definition at line 1600 of file meshRefinementRefine.C.

References Foam::cos(), Foam::degToRad(), and Foam::mag().

Here is the call graph for this function:

◆ refineCandidates()

Foam::labelList refineCandidates ( const pointField keepPoints,
const scalar  curvature,
const scalar  planarAngle,
const bool  featureRefinement,
const bool  featureDistanceRefinement,
const bool  internalRefinement,
const bool  surfaceRefinement,
const bool  curvatureRefinement,
const bool  smallFeatureRefinement,
const bool  gapRefinement,
const bool  bigGapRefinement,
const bool  spreadGapSize,
const label  maxGlobalCells,
const label  maxLocalCells 
) const

Calculate list of cells to refine.

Disable refinement shortcut. nAllowRefine is per processor limit.

Definition at line 2045 of file meshRefinementRefine.C.

References Foam::cos(), Foam::degToRad(), Foam::endl(), forAll, Foam::Info, Foam::labelMax, Foam::max(), and List::setSize().

Here is the call graph for this function:

◆ refine()

Foam::autoPtr< Foam::mapPolyMesh > refine ( const labelList cellsToRefine)

Refine some cells.

Definition at line 2347 of file meshRefinementRefine.C.

References polyTopoChange::changeMesh(), and timeName.

Here is the call graph for this function:

◆ refineAndBalance()

Foam::autoPtr< Foam::mapDistributePolyMesh > refineAndBalance ( const string msg,
decompositionMethod decomposer,
fvMeshDistribute distributor,
const labelList cellsToRefine,
const scalar  maxLoadUnbalance 
)

Refine some cells and rebalance.

Definition at line 2388 of file meshRefinementRefine.C.

References Foam::endl(), Foam::Info, Foam::mag(), MESH, Foam::Pout, Foam::returnReduce(), timeName, and write().

Here is the call graph for this function:

◆ balanceAndRefine()

Foam::autoPtr< Foam::mapDistributePolyMesh > balanceAndRefine ( const string msg,
decompositionMethod decomposer,
fvMeshDistribute distributor,
const labelList cellsToRefine,
const scalar  maxLoadUnbalance 
)

Balance before refining some cells.

Definition at line 2489 of file meshRefinementRefine.C.

References Foam::endl(), forAll, Foam::Info, Foam::mag(), MESH, Foam::Pout, Foam::returnReduce(), List::size(), timeName, and write().

Here is the call graph for this function:

◆ baffleAndSplitMesh()

void baffleAndSplitMesh ( const bool  handleSnapProblems,
const snapParameters snapParams,
const bool  useTopologicalSnapDetection,
const bool  removeEdgeConnectedCells,
const scalarField perpendicularAngle,
const dictionary motionDict,
Time runTime,
const labelList globalToMasterPatch,
const labelList globalToSlavePatch,
const pointField locationsInMesh,
const wordList regionsInMesh,
const pointField locationsOutsideMesh 
)

Split off unreachable areas of mesh.

Definition at line 3431 of file meshRefinementBaffles.C.

References cpuTime::cpuTimeIncrement(), Foam::endl(), Foam::Info, MESH, Foam::nl, Time::path(), Foam::Pout, Foam::returnReduce(), List::setSize(), timeName, and write().

Here is the call graph for this function:

◆ mergeFreeStandingBaffles()

void mergeFreeStandingBaffles ( const snapParameters snapParams,
const bool  useTopologicalSnapDetection,
const bool  removeEdgeConnectedCells,
const scalarField perpendicularAngle,
const scalar  planarAngle,
const dictionary motionDict,
Time runTime,
const labelList globalToMasterPatch,
const labelList globalToSlavePatch,
const pointField locationsInMesh,
const pointField locationsOutsideMesh 
)

Merge free-standing baffles.

Definition at line 3606 of file meshRefinementBaffles.C.

References cpuTime::cpuTimeIncrement(), Foam::endl(), Foam::Info, Foam::nl, Foam::reduce(), and List::size().

Here is the call graph for this function:

◆ splitMesh()

Foam::autoPtr< Foam::mapPolyMesh > splitMesh ( const label  nBufferLayers,
const labelList globalToMasterPatch,
const labelList globalToSlavePatch,
const pointField locationsInMesh,
const wordList regionsInMesh,
const pointField locationsOutsideMesh 
)

Split off (with optional buffer layers) unreachable areas.

of mesh. Does not introduce baffles.

Definition at line 3699 of file meshRefinementBaffles.C.

References DynamicList::append(), List::clear(), Foam::endl(), f(), forAll, removeCells::getExposedFaces(), Foam::Info, Foam::labelMax, Foam::max(), regionSplit::nRegions(), pFaces, Foam::reduce(), DynamicList::shrink(), List::size(), List::transfer(), and WarningInFunction.

Here is the call graph for this function:

◆ dupNonManifoldPoints() [1/2]

Foam::autoPtr< Foam::mapPolyMesh > dupNonManifoldPoints ( const localPointRegion regionSide)

Find boundary points that connect to more than one cell.

region and split them.

Definition at line 3977 of file meshRefinementBaffles.C.

References polyTopoChange::changeMesh(), Foam::endl(), Foam::Info, Foam::returnReduce(), duplicatePoints::setRefinement(), and timeName.

Here is the call graph for this function:

◆ dupNonManifoldPoints() [2/2]

Foam::autoPtr< Foam::mapPolyMesh > dupNonManifoldPoints ( )

Find boundary points that connect to more than one cell.

region and split them.

Definition at line 4035 of file meshRefinementBaffles.C.

References meshRefinement::mesh_.

◆ dupNonManifoldBoundaryPoints()

Foam::autoPtr< Foam::mapPolyMesh > dupNonManifoldBoundaryPoints ( )

Find boundary points that are on faceZones of type boundary.

and duplicate them

Definition at line 4113 of file meshRefinementBaffles.C.

References surfaceZonesInfo::BAFFLE, surfaceZonesInfo::BOUNDARY, Foam::endl(), f(), surfaceZonesInfo::faceZoneTypeNames, forAll, Foam::Info, surfaceZonesInfo::INTERNAL, Foam::max(), n, Foam::returnReduce(), and syncTools::syncPointList().

Here is the call graph for this function:

◆ mergePoints()

Foam::autoPtr< Foam::mapPolyMesh > mergePoints ( const labelList pointToDuplicate)

Merge duplicate points.

Definition at line 4045 of file meshRefinementBaffles.C.

References polyTopoChange::changeMesh(), forAll, polyMeshAdder::mergePoints(), Foam::returnReduce(), and timeName.

Here is the call graph for this function:

◆ createBaffles()

Foam::autoPtr< Foam::mapPolyMesh > createBaffles ( const labelList ownPatch,
const labelList neiPatch 
)

Create baffle for every internal face where ownPatch != -1.

External faces get repatched according to ownPatch (neiPatch should be -1 for these)

Redo the intersections on the newly create baffle faces. Note that

this changes also the cell centre positions.

Definition at line 532 of file meshRefinementBaffles.C.

References Foam::abort(), polyTopoChange::changeMesh(), polyPatch::coupled(), Foam::endl(), Foam::faceMap(), Foam::FatalError, FatalErrorInFunction, forAll, HashSet< Key, Hash >::insert(), Foam::returnReduce(), List::size(), polyPatch::start(), faceSet::sync(), timeName, and HashTable::toc().

Here is the call graph for this function:

◆ getZones()

Foam::labelList getZones ( const List< surfaceZonesInfo::faceZoneType > &  fzTypes) const

Get zones of given type.

Definition at line 712 of file meshRefinementBaffles.C.

References DynamicList::append(), Foam::findIndex(), forAll, and zone::name().

Referenced by autoSnapDriver::getInternalOrBaffleDuplicateFace().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ subsetBaffles()

Foam::List< Foam::labelPair > subsetBaffles ( const polyMesh mesh,
const labelList zoneIDs,
const List< labelPair > &  baffles 
)
static

Subset baffles according to zones.

Definition at line 739 of file meshRefinementBaffles.C.

References DynamicList::append(), forAll, mesh, p, and List::size().

Referenced by autoLayerDriver::addLayers(), and autoSnapDriver::getInternalOrBaffleDuplicateFace().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createZoneBaffles()

Foam::autoPtr< Foam::mapPolyMesh > createZoneBaffles ( const labelList zoneIDs,
List< labelPair > &  baffles,
labelList originatingFaceZone 
)

Create baffles for faces on faceZones. Return created baffles.

(= pairs of faces) and corresponding faceZone

Definition at line 773 of file meshRefinementBaffles.C.

References Foam::abort(), List::clear(), Foam::endl(), Foam::exit(), Foam::faceMap(), Foam::FatalError, FatalErrorInFunction, faceZone::flipMap(), forAll, Foam::Info, MESH, zone::name(), Foam::nl, Foam::Pout, Foam::returnReduce(), Foam::setf(), List::setSize(), Foam::setw(), List::size(), Foam::sum(), timeName, and write().

Here is the call graph for this function:

◆ mergeBaffles()

Foam::autoPtr< Foam::mapPolyMesh > mergeBaffles ( const List< labelPair > &  couples,
const Map< label > &  faceToPatch 
)

Merge baffles. Gets pairs of faces and boundary faces to move.

onto (coupled) patches

Definition at line 1207 of file meshRefinementBaffles.C.

References polyTopoChange::changeMesh(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, faceZone::flipMap(), forAll, forAllConstIter(), Foam::returnReduce(), polyTopoChange::setAction(), List::setSize(), List::size(), timeName, faceZone::whichFace(), and ZoneMesh::whichZone().

Here is the call graph for this function:

◆ mergeZoneBaffles()

Foam::autoPtr< Foam::mapPolyMesh > mergeZoneBaffles ( const bool  doInternalZones,
const bool  doBaffleZones 
)

Merge all baffles on faceZones.

Definition at line 1386 of file meshRefinementBaffles.C.

References DynamicList::append(), Foam::returnReduce(), and List::size().

Here is the call graph for this function:

◆ zonify() [3/3]

Foam::autoPtr< Foam::mapPolyMesh > zonify ( const bool  allowFreeStandingZoneFaces,
const pointField locationsInMesh,
const wordList regionsInMesh,
wordPairHashTable zonesToFaceZone 
)

◆ appendPatch()

Foam::label appendPatch ( fvMesh mesh,
const label  insertPatchI,
const word patchName,
const dictionary patchDict 
)
static

Helper:append patch to end of mesh.

Definition at line 1891 of file meshRefinement.C.

References fvMesh::boundary(), polyMesh::boundaryMesh(), fvMesh::clearOut(), mesh, fvPatch::New(), polyPatch::New(), PtrList::set(), PtrList::setSize(), and PtrList::size().

Here is the call graph for this function:

◆ addPatch()

Foam::label addPatch ( fvMesh mesh,
const word name,
const dictionary patchInfo 
)
static

Helper:add patch to mesh. Update all registered fields.

Used by addMeshedPatch to add patches originating from surfaces.

Definition at line 1990 of file meshRefinement.C.

References fvMesh::boundary(), polyMesh::boundaryMesh(), polyBoundaryMesh::findPatchID(), forAll, mesh, primitiveMesh::nFaces(), polyBoundaryMesh::reorder(), PtrList::reorder(), dictionary::set(), PtrList::size(), and polyPatch::start().

Here is the call graph for this function:

◆ addMeshedPatch()

Foam::label addMeshedPatch ( const word name,
const dictionary patchInfo 
)

Add patch originating from meshing. Update meshedPatches_.

Definition at line 2068 of file meshRefinement.C.

References Foam::findIndex(), and Foam::name().

Referenced by autoRefineDriver::addFaceZones(), and main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ meshedPatches()

Foam::labelList meshedPatches ( ) const

Get patchIDs for patches added in addMeshedPatch.

Definition at line 2118 of file meshRefinement.C.

References Foam::abort(), DynamicList::append(), polyPatch::constraintType(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAll, patches, and Foam::type().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addFaceZone()

Foam::label addFaceZone ( const word fzName,
const word masterPatch,
const word slavePatch,
const surfaceZonesInfo::faceZoneType fzType 
)

Add/lookup faceZone and update information. Return index of.

faceZone

Definition at line 2145 of file meshRefinement.C.

References surfaceZonesInfo::addFaceZone().

Referenced by autoRefineDriver::addFaceZones(), and main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFaceZoneInfo()

bool getFaceZoneInfo ( const word fzName,
label masterPatchID,
label slavePatchID,
surfaceZonesInfo::faceZoneType fzType 
) const

Lookup faceZone information. Return false if no information.

for faceZone

Definition at line 2169 of file meshRefinement.C.

References polyBoundaryMesh::findPatchID().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ selectSeparatedCoupledFaces()

void selectSeparatedCoupledFaces ( boolList selected) const

Select coupled faces that are not collocated.

Definition at line 2197 of file meshRefinement.C.

References forAll, coupledPolyPatch::parallel(), patches, coupledPolyPatch::separated(), and polyPatch::start().

Here is the call graph for this function:

◆ updateIntersections()

void updateIntersections ( const labelList changedFaces)

◆ findRegion()

Foam::label findRegion ( const polyMesh mesh,
const labelList cellRegion,
const vector perturbVec,
const point p 
)
static

Find region point is in. Uses optional perturbation to re-test.

Definition at line 2224 of file meshRefinement.C.

References polyMesh::findCell(), mesh, p, Foam::reduce(), and polyMesh::tetBasePtIs().

Here is the call graph for this function:

◆ findRegions()

void findRegions ( const polyMesh mesh,
const vector perturbVec,
const pointField locationsInMesh,
const pointField locationsOutsideMesh,
const label  nRegions,
labelList cellRegion 
)
static

Definition at line 2321 of file meshRefinement.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::findIndex(), forAll, mesh, and primitiveMesh::nCells().

Here is the call graph for this function:

◆ splitMeshRegions()

Foam::autoPtr< Foam::mapPolyMesh > splitMeshRegions ( const labelList globalToMasterPatch,
const labelList globalToSlavePatch,
const pointField locationsInMesh,
const pointField locationsOutsideMesh 
)

Split mesh. Keep part containing point. Return empty map if.

no cells removed.

Definition at line 2403 of file meshRefinement.C.

References DynamicList::append(), Foam::endl(), forAll, removeCells::getExposedFaces(), Foam::Info, regionSplit::nRegions(), Foam::returnReduce(), List::setSize(), DynamicList::shrink(), List::size(), and WarningInFunction.

Here is the call graph for this function:

◆ doSplitFaces()

void doSplitFaces ( const labelList splitFaces,
const labelPairList splits,
polyTopoChange meshMod 
) const

Split faces into two.

Definition at line 740 of file meshRefinement.C.

References polyTopoChange::addFace(), f(), f1, faceZone::flipMap(), forAll, polyTopoChange::modifyFace(), List::size(), and faceZone::whichFace().

Here is the call graph for this function:

◆ splitFacesUndo()

Foam::label splitFacesUndo ( const labelList splitFaces,
const labelPairList splits,
const dictionary motionDict,
labelList duplicateFace,
List< labelPair > &  baffles 
)

◆ distribute()

void distribute ( const mapDistributePolyMesh map)

Update local numbering for mesh redistribution.

Definition at line 2505 of file meshRefinement.C.

References autoPtr::clear(), mapDistributePolyMesh::distributeFaceData(), Foam::e, treeBoundBox::extend(), Foam::faceMap(), forAll, meshBb, and rndGen().

Here is the call graph for this function:

◆ updateMesh() [1/2]

void updateMesh ( const mapPolyMesh map,
const labelList changedFaces 
)

Update for external change to mesh. changedFaces are in new mesh.

face labels.

Definition at line 2568 of file meshRefinement.C.

◆ updateList()

void updateList ( const labelList newToOld,
const T nullValue,
List< T > &  elems 
)
static

Helper: reorder list according to map.

Definition at line 35 of file meshRefinementTemplates.C.

References forAll, List::size(), and List::transfer().

Referenced by autoLayerDriver::addLayers(), and meshRefinement::splitFacesUndo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ storeData()

void storeData ( const labelList pointsToStore,
const labelList facesToStore,
const labelList cellsToStore 
)

Signal points/face/cells for which to store data.

Definition at line 2580 of file meshRefinement.C.

◆ updateMesh() [2/2]

void updateMesh ( const mapPolyMesh map,
const labelList changedFaces,
const Map< label > &  pointsToRestore,
const Map< label > &  facesToRestore,
const Map< label > &  cellsToRestore 
)

Update local numbering + undo.

Data to restore given as new pointlabel + stored pointlabel (i.e. what was in pointsToStore)

Definition at line 2597 of file meshRefinement.C.

References mapPolyMesh::faceMap(), forAll, forAllConstIter(), mapPolyMesh::reverseFaceMap(), List::size(), and dictionary::transfer().

Here is the call graph for this function:

◆ mergePatchFaces()

Foam::label mergePatchFaces ( const scalar  minCos,
const scalar  concaveCos,
const label  mergeSize,
const labelList patchIDs 
)

◆ mergePatchFacesUndo()

Foam::label mergePatchFacesUndo ( const scalar  minCos,
const scalar  concaveCos,
const labelList patchIDs,
const dictionary motionDict,
const labelList preserveFaces 
)

◆ doRemovePoints()

Foam::autoPtr< Foam::mapPolyMesh > doRemovePoints ( removePoints pointRemover,
const boolList pointCanBeDeleted 
)

◆ doRestorePoints()

Foam::autoPtr< Foam::mapPolyMesh > doRestorePoints ( removePoints pointRemover,
const labelList facesToRestore 
)

◆ collectFaces()

Foam::labelList collectFaces ( const labelList candidateFaces,
const labelHashSet set 
) const

Definition at line 763 of file meshRefinementMerge.C.

References Foam::findIndices(), forAll, and HashTable::found().

Here is the call graph for this function:

◆ growFaceCellFace()

Foam::labelList growFaceCellFace ( const labelHashSet set) const

Definition at line 795 of file meshRefinementMerge.C.

References Foam::findIndices(), forAll, and forAllConstIter().

Here is the call graph for this function:

◆ mergeEdgesUndo()

Foam::label mergeEdgesUndo ( const scalar  minCos,
const dictionary motionDict 
)

Merge edges, maintain mesh quality. Return global number.

of edges merged

Definition at line 837 of file meshRefinementMerge.C.

References Foam::polyMeshGenChecks::checkMesh(), removePoints::countPointUsage(), Foam::endl(), Foam::Info, IOobject::instance(), MESH, n, Foam::nl, IOobject::objectPath(), Foam::Pout, Foam::returnReduce(), removePoints::savedFaceLabels(), List::size(), HashTable::size(), timeName, write(), and regIOobject::write().

Here is the call graph for this function:

◆ checkData()

void checkData ( )

Debugging: check that all faces still obey start()>end()

Definition at line 466 of file meshRefinement.C.

References Foam::endl(), localPointRegion::findDuplicateFaces(), forAll, Foam::identity(), Foam::Pout, syncTools::swapBoundaryFaceList(), syncTools::syncBoundaryFacePositions(), and WarningInFunction.

Here is the call graph for this function:

◆ testSyncPointList() [1/2]

void testSyncPointList ( const string msg,
const polyMesh mesh,
const List< scalar > &  fld 
)
static

◆ testSyncPointList() [2/2]

void testSyncPointList ( const string msg,
const polyMesh mesh,
const List< point > &  fld 
)
static

◆ testSyncBoundaryFaceList()

void testSyncBoundaryFaceList ( const scalar  mergeDistance,
const string msg,
const UList< T > &  faceData,
const UList< T > &  syncedFaceData 
) const

Compare two lists over all boundary faces.

Definition at line 102 of file meshRefinementTemplates.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::mag(), patchIdentifier::name(), patches, UList::size(), polyPatch::start(), and T.

Here is the call graph for this function:

◆ collectAndPrint()

void collectAndPrint ( const UList< point > &  points,
const UList< T > &  data 
)
static

Print list according to (collected and) sorted coordinate.

Definition at line 159 of file meshRefinementTemplates.C.

References Foam::DelaunayMeshTools::allPoints(), Foam::endl(), forAll, Foam::identity(), Foam::Info, Foam::mag(), points, and Foam::sortedOrder().

Here is the call graph for this function:

◆ getMasterPoints()

Foam::PackedBoolList getMasterPoints ( const polyMesh mesh,
const labelList meshPoints 
)
static

Determine master point for subset of points. If coupled.

chooses only one

Definition at line 2747 of file meshRefinement.C.

References forAll, Foam::labelMax, mesh, List::size(), and syncTools::syncPointList().

Referenced by medialAxisMeshMover::calculateDisplacement(), displacementMotionSolverMeshMover::move(), and medialAxisMeshMover::update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getMasterEdges()

Foam::PackedBoolList getMasterEdges ( const polyMesh mesh,
const labelList meshEdges 
)
static

Determine master edge for subset of edges. If coupled.

chooses only one

Definition at line 2784 of file meshRefinement.C.

References forAll, Foam::labelMax, mesh, List::size(), syncTools::syncEdgeList(), and globalIndex::toGlobal().

Referenced by medialAxisMeshMover::calculateDisplacement(), displacementMotionSolverMeshMover::move(), and medialAxisMeshMover::update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ printMeshInfo()

void printMeshInfo ( const bool  debug,
const string msg 
) const

Print some mesh stats.

Definition at line 2820 of file meshRefinement.C.

References Foam::endl(), forAll, syncTools::getMasterFaces(), syncTools::getMasterPoints(), Foam::gMax(), Foam::Info, Pstream::listCombineGather(), Pstream::listCombineScatter(), globalMeshData::nTotalCells(), Foam::Pout, and Foam::returnReduce().

Referenced by main(), and writeMesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ timeName()

Foam::word timeName ( ) const

Replacement for Time::timeName() : return oldInstance (if.

Return either time().constant() or oldInstance.

overwrite_)

Definition at line 2888 of file meshRefinement.C.

Referenced by main(), autoSnapDriver::preSmoothPatch(), and writeMesh().

Here is the caller graph for this function:

◆ setInstance()

void setInstance ( const fileName inst)

Set instance of all local IOobjects.

Definition at line 670 of file meshRefinement.C.

Referenced by meshRefinement::updateIntersections().

Here is the caller graph for this function:

◆ write() [1/2]

bool write ( ) const

Write mesh and all data.

Definition at line 2707 of file meshRefinement.C.

References forAll, and s().

Referenced by main(), autoSnapDriver::preSmoothPatch(), and writeMesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dumpRefinementLevel()

void dumpRefinementLevel ( ) const

Write refinement level as volScalarFields for postprocessing.

Definition at line 2901 of file meshRefinement.C.

References IOobject::AUTO_WRITE, Foam::dimless, forAll, MeshObject< polyMesh, UpdateableMeshObject, pointMesh >::New(), IOobject::NO_READ, and IOobject::NO_WRITE.

Here is the call graph for this function:

◆ dumpIntersections()

void dumpIntersections ( const fileName prefix) const

Debug: Write intersection information to OBJ format.

Definition at line 2963 of file meshRefinement.C.

References Foam::endl(), forAll, OFstream::name(), Foam::nl, Foam::Pout, List::size(), and Foam::meshTools::writeOBJ().

Here is the call graph for this function:

◆ write() [2/2]

void write ( const debugType  debugFlags,
const writeType  writeFlags,
const fileName prefix 
) const

Do any one of above IO functions.

Definition at line 3044 of file meshRefinement.C.

References write().

Here is the call graph for this function:

◆ gAverage()

T gAverage ( const PackedBoolList isMasterElem,
const UList< T > &  values 
)
static

Helper: calculate average.

Definition at line 59 of file meshRefinementTemplates.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, n, Foam::reduce(), PackedList::size(), UList::size(), Foam::sum(), and T.

Referenced by fieldSmoother::smoothLambdaMuDisplacement(), fieldSmoother::smoothNormals(), and fieldSmoother::smoothPatchNormals().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeLevel() [1/2]

Foam::meshRefinement::writeType writeLevel ( )
static

Get/set write level.

Definition at line 3065 of file meshRefinement.C.

Referenced by autoLayerDriver::addLayers(), autoSnapDriver::doSnap(), main(), and autoLayerDriver::writeLayerData().

Here is the caller graph for this function:

◆ writeLevel() [2/2]

void writeLevel ( const writeType  flags)
static

Definition at line 3071 of file meshRefinement.C.

◆ outputLevel() [1/2]

Foam::meshRefinement::outputType outputLevel ( )
static

Get/set output level.

Definition at line 3077 of file meshRefinement.C.

Referenced by main().

Here is the caller graph for this function:

◆ outputLevel() [2/2]

void outputLevel ( const outputType  flags)
static

Definition at line 3083 of file meshRefinement.C.

◆ readFlags()

int readFlags ( const Enum &  namedEnum,
const wordList words 
)
static

Helper: convert wordList into bit pattern using provided.

NamedEnum

Definition at line 261 of file meshRefinementTemplates.C.

References forAll.

Referenced by main().

Here is the caller graph for this function:

Field Documentation

◆ IOdebugTypeNames

const Foam::NamedEnum< Foam::meshRefinement::IOdebugType, 5 > IOdebugTypeNames
static

Definition at line 99 of file meshRefinement.H.

Referenced by main().

◆ IOoutputTypeNames

const Foam::NamedEnum< Foam::meshRefinement::IOoutputType, 1 > IOoutputTypeNames
static

Definition at line 115 of file meshRefinement.H.

Referenced by main().

◆ IOwriteTypeNames

const Foam::NamedEnum< Foam::meshRefinement::IOwriteType, 4 > IOwriteTypeNames
static

Definition at line 129 of file meshRefinement.H.

Referenced by main().

◆ writeLevel_

Foam::meshRefinement::writeType writeLevel_
staticprivate

Control of writing level.

Definition at line 152 of file meshRefinement.H.

◆ outputLevel_

Foam::meshRefinement::outputType outputLevel_
staticprivate

Control of output/log level.

Definition at line 155 of file meshRefinement.H.

◆ mesh_

fvMesh& mesh_
private

◆ mergeDistance_

const scalar mergeDistance_
private

Tolerance used for sorting coordinates (used in 'less' routine)

Definition at line 164 of file meshRefinement.H.

Referenced by meshRefinement::mergeDistance().

◆ overwrite_

const bool overwrite_
private

Overwrite the mesh?

Definition at line 167 of file meshRefinement.H.

Referenced by meshRefinement::overwrite().

◆ oldInstance_

const word oldInstance_
private

Instance of mesh upon construction. Used when in overwrite_ mode.

Definition at line 170 of file meshRefinement.H.

Referenced by meshRefinement::oldInstance().

◆ surfaces_

const refinementSurfaces& surfaces_
private

All surface-intersection interaction.

Definition at line 173 of file meshRefinement.H.

Referenced by meshRefinement::surfaces(), and meshRefinement::updateIntersections().

◆ features_

const refinementFeatures& features_
private

All feature-edge interaction.

Definition at line 176 of file meshRefinement.H.

Referenced by meshRefinement::features().

◆ shells_

const shellSurfaces& shells_
private

All shell-refinement interaction.

Definition at line 179 of file meshRefinement.H.

Referenced by meshRefinement::shells(), and meshRefinement::updateIntersections().

◆ limitShells_

const shellSurfaces& limitShells_
private

All limit-refinement interaction.

Definition at line 182 of file meshRefinement.H.

◆ meshCutter_

hexRef8 meshCutter_
private

Refinement engine.

Definition at line 185 of file meshRefinement.H.

Referenced by meshRefinement::meshCutter().

◆ surfaceIndex_

labelIOList surfaceIndex_
private

Per cc-cc vector the index of the surface hit.

Definition at line 188 of file meshRefinement.H.

Referenced by meshRefinement::surfaceIndex(), and meshRefinement::updateIntersections().

◆ faceToCoupledPatch_

Map<label> faceToCoupledPatch_
private

Original patch for baffle faces that used to be on.

coupled patches

Definition at line 195 of file meshRefinement.H.

◆ userFaceData_

List<Tuple2<mapType, labelList> > userFaceData_
private

User supplied face based data.

Definition at line 199 of file meshRefinement.H.

Referenced by meshRefinement::userFaceData().

◆ meshedPatches_

wordList meshedPatches_
private

Meshed patches - are treated differently. Stored as wordList since.

order changes.

Definition at line 203 of file meshRefinement.H.

◆ faceZoneToMasterPatch_

HashTable<word, word> faceZoneToMasterPatch_
private

FaceZone to master patch name.

Definition at line 206 of file meshRefinement.H.

◆ faceZoneToSlavePatch_

HashTable<word, word> faceZoneToSlavePatch_
private

FaceZone to slave patch name.

Definition at line 209 of file meshRefinement.H.

◆ faceZoneToType_

HashTable<surfaceZonesInfo::faceZoneType, word> faceZoneToType_
private

FaceZone to method to handle faces.

Definition at line 212 of file meshRefinement.H.


The documentation for this class was generated from the following files: