meshRefinement Class Reference

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

Collaboration diagram for meshRefinement:

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 fvMeshmesh () const
 Reference to mesh. More...
 
fvMeshmesh ()
 
scalar mergeDistance () const
 
bool overwrite () const
 Overwrite the mesh? More...
 
const wordoldInstance () const
 (points)instance of mesh upon construction More...
 
const refinementSurfacessurfaces () const
 Reference to surface search engines. More...
 
const refinementFeaturesfeatures () const
 Reference to feature edge mesh. More...
 
const refinementRegionsshells () const
 Reference to refinement shells (regions) More...
 
const hexRef8meshCutter () const
 Reference to meshcutting engine. More...
 
const labelListsurfaceIndex () const
 Per start-end edge the index of the surface hit. More...
 
labelListsurfaceIndex ()
 
const 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< polyDistributionMapbalance (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< polyTopoChangeMaprefine (const labelList &cellsToRefine)
 Refine some cells. More...
 
autoPtr< polyDistributionMaprefineAndBalance (const string &msg, decompositionMethod &decomposer, fvMeshDistribute &distributor, const labelList &cellsToRefine, const scalar maxLoadUnbalance)
 Refine some cells and rebalance. More...
 
autoPtr< polyDistributionMapbalanceAndRefine (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< polyTopoChangeMapsplitMesh (const label nBufferLayers, const labelList &globalToMasterPatch, const labelList &globalToSlavePatch, const refinementParameters::cellSelectionPoints &selectionPoints)
 Split off (with optional buffer layers) unreachable areas. More...
 
autoPtr< polyTopoChangeMapdupNonManifoldPoints (const localPointRegion &)
 Find boundary points that connect to more than one cell. More...
 
autoPtr< polyTopoChangeMapdupNonManifoldPoints ()
 Find boundary points that connect to more than one cell. More...
 
autoPtr< polyTopoChangeMapcreateBaffles (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< polyTopoChangeMapcreateZoneBaffles (const labelList &globalToMasterPatch, const labelList &globalToSlavePatch, List< labelPair > &)
 Create baffles for faces straddling zoned surfaces. Return. More...
 
autoPtr< polyTopoChangeMapmergeBaffles (const List< labelPair > &)
 Merge baffles. Gets pairs of faces. More...
 
autoPtr< polyTopoChangeMapzonify (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< polyTopoChangeMapsplitMeshRegions (const labelList &globalToMasterPatch, const labelList &globalToSlavePatch, const refinementParameters::cellSelectionPoints &selectionPoints)
 Split mesh according to selectionPoints. More...
 
autoPtr< polyTopoChangeMapsplitFaces (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< polyTopoChangeMapdoRemovePoints (removePoints &pointRemover, const boolList &pointCanBeDeleted)
 
autoPtr< polyTopoChangeMapdoRestorePoints (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< indirectPrimitivePatchmakePatch (const polyMesh &, const labelList &)
 Create patch from set of patches. More...
 
static tmp< pointVectorFieldmakeDisplacementField (const pointMesh &pMesh, const labelList &adaptPatchIDs)
 Helper function to make a pointVectorField with correct. More...
 
static void checkCoupledFaceZones (const polyMesh &)
 Helper function: check that face zones are synced. More...
 
static void calculateEdgeWeights (const polyMesh &mesh, const PackedBoolList &isMasterEdge, const labelList &meshPoints, const edgeList &edges, scalarField &edgeWeights, scalarField &invSumWeight)
 Helper: calculate edge weights (1/length) More...
 
template<class Type >
static void weightedSum (const polyMesh &mesh, const PackedBoolList &isMasterEdge, const labelList &meshPoints, const edgeList &edges, const scalarField &edgeWeights, const Field< Type > &data, Field< Type > &sum)
 Helper: weighted sum (over all subset of mesh points) by. More...
 
static 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
 

Detailed Description

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

Maintains

  • per face any intersections of the cc-cc segment with any of the surfaces
Source files

Definition at line 81 of file meshRefinement.H.

Member Enumeration Documentation

◆ IOdebugType

Enumeration for what to debug.

Enumerator
IOMESH 
IOOBJINTERSECTIONS 
IOFEATURESEEDS 
IOATTRACTION 
IOLAYERINFO 

Definition at line 89 of file meshRefinement.H.

◆ debugType

enum debugType
Enumerator
MESH 
OBJINTERSECTIONS 
FEATURESEEDS 
ATTRACTION 
LAYERINFO 

Definition at line 99 of file meshRefinement.H.

◆ IOoutputType

Enumeration for what to output.

Enumerator
IOOUTPUTLAYERINFO 

Definition at line 109 of file meshRefinement.H.

◆ outputType

enum outputType
Enumerator
OUTPUTLAYERINFO 

Definition at line 115 of file meshRefinement.H.

◆ IOwriteType

Enumeration for what to write.

Enumerator
IOWRITEMESH 
IONOWRITEREFINEMENT 
IOWRITELEVELS 
IOWRITELAYERSETS 
IOWRITELAYERFIELDS 

Definition at line 121 of file meshRefinement.H.

◆ writeType

enum writeType
Enumerator
WRITEMESH 
NOWRITEREFINEMENT 
WRITELEVELS 
WRITELAYERSETS 
WRITELAYERFIELDS 

Definition at line 131 of file meshRefinement.H.

◆ mapType

enum mapType

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

Enumerator
MASTERONLY 

maintain master only

KEEPALL 

have slaves (upon refinement) from master

REMOVE 

set value to -1 any face that was refined

Definition at line 141 of file meshRefinement.H.

Constructor & Destructor Documentation

◆ meshRefinement() [1/2]

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 1160 of file meshRefinement.C.

References Foam::identityMap(), hexRef8::level0EdgeLength(), dictionary::lookupOrDefault(), primitiveMesh::nFaces(), refinementSurfaces::setMinLevelFields(), and meshRefinement::surfaces().

Here is the call graph for this function:

◆ meshRefinement() [2/2]

meshRefinement ( const meshRefinement )
delete

Disallow default bitwise copy construction.

Member Function Documentation

◆ ClassName()

ClassName ( "meshRefinement"  )

Runtime type information.

◆ mesh() [1/2]

const fvMesh& mesh ( ) const
inline

Reference to mesh.

Definition at line 610 of file meshRefinement.H.

Referenced by snappySnapDriver::calcNearestSurface(), and snappySnapDriver::preSmoothPatch().

Here is the caller graph for this function:

◆ mesh() [2/2]

fvMesh& mesh ( )
inline

Definition at line 615 of file meshRefinement.H.

◆ mergeDistance()

scalar mergeDistance ( ) const
inline

Definition at line 620 of file meshRefinement.H.

◆ overwrite()

bool overwrite ( ) const
inline

Overwrite the mesh?

Definition at line 626 of file meshRefinement.H.

◆ oldInstance()

const word& oldInstance ( ) const
inline

(points)instance of mesh upon construction

Definition at line 632 of file meshRefinement.H.

◆ surfaces()

const refinementSurfaces& surfaces ( ) const
inline

Reference to surface search engines.

Definition at line 638 of file meshRefinement.H.

Referenced by snappySnapDriver::calcNearestSurface(), and meshRefinement::meshRefinement().

Here is the caller graph for this function:

◆ features()

const refinementFeatures& features ( ) const
inline

Reference to feature edge mesh.

Definition at line 644 of file meshRefinement.H.

◆ shells()

const refinementRegions& shells ( ) const
inline

Reference to refinement shells (regions)

Definition at line 650 of file meshRefinement.H.

◆ meshCutter()

const hexRef8& meshCutter ( ) const
inline

Reference to meshcutting engine.

Definition at line 656 of file meshRefinement.H.

◆ surfaceIndex() [1/2]

const labelList& surfaceIndex ( ) const
inline

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

Definition at line 662 of file meshRefinement.H.

◆ surfaceIndex() [2/2]

labelList& surfaceIndex ( )
inline

Definition at line 667 of file meshRefinement.H.

◆ userFaceData() [1/2]

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

Additional face data that is maintained across.

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

Definition at line 676 of file meshRefinement.H.

◆ userFaceData() [2/2]

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

Definition at line 681 of file meshRefinement.H.

◆ countHits()

Foam::label countHits ( ) const

Count number of intersections (local)

Definition at line 1213 of file meshRefinement.C.

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

Here is the call graph for this function:

◆ balance()

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

◆ intersectedFaces()

Foam::labelList intersectedFaces ( ) const

Get faces with intersection.

Definition at line 1653 of file meshRefinement.C.

References forAll.

◆ intersectedPoints()

Foam::labelList intersectedPoints ( ) const

Get points on surfaces with intersection and boundary faces.

Definition at line 1679 of file meshRefinement.C.

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

Here is the call graph for this function:

◆ makePatch()

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

Create patch from set of patches.

Definition at line 1746 of file meshRefinement.C.

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

Referenced by snappyLayerDriver::addLayers(), snappySnapDriver::doSnap(), and snappySnapDriver::repatchToSurface().

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

◆ makeDisplacementField()

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

Helper function to make a pointVectorField with correct.

bcs for mesh movement:

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

Definition at line 1791 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().

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

◆ checkCoupledFaceZones()

◆ calculateEdgeWeights()

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

Helper: calculate edge weights (1/length)

Definition at line 1927 of file meshRefinement.C.

References Foam::e, forAll, Foam::mag(), Foam::max(), polyMesh::points(), List< T >::setSize(), PackedList< nBits >::size(), and List< T >::size().

Here is the call graph for this function:

◆ weightedSum()

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

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

summing contribution from (master) edges

Definition at line 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.

Here is the call graph for this function:

◆ isGap()

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

Is local topology a small gap?

Hits differ and angles are oppositeish and

hits have a normal distance

Definition at line 1502 of file meshRefinementRefine.C.

References Foam::mag(), VectorSpace< Form, Cmpt, Ncmpts >::zero, and Foam::Zero.

Here is the call graph for this function:

◆ isNormalGap()

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

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

Hits differ and angles are oppositeish and

hits have a normal distance

Definition at line 1559 of file meshRefinementRefine.C.

References Foam::cos(), Foam::degToRad(), Foam::mag(), VectorSpace< Form, Cmpt, Ncmpts >::zero, and Foam::Zero.

Here is the call graph for this function:

◆ refineCandidates()

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 2025 of file meshRefinementRefine.C.

References Foam::cos(), Foam::degToRad(), Foam::endl(), forAll, Foam::Info, insidePoints(), Foam::labelMax, Foam::max(), UPstream::nProcs(), and List< T >::setSize().

Here is the call graph for this function:

◆ refine()

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

Refine some cells.

Definition at line 2228 of file meshRefinementRefine.C.

References polyTopoChange::changeMesh(), Foam::patchDistWave::getChangedFaces(), and Foam::name().

Here is the call graph for this function:

◆ refineAndBalance()

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 2267 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().

Here is the call graph for this function:

◆ balanceAndRefine()

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 2368 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().

Here is the call graph for this function:

◆ baffleAndSplitMesh()

void baffleAndSplitMesh ( const bool  handleSnapProblems,
const snapParameters snapParams,
const bool  useTopologicalSnapDetection,
const bool  removeEdgeConnectedCells,
const scalarField perpendicularAngle,
const bool  mergeFreeStanding,
const scalar  freeStandingAngle,
const dictionary motionDict,
Time runTime,
const labelList globalToMasterPatch,
const labelList globalToSlavePatch,
const refinementParameters::cellSelectionPoints selectionPoints 
)

◆ splitMesh()

◆ dupNonManifoldPoints() [1/2]

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 2675 of file meshRefinementBaffles.C.

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

Here is the call graph for this function:

◆ dupNonManifoldPoints() [2/2]

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

Find boundary points that connect to more than one cell.

region and split them.

Definition at line 2731 of file meshRefinementBaffles.C.

◆ createBaffles()

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 306 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().

Here is the call graph for this function:

◆ checkZoneFaces()

void checkZoneFaces ( ) const

Debug helper: check faceZones are not on processor patches.

Definition at line 444 of file meshRefinementBaffles.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, IOobject::name(), patchIdentifier::name(), patchi, polyPatch::start(), and MeshZones< ZoneType, MeshType >::whichZone().

Here is the call graph for this function:

◆ createZoneBaffles()

Foam::autoPtr< Foam::polyTopoChangeMap > createZoneBaffles ( const labelList globalToMasterPatch,
const labelList globalToSlavePatch,
List< labelPair > &  baffles 
)

◆ mergeBaffles()

◆ zonify()

◆ addMeshedPatch()

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

Add patch originating from meshing. Update meshedPatches_.

Definition at line 1983 of file meshRefinement.C.

References Foam::findIndex(), polyBoundaryMesh::findPatchID(), forAll, Foam::name(), polyPatch::New(), patchi, dictionary::set(), and UPtrList< T >::size().

Here is the call graph for this function:

◆ meshedPatches()

Foam::labelList meshedPatches ( ) const

Get patchIDs for patches added in addMeshedPatch.

Definition at line 2048 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().

Here is the call graph for this function:

◆ selectSeparatedCoupledFaces()

void selectSeparatedCoupledFaces ( boolList selected) const

Select coupled faces that are not collocated.

Definition at line 2074 of file meshRefinement.C.

References forAll, patches, patchi, polyPatch::start(), coupledPolyPatch::transform(), and transformer::transformsPosition().

Here is the call graph for this function:

◆ findRegion()

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

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

Definition at line 2097 of file meshRefinement.C.

References polyMesh::findCell(), and Foam::reduce().

Here is the call graph for this function:

◆ findRegions()

void findRegions ( const polyMesh mesh,
labelList cellRegion,
const vector perturbVec,
const refinementParameters::cellSelectionPoints selectionPoints 
)
static

Find regions points are in and update cellRegion.

Uses optional perturbation to re-test.

Definition at line 2128 of file meshRefinement.C.

References forAll, refinementParameters::cellSelectionPoints::inside(), primitiveMesh::nCells(), and refinementParameters::cellSelectionPoints::outside().

Here is the call graph for this function:

◆ splitMeshRegions()

◆ splitFaces()

◆ distribute()

void distribute ( const polyDistributionMap map)

Update local numbering for mesh redistribution.

Definition at line 2303 of file meshRefinement.C.

References autoPtr< T >::clear(), polyDistributionMap::distributeFaceData(), Foam::e, treeBoundBox::extend(), Foam::faceMap(), forAll, meshBb(), and Foam::second().

Here is the call graph for this function:

◆ topoChange() [1/2]

void topoChange ( const polyTopoChangeMap map,
const labelList changedFaces 
)

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

face labels.

Definition at line 2357 of file meshRefinement.C.

Referenced by meshRefinement::mergePatchFacesUndo().

Here is the caller graph for this function:

◆ updateList()

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

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().

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

◆ storeData()

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

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

Definition at line 2369 of file meshRefinement.C.

Referenced by meshRefinement::mergePatchFacesUndo().

Here is the caller graph for this function:

◆ topoChange() [2/2]

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 2386 of file meshRefinement.C.

References polyTopoChangeMap::faceMap(), Foam::first(), forAll, polyTopoChangeMap::reverseFaceMap(), List< T >::size(), and dictionary::transfer().

Here is the call graph for this function:

◆ mergePatchFacesUndo()

◆ doRemovePoints()

◆ doRestorePoints()

◆ collectFaces()

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

Definition at line 731 of file meshRefinementMerge.C.

References Foam::findIndices(), forAll, HashTable< T, Key, Hash >::found(), and syncTools::syncFaceList().

Here is the call graph for this function:

◆ growFaceCellFace()

Foam::labelList growFaceCellFace ( const labelHashSet set) const

Definition at line 763 of file meshRefinementMerge.C.

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

Referenced by meshRefinement::mergePatchFacesUndo().

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

◆ mergeEdgesUndo()

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

◆ checkData()

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().

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

◆ testSyncPointList() [1/2]

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

◆ testSyncPointList() [2/2]

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

◆ testSyncBoundaryFaceList()

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

Compare two lists over all boundary faces.

Definition at line 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().

Here is the call graph for this function:

◆ collectAndPrint()

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

Print list according to (collected and) sorted coordinate.

Definition at line 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.

Here is the call graph for this function:

◆ getMasterPoints()

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

Determine master point for subset of points. If coupled.

chooses only one

Definition at line 2516 of file meshRefinement.C.

References forAll, Foam::labelMax, List< T >::size(), and syncTools::syncPointList().

Referenced by snappySnapDriver::calcNearestSurface(), and snappySnapDriver::detectNearSurfaces().

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

◆ getMasterEdges()

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

Determine master edge for subset of edges. If coupled.

chooses only one

Definition at line 2553 of file meshRefinement.C.

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

Here is the call graph for this function:

◆ printMeshInfo()

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

◆ name()

Foam::word name ( ) const

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

overwrite_)

Definition at line 2657 of file meshRefinement.C.

Referenced by meshRefinement::mergePatchFacesUndo(), and snappySnapDriver::preSmoothPatch().

Here is the caller graph for this function:

◆ setInstance()

void setInstance ( const fileName inst)

Set instance of all local IOobjects.

Definition at line 602 of file meshRefinement.C.

◆ write() [1/2]

bool write ( ) const

Write mesh and all data.

Definition at line 2481 of file meshRefinement.C.

References forAll, and s().

Referenced by meshRefinement::mergePatchFacesUndo(), and snappySnapDriver::preSmoothPatch().

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

◆ dumpRefinementLevel()

void dumpRefinementLevel ( ) const

Write refinement level as volScalarFields for postprocessing.

Definition at line 2670 of file meshRefinement.C.

References IOobject::AUTO_WRITE, Foam::dimless, forAll, DemandDrivenMeshObject< polyMesh, PatchMeshObject, pointMesh >::New(), IOobject::NO_READ, IOobject::NO_WRITE, and regIOobject::write().

Here is the call graph for this function:

◆ dumpIntersections()

void dumpIntersections ( const fileName prefix) const

Debug: Write intersection information to OBJ format.

Definition at line 2731 of file meshRefinement.C.

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

Here is the call graph for this function:

◆ write() [2/2]

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

Do any one of above IO functions.

Definition at line 2811 of file meshRefinement.C.

References Foam::vtkWriteOps::write().

Here is the call graph for this function:

◆ gAverage()

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

Helper: calculate average.

Definition at line 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().

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

◆ writeLevel() [1/2]

Foam::meshRefinement::writeType writeLevel ( )
static

Get/set write level.

Definition at line 2841 of file meshRefinement.C.

Referenced by snappyLayerDriver::addLayers(), snappySnapDriver::doSnap(), snappySnapDriver::preSmoothPatch(), and snappySnapDriver::smoothDisplacement().

Here is the caller graph for this function:

◆ writeLevel() [2/2]

void writeLevel ( const writeType  flags)
static

Definition at line 2847 of file meshRefinement.C.

◆ outputLevel() [1/2]

Foam::meshRefinement::outputType outputLevel ( )
static

Get/set output level.

Definition at line 2853 of file meshRefinement.C.

◆ outputLevel() [2/2]

void outputLevel ( const outputType  flags)
static

Definition at line 2859 of file meshRefinement.C.

◆ readFlags()

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

Helper: convert wordList into bit pattern using provided.

NamedEnum

Definition at line 201 of file meshRefinementTemplates.C.

References forAll.

◆ operator=()

void operator= ( const meshRefinement )
delete

Disallow default bitwise assignment.

Member Data Documentation

◆ IOdebugTypeNames

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

Definition at line 98 of file meshRefinement.H.

◆ IOoutputTypeNames

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

Definition at line 114 of file meshRefinement.H.

◆ IOwriteTypeNames

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

Definition at line 130 of file meshRefinement.H.


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