Data Structures | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
addPatchCellLayer Class Reference

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

Collaboration diagram for addPatchCellLayer:
Collaboration graph
[legend]

Data Structures

class  uniqueEqOp
 

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 &sideZoneID, const boolList &sideFlip, const labelList &inflateFaceID, 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 calcExtrudeInfo (const bool zoneFromAnyFace, const polyMesh &, const globalIndex &globalFaces, const labelListList &globalEdgeFaces, const indirectPrimitivePatch &pp, labelList &edgePatchID, label &nPatches, Map< label > &nbrProcToPatch, Map< label > &patchToNbrProc, labelList &edgeZoneID, boolList &edgeFlip, labelList &inflateFaceID)
 Determine extrude information per patch edge: More...
 

Private Member Functions

bool sameEdgeNeighbour (const indirectPrimitivePatch &pp, const labelListList &globalEdgeFaces, const boolList &doneEdge, const label thisGlobalFaceI, const label nbrGlobalFaceI, const label edgeI) const
 
labelPair getEdgeString (const indirectPrimitivePatch &pp, const labelListList &globalEdgeFaces, const boolList &doneEdge, const label patchFaceI, const label globalFaceI) const
 
label addSideFace (const indirectPrimitivePatch &, const labelListList &addedCells, const face &newFace, const label newPatchID, const label newZoneI, const bool newFlip, const label inflateFaceI, const label ownFaceI, const label nbrFaceI, const label meshEdgeI, const label layerI, const label numEdgeFaces, const labelList &meshFaces, polyTopoChange &) const
 Add face between layer-1 and layer. More...
 
 addPatchCellLayer (const addPatchCellLayer &)
 Disallow default bitwise copy construct. More...
 
void operator= (const addPatchCellLayer &)
 Disallow default bitwise assignment. More...
 

Static Private Member Functions

static label nbrFace (const labelListList &edgeFaces, const label edgeI, const label faceI)
 Get the face on the other side of the edge. More...
 
static void addVertex (const label, face &, label &fp)
 Add vertex to face if unique. More...
 
static label findProcPatch (const polyMesh &, const label nbrProcID)
 Find patch to neighbouring processor. More...
 
static void setFaceProps (const polyMesh &, const label, label &, label &, bool &)
 Extract properties from mesh face. More...
 
static void setFaceProps (const polyMesh &mesh, const indirectPrimitivePatch &pp, const label ppEdgeI, const label faceI, label &patchI, label &zoneI, bool &zoneFlip, label &inflateFaceI)
 Extract properties from mesh face in pp edge ordering. More...
 
static void findZoneFace (const bool useInternalFaces, const bool useBoundaryFaces, const polyMesh &mesh, const indirectPrimitivePatch &pp, const label ppEdgeI, const UIndirectList< label > &excludeFaces, const labelList &meshFaces, label &inflateFaceI, label &patchI, label &zoneI, bool &zoneFlip)
 Find internal or boundary face to get extrude properties. More...
 

Private Attributes

const polyMeshmesh_
 Reference to mesh. More...
 
const bool addToMesh_
 Add layers to existing mesh or create new mesh. More...
 
labelListList addedPoints_
 For all patchpoints: list of added points (size 0 or nLayers) More...
 
labelListList layerFaces_
 For all patchfaces: list of layer faces. 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() [1/2]

addPatchCellLayer ( const addPatchCellLayer )
private

Disallow default bitwise copy construct.

◆ addPatchCellLayer() [2/2]

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

Construct from mesh.

Definition at line 569 of file addPatchCellLayer.C.

Member Function Documentation

◆ nbrFace()

Foam::label nbrFace ( const labelListList edgeFaces,
const label  edgeI,
const label  faceI 
)
staticprivate

Get the face on the other side of the edge.

Definition at line 51 of file addPatchCellLayer.C.

References List::size().

Here is the call graph for this function:

◆ addVertex()

void addVertex ( const label  pointI,
face f,
label fp 
)
staticprivate

Add vertex to face if unique.

Definition at line 71 of file addPatchCellLayer.C.

References f().

Here is the call graph for this function:

◆ sameEdgeNeighbour()

bool sameEdgeNeighbour ( const indirectPrimitivePatch pp,
const labelListList globalEdgeFaces,
const boolList doneEdge,
const label  thisGlobalFaceI,
const label  nbrGlobalFaceI,
const label  edgeI 
) const
private

Definition at line 94 of file addPatchCellLayer.C.

References Foam::constant::electromagnetic::e, and PrimitivePatch< Face, FaceList, PointField, PointType >::edges().

