Classes | Public Member Functions | Static Public Member Functions | List of all members
addPatchCellLayer Class Reference

Adds layers of cells to outside of polyPatch. Can optionally create stand-alone extruded mesh (addToMesh=false). More...

Public Member Functions

 ClassName ("addPatchCellLayer")
 Runtime type information. More...
 
 addPatchCellLayer (const polyMesh &, const bool addToMesh=true)
 Construct from mesh. More...
 
const labelListListaddedPoints () const
 Added points per patch point. More...
 
const labelListListlayerFaces () const
 Layer faces per patch face. See above. More...
 
labelListList addedCells () const
 Added cells given current mesh & layerfaces. More...
 
void setRefinement (const globalIndex &globalFaces, const labelListList &globalEdgeFaces, const scalarField &expansionRatio, const indirectPrimitivePatch &pp, const labelList &sidePatchID, const labelList &exposedPatchID, const labelList &nFaceLayers, const labelList &nPointLayers, const vectorField &firstLayerDisp, polyTopoChange &meshMod)
 Play commands into polyTopoChange to create layers on top. More...
 
void setRefinement (const globalIndex &globalFaces, const labelListList &globalEdgeFaces, const label nLayers, const indirectPrimitivePatch &pp, const labelList &sidePatchID, const vectorField &overallDisplacement, polyTopoChange &meshMod)
 Add with constant expansion ratio and same nLayers everywhere. More...
 
void updateMesh (const mapPolyMesh &, const labelList &faceMap, const labelList &pointMap)
 Update any locally stored mesh information. Gets additional. More...
 

Static Public Member Functions

static labelListList addedCells (const polyMesh &, const labelListList &layerFaces)
 Helper: get added cells per patch face. More...
 
static labelListList globalEdgeFaces (const polyMesh &, const globalIndex &globalFaces, const indirectPrimitivePatch &pp)
 Per patch edge the pp faces (in global indices) using it. Uses. More...
 
static void calcSidePatch (const polyMesh &, const globalIndex &globalFaces, const labelListList &globalEdgeFaces, const indirectPrimitivePatch &pp, labelList &sidePatchID, label &nPatches, Map< label > &nbrProcToPatch, Map< label > &patchToNbrProc)
 Boundary edges get extruded into boundary faces. Determine patch. More...
 

Detailed Description

Adds layers of cells to outside of polyPatch. Can optionally create stand-alone extruded mesh (addToMesh=false).

Call setRefinement with offset vector for every patch point and number of layers per patch face and number of layers per patch point.

    Was:

       a      b         <- patch of boundary face
    +------+------+
    |      |      |     <- original cells
    +------+------+

    Becomes:

       a      b         <- patch of boundary face
    +------+------+
    +      +------+
    +------+------+
    +------+------+
    |      |      |     <- original cells
    +------+------+

E.g. 3 boundary faces on patches a,b. b gets extruded, a doesn't.

       a      b      b        <- patch of boundary face
    +------+------+------+
    |      |      |      |    <- cells
    +------+------+------+


           ^      ^           <- wanted extrusion vector (none at far right)
       a   |  b   |  b        <- patch of boundary face
    +------+------+------+
    |      |      |      |    <- cells
    +------+------+------+

              b
           +------+\ b        1. prism cell added onto second b face since
       a  a|      | ----\          only one side gets extruded.
    +------+------+------+    2. side-face gets patch a, not b.
    |      |      |      |
    +------+------+------+
Source files

Definition at line 125 of file addPatchCellLayer.H.

Constructor & Destructor Documentation

◆ addPatchCellLayer()

addPatchCellLayer ( const polyMesh mesh,
const bool  addToMesh = true 
)

Construct from mesh.

Definition at line 474 of file addPatchCellLayer.C.

References addPatchCellLayer::addedCells().

Here is the call graph for this function:

Member Function Documentation

◆ ClassName()

ClassName ( "addPatchCellLayer"  )

Runtime type information.

◆ addedPoints()

const labelListList& addedPoints ( ) const
inline

Added points per patch point.

Definition at line 270 of file addPatchCellLayer.H.

◆ layerFaces()

const labelListList& layerFaces ( ) const
inline

Layer faces per patch face. See above.

Definition at line 276 of file addPatchCellLayer.H.

References addPatchCellLayer::addedCells(), addPatchCellLayer::calcSidePatch(), addPatchCellLayer::globalEdgeFaces(), nPatches, and addPatchCellLayer::setRefinement().

Here is the call graph for this function:

◆ addedCells() [1/2]

Foam::labelListList addedCells ( const polyMesh mesh,
const labelListList layerFaces 
)
static

Helper: get added cells per patch face.

addedCells[patchFace] is list of cells added. Last element is the top cells (i.e. the boundary cell)

Definition at line 489 of file addPatchCellLayer.C.

References polyMesh::faceNeighbour(), forAll, List< T >::setSize(), and List< T >::size().

Here is the call graph for this function:

◆ addedCells() [2/2]

Foam::labelListList addedCells ( ) const

