Loading...
Searching...
No Matches
mapPolyMesh Class Reference

Class containing mesh-to-mesh mapping information after a change in polyMesh topology. More...

#include <mapPolyMesh.H>

Public Member Functions

 mapPolyMesh (const mapPolyMesh &)=delete
 No copy construct.
void operator= (const mapPolyMesh &)=delete
 No copy assignment.
 mapPolyMesh (const polyMesh &mesh)
 Construct from mesh.
 mapPolyMesh (const polyMesh &mesh, const label nOldPoints, const label nOldFaces, const label nOldCells, const labelList &pointMap, const List< objectMap > &pointsFromPoints, const labelList &faceMap, const List< objectMap > &facesFromPoints, const List< objectMap > &facesFromEdges, const List< objectMap > &facesFromFaces, const labelList &cellMap, const List< objectMap > &cellsFromPoints, const List< objectMap > &cellsFromEdges, const List< objectMap > &cellsFromFaces, const List< objectMap > &cellsFromCells, const labelList &reversePointMap, const labelList &reverseFaceMap, const labelList &reverseCellMap, const labelHashSet &flipFaceFlux, const labelListList &patchPointMap, const labelListList &pointZoneMap, const labelListList &faceZonePointMap, const labelListList &faceZoneFaceMap, const labelListList &cellZoneMap, const pointField &preMotionPoints, const labelList &oldPatchStarts, const labelList &oldPatchNMeshPoints, const autoPtr< scalarField > &oldCellVolumesPtr)
 Copy construct from components, except for oldCellVolumes which is move construct.
 mapPolyMesh (const polyMesh &mesh, const label nOldPoints, const label nOldFaces, const label nOldCells, labelList &pointMap, List< objectMap > &pointsFromPoints, labelList &faceMap, List< objectMap > &facesFromPoints, List< objectMap > &facesFromEdges, List< objectMap > &facesFromFaces, labelList &cellMap, List< objectMap > &cellsFromPoints, List< objectMap > &cellsFromEdges, List< objectMap > &cellsFromFaces, List< objectMap > &cellsFromCells, labelList &reversePointMap, labelList &reverseFaceMap, labelList &reverseCellMap, labelHashSet &flipFaceFlux, labelListList &patchPointMap, labelListList &pointZoneMap, labelListList &faceZonePointMap, labelListList &faceZoneFaceMap, labelListList &cellZoneMap, pointField &preMotionPoints, labelList &oldPatchStarts, labelList &oldPatchNMeshPoints, autoPtr< scalarField > &oldCellVolumesPtr, const bool reuse)
 Construct from components and optionally reuse storage.
const polyMeshmesh () const noexcept
 Return polyMesh.
label nOldPoints () const noexcept
 Number of old points.
label nOldInternalFaces () const
 Number of old internal faces.
label nOldFaces () const noexcept
 Number of old faces.
label nOldCells () const noexcept
 Number of old cells.
const labelListpointMap () const noexcept
 Old point map.
const List< objectMap > & pointsFromPointsMap () const noexcept
 Points originating from points.
const labelListfaceMap () const noexcept
 Old face map.
const List< objectMap > & facesFromPointsMap () const noexcept
 Faces inflated from points.
const List< objectMap > & facesFromEdgesMap () const noexcept
 Faces inflated from edges.
const List< objectMap > & facesFromFacesMap () const noexcept
 Faces originating from faces.
const labelListcellMap () const noexcept
 Old cell map.
const List< objectMap > & cellsFromPointsMap () const noexcept
 Cells inflated from points.
const List< objectMap > & cellsFromEdgesMap () const noexcept
 Cells inflated from edges.
const List< objectMap > & cellsFromFacesMap () const noexcept
 Cells inflated from faces.
const List< objectMap > & cellsFromCellsMap () const noexcept
 Cells originating from cells.
const labelListreversePointMap () const noexcept
 Reverse point map.
label mergedPoint (const label oldPointi) const
 If point is removed return point (on new mesh) it merged.
const labelListreverseFaceMap () const noexcept
 Reverse face map.
label mergedFace (const label oldFacei) const
 If face is removed return face (on new mesh) it merged into.
const labelListreverseCellMap () const noexcept
 Reverse cell map.
label mergedCell (const label oldCelli) const
 If cell is removed return cell (on new mesh) it merged into.