Here is the call graph for this function:

◆ getEdgeString()

Foam::labelPair getEdgeString ( const indirectPrimitivePatch pp,
const labelListList globalEdgeFaces,
const boolList doneEdge,
const label  patchFaceI,
const label  globalFaceI 
) const
private

◆ addSideFace()

Foam::label addSideFace ( const indirectPrimitivePatch pp,
const labelListList addedCells,
const face newFace,
const label  newPatchID,
const label  newZoneI,
const bool  newFlip,
const label  inflateFaceI,
const label  ownFaceI,
const label  nbrFaceI,
const label  meshEdgeI,
const label  layerI,
const label  numEdgeFaces,
const labelList meshFaces,
polyTopoChange meshMod 
) const
private

Add face between layer-1 and layer.

Definition at line 227 of file addPatchCellLayer.C.

References forAll, polyTopoChange::setAction(), and List::size().

Here is the call graph for this function:

◆ findProcPatch()

Foam::label findProcPatch ( const polyMesh mesh,
const label  nbrProcID 
)
staticprivate

Find patch to neighbouring processor.

Definition at line 393 of file addPatchCellLayer.C.

References forAll, mesh, and patches.

◆ setFaceProps() [1/2]

void setFaceProps ( const polyMesh mesh,
const label  faceI,
label patchI,
label zoneI,
bool &  zoneFlip 
)
staticprivate

Extract properties from mesh face.

Definition at line 418 of file addPatchCellLayer.C.

References mesh.

◆ setFaceProps() [2/2]

void setFaceProps ( const polyMesh mesh,
const indirectPrimitivePatch pp,
const label  ppEdgeI,
const label  faceI,
label patchI,
label zoneI,
bool &  zoneFlip,
label inflateFaceI 
)
staticprivate

◆ findZoneFace()

void findZoneFace ( const bool  useInternalFaces,
const bool  useBoundaryFaces,
const polyMesh mesh,
const indirectPrimitivePatch pp,
const label  ppEdgeI,
const UIndirectList< label > &  excludeFaces,
const labelList meshFaces,
label inflateFaceI,
label patchI,
label zoneI,
bool &  zoneFlip 
)
staticprivate

Find internal or boundary face to get extrude properties.

from. zoneFlip consistent with ppEdge ordering

Definition at line 509 of file addPatchCellLayer.C.

References Foam::findIndex(), forAll, k, and mesh.

Here is the call graph for this function:

◆ operator=()

void operator= ( const addPatchCellLayer )
private

Disallow default bitwise assignment.

◆ ClassName()

ClassName ( "addPatchCellLayer"  )

Runtime type information.

◆ addedPoints()

const labelListList& addedPoints ( ) const
inline

Added points per patch point.

Definition at line 306 of file addPatchCellLayer.H.

References addPatchCellLayer::addedPoints_.

Referenced by main().

Here is the caller graph for this function:

◆ layerFaces()

const labelListList& layerFaces ( ) const
inline

Layer faces per patch face. See above.

Definition at line 312 of file addPatchCellLayer.H.

References addPatchCellLayer::layerFaces_.

Referenced by autoLayerDriver::checkAndUnmark(), autoLayerDriver::getLayerCellsFaces(), and main().

Here is the caller 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 584 of file addPatchCellLayer.C.

References forAll, mesh, List::setSize(), and List::size().

Referenced by main().

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

◆ addedCells() [2/2]

Foam::labelListList addedCells ( ) const

Added cells given current mesh & layerfaces.

Definition at line 610 of file addPatchCellLayer.C.

References addPatchCellLayer::layerFaces_, and addPatchCellLayer::mesh_.

Referenced by autoLayerDriver::checkAndUnmark(), and autoLayerDriver::getLayerCellsFaces().

Here is the caller graph for this function:

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

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

Referenced by autoLayerDriver::addLayers(), main(), and addPatchCellLayer::setRefinement().

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

◆ calcExtrudeInfo()

void calcExtrudeInfo ( const bool  zoneFromAnyFace,
const polyMesh mesh,
const globalIndex globalFaces,
const labelListList globalEdgeFaces,
const indirectPrimitivePatch pp,
labelList edgePatchID,
label nPatches,
Map< label > &  nbrProcToPatch,
Map< label > &  patchToNbrProc,
labelList edgeZoneID,
boolList edgeFlip,
labelList inflateFaceID 
)
static

