Helper class which maintains intersections of (changing) mesh with (static) surfaces. More...
Public Types | |
enum | debugType { MESH = (1 << 0) , OBJINTERSECTIONS = (1 << 1) , FEATURESEEDS = (1 << 2) , ATTRACTION = (1 << 3) , LAYERINFO = (1 << 4) } |
Enumeration for what to debug. Used as a bit-pattern. More... | |
enum | writeType { WRITEMESH = (1 << 0) , NOWRITEREFINEMENT = (1 << 1) , WRITELEVELS = (1 << 2) , WRITELAYERSETS = (1 << 3) , WRITELAYERFIELDS = (1 << 4) } |
Enumeration for what to write. Used as a bit-pattern. More... | |
enum | mapType { MASTERONLY = 1 , KEEPALL = 2 , REMOVE = 4 } |
Enumeration for how userdata is to be mapped upon refinement. More... | |
enum | FaceMergeType { NONE , GEOMETRIC , IGNOREPATCH } |
Enumeration for what to do with co-planar patch faces on a single. 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 &, const labelUList &checkFaces, const bool dryRun) | |
Construct from components. More... | |
const fvMesh & | mesh () const |
Reference to mesh. More... | |
fvMesh & | mesh () |
scalar | mergeDistance () const |
bool | overwrite () const |
Overwrite the mesh? More... | |
const word & | oldInstance () const |
(points)instance of mesh upon construction More... | |
const refinementSurfaces & | surfaces () const |
Reference to surface search engines. More... | |
const refinementFeatures & | features () const |
Reference to feature edge mesh. More... | |
const shellSurfaces & | shells () const |
Reference to refinement shells (regions) More... | |
const shellSurfaces & | limitShells () const |
Reference to limit shells (regions) More... | |
const hexRef8 & | meshCutter () const |
Reference to meshcutting engine. More... | |
const labelList & | surfaceIndex () const |
Per start-end edge the index of the surface hit. More... | |
labelList & | surfaceIndex () |
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< mapDistributePolyMesh > | balance (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 planarCos, const label level0, const vector &point0, const vector &normal0, const label level1, const vector &point1, const vector &normal1) 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... | |
void | markOutsideFaces (const labelList &cellLevel, const labelList &neiLevel, const labelList &refineCell, bitSet &isOutsideFace) const |
Mark faces on interface between set and rest. More... | |
label | countFaceDirs (const bitSet &isOutsideFace, const label celli) const |
Count number of faces on cell that are in set. More... | |
void | growSet (const labelList &neiLevel, const bitSet &isOutsideFace, labelList &refineCell, label &nRefine) const |
Add one layer of cells to set. More... | |
autoPtr< mapPolyMesh > | removeGapCells (const scalar planarAngle, const labelList &minSurfaceLevel, const labelList &globalToMasterPatch, const label growIter) |
Detect gapRefinement cells and remove them. More... | |
void | selectIntersectedFaces (const labelList &surfaces, boolList &isBlockedFace) const |
Faces currently on boundary or intersected by surface. More... | |
labelList | detectLeakCells (const boolList &isBlockedFace, const labelList &leakFaces, const labelList &seedCells) const |
Return list of cells to block by walking from the seedCells. More... | |
autoPtr< mapPolyMesh > | removeLeakCells (const labelList &globalToMasterPatch, const labelList &globalToSlavePatch, const pointField &locationsInMesh, const pointField &locationsOutsideMesh, const labelList &selectedSurfaces) |
Remove minimum amount of cells to break any leak from. More... | |
autoPtr< mapPolyMesh > | blockLeakFaces (const labelList &globalToMasterPatch, const labelList &globalToSlavePatch, const pointField &locationsInMesh, const wordList &zonesInMesh, const pointField &locationsOutsideMesh, const labelList &selectedSurfaces) |
Baffle faces to break any leak from inside to outside. More... | |
autoPtr< mapPolyMesh > | refine (const labelList &cellsToRefine) |
Refine some cells. More... | |
autoPtr< mapDistributePolyMesh > | refineAndBalance (const string &msg, decompositionMethod &decomposer, fvMeshDistribute &distributor, const labelList &cellsToRefine, const scalar maxLoadUnbalance) |
Refine some cells and rebalance. More... | |
autoPtr< mapDistributePolyMesh > | balanceAndRefine (const string &msg, decompositionMethod &decomposer, fvMeshDistribute &distributor, const labelList &cellsToRefine, const scalar maxLoadUnbalance) |
Balance before refining some cells. More... | |
labelList | directionalRefineCandidates (const label maxGlobalCells, const label maxLocalCells, const labelList ¤tLevel, const direction dir) const |
Calculate list of cells to directionally refine. More... | |
autoPtr< mapPolyMesh > | directionalRefine (const string &msg, const direction cmpt, const labelList &cellsToRefine) |
Directionally refine in direction cmpt. More... | |
void | baffleAndSplitMesh (const bool handleSnapProblems, const snapParameters &snapParams, const bool useTopologicalSnapDetection, const bool removeEdgeConnectedCells, const scalarField &perpendicularAngle, const label nErodeCellZones, const dictionary &motionDict, Time &runTime, const labelList &globalToMasterPatch, const labelList &globalToSlavePatch, const pointField &locationsInMesh, const wordList ®ionsInMesh, const pointField &locationsOutsideMesh, const bool exitIfLeakPath, const refPtr< coordSetWriter > &leakPathFormatter) |
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< mapPolyMesh > | splitMesh (const label nBufferLayers, const label nErodeCellZones, const labelList &globalToMasterPatch, const labelList &globalToSlavePatch, const pointField &locationsInMesh, const wordList ®ionsInMesh, const pointField &locationsOutsideMesh, const bool exitIfLeakPath, const refPtr< coordSetWriter > &leakPathFormatter) |
Split off (with optional buffer layers) unreachable areas. More... | |
autoPtr< mapPolyMesh > | removeLimitShells (const label nBufferLayers, const label nErodeCellZones, const labelList &globalToMasterPatch, const labelList &globalToSlavePatch, const pointField &locationsInMesh, const wordList ®ionsInMesh, const pointField &locationsOutsideMesh) |
Remove cells from limitRegions if level -1. More... | |
autoPtr< mapPolyMesh > | dupNonManifoldPoints (const localPointRegion &) |
Find boundary points that connect to more than one cell. More... | |
autoPtr< mapPolyMesh > | dupNonManifoldPoints () |
Find boundary points that connect to more than one cell. More... | |
autoPtr< mapPolyMesh > | dupNonManifoldBoundaryPoints () |
Find boundary points that are on faceZones of type boundary. More... | |
autoPtr< mapPolyMesh > | mergePoints (const labelList &pointToDuplicate) |
Merge duplicate points. More... | |
autoPtr< mapPolyMesh > | createBaffles (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... | |
void | getZoneFaces (const labelList &zoneIDs, labelList &faceZoneID, labelList &ownPatch, labelList &neiPatch, labelList &nBaffles) const |
Get per-face information (faceZone, master/slave patch) More... | |
autoPtr< mapPolyMesh > | createZoneBaffles (const labelList &zoneIDs, List< labelPair > &baffles, labelList &originatingFaceZone) |
Create baffles for faces on faceZones. Return created baffles. More... | |
autoPtr< mapPolyMesh > | mergeBaffles (const List< labelPair > &, const Map< label > &faceToPatch) |
Merge baffles. Gets pairs of faces and boundary faces to move. More... | |
autoPtr< mapPolyMesh > | mergeZoneBaffles (const bool doInternalZones, const bool doBaffleZones) |
Merge all baffles on faceZones. More... | |
autoPtr< mapPolyMesh > | zonify (const bool allowFreeStandingZoneFaces, const label nErodeCellZones, const pointField &locationsInMesh, const wordList ®ionsInMesh, const pointField &locationsOutsideMesh, const bool exitIfLeakPath, const refPtr< coordSetWriter > &leakPathFormatter, 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... | |
label | addPointZone (const word &name) |
Add pointZone if does not exist. Return index of zone. More... | |
labelList | countEdgeFaces (const uindirectPrimitivePatch &pp) const |
Count number of faces per patch edge. Parallel consistent. 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... | |
void | nearestIntersection (const labelList &surfacesToTest, const labelList &testFaces, labelList &surface1, List< pointIndexHit > &hit1, labelList ®ion1, labelList &surface2, List< pointIndexHit > &hit2, labelList ®ion2) const |
Calculate nearest intersection for selected mesh faces. More... | |
autoPtr< mapPolyMesh > | doRemoveCells (const labelList &cellsToRemove, const labelList &exposedFaces, const labelList &exposedPatchIDs, removeCells &cellRemover) |
Remove cells. Put exposedFaces into exposedPatchIDs. More... | |
autoPtr< mapPolyMesh > | splitMeshRegions (const labelList &globalToMasterPatch, const labelList &globalToSlavePatch, const pointField &locationsInMesh, const pointField &locationsOutsideMesh, const bool exitIfLeakPath, const refPtr< coordSetWriter > &leakPathFormatter) |
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, const meshRefinement::FaceMergeType mergeType) |
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, const meshRefinement::FaceMergeType mergeType) |
Merge coplanar faces. preserveFaces is != -1 for faces. More... | |
autoPtr< mapPolyMesh > | doRemovePoints (removePoints &pointRemover, const boolList &pointCanBeDeleted) |
autoPtr< mapPolyMesh > | doRestorePoints (removePoints &pointRemover, const labelList &facesToRestore) |
labelList | collectFaces (const labelList &candidateFaces, const labelHashSet &set) const |
labelList | growFaceCellFace (const labelUList &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 |
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< indirectPrimitivePatch > | makePatch (const polyMesh &, const labelList &) |
Create patch from set of patches. More... | |
static tmp< pointVectorField > | makeDisplacementField (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 bitSet &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 bitSet &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< labelPair > | subsetBaffles (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 | findCell (const polyMesh &, const vector &perturbVec, const point &p) |
Find cell point is in. Uses optional perturbation to re-test. 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 label | findRegions (const polyMesh &, const vector &perturbVec, const pointField &locationsInMesh, const pointField &locationsOutsideMesh, const label nRegions, labelList &cellRegion, const boolList &blockedFace, const bool exitIfLeakPath, const refPtr< coordSetWriter > &leakPathFormatter) |
Find regions points are in. More... | |
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 bitSet | getMasterPoints (const polyMesh &mesh, const labelList &meshPoints) |
Determine master point for subset of points. If coupled. More... | |
static bitSet | getMasterEdges (const polyMesh &mesh, const labelList &meshEdges) |
Determine master edge for subset of edges. If coupled. More... | |
static void | removeFiles (const polyMesh &) |
Helper: remove all relevant files from mesh instance. More... | |
template<class T > | |
static T | gAverage (const bitSet &isMasterElem, const UList< T > &values) |
Helper: calculate average. More... | |
static writeType | writeLevel () |
Get/set write level. More... | |
static void | writeLevel (const writeType) |
template<class EnumContainer > | |
static int | readFlags (const EnumContainer &namedEnum, const wordList &words) |
Helper: convert wordList into bit pattern using provided Enum. More... | |
template<class Type > | |
static Type | get (const dictionary &dict, const word &keyword, const bool noExit, enum keyType::option matchOpt=keyType::REGEX, const Type &deflt=Zero) |
Wrapper around dictionary::get which does not exit. More... | |
static const dictionary & | subDict (const dictionary &dict, const word &keyword, const bool noExit, enum keyType::option matchOpt=keyType::REGEX) |
Wrapper around dictionary::subDict which does not exit. More... | |
static ITstream & | lookup (const dictionary &dict, const word &keyword, const bool noExit, enum keyType::option matchOpt=keyType::REGEX) |
Wrapper around dictionary::lookup which does not exit. More... | |
Static Public Attributes | |
static const Enum< debugType > | debugTypeNames |
static const Enum< writeType > | writeTypeNames |
Helper class which maintains intersections of (changing) mesh with (static) surfaces.
Maintains
Definition at line 86 of file meshRefinement.H.
enum debugType |
Enumeration for what to debug. Used as a bit-pattern.
Enumerator | |
---|---|
MESH | |
OBJINTERSECTIONS | |
FEATURESEEDS | |
ATTRACTION | |
LAYERINFO |
Definition at line 93 of file meshRefinement.H.
enum writeType |
Enumeration for what to write. Used as a bit-pattern.
Enumerator | |
---|---|
WRITEMESH | |
NOWRITEREFINEMENT | |
WRITELEVELS | |
WRITELAYERSETS | |
WRITELAYERFIELDS |
Definition at line 113 of file meshRefinement.H.
enum mapType |
Enumeration for how 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 125 of file meshRefinement.H.
enum FaceMergeType |
Enumeration for what to do with co-planar patch faces on a single.
cell
Enumerator | |
---|---|
NONE | |
GEOMETRIC | |
IGNOREPATCH |
Definition at line 134 of file meshRefinement.H.
meshRefinement | ( | fvMesh & | mesh, |
const scalar | mergeDistance, | ||
const bool | overwrite, | ||
const refinementSurfaces & | surfaces, | ||
const refinementFeatures & | features, | ||
const shellSurfaces & | shells, | ||
const shellSurfaces & | limitShells, | ||
const labelUList & | checkFaces, | ||
const bool | dryRun | ||
) |
Construct from components.
Definition at line 1686 of file meshRefinement.C.
References meshRefinement::updateIntersections().
ClassName | ( | "meshRefinement" | ) |
Runtime type information.
|
inline |
Reference to mesh.
Definition at line 967 of file meshRefinement.H.
Referenced by snappyRefineDriver::addFaceZones(), snappyLayerDriver::addLayersSinglePass(), snappySnapDriver::calcNearestSurface(), and snappySnapDriver::preSmoothPatch().
|
inline |
Definition at line 971 of file meshRefinement.H.
|
inline |
Definition at line 976 of file meshRefinement.H.
|
inline |
Overwrite the mesh?
Definition at line 982 of file meshRefinement.H.
|
inline |
(points)instance of mesh upon construction
Definition at line 988 of file meshRefinement.H.
|
inline |
Reference to surface search engines.
Definition at line 994 of file meshRefinement.H.
Referenced by snappySnapDriver::calcNearestSurface(), and snappyVoxelMeshDriver::snappyVoxelMeshDriver().
|
inline |
Reference to feature edge mesh.
Definition at line 1000 of file meshRefinement.H.
Referenced by snappyVoxelMeshDriver::snappyVoxelMeshDriver().
|
inline |
Reference to refinement shells (regions)
Definition at line 1006 of file meshRefinement.H.
Referenced by snappyVoxelMeshDriver::snappyVoxelMeshDriver().
|
inline |
Reference to limit shells (regions)
Definition at line 1012 of file meshRefinement.H.
|
inline |
Reference to meshcutting engine.
Definition at line 1018 of file meshRefinement.H.
Referenced by snappyLayerDriver::addLayersSinglePass(), and snappyVoxelMeshDriver::snappyVoxelMeshDriver().
const Foam::labelList & surfaceIndex | ( | ) | const |
Per start-end edge the index of the surface hit.
Definition at line 1736 of file meshRefinement.C.
References Foam::identity(), and meshRefinement::updateIntersections().
Foam::labelList & surfaceIndex | ( | ) |
Definition at line 1749 of file meshRefinement.C.
References Foam::identity().
|
inline |
For faces originating from processor faces store the original.
patch
Definition at line 1030 of file meshRefinement.H.
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 1039 of file meshRefinement.H.
Definition at line 1044 of file meshRefinement.H.
Foam::label countHits | ( | ) | const |
Count number of intersections (local)
Definition at line 1759 of file meshRefinement.C.
References forAll, syncTools::getMasterFaces(), and bitSet::test().
Foam::autoPtr< Foam::mapDistributePolyMesh > balance | ( | const bool | keepZoneFaces, |
const bool | keepBaffles, | ||
const scalarField & | cellWeights, | ||
decompositionMethod & | decomposer, | ||
fvMeshDistribute & | distributor | ||
) |
Redecompose according to cell count.
keepZoneFaces : find all faceZones from zoned surfaces and keep owner and neighbour together keepBaffles : find all baffles and keep them together
Definition at line 1779 of file meshRefinement.C.
References fvMeshDistribute::countCells(), coupled(), decompositionMethod::decompose(), fvMeshDistribute::distribute(), Foam::endl(), localPointRegion::findDuplicateFacePairs(), FixedList< T, N >::first(), forAll, Foam::Info, Pstream::listCombineAllGather(), IOobject::name(), zoneIdentifier::name(), UPstream::parRun(), Foam::Pout, Foam::reduce(), Foam::returnReduce(), Pair< T >::second(), decompositionMethod::setConstraints(), List< T >::setSize(), UList< T >::size(), syncTools::syncFaceList(), timeName, WarningInFunction, and polyBoundaryMesh::whichPatch().
Referenced by snappyLayerDriver::addLayersSinglePass().
Foam::labelList intersectedFaces | ( | ) | const |
Foam::labelList intersectedPoints | ( | ) | const |
Get points on surfaces with intersection and boundary faces.
Definition at line 2057 of file meshRefinement.C.
References f(), forAll, bitSet::set(), and bitSet::test().
|
static |
Create patch from set of patches.
Definition at line 2127 of file meshRefinement.C.
References polyMesh::boundaryMesh(), polyMesh::faces(), forAll, mesh, Time::New(), nFaces(), patches, polyMesh::points(), and polyPatch::start().
Referenced by snappyLayerDriver::addLayers(), snappyLayerDriver::addLayersSinglePass(), snappySnapDriver::doSnap(), and snappySnapDriver::repatchToSurface().
|
static |
Helper function to make a pointVectorField with correct.
bcs for mesh movement:
Definition at line 2169 of file meshRefinement.C.
References IOobject::AUTO_WRITE, pointMesh::boundary(), Foam::dimLength, forAll, mesh, Time::New(), IOobject::NO_READ, UPtrList< T >::size(), fvMesh::time(), Time::timeName(), and Foam::Zero.
Referenced by snappySnapDriver::doSnap().
|
static |
Helper function: check that face zones are synced.
Definition at line 2223 of file meshRefinement.C.
References Foam::abort(), Pstream::allGatherList(), meshRefinement::checkCoupledFaceZones(), Foam::exit(), polyMesh::faceZones(), Foam::FatalError, FatalErrorInFunction, forAll, mesh, processorFaPatch::myProcNo(), IOobject::name(), zoneIdentifier::name(), ZoneMesh< ZoneType, MeshType >::names(), primitiveMesh::nBoundaryFaces(), primitiveMesh::nInternalFaces(), Foam::nl, PstreamBuffers::nProcs(), and syncTools::swapBoundaryFaceList().
Referenced by meshRefinement::checkCoupledFaceZones().
|
static |
Helper: calculate edge weights (1/length)
Definition at line 2311 of file meshRefinement.C.
References e, forAll, Foam::mag(), Foam::max(), mesh, polyMesh::points(), List< T >::setSize(), PackedList< Width >::size(), and UList< T >::size().
Referenced by fieldSmoother::minSmoothField(), fieldSmoother::smoothLambdaMuDisplacement(), fieldSmoother::smoothNormals(), and fieldSmoother::smoothPatchNormals().
|
static |
Helper: weighted sum (over all subset of mesh points) by.
summing contribution from (master) edges
Definition at line 270 of file meshRefinementTemplates.C.
References Foam::abort(), e, Foam::FatalError, FatalErrorInFunction, forAll, mesh, PackedList< Width >::size(), UList< T >::size(), Foam::sum(), syncTools::syncPointList(), bitSet::test(), and Foam::Zero.
Referenced by fieldSmoother::minSmoothField(), fieldSmoother::smoothLambdaMuDisplacement(), fieldSmoother::smoothNormals(), and fieldSmoother::smoothPatchNormals().
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 1531 of file meshRefinementRefine.C.
References Foam::mag(), and Foam::Zero.
bool isNormalGap | ( | const scalar | planarCos, |
const label | level0, | ||
const vector & | point0, | ||
const vector & | normal0, | ||
const label | level1, | ||
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 1578 of file meshRefinementRefine.C.
References Foam::cos(), Foam::degToRad(), Foam::mag(), and Foam::Zero.
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 2035 of file meshRefinementRefine.C.
References Foam::cos(), Foam::degToRad(), Foam::endl(), forAll, Foam::Info, Foam::labelMax, Foam::max(), PstreamBuffers::nProcs(), List< T >::setSize(), and UList< T >::size().
void markOutsideFaces | ( | const labelList & | cellLevel, |
const labelList & | neiLevel, | ||
const labelList & | refineCell, | ||
bitSet & | isOutsideFace | ||
) | const |
Mark faces on interface between set and rest.
(and same cell level)
Definition at line 177 of file meshRefinementBlock.C.
References polyMesh::faceNeighbour(), polyMesh::faceOwner(), forAll, primitiveMesh::nBoundaryFaces(), primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), bitSet::set(), PackedList< Width >::setSize(), syncTools::swapBoundaryCellList(), and Foam::Zero.
Foam::label countFaceDirs | ( | const bitSet & | isOutsideFace, |
const label | celli | ||
) | const |
Count number of faces on cell that are in set.
Definition at line 235 of file meshRefinementBlock.C.
References forAll, Foam::magSqr(), n, and Foam::sqr().
void growSet | ( | const labelList & | neiLevel, |
const bitSet & | isOutsideFace, | ||
labelList & | refineCell, | ||
label & | nRefine | ||
) | const |
Add one layer of cells to set.
Definition at line 286 of file meshRefinementBlock.C.
Foam::autoPtr< Foam::mapPolyMesh > removeGapCells | ( | const scalar | planarAngle, |
const labelList & | minSurfaceLevel, | ||
const labelList & | globalToMasterPatch, | ||
const label | growIter | ||
) |
Detect gapRefinement cells and remove them.
Definition at line 956 of file meshRefinementBlock.C.
References Foam::cos(), Foam::degToRad(), Foam::endl(), forAll, removeCells::getExposedFaces(), surfaceZonesInfo::getUnnamedSurfaces(), Foam::Info, HashTable< T, Key, Hash >::insert(), Foam::labelMax, Foam::min(), PstreamBuffers::nProcs(), Foam::returnReduce(), s(), UList< T >::size(), and HashTable< T, Key, Hash >::sortedToc().
Faces currently on boundary or intersected by surface.
Definition at line 1145 of file meshRefinementBlock.C.
References forAll, and List< T >::setSize().
labelList detectLeakCells | ( | const boolList & | isBlockedFace, |
const labelList & | leakFaces, | ||
const labelList & | seedCells | ||
) | const |
Return list of cells to block by walking from the seedCells.
until reaching a leak face
autoPtr< mapPolyMesh > removeLeakCells | ( | const labelList & | globalToMasterPatch, |
const labelList & | globalToSlavePatch, | ||
const pointField & | locationsInMesh, | ||
const pointField & | locationsOutsideMesh, | ||
const labelList & | selectedSurfaces | ||
) |
Remove minimum amount of cells to break any leak from.
inside to outside
Foam::autoPtr< Foam::mapPolyMesh > blockLeakFaces | ( | const labelList & | globalToMasterPatch, |
const labelList & | globalToSlavePatch, | ||
const pointField & | locationsInMesh, | ||
const wordList & | zonesInMesh, | ||
const pointField & | locationsOutsideMesh, | ||
const labelList & | selectedSurfaces | ||
) |
Baffle faces to break any leak from inside to outside.
Definition at line 1837 of file meshRefinementBlock.C.
References surfaceZonesInfo::addFaceZone(), List< T >::append(), holeToFace::calcClosure(), ZoneMesh< ZoneType, MeshType >::clearAddressing(), e, PrimitivePatch< FaceList, PointField >::edges(), Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, UList< T >::find(), Foam::findIndices(), forAll, meshRefinement::MESH, PrimitivePatch< FaceList, PointField >::meshPoints(), Foam::name(), Foam::nl, polyBoundaryMesh::nNonProcessor(), patches, Foam::Pout, Foam::reduce(), Foam::returnReduce(), bitSet::set(), UPtrList< T >::size(), UList< T >::size(), bitSet::sortedToc(), polyPatch::start(), syncTools::syncPointList(), timeName, autoPtr< T >::valid(), WarningInFunction, write(), meshRefinement::writeLevel(), meshRefinement::WRITEMESH, and refinementParameters::zonePoints().
Foam::autoPtr< Foam::mapPolyMesh > refine | ( | const labelList & | cellsToRefine | ) |
Refine some cells.
Definition at line 2344 of file meshRefinementRefine.C.
References polyTopoChange::changeMesh(), mapPolyMesh::hasMotionPoints(), mapPolyMesh::preMotionPoints(), and timeName.
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 2390 of file meshRefinementRefine.C.
References Foam::checkData(), Foam::endl(), Foam::Info, Foam::mag(), meshRefinement::MESH, PstreamBuffers::nProcs(), Foam::Pout, Foam::returnReduce(), timeName, and write().
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 2491 of file meshRefinementRefine.C.
References Foam::checkData(), Foam::endl(), forAll, Foam::Info, Foam::mag(), meshRefinement::MESH, PstreamBuffers::nProcs(), Foam::Pout, Foam::returnReduce(), UList< T >::size(), timeName, and write().
Foam::labelList directionalRefineCandidates | ( | const label | maxGlobalCells, |
const label | maxLocalCells, | ||
const labelList & | currentLevel, | ||
const direction | dir | ||
) | const |
Calculate list of cells to directionally refine.
Definition at line 2651 of file meshRefinementRefine.C.
References Foam::endl(), forAll, Foam::Info, Foam::labelMax, PstreamBuffers::nProcs(), Foam::Pout, and List< T >::setSize().
Foam::autoPtr< Foam::mapPolyMesh > directionalRefine | ( | const string & | msg, |
const direction | cmpt, | ||
const labelList & | cellsToRefine | ||
) |
Directionally refine in direction cmpt.
Definition at line 2751 of file meshRefinementRefine.C.
References polyTopoChange::changeMesh(), forAll, meshCutter::setRefinement(), UList< T >::size(), timeName, meshCutter::updateMesh(), and Foam::Zero.
void baffleAndSplitMesh | ( | const bool | handleSnapProblems, |
const snapParameters & | snapParams, | ||
const bool | useTopologicalSnapDetection, | ||
const bool | removeEdgeConnectedCells, | ||
const scalarField & | perpendicularAngle, | ||
const label | nErodeCellZones, | ||
const dictionary & | motionDict, | ||
Time & | runTime, | ||
const labelList & | globalToMasterPatch, | ||
const labelList & | globalToSlavePatch, | ||
const pointField & | locationsInMesh, | ||
const wordList & | regionsInMesh, | ||
const pointField & | locationsOutsideMesh, | ||
const bool | exitIfLeakPath, | ||
const refPtr< coordSetWriter > & | leakPathFormatter | ||
) |
Split off unreachable areas of mesh.
Definition at line 4532 of file meshRefinementBaffles.C.
References Foam::checkData(), cpuTimeCxx::cpuTimeIncrement(), Foam::endl(), Foam::Info, Foam::nl, Time::path(), Foam::Pout, Foam::returnReduce(), runTime, List< T >::setSize(), timeName, and write().
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 4722 of file meshRefinementBaffles.C.
References Foam::checkData(), cpuTimeCxx::cpuTimeIncrement(), Foam::endl(), localPointRegion::findDuplicateFacePairs(), Foam::Info, Foam::nl, Foam::reduce(), runTime, and UList< T >::size().
Foam::autoPtr< Foam::mapPolyMesh > splitMesh | ( | const label | nBufferLayers, |
const label | nErodeCellZones, | ||
const labelList & | globalToMasterPatch, | ||
const labelList & | globalToSlavePatch, | ||
const pointField & | locationsInMesh, | ||
const wordList & | regionsInMesh, | ||
const pointField & | locationsOutsideMesh, | ||
const bool | exitIfLeakPath, | ||
const refPtr< coordSetWriter > & | leakPathFormatter | ||
) |
Split off (with optional buffer layers) unreachable areas.
of mesh. Does not introduce baffles.
Definition at line 4817 of file meshRefinementBaffles.C.
References forAll, regionSplit::nRegions(), and syncTools::syncFaceList().
Foam::autoPtr< Foam::mapPolyMesh > removeLimitShells | ( | const label | nBufferLayers, |
const label | nErodeCellZones, | ||
const labelList & | globalToMasterPatch, | ||
const labelList & | globalToSlavePatch, | ||
const pointField & | locationsInMesh, | ||
const wordList & | regionsInMesh, | ||
const pointField & | locationsOutsideMesh | ||
) |
Remove cells from limitRegions if level -1.
Definition at line 5289 of file meshRefinementBaffles.C.
References Foam::endl(), forAll, meshRefinement::MESH, Foam::Pout, timeName, write(), and Foam::Zero.
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 5377 of file meshRefinementBaffles.C.
References polyTopoChange::changeMesh(), Foam::endl(), mapPolyMesh::hasMotionPoints(), Foam::Info, mapPolyMesh::preMotionPoints(), Foam::returnReduce(), duplicatePoints::setRefinement(), and timeName.
Foam::autoPtr< Foam::mapPolyMesh > dupNonManifoldPoints | ( | ) |
Find boundary points that connect to more than one cell.
region and split them.
Definition at line 5441 of file meshRefinementBaffles.C.
Foam::autoPtr< Foam::mapPolyMesh > dupNonManifoldBoundaryPoints | ( | ) |
Find boundary points that are on faceZones of type boundary.
and duplicate them
Definition at line 5524 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().
Referenced by snappyLayerDriver::addLayersSinglePass().
Foam::autoPtr< Foam::mapPolyMesh > mergePoints | ( | const labelList & | pointToDuplicate | ) |
Merge duplicate points.
Definition at line 5450 of file meshRefinementBaffles.C.
References polyTopoChange::changeMesh(), forAll, mapPolyMesh::hasMotionPoints(), HashTable< T, Key, Hash >::insert(), polyMeshAdder::mergePoints(), mapPolyMesh::preMotionPoints(), Foam::returnReduce(), and timeName.
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 492 of file meshRefinementBaffles.C.
References Foam::abort(), polyTopoChange::changeMesh(), polyPatch::coupled(), Foam::endl(), mapPolyMesh::faceMap(), Foam::faceMap(), Foam::FatalError, FatalErrorInFunction, forAll, mapPolyMesh::hasMotionPoints(), HashSet< Key, Hash >::insert(), mapPolyMesh::preMotionPoints(), Foam::returnReduce(), mapPolyMesh::reverseFaceMap(), UList< T >::size(), polyPatch::start(), faceSet::sync(), syncTools::syncFaceList(), timeName, and HashTable< T, Key, Hash >::toc().
Foam::labelList getZones | ( | const List< surfaceZonesInfo::faceZoneType > & | fzTypes | ) | const |
Get zones of given type.
Definition at line 671 of file meshRefinementBaffles.C.
References List< T >::append(), forAll, UList< T >::found(), zoneIdentifier::name(), UPtrList< T >::size(), and zoneIDs.
Referenced by snappyLayerDriver::addLayersSinglePass().
|
static |
Subset baffles according to zones.
Definition at line 698 of file meshRefinementBaffles.C.
References DynamicList< T, SizeMin >::append(), polyMesh::faceZones(), forAll, mesh, primitiveMesh::nFaces(), p, UList< T >::size(), zoneID, and zoneIDs.
Referenced by snappyLayerDriver::addLayers().
void getZoneFaces | ( | const labelList & | zoneIDs, |
labelList & | faceZoneID, | ||
labelList & | ownPatch, | ||
labelList & | neiPatch, | ||
labelList & | nBaffles | ||
) | const |
Get per-face information (faceZone, master/slave patch)
Get per face whether it is internal or coupled
Definition at line 731 of file meshRefinementBaffles.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, faceZone::flipMap(), forAll, syncTools::getInternalOrCoupledFaces(), zoneIdentifier::name(), List< T >::setSize(), UList< T >::size(), Foam::Zero, and zoneIDs.
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 799 of file meshRefinementBaffles.C.
References Foam::abort(), List< T >::clear(), Foam::endl(), Foam::faceMap(), surfaceZonesInfo::faceZoneTypeNames, Foam::FatalError, FatalErrorInFunction, forAll, Foam::Info, Pstream::listCombineAllGather(), zoneIdentifier::name(), Foam::nl, Foam::Pout, Foam::returnReduce(), Foam::setf(), List< T >::setSize(), Foam::setw(), UList< T >::size(), Foam::sum(), timeName, write(), and zoneIDs.
Referenced by snappyLayerDriver::addLayersSinglePass().
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 1192 of file meshRefinementBaffles.C.
References polyTopoChange::changeMesh(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, UList< T >::first(), faceZone::flipMap(), forAll, forAllConstIters, mapPolyMesh::hasMotionPoints(), mapPolyMesh::preMotionPoints(), Foam::returnReduce(), mapPolyMesh::reverseFaceMap(), polyTopoChange::setAction(), List< T >::setSize(), HashTable< T, Key, Hash >::size(), UList< T >::size(), timeName, faceZone::whichFace(), ZoneMesh< ZoneType, MeshType >::whichZone(), and zoneID.
Foam::autoPtr< Foam::mapPolyMesh > mergeZoneBaffles | ( | const bool | doInternalZones, |
const bool | doBaffleZones | ||
) |
Merge all baffles on faceZones.
Definition at line 1376 of file meshRefinementBaffles.C.
References DynamicList< T, SizeMin >::append(), surfaceZonesInfo::BAFFLE, localPointRegion::findDuplicateFacePairs(), surfaceZonesInfo::INTERNAL, Foam::returnReduce(), UList< T >::size(), and zoneIDs.
Foam::autoPtr< Foam::mapPolyMesh > zonify | ( | const bool | allowFreeStandingZoneFaces, |
const label | nErodeCellZones, | ||
const pointField & | locationsInMesh, | ||
const wordList & | regionsInMesh, | ||
const pointField & | locationsOutsideMesh, | ||
const bool | exitIfLeakPath, | ||
const refPtr< coordSetWriter > & | leakPathFormatter, | ||
wordPairHashTable & | zonesToFaceZone | ||
) |
Put faces/cells into zones according to surface specification.
Returns null if no zone surfaces present. Regions containing locationsInMesh/regionsInMesh will be put in corresponding cellZone. keepPoints is for backwards compatibility and sets all yet unassigned cells to be non-zoned (zone = -1)
Per face index of faceZone or -1
Definition at line 5622 of file meshRefinementBaffles.C.
References Foam::abort(), surfaceZonesInfo::addCellZonesToMesh(), surfaceZonesInfo::addFaceZone(), surfaceZonesInfo::addFaceZonesToMesh(), polyTopoChange::changeMesh(), polyPatch::coupled(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, HashTable< T, Key, Hash >::find(), ZoneMesh< ZoneType, MeshType >::findZoneID(), FixedList< T, N >::first(), forAll, syncTools::getMasterFaces(), surfaceZonesInfo::getNamedSurfaces(), Foam::indent(), Foam::Info, HashTable< T, Key, Hash >::insert(), Pstream::mapCombineAllGather(), n, OFstream::name(), zoneIdentifier::name(), Foam::nl, nZones, patches, Foam::Pout, Foam::returnReduce(), Pair< T >::second(), HashTable< T, Key, Hash >::size(), UList< T >::size(), HashTable< T, Key, Hash >::sortedToc(), polyPatch::start(), syncTools::swapBoundaryCellList(), bitSet::test(), timeName, and OBJstream::write().
|
static |
Helper:append patch to end of mesh.
Definition at line 2367 of file meshRefinement.C.
References fvMesh::boundary(), polyMesh::boundaryMesh(), fvMesh::clearOut(), mesh, Time::New(), PtrList< T >::set(), PtrList< T >::setSize(), and UPtrList< T >::size().
|
static |
Helper:add patch to mesh. Update all registered fields.
Used by addMeshedPatch to add patches originating from surfaces.
Definition at line 2465 of file meshRefinement.C.
References fvMesh::boundary(), polyMesh::boundaryMesh(), polyBoundaryMesh::findPatchID(), forAll, mesh, primitiveMesh::nFaces(), UPtrList< T >::reorder(), polyBoundaryMesh::reorder(), dictionary::set(), UPtrList< T >::size(), and polyPatch::start().
Foam::label addMeshedPatch | ( | const word & | name, |
const dictionary & | patchInfo | ||
) |
Add patch originating from meshing. Update meshedPatches_.
Definition at line 2543 of file meshRefinement.C.
References Foam::name().
Referenced by snappyRefineDriver::addFaceZones().
Foam::labelList meshedPatches | ( | ) | const |
Get patchIDs for patches added in addMeshedPatch.
Definition at line 2594 of file meshRefinement.C.
References DynamicList< T, SizeMin >::append(), cyclicACMIPointPatch::constraintType(), Foam::endl(), polyBoundaryMesh::findPatchID(), forAll, polyBoundaryMesh::names(), patches, Foam::type(), and WarningInFunction.
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.
Definition at line 2620 of file meshRefinement.C.
References surfaceZonesInfo::addFaceZone().
Referenced by snappyRefineDriver::addFaceZones().
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 2644 of file meshRefinement.C.
References polyBoundaryMesh::findPatchID().
Referenced by snappyLayerDriver::addLayersSinglePass().
Foam::label addPointZone | ( | const word & | name | ) |
Add pointZone if does not exist. Return index of zone.
Definition at line 2673 of file meshRefinement.C.
References ZoneMesh< ZoneType, MeshType >::clearAddressing(), ZoneMesh< ZoneType, MeshType >::findZoneID(), Foam::name(), PtrList< T >::set(), PtrList< T >::setSize(), and UPtrList< T >::size().
Foam::labelList countEdgeFaces | ( | const uindirectPrimitivePatch & | pp | ) | const |
Count number of faces per patch edge. Parallel consistent.
Definition at line 2715 of file meshRefinement.C.
References mapDistributeBase::constructSize(), globalMeshData::coupledPatch(), PrimitivePatch< FaceList, PointField >::edgeFaces(), forAll, globalMeshData::globalEdgeSlaves(), globalMeshData::globalEdgeSlavesMap(), globalMeshData::globalEdgeTransformedSlaves(), PatchTools::matchEdges(), UPstream::parRun(), UList< T >::size(), globalMeshData::syncData(), and Foam::Zero.
void selectSeparatedCoupledFaces | ( | boolList & | selected | ) | const |
Select coupled faces that are not collocated.
Definition at line 2700 of file meshRefinement.C.
References polyPatch::boundaryMesh(), and UList< T >::size().
void updateIntersections | ( | const labelList & | changedFaces | ) |
Find any intersection of surface. Store in surfaceIndex_.
Definition at line 350 of file meshRefinement.C.
References bitSet::count(), Foam::endl(), forAll, syncTools::getMasterFaces(), Foam::Info, Foam::nl, Foam::reduce(), Foam::returnReduce(), UList< T >::size(), syncTools::syncFaceList(), and bitSet::test().
Referenced by meshRefinement::meshRefinement(), and meshRefinement::surfaceIndex().
void nearestIntersection | ( | const labelList & | surfacesToTest, |
const labelList & | testFaces, | ||
labelList & | surface1, | ||
List< pointIndexHit > & | hit1, | ||
labelList & | region1, | ||
labelList & | surface2, | ||
List< pointIndexHit > & | hit2, | ||
labelList & | region2 | ||
) | const |
Calculate nearest intersection for selected mesh faces.
Definition at line 659 of file meshRefinement.C.
References UList< T >::size().
Foam::autoPtr< Foam::mapPolyMesh > doRemoveCells | ( | const labelList & | cellsToRemove, |
const labelList & | exposedFaces, | ||
const labelList & | exposedPatchIDs, | ||
removeCells & | cellRemover | ||
) |
Remove cells. Put exposedFaces into exposedPatchIDs.
Definition at line 1119 of file meshRefinement.C.
References polyTopoChange::changeMesh(), mapPolyMesh::hasMotionPoints(), mapPolyMesh::preMotionPoints(), Foam::renumber(), mapPolyMesh::reverseFaceMap(), removeCells::setRefinement(), timeName, and removeCells::updateMesh().
Find cell point is in. Uses optional perturbation to re-test.
Returns -1 on processors that do not have the cell.
Definition at line 2772 of file meshRefinement.C.
References polyMesh::findCell(), findCellMode(), mesh, p, Foam::returnReduce(), and polyMesh::tetBasePtIs().
|
static |
Find region point is in. Uses optional perturbation to re-test.
Definition at line 2792 of file meshRefinement.C.
References polyMesh::findCell(), findCellMode(), mesh, p, Foam::reduce(), and polyMesh::tetBasePtIs().
|
static |
Find regions points are in.
Definition at line 2979 of file meshRefinement.C.
References refPtr< T >::constCast(), Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, UList< T >::find(), forAll, Foam::Info, mesh, primitiveMesh::nCells(), bitSet::set(), UList< T >::size(), bitSet::test(), and WarningInFunction.
Foam::autoPtr< Foam::mapPolyMesh > splitMeshRegions | ( | const labelList & | globalToMasterPatch, |
const labelList & | globalToSlavePatch, | ||
const pointField & | locationsInMesh, | ||
const pointField & | locationsOutsideMesh, | ||
const bool | exitIfLeakPath, | ||
const refPtr< coordSetWriter > & | leakPathFormatter | ||
) |
Split mesh. Keep part containing point. Return empty map if.
no cells removed.
Definition at line 3096 of file meshRefinement.C.
References DynamicList< T, SizeMin >::append(), Foam::endl(), forAll, removeCells::getExposedFaces(), Foam::Info, regionSplit::nRegions(), Foam::returnReduce(), List< T >::setSize(), DynamicList< T, SizeMin >::shrink(), UList< T >::size(), and WarningInFunction.
void doSplitFaces | ( | const labelList & | splitFaces, |
const labelPairList & | splits, | ||
polyTopoChange & | meshMod | ||
) | const |
Split faces into two.
Definition at line 1183 of file meshRefinement.C.
References polyTopoChange::addFace(), Foam::endl(), f(), UList< T >::fcIndex(), faceZone::flipMap(), forAll, polyTopoChange::modifyFace(), Foam::Pout, UList< T >::size(), split(), and faceZone::whichFace().
Foam::label splitFacesUndo | ( | const labelList & | splitFaces, |
const labelPairList & | splits, | ||
const dictionary & | motionDict, | ||
labelList & | duplicateFace, | ||
List< labelPair > & | baffles | ||
) |
Split faces along diagonal. Maintain mesh quality. Return.
total number of faces split.
Definition at line 1302 of file meshRefinement.C.
References DynamicList< T, SizeMin >::append(), HashTable< T, Key, Hash >::cfind(), polyTopoChange::changeMesh(), hexRef8::checkMesh(), HashTable< T, Key, Hash >::clear(), Foam::endl(), Foam::exit(), mapPolyMesh::faceMap(), polyTopoChange::faces(), Foam::FatalError, FatalErrorInFunction, FixedList< T, N >::first(), faceZone::flipMap(), forAll, HashTable< T, Key, Hash >::found(), topoSet::found(), mapPolyMesh::hasMotionPoints(), Foam::Info, Foam::inplaceRenumber(), HashSet< Key, Hash >::insert(), HashTable< T, Key, Hash >::insert(), polyTopoChange::modifyFace(), n, Foam::nl, polyTopoChange::points(), mapPolyMesh::preMotionPoints(), polyTopoChange::removeFace(), Foam::renumber(), Foam::returnReduce(), mapPolyMesh::reverseFaceMap(), mapPolyMesh::reversePointMap(), Pair< T >::second(), polyTopoChange::setCapacity(), List< T >::setSize(), HashTable< T, Key, Hash >::size(), UList< T >::size(), timeName, meshRefinement::updateList(), and faceZone::whichFace().
void distribute | ( | const mapDistributePolyMesh & | map | ) |
Update local numbering for mesh redistribution.
Definition at line 3205 of file meshRefinement.C.
References autoPtr< T >::clear(), meshRefinement::distribute(), mapDistributePolyMesh::distributeFaceData(), e, treeBoundBox::extend(), Foam::faceMap(), forAll, meshBb(), and rndGen.
Referenced by meshRefinement::distribute().
void updateMesh | ( | const mapPolyMesh & | map, |
const labelList & | changedFaces | ||
) |
Update for external change to mesh. changedFaces are in new mesh.
face labels.
Definition at line 3266 of file meshRefinement.C.
Referenced by snappyLayerDriver::addLayersSinglePass(), and meshRefinement::mergePatchFaces().
Helper: reorder list according to map.
Definition at line 37 of file meshRefinementTemplates.C.
References forAll, UList< T >::size(), and List< T >::transfer().
Referenced by snappyLayerDriver::addLayers(), snappyLayerDriver::addLayersSinglePass(), and meshRefinement::splitFacesUndo().
void storeData | ( | const labelList & | pointsToStore, |
const labelList & | facesToStore, | ||
const labelList & | cellsToStore | ||
) |
Signal points/face/cells for which to store data.
Definition at line 3278 of file meshRefinement.C.
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 3295 of file meshRefinement.C.
References mapPolyMesh::faceMap(), forAll, forAllConstIters, HashTable< T, Key, Hash >::insert(), mapPolyMesh::reverseFaceMap(), UList< T >::size(), and dictionary::transfer().
Foam::label mergePatchFaces | ( | const scalar | minCos, |
const scalar | concaveCos, | ||
const label | mergeSize, | ||
const labelList & | patchIDs, | ||
const meshRefinement::FaceMergeType | mergeType | ||
) |
Merge coplanar faces if sets are of size mergeSize.
(usually 4)
Definition at line 41 of file meshRefinementMerge.C.
References polyMesh::boundaryMesh(), polyTopoChange::changeMesh(), fvMesh::clearOut(), Foam::endl(), polyMesh::faceOwner(), forAll, combineFaces::getMergeSets(), meshRefinement::growFaceCellFace(), mapPolyMesh::hasMotionPoints(), meshRefinement::IGNOREPATCH, Foam::Info, HashSet< Key, Hash >::insert(), fvMesh::movePoints(), polyMesh::moving(), primitiveMesh::nBoundaryFaces(), Foam::nl, patches, mapPolyMesh::preMotionPoints(), Foam::returnReduce(), mapPolyMesh::reverseFaceMap(), polyMesh::setInstance(), combineFaces::setRefinement(), List< T >::setSize(), UList< T >::size(), meshRefinement::timeName(), combineFaces::updateMesh(), meshRefinement::updateMesh(), and fvMesh::updateMesh().
Foam::label mergePatchFacesUndo | ( | const scalar | minCos, |
const scalar | concaveCos, | ||
const labelList & | patchIDs, | ||
const dictionary & | motionDict, | ||
const labelList & | preserveFaces, | ||
const meshRefinement::FaceMergeType | mergeType | ||
) |
Merge coplanar faces. preserveFaces is != -1 for faces.
to be preserved
Definition at line 257 of file meshRefinementMerge.C.
References DynamicList< T, SizeMin >::append(), polyTopoChange::changeMesh(), Foam::checkData(), hexRef8::checkMesh(), Foam::endl(), forAll, forAllConstIters, topoSet::found(), combineFaces::getMergeSets(), Foam::Info, Foam::inplaceMapKey(), HashSet< Key, Hash >::insert(), IOobject::instance(), combineFaces::masterFace(), meshRefinement::MESH, Foam::nl, IOobject::objectPath(), patches, Foam::Pout, Foam::returnReduce(), combineFaces::savedPointLabels(), combineFaces::setRefinement(), List< T >::setSize(), combineFaces::setUnrefinement(), DynamicList< T, SizeMin >::shrink(), HashTable< T, Key, Hash >::size(), UList< T >::size(), timeName, combineFaces::updateMesh(), write(), and regIOobject::write().
Foam::autoPtr< Foam::mapPolyMesh > doRemovePoints | ( | removePoints & | pointRemover, |
const boolList & | pointCanBeDeleted | ||
) |
Definition at line 637 of file meshRefinementMerge.C.
References polyTopoChange::changeMesh(), Foam::checkData(), Foam::endl(), mapPolyMesh::hasMotionPoints(), HashSet< Key, Hash >::insert(), Foam::Pout, mapPolyMesh::preMotionPoints(), removePoints::savedFaceLabels(), removePoints::setRefinement(), UList< T >::size(), timeName, and removePoints::updateMesh().
Foam::autoPtr< Foam::mapPolyMesh > doRestorePoints | ( | removePoints & | pointRemover, |
const labelList & | facesToRestore | ||
) |
Definition at line 699 of file meshRefinementMerge.C.
References polyTopoChange::changeMesh(), Foam::checkData(), Foam::endl(), forAll, removePoints::getUnrefimentSet(), mapPolyMesh::hasMotionPoints(), HashSet< Key, Hash >::insert(), Foam::Pout, mapPolyMesh::preMotionPoints(), mapPolyMesh::reverseFaceMap(), removePoints::setUnrefinement(), UList< T >::size(), timeName, and removePoints::updateMesh().
Foam::labelList collectFaces | ( | const labelList & | candidateFaces, |
const labelHashSet & | set | ||
) | const |
Definition at line 777 of file meshRefinementMerge.C.
References Foam::findIndices(), and syncTools::syncFaceList().
Foam::labelList growFaceCellFace | ( | const labelUList & | set | ) | const |
Definition at line 840 of file meshRefinementMerge.C.
References Foam::findIndices(), Foam::markGrowFaceCellFace(), and syncTools::syncFaceList().
Referenced by meshRefinement::mergePatchFaces().
Foam::labelList growFaceCellFace | ( | const labelHashSet & | set | ) | const |
Definition at line 863 of file meshRefinementMerge.C.
References Foam::findIndices(), Foam::markGrowFaceCellFace(), and syncTools::syncFaceList().
Foam::label mergeEdgesUndo | ( | const scalar | minCos, |
const dictionary & | motionDict | ||
) |
Merge edges, maintain mesh quality. Return global number.
of edges merged
Definition at line 887 of file meshRefinementMerge.C.
References hexRef8::checkMesh(), removePoints::countPointUsage(), Foam::endl(), Foam::Info, IOobject::instance(), meshRefinement::MESH, n, Foam::nl, IOobject::objectPath(), Foam::Pout, Foam::returnReduce(), removePoints::savedFaceLabels(), HashTable< T, Key, Hash >::size(), UList< T >::size(), timeName, write(), and regIOobject::write().
void checkData | ( | ) |
Debugging: check that all faces still obey start()>end()
Definition at line 905 of file meshRefinement.C.
References Foam::endl(), localPointRegion::findDuplicateFaces(), forAll, Foam::identity(), Foam::Pout, UList< T >::size(), syncTools::swapBoundaryFaceList(), syncTools::syncBoundaryFacePositions(), and WarningInFunction.
|
static |
Definition at line 811 of file meshRefinement.C.
References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, fld(), forAll, Foam::mag(), mesh, Foam::nl, primitiveMesh::nPoints(), polyMesh::points(), Foam::Pout, and syncTools::syncPointList().
|
static |
Definition at line 858 of file meshRefinement.C.
References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, fld(), forAll, Foam::mag(), mesh, Foam::nl, primitiveMesh::nPoints(), polyMesh::points(), Foam::Pout, and syncTools::syncPointList().
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 104 of file meshRefinementTemplates.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::mag(), patchIdentifier::name(), patches, UList< T >::size(), polyPatch::start(), and T.
Print list according to (collected and) sorted coordinate.
Definition at line 161 of file meshRefinementTemplates.C.
References UPstream::blocking, Foam::endl(), Foam::Info, Foam::mag(), UPstream::msgType(), points, UList< T >::size(), and Foam::sortedOrder().
|
static |
Determine master point for subset of points. If coupled.
chooses only one
Definition at line 3441 of file meshRefinement.C.
References forAll, Foam::identity(), Foam::labelMax, mesh, bitSet::set(), UList< T >::size(), and syncTools::syncPointList().
Referenced by snappySnapDriver::calcNearestSurface(), snappySnapDriver::detectNearSurfaces(), and displacementMotionSolverMeshMover::move().
|
static |
Determine master edge for subset of edges. If coupled.
chooses only one
Definition at line 3477 of file meshRefinement.C.
References forAll, Foam::identity(), Foam::labelMax, globalIndex::localSize(), globalIndex::localStart(), mesh, bitSet::set(), UList< T >::size(), syncTools::syncEdgeList(), and globalIndex::toGlobal().
Referenced by displacementMotionSolverMeshMover::move().
Print some mesh stats.
Pstream::broadcast(nCells);
Definition at line 3513 of file meshRefinement.C.
References bitSet::count(), Foam::endl(), forAll, syncTools::getMasterFaces(), syncTools::getMasterPoints(), Foam::gMax(), Foam::Info, Pstream::listCombineGather(), splitCell::master(), globalMeshData::nTotalCells(), Foam::Pout, Foam::returnReduce(), and Foam::Zero.
Foam::word timeName | ( | ) | const |
Replacement for Time::timeName() that returns oldInstance (if overwrite_)
Definition at line 3569 of file meshRefinement.C.
Referenced by snappyLayerDriver::addLayersSinglePass(), meshRefinement::mergePatchFaces(), and snappySnapDriver::preSmoothPatch().
void setInstance | ( | const fileName & | inst | ) |
Set instance of all local IOobjects.
Definition at line 1112 of file meshRefinement.C.
bool write | ( | ) | const |
Write mesh and all data.
Definition at line 3406 of file meshRefinement.C.
Referenced by snappyLayerDriver::addLayersSinglePass(), and snappySnapDriver::preSmoothPatch().
void dumpRefinementLevel | ( | ) | const |
Write refinement level as volScalarFields for postprocessing.
Definition at line 3580 of file meshRefinement.C.
References IOobject::AUTO_WRITE, Foam::dimless, forAll, Time::New(), IOobject::NO_READ, IOobject::NO_WRITE, regIOobject::write(), and Foam::Zero.
void dumpIntersections | ( | const fileName & | prefix | ) | const |
Debug: Write intersection information to OBJ format.
Definition at line 3642 of file meshRefinement.C.
References Foam::endl(), forAll, OFstream::name(), Foam::nl, Foam::Pout, UList< T >::size(), and Foam::meshTools::writeOBJ().
void write | ( | const debugType | debugFlags, |
const writeType | writeFlags, | ||
const fileName & | prefix | ||
) | const |
Do any one of above IO functions.
Definition at line 3710 of file meshRefinement.C.
References write().
|
static |
Helper: remove all relevant files from mesh instance.
Definition at line 3743 of file meshRefinement.C.
References DebugVar, Foam::exists(), polyMesh::facesInstance(), io(), mesh, polyMesh::meshSubDir, IOobject::path(), faMesh::removeFiles(), and Foam::rm().
Helper: calculate average.
Definition at line 61 of file meshRefinementTemplates.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, n, Foam::reduce(), PackedList< Width >::size(), Foam::sum(), T, bitSet::test(), and Foam::Zero.
Referenced by snappySnapDriver::calcNearestSurface(), fieldSmoother::minSmoothField(), fieldSmoother::smoothLambdaMuDisplacement(), fieldSmoother::smoothNormals(), and fieldSmoother::smoothPatchNormals().
|
static |
Get/set write level.
Definition at line 3767 of file meshRefinement.C.
Referenced by snappyLayerDriver::addLayers(), snappyLayerDriver::addLayersSinglePass(), meshRefinement::blockLeakFaces(), snappySnapDriver::doSnap(), snappySnapDriver::preSmoothPatch(), and snappySnapDriver::smoothDisplacement().
|
static |
Definition at line 3773 of file meshRefinement.C.
|
static |
Helper: convert wordList into bit pattern using provided Enum.
Definition at line 252 of file meshRefinementTemplates.C.
|
static |
Wrapper around dictionary::get which does not exit.
Definition at line 329 of file meshRefinementTemplates.C.
References dict, FatalIOErrorInFunction, dictionary::name(), Foam::nl, and dictionary::readEntry().
|
static |
Wrapper around dictionary::subDict which does not exit.
Definition at line 3791 of file meshRefinement.C.
References dictionary::csearch(), dict, Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, dictionary::name(), Foam::nl, and dictionary::null.
Referenced by layerParameters::layerParameters().
|
static |
Wrapper around dictionary::lookup which does not exit.
Definition at line 3822 of file meshRefinement.C.
References dictionary::csearch(), dict, Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, UILList< LListBase, T >::first(), dictionary::name(), and Foam::nl.
|
static |
Definition at line 102 of file meshRefinement.H.
|
static |
Definition at line 122 of file meshRefinement.H.