mapPolyMesh Class Reference

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

Public Member Functions

 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)
 Construct from components. Copy (except for oldCellVolumes). More...
 
 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. More...
 
 mapPolyMesh (const mapPolyMesh &)=delete
 Disallow default bitwise copy construction. More...
 
const polyMeshmesh () const
 Return polyMesh. More...
 
label nOldPoints () const
 Number of old points. More...
 
label nOldInternalFaces () const
 Number of old internal faces. More...
 
label nOldFaces () const
 Number of old faces. More...
 
label nOldCells () const
 Number of old cells. More...
 
const labelListpointMap () const
 Old point map. More...
 
const List< objectMap > & pointsFromPointsMap () const
 Points originating from points. More...
 
const labelListfaceMap () const
 Old face map. More...
 
const List< objectMap > & facesFromPointsMap () const
 Faces inflated from points. More...
 
const List< objectMap > & facesFromEdgesMap () const
 Faces inflated from edges. More...
 
const List< objectMap > & facesFromFacesMap () const
 Faces originating from faces. More...
 
const labelListcellMap () const
 Old cell map. More...
 
const List< objectMap > & cellsFromPointsMap () const
 Cells inflated from points. More...
 
const List< objectMap > & cellsFromEdgesMap () const
 Cells inflated from edges. More...
 
const List< objectMap > & cellsFromFacesMap () const
 Cells inflated from faces. More...
 
const List< objectMap > & cellsFromCellsMap () const
 Cells originating from cells. More...
 
const labelListreversePointMap () const
 Reverse point map. More...
 
label mergedPoint (const label oldPointi) const
 If point is removed return point (on new mesh) it merged. More...
 
const labelListreverseFaceMap () const
 Reverse face map. More...
 
label mergedFace (const label oldFacei) const
 If face is removed return face (on new mesh) it merged into. More...
 
const labelListreverseCellMap () const
 Reverse cell map. More...
 
label mergedCell (const label oldCelli) const
 If cell is removed return cell (on new mesh) it merged into. More...
 
const labelHashSetflipFaceFlux () const
 Map of flipped face flux faces. More...
 
const labelListListpatchPointMap () const
 Patch point renumbering. More...
 
const labelListListpointZoneMap () const
 Point zone renumbering. More...
 
const labelListListfaceZonePointMap () const
 Face zone point renumbering. More...
 
const labelListListfaceZoneFaceMap () const
 Face zone face renumbering. More...
 
const labelListListcellZoneMap () const
 Cell zone renumbering. More...
 
const pointFieldpreMotionPoints () const
 Pre-motion point positions. More...
 
bool hasMotionPoints () const
 Has valid preMotionPoints? More...
 
const labelListoldPatchSizes () const
 Return list of the old patch sizes. More...
 
const labelListoldPatchStarts () const
 Return list of the old patch start labels. More...
 
const labelListoldPatchNMeshPoints () const
 Return numbers of mesh points per old patch. More...
 
bool hasOldCellVolumes () const
 
const scalarFieldoldCellVolumes () const
 
void operator= (const mapPolyMesh &)=delete
 Disallow default bitwise assignment. More...
 

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/3]

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 
)

Construct from components. Copy (except for oldCellVolumes).

Definition at line 32 of file mapPolyMesh.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, Foam::min(), and patchi.

Here is the call graph for this function:

◆ mapPolyMesh() [2/3]

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.

Definition at line 120 of file mapPolyMesh.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, Foam::min(), and patchi.

Here is the call graph for this function:

◆ mapPolyMesh() [3/3]

mapPolyMesh ( const mapPolyMesh )
delete

Disallow default bitwise copy construction.

Member Function Documentation

◆ mesh()

const polyMesh& mesh ( ) const
inline

Return polyMesh.

Definition at line 352 of file mapPolyMesh.H.

Referenced by hexRef8Data::updateMesh(), probes::updateMesh(), sampledSurfaces::updateMesh(), sampledSets::updateMesh(), and streamlines::updateMesh().

Here is the caller graph for this function:

◆ nOldPoints()

label nOldPoints ( ) const
inline

Number of old points.

Definition at line 358 of file mapPolyMesh.H.

Referenced by pointMapper::sizeBeforeMapping(), and hexRef8::updateMesh().

Here is the caller graph for this function:

◆ nOldInternalFaces()