const labelHashSetflipFaceFlux () const noexcept
 Map of flipped face flux faces.
const labelListListpatchPointMap () const noexcept
 Patch point renumbering.
const labelListListpointZoneMap () const noexcept
 Point zone renumbering.
const labelListListfaceZonePointMap () const noexcept
 Face zone point renumbering.
const labelListListfaceZoneFaceMap () const noexcept
 Face zone face renumbering.
const labelListListcellZoneMap () const noexcept
 Cell zone renumbering.
const pointFieldpreMotionPoints () const noexcept
 Pre-motion point positions.
bool hasMotionPoints () const noexcept
 Has valid preMotionPoints?
const labelListoldPatchSizes () const noexcept
 Return list of the old patch sizes.
const labelListoldPatchStarts () const noexcept
 Return list of the old patch start labels.
const labelListoldPatchNMeshPoints () const noexcept
 Return numbers of mesh points per old patch.
bool hasOldCellVolumes () const noexcept
const scalarFieldoldCellVolumes () const

Detailed Description

Class containing mesh-to-mesh mapping information after a change in polyMesh topology.

General:

  • pointMap/faceMap/cellMap:
    from current mesh back to previous mesh. (so to 'pull' the information onto the current mesh)
  • reversePointMap/faceMap/cellMap:
    from previous mesh to current. (so to 'push' information)

In the topology change points/faces/cells

  • can be unchanged. (faces might be renumbered though)
  • can be removed (into nothing)
  • can be removed into/merged with existing same entity (so point merged with other point, face with other face, cell with other cell. Note that probably only cell with cell is relevant)
  • can be added from existing same 'master' entity (so point from point, face from face and cell from cell)
  • can be inflated: face out of edge or point, cell out of face, edge or point.
  • can be appended: added 'out of nothing'.

All this information is necessary to correctly map fields.

points
  • unchanged:
    • pointMap[pointi] contains old point label
    • reversePointMap[oldPointi] contains new point label
  • removed:
    • reversePointMap[oldPointi] contains -1
  • merged into point:
    • reversePointMap[oldPointi] contains <-1 : -newPointi-2
    • pointMap[pointi] contains the old master point label
    • pointsFromPoints gives for pointi all the old point labels (including the old master point!)
  • added-from-same:
    • pointMap[pointi] contains the old master point label
  • appended:
    • pointMap[pointi] contains -1
faces
  • unchanged:
    • faceMap[facei] contains old face label
    • reverseFaceMap[oldFacei] contains new face label
  • removed:
    • reverseFaceMap[oldFacei] contains -1
  • merged into face:
    • reverseFaceMap[oldFacei] contains <-1 : -newFacei-2
    • faceMap[facei] contains the old master face label
    • facesFromFaces gives for facei all the old face labels (including the old master face!)
  • added-from-same:
    • faceMap[facei] contains the old master face label
  • inflated-from-edge:
    • faceMap[facei] contains -1
    • facesFromEdges contains an entry with
      • facei
      • list of faces(*) on old mesh that connected to the old edge
  • inflated-from-point:
    • faceMap[facei] contains -1
    • facesFromPoints contains an entry with
      • facei
      • list of faces(*) on old mesh that connected to the old point
  • appended:
    • faceMap[facei] contains -1

Note (*)
if the newly inflated face is a boundary face the list of faces will only be boundary faces; if the new face is an internal face they will only be internal faces.

cells
  • unchanged:
    • cellMap[celli] contains old cell label
    • reverseCellMap[oldCelli] contains new cell label
  • removed:
    • reverseCellMap[oldCelli] contains -1
  • merged into cell:
    • reverseCellMap[oldCelli] contains <-1 : -newCelli-2
    • cellMap[celli] contains the old master cell label
    • cellsFromCells gives for celli all the old cell labels (including the old master cell!)
  • added-from-same:
    • cellMap[celli] contains the old master cell label
  • inflated-from-face:
    • cellMap[celli] contains -1
    • cellsFromFaces contains an entry with
      • celli
      • list of cells on old mesh that connected to the old face
  • inflated-from-edge:
    • cellMap[celli] contains -1
    • cellsFromEdges contains an entry with
      • celli
      • list of cells on old mesh that connected to the old edge
  • inflated-from-point:
    • cellMap[celli] contains -1
    • cellsFromPoints contains an entry with
      • celli
      • list of cells on old mesh that connected to the old point
  • appended:
    • cellMap[celli] contains -1
