OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

polyTopoChange Class Reference

Direct mesh changes based on v1.3 polyTopoChange syntax. More...

Collaboration diagram for polyTopoChange:

List of all members.


Public Member Functions

 ClassName ("polyTopoChange")
 Runtime type information.
 polyTopoChange (const label nPatches, const bool strict=true)
 Construct without mesh. Either specify nPatches or use.
 polyTopoChange (const polyMesh &mesh, const bool strict=true)
 Construct from mesh. Adds all points/face/cells from mesh.
const DynamicList< point > & points () const
 Points. Shrunk after constructing mesh (or calling of compact()).
const DynamicList< face > & faces () const
const DynamicList< label > & region () const
const DynamicList< label > & faceOwner () const
const DynamicList< label > & faceNeighbour () const
bool pointRemoved (const label pointI) const
 Is point removed?
bool faceRemoved (const label faceI) const
 Is face removed?
bool cellRemoved (const label cellI) const
 Is cell removed?
void clear ()
 Clear all storage.
void addMesh (const polyMesh &, const labelList &patchMap, const labelList &pointZoneMap, const labelList &faceZoneMap, const labelList &cellZoneMap)
 Add all points/faces/cells of mesh. Additional offset for patch.
void movePoints (const pointField &newPoints)
 Move all points. Incompatible with other topology changes.
label setAction (const topoAction &action)
 For compatibility with polyTopoChange: set topological action.
label addPoint (const point &, const label masterPointID, const label zoneID, const bool inCell)
 Add point. Return new point label.
void modifyPoint (const label, const point &, const label newZoneID, const bool inCell)
 Modify coordinate.
void removePoint (const label, const label)
 Remove/merge point.
label addFace (const face &f, const label own, const label nei, const label masterPointID, const label masterEdgeID, const label masterFaceID, const bool flipFaceFlux, const label patchID, const label zoneID, const bool zoneFlip)
 Add face to cells. Return new face label.
void modifyFace (const face &f, const label faceI, const label own, const label nei, const bool flipFaceFlux, const label patchID, const label zoneID, const bool zoneFlip)
 Modify vertices or cell of face.
void removeFace (const label, const label)
 Remove/merge face.
label addCell (const label masterPointID, const label masterEdgeID, const label masterFaceID, const label masterCellID, const label zoneID)
 Add cell. Return new cell label.
void modifyCell (const label, const label zoneID)
 Modify zone of cell.
void removeCell (const label, const label)
 Remove/merge cell.
void setNumPatches (const label nPatches)
 Explicitly set the number of patches if construct-without-mesh.
autoPtr< mapPolyMesh > changeMesh (polyMesh &mesh, const bool inflate, const bool syncParallel=true, const bool orderCells=false, const bool orderPoints=false)
 Inplace changes mesh without change of patches.
autoPtr< mapPolyMesh > makeMesh (autoPtr< fvMesh > &newMesh, const IOobject &io, const fvMesh &mesh, const bool syncParallel=true, const bool orderCells=false, const bool orderPoints=false)
 Create new mesh with old mesh patches.

Detailed Description

Direct mesh changes based on v1.3 polyTopoChange syntax.

Instead of recording changes and executing them all in one go (as did v1.3 polyTopoChange) this class actually holds the current points/faces/cells and does the change immediately. It can be asked to compress out all unused points/faces/cells and renumber everything to be consistent.

Note:

  • polyTopoChange can be copied.
  • adding a face using non-existing cells causes all intermediate cells to be added. So always first add cells/points and then faces. (or set strict checking)
  • strict checking:
    • any added/modified face can only use already existing vertices
    • any added face can only use already existing cells
    • no item can be removed more than once.
  • removed cell: cell set to 0 faces.
  • removed face: face set to 0 vertices.
  • removed point: coordinate set to greatPoint (GREAT,GREAT,GREAT). Note that this might give problems if this value is used already. To see if point is equal to above value we don't use == (which might give problems with roundoff error) but instead compare the individual component with >.
  • coupled patches: the reorderCoupledFaces routine (borrowed from the couplePatches utility) reorders coupled patch faces and uses the cyclicPolyPatch,processorPolyPatch functionality.

Source files

Definition at line 97 of file polyTopoChange.H.


Constructor & Destructor Documentation

polyTopoChange ( const label  nPatches,
const bool  strict = true 
)

Construct without mesh. Either specify nPatches or use.

setNumPatches before trying to make a mesh (makeMesh, changeMesh)

Definition at line 2074 of file polyTopoChange.C.

polyTopoChange ( const polyMesh &  mesh,
const bool  strict = true 
)

Construct from mesh. Adds all points/face/cells from mesh.

Definition at line 2106 of file polyTopoChange.C.


Member Function Documentation

ClassName ( "polyTopoChange"   ) 

Runtime type information.

const DynamicList<point>& points (  )  const [inline]

Points. Shrunk after constructing mesh (or calling of compact()).

Definition at line 442 of file polyTopoChange.H.

Referenced by duplicatePoints::updateMesh().

Here is the caller graph for this function:

const DynamicList<face>& faces (  )  const [inline]

Definition at line 447 of file polyTopoChange.H.

const DynamicList<label>& region (  )  const [inline]