label nOldInternalFaces ( ) const
inline

Number of old internal faces.

Definition at line 364 of file mapPolyMesh.H.

Referenced by faceMapper::internalSizeBeforeMapping(), and faceMapper::nOldInternalFaces().

Here is the caller graph for this function:

◆ nOldFaces()

label nOldFaces ( ) const
inline

Number of old faces.

Definition at line 370 of file mapPolyMesh.H.

Referenced by fvMesh::mapFields(), and faceMapper::sizeBeforeMapping().

Here is the caller graph for this function:

◆ nOldCells()

label nOldCells ( ) const
inline

Number of old cells.

Definition at line 376 of file mapPolyMesh.H.

References mapPolyMesh::pointMap().

Referenced by fvMesh::mapFields(), cellMapper::sizeBeforeMapping(), fvMesh::updateMesh(), and hexRef8::updateMesh().

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

◆ pointMap()

const labelList& pointMap ( ) const
inline

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 385 of file mapPolyMesh.H.

Referenced by polyMeshFilter::copyMesh(), pointMapper::directAddressing(), mapPolyMesh::nOldCells(), pointMapper::pointMapper(), points0MotionSolver::updateMesh(), hexRef8Data::updateMesh(), componentDisplacementMotionSolver::updateMesh(), displacementLayeredMotionMotionSolver::updateMesh(), hexRef8::updateMesh(), and polyMesh::updateMesh().

Here is the caller graph for this function:

◆ pointsFromPointsMap()

const List<objectMap>& pointsFromPointsMap ( ) const
inline

Points originating from points.

Definition at line 391 of file mapPolyMesh.H.

References mapPolyMesh::faceMap().

Referenced by pointMapper::pointMapper().

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

◆ faceMap()

const labelList& faceMap ( ) const
inline

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 399 of file mapPolyMesh.H.

Referenced by polyMeshFilter::copyMesh(), faceMapper::directAddressing(), faceMapper::faceMapper(), fvMesh::mapFields(), mapPolyMesh::pointsFromPointsMap(), fvMeshDistribute::printFieldInfo(), and meshRefinement::updateMesh().

Here is the caller graph for this function:

◆ facesFromPointsMap()

const List<objectMap>& facesFromPointsMap ( ) const
inline

Faces inflated from points.

Definition at line 405 of file mapPolyMesh.H.

Referenced by faceMapper::faceMapper().

Here is the caller graph for this function:

◆ facesFromEdgesMap()

const List<objectMap>& facesFromEdgesMap ( ) const
inline

Faces inflated from edges.

Definition at line 411 of file mapPolyMesh.H.

Referenced by faceMapper::faceMapper().

Here is the caller graph for this function:

◆ facesFromFacesMap()

const List<objectMap>& facesFromFacesMap ( ) const
inline

Faces originating from faces.

Definition at line 417 of file mapPolyMesh.H.

References mapPolyMesh::cellMap().

Referenced by faceMapper::faceMapper().

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

◆ cellMap()

const labelList& cellMap ( ) const
inline

Old cell map.

Contains old cell label for all preserved cells.

Definition at line 424 of file mapPolyMesh.H.

Referenced by cellMapper::cellMapper(), cellMapper::directAddressing(), mapPolyMesh::facesFromFacesMap(), fvMesh::mapFields(), hexRef8Data::updateMesh(), refinementHistory::updateMesh(), hexRef8::updateMesh(), and polyMesh::updateMesh().

Here is the caller graph for this function:

◆ cellsFromPointsMap()

const List<objectMap>& cellsFromPointsMap ( ) const
inline

Cells inflated from points.

Definition at line 430 of file mapPolyMesh.H.

Referenced by cellMapper::cellMapper().

Here is the caller graph for this function:

◆ cellsFromEdgesMap()

const List<objectMap>& cellsFromEdgesMap ( ) const
inline

Cells inflated from edges.

Definition at line 436 of file mapPolyMesh.H.

Referenced by cellMapper::cellMapper().

Here is the caller graph for this function:

◆ cellsFromFacesMap()

const List<objectMap>& cellsFromFacesMap ( ) const
inline

Cells inflated from faces.

Definition at line 442 of file mapPolyMesh.H.

Referenced by cellMapper::cellMapper().

Here is the caller graph for this function:

◆ cellsFromCellsMap()

const List<objectMap>& cellsFromCellsMap ( ) const
inline