Source files

Definition at line 158 of file mapPolyMesh.H.

Constructor & Destructor Documentation

◆ mapPolyMesh() [1/4]

mapPolyMesh ( const mapPolyMesh & )
delete

No copy construct.

References mapPolyMesh().

Referenced by mapPolyMesh(), and operator=().

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

◆ mapPolyMesh() [2/4]

mapPolyMesh ( const polyMesh & mesh)

Construct from mesh.

Definition at line 27 of file mapPolyMesh.C.

References forAll, Foam::identity(), mesh(), nPoints, and points.

Here is the call graph for this function:

◆ mapPolyMesh() [3/4]

mapPolyMesh ( const polyMesh & mesh,
const label nOldPoints,
const label nOldFaces,
const label nOldCells,
const labelList & pointMap,
const List< objectMap > & pointsFromPoints,
const labelList & faceMap,
const List< objectMap > & facesFromPoints,
const List< objectMap > & facesFromEdges,
const List< objectMap > & facesFromFaces,
const labelList & cellMap,
const List< objectMap > & cellsFromPoints,
const List< objectMap > & cellsFromEdges,
const List< objectMap > & cellsFromFaces,
const List< objectMap > & cellsFromCells,
const labelList & reversePointMap,
const labelList & reverseFaceMap,
const labelList & reverseCellMap,
const labelHashSet & flipFaceFlux,
const labelListList & patchPointMap,
const labelListList & pointZoneMap,
const labelListList & faceZonePointMap,
const labelListList & faceZoneFaceMap,
const labelListList & cellZoneMap,
const pointField & preMotionPoints,
const labelList & oldPatchStarts,
const labelList & oldPatchNMeshPoints,
const autoPtr< scalarField > & oldCellVolumesPtr )

◆ mapPolyMesh() [4/4]

mapPolyMesh ( const polyMesh & mesh,
const label nOldPoints,
const label nOldFaces,
const label nOldCells,
labelList & pointMap,
List< objectMap > & pointsFromPoints,
labelList & faceMap,
List< objectMap > & facesFromPoints,
List< objectMap > & facesFromEdges,
List< objectMap > & facesFromFaces,
labelList & cellMap,
List< objectMap > & cellsFromPoints,
List< objectMap > & cellsFromEdges,
List< objectMap > & cellsFromFaces,
List< objectMap > & cellsFromCells,
labelList & reversePointMap,
labelList & reverseFaceMap,
labelList & reverseCellMap,
labelHashSet & flipFaceFlux,
labelListList & patchPointMap,
labelListList & pointZoneMap,
labelListList & faceZonePointMap,
labelListList & faceZoneFaceMap,
labelListList & cellZoneMap,
pointField & preMotionPoints,
labelList & oldPatchStarts,
labelList & oldPatchNMeshPoints,
autoPtr< scalarField > & oldCellVolumesPtr,
const bool reuse )

Member Function Documentation

◆ operator=()

◆ mesh()

◆ nOldPoints()

label nOldPoints ( ) const
inlinenoexcept

Number of old points.

Definition at line 448 of file mapPolyMesh.H.

References Foam::noexcept.

Referenced by mapPolyMesh(), mapPolyMesh(), operator=(), hexRef8::updateMesh(), and hexRef8Data::updateMesh().

Here is the caller graph for this function:

◆ nOldInternalFaces()

label nOldInternalFaces ( ) const
inline

Number of old internal faces.

Definition at line 456 of file mapPolyMesh.H.

◆ nOldFaces()

label nOldFaces ( ) const
inlinenoexcept

Number of old faces.

Definition at line 464 of file mapPolyMesh.H.

References Foam::noexcept.

Referenced by snappyLayerDriver::addLayers(), fvMesh::mapFields(), mapPolyMesh(), mapPolyMesh(), and operator=().

Here is the caller graph for this function:

◆ nOldCells()

label nOldCells ( ) const
inlinenoexcept

Number of old cells.

Definition at line 472 of file mapPolyMesh.H.

References Foam::noexcept.

Referenced by snappyLayerDriver::addLayers(), dynamicRefineFvMesh::mapFields(), fvMesh::mapFields(), mapPolyMesh(), mapPolyMesh(), operator=(), fvMesh::updateMesh(), hexRef8::updateMesh(), and hexRef8Data::updateMesh().