Definition at line 452 of file polyTopoChange.H.

const DynamicList<label>& faceOwner (  )  const [inline]

Definition at line 457 of file polyTopoChange.H.

const DynamicList<label>& faceNeighbour (  )  const [inline]

Definition at line 462 of file polyTopoChange.H.

bool pointRemoved ( const label  pointI  )  const [inline]

Is point removed?

Definition at line 21 of file polyTopoChangeI.H.

bool faceRemoved ( const label  faceI  )  const [inline]

Is face removed?

Definition at line 32 of file polyTopoChangeI.H.

bool cellRemoved ( const label  cellI  )  const [inline]

Is cell removed?

Definition at line 38 of file polyTopoChangeI.H.

void clear (  ) 

Clear all storage.

Definition at line 2150 of file polyTopoChange.C.

void addMesh ( const polyMesh &  mesh,
const labelList &  patchMap,
const labelList &  pointZoneMap,
const labelList &  faceZoneMap,
const labelList &  cellZoneMap 
)

Add all points/faces/cells of mesh. Additional offset for patch.

or zone ids.

Definition at line 2181 of file polyTopoChange.C.

void movePoints ( const pointField &  newPoints  ) 

Move all points. Incompatible with other topology changes.

Definition at line 2606 of file polyTopoChange.C.

Foam::label setAction ( const topoAction &  action  ) 

For compatibility with polyTopoChange: set topological action.

Definition at line 2392 of file polyTopoChange.C.

Foam::label addPoint ( const point &  pt,
const label  masterPointID,
const label  zoneID,
const bool  inCell 
)

Add point. Return new point label.

Notes:

  • masterPointID can be < 0 (appended points)
  • inCell = false: add retired point (to end of point list)

Definition at line 2523 of file polyTopoChange.C.

void modifyPoint ( const label  pointI,
const point &  pt,
const label  newZoneID,
const bool  inCell 
)

Modify coordinate.

Notes:

  • inCell = false: add retired point (to end of point list)

Definition at line 2551 of file polyTopoChange.C.

void removePoint ( const label  pointI,
const label  mergePointI 
)

Remove/merge point.

Definition at line 2625 of file polyTopoChange.C.

Foam::label addFace ( const face &  f,
const label  own,
const label  nei,
const label  masterPointID,
const label  masterEdgeID,
const label  masterFaceID,
const bool  flipFaceFlux,
const label  patchID,
const label  zoneID,
const bool  zoneFlip 
)

Add face to cells. Return new face label.

own,nei<0, zoneID>=0 : add inactive face (to end of face list)

Definition at line 2673 of file polyTopoChange.C.

void modifyFace ( const face &  f,
const label  faceI,
const label  own,
const label  nei,
const bool  flipFaceFlux,
const label  patchID,
const label  zoneID,
const bool  zoneFlip 
)

Modify vertices or cell of face.

Definition at line 2737 of file polyTopoChange.C.

void removeFace ( const label  faceI,
const label  mergeFaceI 
)

Remove/merge face.

Definition at line 2782 of file polyTopoChange.C.

Foam::label addCell ( const label  masterPointID,
const label  masterEdgeID,
const label  masterFaceID,
const label  masterCellID,
const label  zoneID 
)

Add cell. Return new cell label.

Definition at line 2826 of file polyTopoChange.C.

void modifyCell ( const label  cellI,
const label  zoneID 
)

Modify zone of cell.

Definition at line 2863 of file polyTopoChange.C.

void removeCell ( const label  cellI,
const label  mergeCellI 
)

Remove/merge cell.

Definition at line 2872 of file polyTopoChange.C.

void setNumPatches ( const label  nPatches  )  [inline]

Explicitly set the number of patches if construct-without-mesh.

used.

Definition at line 44 of file polyTopoChangeI.H.

Foam::autoPtr< Foam::mapPolyMesh > changeMesh ( polyMesh &  mesh,
const bool  inflate,
const bool  syncParallel = true,
const bool  orderCells = false,
const bool  orderPoints = false 
)

Inplace changes mesh without change of patches.

Adapts patch start/end and by default does parallel matching. Clears all data. Returns map. inflate = true : keep old mesh points. Put new points into the returned map (preMotionPoints) so we can use inflation. Any points out of nothing (appended points) are vector::zero. inflate = false: set mesh points directly. Empty preMotionPoints in the map. orderCells : whether to order the cells (see bandCompression.H) orderPoints : whether to order the points into internal first followed by boundary points. This is not fully consistent with upper-triangular ordering of points and edges so is only done when explicitly asked for.

Definition at line 2907 of file polyTopoChange.C.

Referenced by meshRefinement::mergePatchFaces().

Here is the caller graph for this function:

Foam::autoPtr< Foam::mapPolyMesh > makeMesh ( autoPtr< fvMesh > &  newMesh,
const IOobject &  io,
const fvMesh &  mesh,
const bool  syncParallel = true,
const bool  orderCells = false,
const bool  orderPoints = false 
)

Create new mesh with old mesh patches.

Definition at line 3167 of file polyTopoChange.C.


The documentation for this class was generated from the following files:
Copyright © 2000-2009 OpenCFD Ltd