Helper class which maintains intersections of (changing) mesh with (static) surfaces. More...
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 , IONOWRITEREFINEMENT , IOWRITELEVELS , IOWRITELAYERSETS , IOWRITELAYERFIELDS } |
Enumeration for what to write. More... | |
enum | writeType { WRITEMESH = 1<<IOWRITEMESH , NOWRITEREFINEMENT = 1<<IONOWRITEREFINEMENT , 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 dictionary &refineDict, const scalar mergeDistance, const bool overwrite, refinementSurfaces &, const refinementFeatures &, const refinementRegions &) | |
Construct from components. More... | |
meshRefinement (const meshRefinement &)=delete | |
Disallow default bitwise copy construction. 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 refinementRegions & | shells () const |
Reference to refinement 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 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< polyDistributionMap > | 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, const vector &, const vector &, const vector &, const vector &) const |
Is local topology a small gap normal to the test vector. More... | |
labelList | refineCandidates (const List< point > &insidePoints, const scalar curvature, const scalar planarAngle, const bool featureRefinement, const bool featureDistanceRefinement, const bool internalRefinement, const bool surfaceRefinement, const bool curvatureRefinement, const bool gapRefinement, const label maxGlobalCells, const label maxLocalCells) const |
Calculate list of cells to refine. More... | |
autoPtr< polyTopoChangeMap > | refine (const labelList &cellsToRefine) |
Refine some cells. More... | |
autoPtr< polyDistributionMap > | refineAndBalance (const string &msg, decompositionMethod &decomposer, fvMeshDistribute &distributor, const labelList &cellsToRefine, const scalar maxLoadUnbalance) |
Refine some cells and rebalance. More... | |
autoPtr< polyDistributionMap > | balanceAndRefine (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 bool mergeFreeStanding, const scalar freeStandingAngle, const dictionary &motionDict, Time &runTime, const labelList &globalToMasterPatch, const labelList &globalToSlavePatch, const refinementParameters::cellSelectionPoints &selectionPoints) |
Split off unreachable areas of mesh. More... | |
autoPtr< polyTopoChangeMap > | splitMesh (const label nBufferLayers, const labelList &globalToMasterPatch, const labelList &globalToSlavePatch, const refinementParameters::cellSelectionPoints &selectionPoints) |
Split off (with optional buffer layers) unreachable areas. More... | |
autoPtr< polyTopoChangeMap > | dupNonManifoldPoints (const localPointRegion &) |
Find boundary points that connect to more than one cell. More... | |
autoPtr< polyTopoChangeMap > | dupNonManifoldPoints () |
Find boundary points that connect to more than one cell. More... | |
autoPtr< polyTopoChangeMap > | createBaffles (const labelList &ownPatch, const labelList &nbrPatch) |
Create baffle for every internal face where ownPatch != -1. More... | |
void | checkZoneFaces () const |
Debug helper: check faceZones are not on processor patches. More... | |
autoPtr< polyTopoChangeMap > | createZoneBaffles (const labelList &globalToMasterPatch, const labelList &globalToSlavePatch, List< labelPair > &) |
Create baffles for faces straddling zoned surfaces. Return. More... | |
autoPtr< polyTopoChangeMap > | mergeBaffles (const List< labelPair > &) |
Merge baffles. Gets pairs of faces. More... | |
autoPtr< polyTopoChangeMap > | zonify (const List< point > &insidePoints, const bool allowFreeStandingZoneFaces) |
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... | |
void | selectSeparatedCoupledFaces (boolList &) const |
Select coupled faces that are not collocated. More... | |
autoPtr< polyTopoChangeMap > | splitMeshRegions (const labelList &globalToMasterPatch, const labelList &globalToSlavePatch, const refinementParameters::cellSelectionPoints &selectionPoints) |
Split mesh according to selectionPoints. More... | |
autoPtr< polyTopoChangeMap > | splitFaces (const labelList &splitFaces, const labelPairList &splits) |
Split faces into two. More... | |
void | distribute (const polyDistributionMap &) |
Update local numbering for mesh redistribution. More... | |
void | topoChange (const polyTopoChangeMap &, 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 | topoChange (const polyTopoChangeMap &, const labelList &changedFaces, const Map< label > &pointsToRestore, const Map< label > &facesToRestore, const Map< label > &cellsToRestore) |
Update local numbering + undo. More... | |
label | mergePatchFacesUndo (const scalar minCos, const scalar concaveCos, const labelHashSet &patchIDs, const dictionary &motionDict, const labelList &preserveFaces) |
Merge coplanar faces. preserveFaces is != -1 for faces. More... | |
autoPtr< polyTopoChangeMap > | doRemovePoints (removePoints &pointRemover, const boolList &pointCanBeDeleted) |
autoPtr< polyTopoChangeMap > | doRestorePoints (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 | name () const |
Replacement for Time::name() : 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... | |
void | operator= (const meshRefinement &)=delete |
Disallow default bitwise assignment. 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 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 label | findRegion (const polyMesh &, const labelList &cellRegion, const vector &perturbVec, const point &location) |
Find region point is in. Uses optional perturbation to re-test. More... | |
static void | findRegions (const polyMesh &, labelList &cellRegion, const vector &perturbVec, const refinementParameters::cellSelectionPoints &selectionPoints) |
Find regions points are in and update cellRegion. 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 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, 5 > | IOwriteTypeNames |
Helper class which maintains intersections of (changing) mesh with (static) surfaces.
Maintains
Definition at line 81 of file meshRefinement.H.
enum IOdebugType |
Enumeration for what to debug.
Enumerator | |
---|---|
IOMESH | |
IOOBJINTERSECTIONS | |
IOFEATURESEEDS | |
IOATTRACTION | |
IOLAYERINFO |
Definition at line 89 of file meshRefinement.H.
enum debugType |
Enumerator | |
---|---|
MESH | |
OBJINTERSECTIONS | |
FEATURESEEDS | |
ATTRACTION | |
LAYERINFO |
Definition at line 99 of file meshRefinement.H.
enum IOoutputType |
Enumeration for what to output.
Enumerator | |
---|---|
IOOUTPUTLAYERINFO |
Definition at line 109 of file meshRefinement.H.
enum outputType |
Enumerator | |
---|---|
OUTPUTLAYERINFO |
Definition at line 115 of file meshRefinement.H.
enum IOwriteType |
Enumeration for what to write.
Enumerator | |
---|---|
IOWRITEMESH | |
IONOWRITEREFINEMENT | |
IOWRITELEVELS | |
IOWRITELAYERSETS | |
IOWRITELAYERFIELDS |
Definition at line 121 of file meshRefinement.H.
enum writeType |
Enumerator | |
---|---|
WRITEMESH | |
NOWRITEREFINEMENT | |
WRITELEVELS | |
WRITELAYERSETS | |
WRITELAYERFIELDS |
Definition at line 131 of file meshRefinement.H.
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 141 of file meshRefinement.H.
meshRefinement | ( | fvMesh & | mesh, |
const dictionary & | refineDict, | ||
const scalar | mergeDistance, | ||
const bool | overwrite, | ||
refinementSurfaces & | surfaces, | ||
const refinementFeatures & | features, | ||
const refinementRegions & | shells | ||
) |
Construct from components.
Definition at line 1122 of file meshRefinement.C.
References Foam::identityMap(), hexRef8::level0EdgeLength(), dictionary::lookupOrDefault(), primitiveMesh::nFaces(), refinementSurfaces::setMinLevelFields(), and meshRefinement::surfaces().
|
delete |
Disallow default bitwise copy construction.
ClassName | ( | "meshRefinement" | ) |
Runtime type information.
|
inline |
Reference to mesh.
Definition at line 610 of file meshRefinement.H.
Referenced by snappySnapDriver::calcNearestSurface(), and snappySnapDriver::preSmoothPatch().
|
inline |
Definition at line 615 of file meshRefinement.H.
|
inline |
Definition at line 620 of file meshRefinement.H.
|
inline |
Overwrite the mesh?
Definition at line 626 of file meshRefinement.H.
|
inline |
(points)instance of mesh upon construction
Definition at line 632 of file meshRefinement.H.
|
inline |
Reference to surface search engines.
Definition at line 638 of file meshRefinement.H.
Referenced by snappySnapDriver::calcNearestSurface(), and meshRefinement::meshRefinement().
|
inline |
Reference to feature edge mesh.
Definition at line 644 of file meshRefinement.H.
|
inline |
Reference to refinement shells (regions)
Definition at line 650 of file meshRefinement.H.
|
inline |
Reference to meshcutting engine.
Definition at line 656 of file meshRefinement.H.
|
inline |
Per start-end edge the index of the surface hit.
Definition at line 662 of file meshRefinement.H.
|
inline |
Definition at line 667 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 676 of file meshRefinement.H.
Definition at line 681 of file meshRefinement.H.
Foam::label countHits | ( | ) | const |
Count number of intersections (local)
Definition at line 1175 of file meshRefinement.C.
References forAll, PackedList< nBits >::get(), and syncTools::getMasterFaces().
Foam::autoPtr< Foam::polyDistributionMap > 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 1337 of file meshRefinement.C.
References fvMeshDistribute::countCells(), decompositionMethod::decompose(), fvMeshDistribute::distribute(), Foam::endl(), localPointRegion::findDuplicateFacePairs(), Pair< Type >::first(), forAll, Foam::Info, Pstream::listCombineGather(), Pstream::listCombineScatter(), Foam::name(), UPstream::parRun(), Foam::Pout, Foam::reduce(), Foam::returnReduce(), Pair< Type >::second(), decompositionMethod::setConstraints(), List< T >::setSize(), List< T >::size(), syncTools::syncFaceList(), and polyBoundaryMesh::whichPatch().
Foam::labelList intersectedFaces | ( | ) | const |
Foam::labelList intersectedPoints | ( | ) | const |
Get points on surfaces with intersection and boundary faces.
Definition at line 1641 of file meshRefinement.C.
References f(), forAll, PackedList< nBits >::get(), and PackedBoolList::set().
|
static |
Create patch from set of patches.
Definition at line 1708 of file meshRefinement.C.
References polyMesh::boundaryMesh(), polyMesh::faces(), forAll, patches, polyMesh::points(), UList< T >::size(), and polyPatch::start().
Referenced by snappyLayerDriver::addLayers(), snappySnapDriver::doSnap(), and snappySnapDriver::repatchToSurface().
|
static |
Helper function to make a pointVectorField with correct.
bcs for mesh movement:
Definition at line 1753 of file meshRefinement.C.
References pointMesh::boundary(), Foam::dimLength, forAll, GeometricField< Type, pointPatchField, pointMesh >::New(), patchi, UPtrList< T >::size(), and Foam::Zero.
Referenced by snappySnapDriver::doSnap().
|
static |
Helper function: check that face zones are synced.
Definition at line 1802 of file meshRefinement.C.
References Foam::abort(), Foam::exit(), polyMesh::faceZones(), Foam::FatalError, FatalErrorInFunction, forAll, Pstream::gatherList(), UPstream::myProcNo(), Zone< ZoneType, ZonesType >::name(), primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), Foam::nl, UPstream::nProcs(), Pstream::scatterList(), syncTools::swapBoundaryFaceList(), and DictionaryBase< IDLListType, T >::toc().
|
static |
Helper: calculate edge weights (1/length)
Definition at line 1880 of file meshRefinement.C.
References Foam::e, forAll, Foam::mag(), Foam::max(), polyMesh::points(), List< T >::setSize(), PackedList< nBits >::size(), and List< T >::size().
|
static |
Helper: weighted sum (over all subset of mesh points) by.
summing contribution from (master) edges
Definition at line 220 of file meshRefinementTemplates.C.
References Foam::abort(), Foam::e, Foam::FatalError, FatalErrorInFunction, forAll, PackedList< nBits >::size(), List< T >::size(), Foam::sum(), syncTools::syncPointList(), and Foam::Zero.
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 1506 of file meshRefinementRefine.C.
References Foam::mag(), VectorSpace< Form, Cmpt, Ncmpts >::zero, and Foam::Zero.
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 1563 of file meshRefinementRefine.C.
References Foam::cos(), Foam::degToRad(), Foam::mag(), VectorSpace< Form, Cmpt, Ncmpts >::zero, and Foam::Zero.
Foam::labelList refineCandidates | ( | const List< point > & | insidePoints, |
const scalar | curvature, | ||
const scalar | planarAngle, | ||
const bool | featureRefinement, | ||
const bool | featureDistanceRefinement, | ||
const bool | internalRefinement, | ||
const bool | surfaceRefinement, | ||
const bool | curvatureRefinement, | ||
const bool | gapRefinement, | ||
const label | maxGlobalCells, | ||
const label | maxLocalCells | ||
) | const |
Calculate list of cells to refine.
Disable refinement shortcut. nAllowRefine is per processor limit.
Definition at line 2029 of file meshRefinementRefine.C.
References Foam::cos(), Foam::endl(), forAll, Foam::Info, insidePoints(), Foam::labelMax, Foam::max(), UPstream::nProcs(), Foam::radToDeg(), and List< T >::setSize().
Foam::autoPtr< Foam::polyTopoChangeMap > refine | ( | const labelList & | cellsToRefine | ) |
Refine some cells.
Definition at line 2232 of file meshRefinementRefine.C.
References polyTopoChange::changeMesh(), Foam::patchDistWave::getChangedFaces(), and Foam::name().
Foam::autoPtr< Foam::polyDistributionMap > refineAndBalance | ( | const string & | msg, |
decompositionMethod & | decomposer, | ||
fvMeshDistribute & | distributor, | ||
const labelList & | cellsToRefine, | ||
const scalar | maxLoadUnbalance | ||
) |
Refine some cells and rebalance.
Definition at line 2261 of file meshRefinementRefine.C.
References Foam::endl(), Foam::Info, Foam::mag(), meshRefinement::MESH, Foam::name(), UPstream::nProcs(), Foam::Pout, Foam::returnReduce(), and Foam::vtkWriteOps::write().
Foam::autoPtr< Foam::polyDistributionMap > balanceAndRefine | ( | const string & | msg, |
decompositionMethod & | decomposer, | ||
fvMeshDistribute & | distributor, | ||
const labelList & | cellsToRefine, | ||
const scalar | maxLoadUnbalance | ||
) |
Balance before refining some cells.
Definition at line 2362 of file meshRefinementRefine.C.
References Foam::endl(), forAll, Foam::Info, Foam::mag(), meshRefinement::MESH, Foam::name(), UPstream::nProcs(), Foam::Pout, Foam::returnReduce(), List< T >::size(), and Foam::vtkWriteOps::write().
void baffleAndSplitMesh | ( | const bool | handleSnapProblems, |
const snapParameters & | snapParams, | ||
const bool | useTopologicalSnapDetection, | ||
const bool | removeEdgeConnectedCells, | ||
const scalarField & | perpendicularAngle, | ||
const bool | mergeFreeStanding, | ||
const scalar | freeStandingAngle, | ||
const dictionary & | motionDict, | ||
Time & | runTime, | ||
const labelList & | globalToMasterPatch, | ||
const labelList & | globalToSlavePatch, | ||
const refinementParameters::cellSelectionPoints & | selectionPoints | ||
) |
Split off unreachable areas of mesh.
Definition at line 2130 of file meshRefinementBaffles.C.
References cpuTime::cpuTimeIncrement(), Foam::endl(), localPointRegion::findDuplicateFacePairs(), Foam::Info, Foam::name(), Foam::nl, Time::path(), Foam::Pout, Foam::reduce(), Foam::returnReduce(), List< T >::size(), and Foam::vtkWriteOps::write().
Foam::autoPtr< Foam::polyTopoChangeMap > splitMesh | ( | const label | nBufferLayers, |
const labelList & | globalToMasterPatch, | ||
const labelList & | globalToSlavePatch, | ||
const refinementParameters::cellSelectionPoints & | selectionPoints | ||
) |
Split off (with optional buffer layers) unreachable areas.
of mesh. Does not introduce baffles.
Definition at line 2320 of file meshRefinementBaffles.C.
References DynamicList< T, SizeInc, SizeMult, SizeDiv >::append(), List< T >::clear(), Foam::endl(), f(), forAll, removeCells::getExposedFaces(), Foam::Info, refinementParameters::cellSelectionPoints::inside(), Foam::labelMax, Foam::max(), VectorSpace< Form, Cmpt, Ncmpts >::one, pFaces, Foam::reduce(), DynamicList< T, SizeInc, SizeMult, SizeDiv >::shrink(), List< T >::size(), syncTools::syncFaceList(), syncTools::syncPointList(), List< T >::transfer(), and WarningInFunction.
Foam::autoPtr< Foam::polyTopoChangeMap > dupNonManifoldPoints | ( | const localPointRegion & | regionSide | ) |
Find boundary points that connect to more than one cell.
region and split them.
Definition at line 2590 of file meshRefinementBaffles.C.
References polyTopoChange::changeMesh(), Foam::endl(), Foam::Info, localPointRegion::meshPointMap(), Foam::name(), Foam::returnReduce(), duplicatePoints::setRefinement(), and HashTable< T, Key, Hash >::size().
Foam::autoPtr< Foam::polyTopoChangeMap > dupNonManifoldPoints | ( | ) |
Find boundary points that connect to more than one cell.
region and split them.
Definition at line 2635 of file meshRefinementBaffles.C.
Foam::autoPtr< Foam::polyTopoChangeMap > createBaffles | ( | const labelList & | ownPatch, |
const labelList & | nbrPatch | ||
) |
Create baffle for every internal face where ownPatch != -1.
External faces get repatched according to ownPatch (nbrPatch 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 271 of file meshRefinementBaffles.C.
References Foam::abort(), polyTopoChange::changeMesh(), Foam::endl(), Foam::faceMap(), Foam::FatalError, FatalErrorInFunction, forAll, HashSet< Key, Hash >::insert(), Foam::name(), List< T >::size(), faceSet::sync(), syncTools::syncFaceList(), and HashTable< T, Key, Hash >::toc().
void checkZoneFaces | ( | ) | const |
Debug helper: check faceZones are not on processor patches.
Definition at line 397 of file meshRefinementBaffles.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, IOobject::name(), patchIdentifier::name(), patchi, polyPatch::start(), and ZoneList< ZoneType, ZonesType, MeshType >::whichZones().
Foam::autoPtr< Foam::polyTopoChangeMap > createZoneBaffles | ( | const labelList & | globalToMasterPatch, |
const labelList & | globalToSlavePatch, | ||
List< labelPair > & | baffles | ||
) |
Create baffles for faces straddling zoned surfaces. Return.
baffles.
Definition at line 430 of file meshRefinementBaffles.C.
References Foam::abort(), HashTableCore::end(), Foam::endl(), Foam::faceMap(), Foam::FatalError, FatalErrorInFunction, HashTable< T, Key, Hash >::find(), UList< T >::first(), forAll, forAllConstIter, surfaceZonesInfo::getNamedSurfaces(), Foam::Info, Foam::name(), Foam::nl, Foam::Pout, Foam::returnReduce(), List< T >::setSize(), HashTable< T, Key, Hash >::size(), List< T >::size(), and Foam::vtkWriteOps::write().
Foam::autoPtr< Foam::polyTopoChangeMap > mergeBaffles | ( | const List< labelPair > & | couples | ) |
Merge baffles. Gets pairs of faces.
Definition at line 783 of file meshRefinementBaffles.C.
References polyTopoChange::changeMesh(), UList< T >::first(), forAll, polyTopoChange::modifyFace(), Foam::name(), polyTopoChange::removeFace(), List< T >::setSize(), and List< T >::size().
Foam::autoPtr< Foam::polyTopoChangeMap > zonify | ( | const List< point > & | insidePoints, |
const bool | allowFreeStandingZoneFaces | ||
) |
Put faces/cells into zones according to surface specification.
Returns null if no zone surfaces present. Region containing the insidePoint will not be put into a cellZone.
Per face index of faceZone or -1
Definition at line 2644 of file meshRefinementBaffles.C.
References surfaceZonesInfo::addCellZonesToMesh(), surfaceZonesInfo::addFaceZonesToMesh(), UIndirectList< T >::addressing(), polyTopoChange::changeMesh(), polyPatch::coupled(), Foam::endl(), HashTable< T, Key, Hash >::find(), forAll, surfaceZonesInfo::getClosedNamedSurfaces(), surfaceZonesInfo::getInsidePointNamedSurfaces(), syncTools::getMasterFaces(), surfaceZonesInfo::getNamedSurfaces(), Foam::Info, HashTable< T, Key, Hash >::insert(), insidePoints(), PrimitivePatch< FaceList, PointField >::localFaces(), PrimitivePatch< FaceList, PointField >::localPoints(), Foam::magSqr(), Pstream::mapCombineGather(), Pstream::mapCombineScatter(), n, Zone< ZoneType, ZonesType >::name(), Foam::name(), Foam::nl, patches, patchi, Foam::Pout, Foam::returnReduce(), UIndirectList< T >::size(), UPtrList< T >::size(), List< T >::size(), polyPatch::start(), syncTools::swapBoundaryCellList(), syncTools::syncFaceList(), and OBJstream::write().
Foam::label addMeshedPatch | ( | const word & | name, |
const dictionary & | patchInfo | ||
) |
Add patch originating from meshing. Update meshedPatches_.
Definition at line 1936 of file meshRefinement.C.
References Foam::findIndex(), polyBoundaryMesh::findIndex(), forAll, Foam::name(), polyPatch::New(), patchi, dictionary::set(), and UPtrList< T >::size().
Foam::labelList meshedPatches | ( | ) | const |
Get patchIDs for patches added in addMeshedPatch.
Definition at line 2001 of file meshRefinement.C.
References Foam::abort(), DynamicList< T, SizeInc, SizeMult, SizeDiv >::append(), polyPatch::constraintType(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAll, patches, patchi, and Foam::type().
void selectSeparatedCoupledFaces | ( | boolList & | selected | ) | const |
Select coupled faces that are not collocated.
Definition at line 2027 of file meshRefinement.C.
References forAll, patches, patchi, polyPatch::start(), coupledPolyPatch::transform(), and transformer::transformsPosition().
|
static |
Find region point is in. Uses optional perturbation to re-test.
Definition at line 2050 of file meshRefinement.C.
References polyMesh::findCell(), and Foam::reduce().
|
static |
Find regions points are in and update cellRegion.
Uses optional perturbation to re-test.
Definition at line 2081 of file meshRefinement.C.
References forAll, refinementParameters::cellSelectionPoints::inside(), primitiveMesh::nCells(), and refinementParameters::cellSelectionPoints::outside().
Foam::autoPtr< Foam::polyTopoChangeMap > splitMeshRegions | ( | const labelList & | globalToMasterPatch, |
const labelList & | globalToSlavePatch, | ||
const refinementParameters::cellSelectionPoints & | selectionPoints | ||
) |
Split mesh according to selectionPoints.
Definition at line 2156 of file meshRefinement.C.
References DynamicList< T, SizeInc, SizeMult, SizeDiv >::append(), Foam::endl(), forAll, removeCells::getExposedFaces(), Foam::Info, refinementParameters::cellSelectionPoints::inside(), VectorSpace< Form, Cmpt, Ncmpts >::one, Foam::reduce(), Foam::returnReduce(), List< T >::setSize(), DynamicList< T, SizeInc, SizeMult, SizeDiv >::shrink(), List< T >::size(), and WarningInFunction.
Foam::autoPtr< Foam::polyTopoChangeMap > splitFaces | ( | const labelList & | splitFaces, |
const labelPairList & | splits | ||
) |
Split faces into two.
Definition at line 657 of file meshRefinement.C.
References polyTopoChange::addFace(), polyTopoChange::changeMesh(), Foam::endl(), f(), Foam::faceMap(), UList< T >::fcIndex(), forAll, polyTopoChange::modifyFace(), Foam::name(), patchi, Foam::Pout, Foam::renumber(), List< T >::setSize(), and List< T >::size().
void distribute | ( | const polyDistributionMap & | map | ) |
Update local numbering for mesh redistribution.
Definition at line 2256 of file meshRefinement.C.
References autoPtr< T >::clear(), polyDistributionMap::distributeFaceData(), Foam::e, treeBoundBox::extend(), Foam::faceMap(), forAll, meshBb(), and Foam::second().
void topoChange | ( | const polyTopoChangeMap & | map, |
const labelList & | changedFaces | ||
) |
Update for external change to mesh. changedFaces are in new mesh.
face labels.
Definition at line 2310 of file meshRefinement.C.
Referenced by meshRefinement::mergePatchFacesUndo().
Helper: reorder list according to map.
Definition at line 33 of file meshRefinementTemplates.C.
References forAll, List< T >::size(), and List< T >::transfer().
Referenced by snappyLayerDriver::addLayers(), and snappySnapDriver::doSnap().
void storeData | ( | const labelList & | pointsToStore, |
const labelList & | facesToStore, | ||
const labelList & | cellsToStore | ||
) |
Signal points/face/cells for which to store data.
Definition at line 2322 of file meshRefinement.C.
Referenced by meshRefinement::mergePatchFacesUndo().
void topoChange | ( | const polyTopoChangeMap & | 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 2339 of file meshRefinement.C.
References polyTopoChangeMap::faceMap(), Foam::first(), forAll, polyTopoChangeMap::reverseFaceMap(), List< T >::size(), and List< T >::transfer().
Foam::label mergePatchFacesUndo | ( | const scalar | minCos, |
const scalar | concaveCos, | ||
const labelHashSet & | patchIDs, | ||
const dictionary & | motionDict, | ||
const labelList & | preserveFaces | ||
) |
Merge coplanar faces. preserveFaces is != -1 for faces.
to be preserved
Definition at line 225 of file meshRefinementMerge.C.
References DynamicList< T, SizeInc, SizeMult, SizeDiv >::append(), primitiveMesh::cells(), polyTopoChange::changeMesh(), meshRefinement::checkData(), Foam::meshCheck::checkMesh(), Foam::endl(), polyMesh::faceOwner(), forAll, forAllConstIter, HashTable< T, Key, Hash >::found(), combineFaces::getMergeSets(), meshRefinement::growFaceCellFace(), Foam::Info, Foam::inplaceMapKey(), HashSet< Key, Hash >::insert(), IOobject::instance(), combineFaces::masterFace(), meshRefinement::MESH, meshRefinement::name(), primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), Foam::nl, regIOobject::objectPath(), Foam::Pout, Foam::returnReduce(), combineFaces::savedPointLabels(), polyMesh::setInstance(), combineFaces::setRefinement(), List< T >::setSize(), combineFaces::setUnrefinement(), DynamicList< T, SizeInc, SizeMult, SizeDiv >::shrink(), HashTable< T, Key, Hash >::size(), List< T >::size(), meshRefinement::storeData(), fvMesh::time(), combineFaces::topoChange(), meshRefinement::topoChange(), fvMesh::topoChange(), meshRefinement::write(), and regIOobject::write().
Foam::autoPtr< Foam::polyTopoChangeMap > doRemovePoints | ( | removePoints & | pointRemover, |
const boolList & | pointCanBeDeleted | ||
) |
Definition at line 554 of file meshRefinementMerge.C.
References polyTopoChange::changeMesh(), Foam::endl(), forAll, HashSet< Key, Hash >::insert(), Foam::name(), Foam::Pout, removePoints::savedFaceLabels(), removePoints::setRefinement(), List< T >::size(), and removePoints::topoChange().
Foam::autoPtr< Foam::polyTopoChangeMap > doRestorePoints | ( | removePoints & | pointRemover, |
const labelList & | facesToRestore | ||
) |
Definition at line 600 of file meshRefinementMerge.C.
References polyTopoChange::changeMesh(), Foam::endl(), forAll, removePoints::getUnrefimentSet(), HashSet< Key, Hash >::insert(), Foam::name(), Foam::Pout, removePoints::setUnrefinement(), List< T >::size(), and removePoints::topoChange().
Foam::labelList collectFaces | ( | const labelList & | candidateFaces, |
const labelHashSet & | set | ||
) | const |
Definition at line 662 of file meshRefinementMerge.C.
References Foam::findIndices(), forAll, HashTable< T, Key, Hash >::found(), and syncTools::syncFaceList().
Foam::labelList growFaceCellFace | ( | const labelHashSet & | set | ) | const |
Definition at line 694 of file meshRefinementMerge.C.
References Foam::findIndices(), forAll, forAllConstIter, and syncTools::syncFaceList().
Referenced by meshRefinement::mergePatchFacesUndo().
Foam::label mergeEdgesUndo | ( | const scalar | minCos, |
const dictionary & | motionDict | ||
) |
Merge edges, maintain mesh quality. Return global number.
of edges merged
Definition at line 735 of file meshRefinementMerge.C.
References Foam::meshCheck::checkMesh(), removePoints::countPointUsage(), Foam::endl(), Foam::Info, IOobject::instance(), meshRefinement::MESH, n, Foam::name(), Foam::nl, regIOobject::objectPath(), Foam::Pout, Foam::returnReduce(), removePoints::savedFaceLabels(), HashTable< T, Key, Hash >::size(), List< T >::size(), regIOobject::write(), and Foam::vtkWriteOps::write().
void checkData | ( | ) |
Debugging: check that all faces still obey start()>end()
Definition at line 405 of file meshRefinement.C.
References Foam::endl(), localPointRegion::findDuplicateFaces(), forAll, Foam::identityMap(), Foam::Pout, List< T >::size(), syncTools::swapBoundaryFaceList(), syncTools::syncBoundaryFacePositions(), and WarningInFunction.
Referenced by meshRefinement::mergePatchFacesUndo().
|
static |
Definition at line 311 of file meshRefinement.C.
References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, fld(), forAll, Foam::mag(), Foam::nl, primitiveMesh::nPoints(), polyMesh::points(), Foam::Pout, and syncTools::syncPointList().
|
static |
Definition at line 358 of file meshRefinement.C.
References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, fld(), forAll, Foam::mag(), Foam::nl, primitiveMesh::nPoints(), polyMesh::points(), Foam::Pout, syncTools::syncPointList(), and VectorSpace< Form, Cmpt, Ncmpts >::zero.
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 99 of file meshRefinementTemplates.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::mag(), patchIdentifier::name(), patches, patchi, UList< T >::size(), polyPatch::start(), and Foam::T().
Print list according to (collected and) sorted coordinate.
Definition at line 156 of file meshRefinementTemplates.C.
References UPstream::blocking, Foam::endl(), forAll, Foam::identityMap(), Foam::Info, Foam::mag(), UPstream::msgType(), UPstream::nProcs(), points, List< T >::size(), Foam::sortedOrder(), and UPstream::worldComm.
|
static |
Determine master point for subset of points. If coupled.
chooses only one
Definition at line 2473 of file meshRefinement.C.
References forAll, Foam::labelMax, List< T >::size(), and syncTools::syncPointList().
Referenced by snappySnapDriver::calcNearestSurface(), and snappySnapDriver::detectNearSurfaces().
|
static |
Determine master edge for subset of edges. If coupled.
chooses only one
Definition at line 2510 of file meshRefinement.C.
References forAll, Foam::labelMax, List< T >::size(), syncTools::syncEdgeList(), and globalIndex::toGlobal().
void printMeshInfo | ( | const bool | debug, |
const string & | msg | ||
) | const |
Print some mesh stats.
Definition at line 2547 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().
Foam::word name | ( | ) | const |
Replacement for Time::name() : return oldInstance (if.
overwrite_)
Definition at line 2614 of file meshRefinement.C.
Referenced by meshRefinement::mergePatchFacesUndo(), and snappySnapDriver::preSmoothPatch().
void setInstance | ( | const fileName & | inst | ) |
Set instance of all local IOobjects.
Definition at line 602 of file meshRefinement.C.
bool write | ( | ) | const |
Write mesh and all data.
Definition at line 2434 of file meshRefinement.C.
References forAll, Foam::name(), and s().
Referenced by meshRefinement::mergePatchFacesUndo(), and snappySnapDriver::preSmoothPatch().
void dumpRefinementLevel | ( | ) | const |
Write refinement level as volScalarFields for postprocessing.
Definition at line 2627 of file meshRefinement.C.
References IOobject::AUTO_WRITE, Foam::dimless, forAll, DemandDrivenMeshObject< polyMesh, RepatchableMeshObject, pointMesh >::New(), IOobject::NO_READ, IOobject::NO_WRITE, and regIOobject::write().
void dumpIntersections | ( | const fileName & | prefix | ) | const |
Debug: Write intersection information to OBJ format.
Definition at line 2688 of file meshRefinement.C.
References Foam::endl(), forAll, OFstream::name(), Foam::nl, Foam::Pout, List< 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 2768 of file meshRefinement.C.
References Foam::vtkWriteOps::write().
|
static |
Helper: calculate average.
Definition at line 57 of file meshRefinementTemplates.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, n, Foam::reduce(), PackedList< nBits >::size(), UList< T >::size(), Foam::sum(), Foam::T(), and Foam::Zero.
Referenced by snappySnapDriver::calcNearestSurface().
|
static |
Get/set write level.
Definition at line 2798 of file meshRefinement.C.
Referenced by snappyLayerDriver::addLayers(), snappySnapDriver::doSnap(), snappySnapDriver::preSmoothPatch(), and snappySnapDriver::smoothDisplacement().
|
static |
Definition at line 2804 of file meshRefinement.C.
|
static |
Get/set output level.
Definition at line 2810 of file meshRefinement.C.
|
static |
Definition at line 2816 of file meshRefinement.C.
|
static |
Helper: convert wordList into bit pattern using provided.
Definition at line 201 of file meshRefinementTemplates.C.
References forAll.
|
delete |
Disallow default bitwise assignment.
|
static |
Definition at line 98 of file meshRefinement.H.
|
static |
Definition at line 114 of file meshRefinement.H.
|
static |
Definition at line 130 of file meshRefinement.H.