Added cells given current mesh & layerfaces.

Definition at line 515 of file addPatchCellLayer.C.

References addPatchCellLayer::globalEdgeFaces().

Referenced by addPatchCellLayer::addPatchCellLayer(), and addPatchCellLayer::layerFaces().

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

◆ globalEdgeFaces()

Foam::labelListList globalEdgeFaces ( const polyMesh mesh,
const globalIndex globalFaces,
const indirectPrimitivePatch pp 
)
static

◆ calcSidePatch()

void calcSidePatch ( const polyMesh mesh,
const globalIndex globalFaces,
const labelListList globalEdgeFaces,
const indirectPrimitivePatch pp,
labelList sidePatchID,
label nPatches,
Map< label > &  nbrProcToPatch,
Map< label > &  patchToNbrProc 
)
static

◆ setRefinement() [1/2]

void setRefinement ( const globalIndex globalFaces,
const labelListList globalEdgeFaces,
const scalarField expansionRatio,
const indirectPrimitivePatch pp,
const labelList sidePatchID,
const labelList exposedPatchID,
const labelList nFaceLayers,
const labelList nPointLayers,
const vectorField firstLayerDisp,
polyTopoChange meshMod 
)

Play commands into polyTopoChange to create layers on top.

of indirectPrimitivePatch (have to be outside faces). Gets displacement per patch point.

  • exposedPatchID : only used if creating a new mesh (addToMesh=false) gives per pp face the patch the exposed face should get.
  • nPointLayers : number of layers per (patch)point.
  • nFaceLayers : number of layers per (patch) face.
  • firstDisplacement : displacement per point for first layer of points (i.e. nearest to original mesh). If zero do not add point. Layer thicknesses are calculated to constant geometric expansion. Use expansionRatio 1 for constant size. Sets addedPoints_ which is per pp point a list of points added. Note: firstDisplacement has to be parallel synchronised before calling this routine. Only if all procs sharing a point get a cell should firstDisplacement be <> 0 Note: cells get added from owner cells of patch faces (instead of e.g. from patch faces)

Definition at line 779 of file addPatchCellLayer.C.

References Foam::abort(), PrimitivePatch< Face, FaceList, PointField, PointType >::edgeFaces(), PrimitivePatch< Face, FaceList, PointField, PointType >::edges(), Foam::endl(), f(), PrimitivePatch< Face, FaceList, PointField, PointType >::faceEdges(), Foam::FatalError, FatalErrorInFunction, UList< T >::fcIndex(), faceZone::flipMap(), forAll, forAllReverse, Foam::gMax(), UList< T >::last(), edge::line(), PrimitivePatch< Face, FaceList, PointField, PointType >::localFaces(), PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), Foam::mag(), VectorSpace< Vector< scalar >, scalar, 3 >::max, Foam::max(), PrimitivePatch< Face, FaceList, PointField, PointType >::meshEdges(), PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), n, PrimitivePatch< Face, FaceList, PointField, PointType >::nEdges(), PrimitivePatch< Face, FaceList, PointField, PointType >::nInternalEdges(), Foam::nl, PrimitivePatch< Face, FaceList, PointField, PointType >::nPoints(), patchi, PrimitivePatch< Face, FaceList, PointField, PointType >::points(), polyTopoChange::points(), Foam::Pout, polyTopoChange::setAction(), List< T >::setSize(), List< T >::size(), syncTools::syncEdgeList(), syncTools::syncPointList(), globalIndex::toGlobal(), addPatchCellLayer::updateMesh(), faceZone::whichFace(), and polyBoundaryMesh::whichPatch().

Referenced by snappyLayerDriver::addLayers(), addPatchCellLayer::calcSidePatch(), addPatchCellLayer::layerFaces(), and addPatchCellLayer::setRefinement().

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

◆ setRefinement() [2/2]

void setRefinement ( const globalIndex globalFaces,
const labelListList globalEdgeFaces,
const label  nLayers,
const indirectPrimitivePatch pp,
const labelList sidePatchID,
const vectorField overallDisplacement,
polyTopoChange meshMod 
)
inline

Add with constant expansion ratio and same nLayers everywhere.

Definition at line 360 of file addPatchCellLayer.H.

References Foam::faceMap(), PrimitivePatch< Face, FaceList, PointField, PointType >::nPoints(), addPatchCellLayer::setRefinement(), and addPatchCellLayer::updateMesh().

Here is the call graph for this function:

◆ updateMesh()

void updateMesh ( const mapPolyMesh morphMap,
const labelList faceMap,
const labelList pointMap 
)

Update any locally stored mesh information. Gets additional.

map from new to old patch (since patch needs to be recreated since has to be on outside).

Definition at line 1723 of file addPatchCellLayer.C.

References forAll, newPointi, mapPolyMesh::reverseFaceMap(), mapPolyMesh::reversePointMap(), List< T >::setSize(), and List< T >::size().

Referenced by snappyLayerDriver::addLayers(), and addPatchCellLayer::setRefinement().

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

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