Cells originating from cells.

Definition at line 448 of file mapPolyMesh.H.

References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, mapPolyMesh::mergedPoint(), mapPolyMesh::reverseFaceMap(), and mapPolyMesh::reversePointMap().

Referenced by cellMapper::cellMapper().

Here is the call graph for this function:
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 465 of file mapPolyMesh.H.

Referenced by mapPolyMesh::cellsFromCellsMap().

Here is the caller 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 496 of file mapPolyMesh.H.

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

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 527 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
inline

Map of flipped face flux faces.

Definition at line 551 of file mapPolyMesh.H.

References mapPolyMesh::cellZoneMap(), mapPolyMesh::faceZoneFaceMap(), mapPolyMesh::faceZonePointMap(), mapPolyMesh::patchPointMap(), mapPolyMesh::pointZoneMap(), and mapPolyMesh::preMotionPoints().

Referenced by faceMapper::flipFaceFlux(), and fvMeshDistribute::printFieldInfo().

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

◆ patchPointMap()

const labelListList& patchPointMap ( ) const
inline

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 559 of file mapPolyMesh.H.

Referenced by mapPolyMesh::flipFaceFlux().

Here is the caller graph for this function:

◆ pointZoneMap()

const labelListList& pointZoneMap ( ) const
inline

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 570 of file mapPolyMesh.H.

Referenced by mapPolyMesh::flipFaceFlux().

Here is the caller graph for this function:

◆ faceZonePointMap()

const labelListList& faceZonePointMap ( ) const
inline

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 578 of file mapPolyMesh.H.

Referenced by mapPolyMesh::flipFaceFlux().

Here is the caller graph for this function:

◆ faceZoneFaceMap()

const labelListList& faceZoneFaceMap ( ) const
inline

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 586 of file mapPolyMesh.H.

Referenced by mapPolyMesh::flipFaceFlux().

Here is the caller graph for this function:

◆ cellZoneMap()

const labelListList& cellZoneMap ( ) const
inline

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 594 of file mapPolyMesh.H.

Referenced by mapPolyMesh::flipFaceFlux().

Here is the caller graph for this function:

◆ preMotionPoints()

const pointField& preMotionPoints ( ) const
inline

Pre-motion point positions.

This specifies the correct way of blowing up zero-volume objects

Definition at line 602 of file mapPolyMesh.H.

Referenced by polyMeshFilter::copyMesh(), mapPolyMesh::flipFaceFlux(), points0MotionSolver::updateMesh(), and componentDisplacementMotionSolver::updateMesh().

Here is the caller graph for this function:

◆ hasMotionPoints()

bool hasMotionPoints ( ) const
inline

Has valid preMotionPoints?

Definition at line 608 of file mapPolyMesh.H.

References List< T >::size().

Referenced by polyMeshFilter::copyMesh(), points0MotionSolver::updateMesh(), and componentDisplacementMotionSolver::updateMesh().

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

◆ oldPatchSizes()

const labelList& oldPatchSizes ( ) const
inline

Return list of the old patch sizes.

Definition at line 615 of file mapPolyMesh.H.

Referenced by faceMapper::oldPatchSizes().

Here is the caller graph for this function:

◆ oldPatchStarts()

const labelList& oldPatchStarts ( ) const
inline

Return list of the old patch start labels.

Definition at line 621 of file mapPolyMesh.H.

Referenced by faceMapper::oldPatchStarts(), and fvMeshDistribute::printFieldInfo().

Here is the caller graph for this function:

◆ oldPatchNMeshPoints()

const labelList& oldPatchNMeshPoints ( ) const
inline

Return numbers of mesh points per old patch.

Definition at line 627 of file mapPolyMesh.H.

◆ hasOldCellVolumes()

bool hasOldCellVolumes ( ) const
inline

Definition at line 635 of file mapPolyMesh.H.

References autoPtr< T >::valid().

Here is the call graph for this function:

◆ oldCellVolumes()

const scalarField& oldCellVolumes ( ) const
inline

Definition at line 640 of file mapPolyMesh.H.

References mapPolyMesh::operator=().

Referenced by fvMesh::updateMesh().

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

◆ operator=()

void operator= ( const mapPolyMesh )
delete

Disallow default bitwise assignment.

Referenced by mapPolyMesh::oldCellVolumes().

Here is the caller graph for this function:

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