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...
 
 addPatchCellLayer (const addPatchCellLayer &)=delete
 Disallow default bitwise copy construction. 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 topoChange (const polyTopoChangeMap &, const labelList &faceMap, const labelList &pointMap)
 Update any locally stored mesh information. Gets additional. More...
 
void operator= (const addPatchCellLayer &)=delete
 Disallow default bitwise assignment. 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.

  • offset vector should be zero for any non-manifold point and synchronised on coupled points before calling this.
  • offset vector of zero will not add any points.
  • gets supplied the number of extruded layers both per face and per point. Usually the point nlayers is the max of surrounding face nlayers.

    point nlayers:

    • 0 : no extrusion. Any surrounding face being extruded becomes 'prism'
    • >0 : should be max of surrounding face nlayers.
  • differing face nlayers: 'termination' : (e.g. from 2 to 4 layers) match at original patch face side.

    E.g. 2 boundary faces on patches a,b. 2 layers for a, 3 for b.

    Was:

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

    Becomes:

       a      b         <- patch of boundary face
    +------+------+
    +      +------+
    +------+------+
    +------+------+
    |      |      |     <- original cells
    +------+------+
  • added faces get same patchID as face they are extruded from
  • 'side' faces (i.e. on the edge of pp) get the patchID/zoneID of the other patch/zone they are connected to (hopefully only 1)

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() [1/2]

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

Construct from mesh.

Definition at line 473 of file addPatchCellLayer.C.

◆ addPatchCellLayer() [2/2]

addPatchCellLayer ( const addPatchCellLayer )
delete

Disallow default bitwise copy construction.

Member Function Documentation

◆ ClassName()

ClassName ( "addPatchCellLayer"  )

Runtime type information.

◆ addedPoints()

const labelListList& addedPoints ( ) const
inline

Added points per patch point.

Definition at line 267 of file addPatchCellLayer.H.

◆ layerFaces()

const labelListList& layerFaces ( ) const
inline

Layer faces per patch face. See above.

Definition at line 273 of file addPatchCellLayer.H.

◆ 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 488 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.

◆ globalEdgeFaces()

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

Per patch edge the pp faces (in global indices) using it. Uses.

uniqueEqOp() to remove duplicates.

Definition at line 522 of file addPatchCellLayer.C.

References UIndirectList< T >::addressing(), PrimitivePatch< FaceList, PointField >::edgeFaces(), primitiveMesh::edges(), forAll, PrimitivePatch< FaceList, PointField >::meshEdges(), primitiveMesh::nEdges(), primitiveMesh::pointEdges(), List< T >::setSize(), List< T >::size(), syncTools::syncEdgeList(), and globalIndex::toGlobal().

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

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

◆ 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 778 of file addPatchCellLayer.C.

References Foam::abort(), UIndirectList< T >::addressing(), Foam::e, PrimitivePatch< FaceList, PointField >::edgeFaces(), PrimitivePatch< FaceList, PointField >::edges(), Foam::endl(), f(), PrimitivePatch< FaceList, PointField >::faceEdges(), Foam::FatalError, FatalErrorInFunction, UList< T >::fcIndex(), faceZone::flipMap(), forAll, forAllReverse, Foam::gMax(), HashSet< Key, Hash >::insert(), UList< T >::last(), PrimitivePatch< FaceList, PointField >::localFaces(), PrimitivePatch< FaceList, PointField >::localPoints(), Foam::mag(), Foam::max(), VectorSpace< Form, Cmpt, Ncmpts >::max, PrimitivePatch< FaceList, PointField >::meshEdges(), PrimitivePatch< FaceList, PointField >::meshPoints(), n, PrimitivePatch< FaceList, PointField >::nEdges(), PrimitivePatch< FaceList, PointField >::nInternalEdges(), Foam::nl, PrimitivePatch< FaceList, PointField >::nPoints(), Foam::offset(), patches, patchi, polyTopoChange::points(), PrimitivePatch< FaceList, PointField >::points(), Foam::Pout, polyTopoChange::setAction(), List< T >::setSize(), PtrList< T >::setSize(), UIndirectList< T >::size(), List< T >::size(), syncTools::syncEdgeList(), syncTools::syncPointList(), globalIndex::toGlobal(), and faceZone::whichFace().

Referenced by snappyLayerDriver::addLayers(), 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 356 of file addPatchCellLayer.H.

References addPatchCellLayer::globalEdgeFaces(), PrimitivePatch< FaceList, PointField >::nPoints(), addPatchCellLayer::setRefinement(), and UIndirectList< T >::size().

Here is the call graph for this function:

◆ topoChange()

void topoChange ( const polyTopoChangeMap map,
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 1722 of file addPatchCellLayer.C.

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

Referenced by snappyLayerDriver::addLayers().

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

◆ operator=()

void operator= ( const addPatchCellLayer )
delete

Disallow default bitwise assignment.


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