Here is the caller graph for this function:

◆ pointMap()

const labelList & pointMap ( ) const
inlinenoexcept

Old point map.

Contains the old point label for all new points. For preserved points this is the old point label. For added points this is the master point ID

Definition at line 484 of file mapPolyMesh.H.

References Foam::noexcept.

Referenced by snappyLayerDriver::mapFaceZonePoints(), mapPolyMesh(), mapPolyMesh(), operator=(), componentDisplacementMotionSolver::updateMesh(), displacementLayeredMotionMotionSolver::updateMesh(), hexRef8::updateMesh(), hexRef8Data::updateMesh(), points0MotionSolver::updateMesh(), and polyMesh::updateMesh().

Here is the caller graph for this function:

◆ pointsFromPointsMap()

const List< objectMap > & pointsFromPointsMap ( ) const
inlinenoexcept

Points originating from points.

Definition at line 492 of file mapPolyMesh.H.

References Foam::noexcept.

◆ faceMap()

const labelList & faceMap ( ) const
inlinenoexcept

Old face map.

Contains a list of old face labels for every new face. Warning: this map contains invalid entries for new faces

Definition at line 503 of file mapPolyMesh.H.

References Foam::noexcept.

Referenced by snappyLayerDriver::addLayers(), snappyLayerDriver::addLayers(), snappyLayerDriver::addLayersSinglePass(), meshRefinement::createBaffles(), snappyLayerDriver::mapFaceZonePoints(), dynamicRefineFvMesh::mapFields(), fvMesh::mapFields(), mapPolyMesh(), mapPolyMesh(), operator=(), meshRefinement::splitFacesUndo(), and meshRefinement::updateMesh().

Here is the caller graph for this function:

◆ facesFromPointsMap()

const List< objectMap > & facesFromPointsMap ( ) const
inlinenoexcept

Faces inflated from points.

Definition at line 511 of file mapPolyMesh.H.

References Foam::noexcept.

◆ facesFromEdgesMap()

const List< objectMap > & facesFromEdgesMap ( ) const
inlinenoexcept

Faces inflated from edges.

Definition at line 519 of file mapPolyMesh.H.

References Foam::noexcept.

◆ facesFromFacesMap()

const List< objectMap > & facesFromFacesMap ( ) const
inlinenoexcept

Faces originating from faces.

Definition at line 527 of file mapPolyMesh.H.

References Foam::noexcept.

◆ cellMap()

const labelList & cellMap ( ) const
inlinenoexcept

Old cell map.

Contains old cell label for all preserved cells.

Definition at line 537 of file mapPolyMesh.H.

References Foam::noexcept.

Referenced by snappyLayerDriver::addLayers(), dynamicRefineFvMesh::mapFields(), fvMesh::mapFields(), mapPolyMesh(), mapPolyMesh(), operator=(), hexRef8::updateMesh(), hexRef8Data::updateMesh(), polyMesh::updateMesh(), and refinementHistory::updateMesh().

Here is the caller graph for this function:

◆ cellsFromPointsMap()

const List< objectMap > & cellsFromPointsMap ( ) const
inlinenoexcept

Cells inflated from points.

Definition at line 545 of file mapPolyMesh.H.

References Foam::noexcept.

◆ cellsFromEdgesMap()

const List< objectMap > & cellsFromEdgesMap ( ) const
inlinenoexcept

Cells inflated from edges.

Definition at line 553 of file mapPolyMesh.H.

References Foam::noexcept.

◆ cellsFromFacesMap()

const List< objectMap > & cellsFromFacesMap ( ) const
inlinenoexcept

Cells inflated from faces.

Definition at line 561 of file mapPolyMesh.H.

References Foam::noexcept.

◆ cellsFromCellsMap()

const List< objectMap > & cellsFromCellsMap ( ) const
inlinenoexcept

Cells originating from cells.

Definition at line 569 of file mapPolyMesh.H.

References Foam::noexcept.

Referenced by dynamicRefineFvMesh::mapFields().

Here is the caller graph for this function:

◆ reversePointMap()

◆ mergedPoint()

label mergedPoint ( const label oldPointi) const
inline

If point is removed return point (on new mesh) it merged.

into

Definition at line 592 of file mapPolyMesh.H.

References Foam::abort(), Foam::endl(), Foam::FatalError, and FatalErrorInFunction.

Here is the call graph for this function:

◆ reverseFaceMap()

◆ mergedFace()

label mergedFace ( const label oldFacei) const
inline

If face is removed return face (on new mesh) it merged into.

Definition at line 628 of file mapPolyMesh.H.

References Foam::abort(), Foam::endl(), Foam::FatalError, and FatalErrorInFunction.

Here is the call graph for this function:

◆ reverseCellMap()

◆ mergedCell()

label mergedCell ( const label oldCelli) const
inline

If cell is removed return cell (on new mesh) it merged into.

Definition at line 664 of file mapPolyMesh.H.

References Foam::abort(), Foam::endl(), Foam::FatalError, and FatalErrorInFunction.

Here is the call graph for this function:

◆ flipFaceFlux()

const labelHashSet & flipFaceFlux ( ) const
inlinenoexcept

Map of flipped face flux faces.

Definition at line 690 of file mapPolyMesh.H.

References Foam::noexcept.

Referenced by mapPolyMesh(), mapPolyMesh(), and operator=().

Here is the caller graph for this function:

◆ patchPointMap()

const labelListList & patchPointMap ( ) const
inlinenoexcept

Patch point renumbering.

For every preserved point on a patch give the old position. For added points, the index is set to -1

Definition at line 701 of file mapPolyMesh.H.

References Foam::noexcept.

Referenced by mapPolyMesh(), mapPolyMesh(), and operator=().

Here is the caller graph for this function:

◆ pointZoneMap()

const labelListList & pointZoneMap ( ) const
inlinenoexcept

Point zone renumbering.

For every preserved point in zone give the old position. For added points, the index is set to -1

Definition at line 715 of file mapPolyMesh.H.

References Foam::noexcept.

Referenced by mapPolyMesh(), mapPolyMesh(), and operator=().

Here is the caller graph for this function:

◆ faceZonePointMap()

const labelListList & faceZonePointMap ( ) const
inlinenoexcept

Face zone point renumbering.

For every preserved point in zone give the old position. For added points, the index is set to -1

Definition at line 726 of file mapPolyMesh.H.

References Foam::noexcept.

Referenced by mapPolyMesh(), mapPolyMesh(), and operator=().

Here is the caller graph for this function:

◆ faceZoneFaceMap()

const labelListList & faceZoneFaceMap ( ) const
inlinenoexcept

Face zone face renumbering.

For every preserved face in zone give the old position. For added faces, the index is set to -1

Definition at line 737 of file mapPolyMesh.H.

References Foam::noexcept.

Referenced by mapPolyMesh(), mapPolyMesh(), and operator=().

Here is the caller graph for this function:

◆ cellZoneMap()

const labelListList & cellZoneMap ( ) const
inlinenoexcept

Cell zone renumbering.

For every preserved cell in zone give the old position. For added cells, the index is set to -1

Definition at line 748 of file mapPolyMesh.H.

References Foam::noexcept.

Referenced by mapPolyMesh(), mapPolyMesh(), and operator=().

Here is the caller graph for this function:

◆ preMotionPoints()

◆ hasMotionPoints()

◆ oldPatchSizes()

const labelList & oldPatchSizes ( ) const
inlinenoexcept

Return list of the old patch sizes.

Definition at line 776 of file mapPolyMesh.H.

References Foam::noexcept.

◆ oldPatchStarts()

const labelList & oldPatchStarts ( ) const
inlinenoexcept

Return list of the old patch start labels.

Definition at line 784 of file mapPolyMesh.H.

References Foam::noexcept.

Referenced by mapPolyMesh(), mapPolyMesh(), and operator=().

Here is the caller graph for this function:

◆ oldPatchNMeshPoints()

const labelList & oldPatchNMeshPoints ( ) const
inlinenoexcept

Return numbers of mesh points per old patch.

Definition at line 792 of file mapPolyMesh.H.

References Foam::noexcept.

Referenced by mapPolyMesh(), mapPolyMesh(), and operator=().

Here is the caller graph for this function:

◆ hasOldCellVolumes()

bool hasOldCellVolumes ( ) const
inlinenoexcept

Definition at line 800 of file mapPolyMesh.H.

References Foam::noexcept.

◆ oldCellVolumes()

const scalarField & oldCellVolumes ( ) const
inline

Definition at line 805 of file mapPolyMesh.H.

Referenced by fvMesh::updateMesh().

Here is the caller graph for this function:

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