Determine extrude information per patch edge:

  • zoneID, zoneFlip : picks one of the faces that connects to the edge. For boundary edge only looks at boundary faces. For internal edge it looks at internal faces only (zoneFromAnyFace = false) or at any face (zoneFromAnyFace = true). zoneFlip is consistent with ordering of pp edge. Face selected gets stored in inflateFaceID

patchID : get patch from any boundary face connected to the edge. The patch might be a to-be-created processor patch (patchI >= mesh.boundaryMesh().size()) in which case the nbrProcToPatch, patchToNbrProc give the correspondence. nPatches is the new number of patches.

Definition at line 663 of file addPatchCellLayer.C.

References polyMesh::boundaryMesh(), globalMeshData::coupledPatch(), Foam::e, PrimitivePatch< Face, FaceList, PointField, PointType >::edgeFaces(), primitiveMesh::edgeFaces(), PrimitivePatch< Face, FaceList, PointField, PointType >::edges(), primitiveMesh::edges(), Foam::endl(), f1, Foam::findIndex(), forAll, polyMesh::globalData(), globalMeshData::globalEdgeSlaves(), globalMeshData::globalEdgeSlavesMap(), globalMeshData::globalEdgeTransformedSlaves(), globalMeshData::globalTransforms(), primitiveMesh::isInternalFace(), globalIndex::isLocal(), k, PatchTools::matchEdges(), mesh, PrimitivePatch< Face, FaceList, PointField, PointType >::meshEdges(), PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), UPstream::myProcNo(), PrimitivePatch< Face, FaceList, PointField, PointType >::nEdges(), nPatches, UPstream::parRun(), patches, primitiveMesh::pointEdges(), PrimitivePatch< Face, FaceList, PointField, PointType >::points(), ProcessorTopology< Container, ProcPatch >::procPatchMap(), List::setSize(), List::size(), globalMeshData::syncData(), WarningInFunction, and globalIndex::whichProcID().

Referenced by autoLayerDriver::determineSidePatches(), and main().

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

◆ setRefinement() [1/2]

void setRefinement ( const globalIndex globalFaces,
const labelListList globalEdgeFaces,
const scalarField expansionRatio,
const indirectPrimitivePatch pp,
const labelList sidePatchID,
const labelList sideZoneID,
const boolList sideFlip,
const labelList inflateFaceID,
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 1008 of file addPatchCellLayer.C.

References Foam::abort(), Foam::e, PrimitivePatch< Face, FaceList, PointField, PointType >::edgeFaces(), PrimitivePatch< Face, FaceList, PointField, PointType >::edges(), Foam::endl(), f(), PrimitivePatch< Face, FaceList, PointField, PointType >::faceEdges(), Foam::FatalError, FatalErrorInFunction, faceZone::flipMap(), forAll, forAllReverse, Foam::gMax(), HashSet< Key, Hash >::insert(), PrimitivePatch< Face, FaceList, PointField, PointType >::localFaces(), PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), Foam::mag(), Vector< scalar >::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(), patches, PrimitivePatch< Face, FaceList, PointField, PointType >::points(), polyTopoChange::points(), Foam::Pout, polyTopoChange::setAction(), List::setSize(), List::size(), syncTools::syncEdgeList(), syncTools::syncPointList(), globalIndex::toGlobal(), and faceZone::whichFace().

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

References addPatchCellLayer::globalEdgeFaces(), PrimitivePatch< Face, FaceList, PointField, PointType >::nEdges(), PrimitivePatch< Face, FaceList, PointField, PointType >::nPoints(), and addPatchCellLayer::setRefinement().

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

References Foam::faceMap(), forAll, mapPolyMesh::reverseFaceMap(), mapPolyMesh::reversePointMap(), List::setSize(), and List::size().

Referenced by autoLayerDriver::addLayers(), and main().

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

Field Documentation

◆ mesh_

const polyMesh& mesh_
private

Reference to mesh.

Definition at line 164 of file addPatchCellLayer.H.

Referenced by addPatchCellLayer::addedCells().

◆ addToMesh_

const bool addToMesh_
private

Add layers to existing mesh or create new mesh.

Definition at line 167 of file addPatchCellLayer.H.

◆ addedPoints_

labelListList addedPoints_
private

For all patchpoints: list of added points (size 0 or nLayers)

First point in list is one nearest to original point in patch, last one is the new point on the surface.

Definition at line 172 of file addPatchCellLayer.H.

Referenced by addPatchCellLayer::addedPoints().

◆ layerFaces_

labelListList layerFaces_
private

For all patchfaces: list of layer faces.

  • empty if no face extruded

first face is original boundary face

  • last one is new boundary face.

Definition at line 178 of file addPatchCellLayer.H.

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


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