FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

addPatchCellLayer Class Reference

Adds layers of cells to outside of polyPatch. More...

#include <dynamicMesh/addPatchCellLayer.H>


Detailed Description

Adds layers of cells to outside of polyPatch.

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 of the other patch they are connected to.

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.

Collaboration diagram for addPatchCellLayer:

List of all members.

Classes

class  uniqueEqOp

Public Member Functions

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

Static Public Member Functions

static labelListList  addedCells (const polyMesh &, const labelListList &layerFaces)
 Helper: get added cells per patch face.
static labelList  calcMeshEdges (const primitiveMesh &mesh, const indirectPrimitivePatch &)
 Per patch edge the corresponding mesh edge.

Constructor & Destructor Documentation

addPatchCellLayer ( const polyMesh &   mesh  )

Construct from mesh.

Definition at line 515 of file addPatchCellLayer.C.


Member Function Documentation

ClassName ( "addPatchCellLayer"    )

Runtime type information.

const labelListList& addedPoints (  ) const [inline]

Added points per patch point.

Definition at line 264 of file addPatchCellLayer.H.

const labelListList& layerFaces (  ) const [inline]

Layer faces per patch face. See above.

Definition at line 270 of file addPatchCellLayer.H.

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

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

Foam::labelListList addedCells (  ) const

added cells given current mesh & layerfaces.

Definition at line 552 of file addPatchCellLayer.C.

void setRefinement ( const scalarField &   expansionRatio,
const indirectPrimitivePatch &   pp,
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.

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

References Foam::abort(), d, PrimitivePatch< Face, FaceList, PointField, PointType >::edgeFaces(), PrimitivePatch< Face, FaceList, PointField, PointType >::edges(), Foam::endl(), PrimitivePatch< Face, FaceList, PointField, PointType >::faceEdges(), Foam::FatalError, FatalErrorIn, UList< T >::fcIndex(), faceZone::flipMap(), forAll, forAllReverse, wallPoint::greatPoint, PrimitivePatch< Face, FaceList, PointField, PointType >::localFaces(), Foam::mag(), Foam::max(), PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), PrimitivePatch< Face, FaceList, PointField, PointType >::nEdges(), PrimitivePatch< Face, FaceList, PointField, PointType >::nInternalEdges(), Foam::nl, PrimitivePatch< Face, FaceList, PointField, PointType >::nPoints(), PrimitivePatch< Face, FaceList, PointField, PointType >::points(), Foam::Pout, polyTopoChange::setAction(), List< T >::setSize(), List< T >::size(), syncTools::syncEdgeList(), syncTools::syncPointList(), faceZone::whichFace(), and polyBoundaryMesh::whichPatch().

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

void setRefinement ( const label   nLayers,
const indirectPrimitivePatch &   pp,
const vectorField &   overallDisplacement,
polyTopoChange &   meshMod  
) [inline]

Add with constant expansion ratio and same nLayers everywhere.

Definition at line 320 of file addPatchCellLayer.H.

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

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

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

Referenced by autoLayerDriver::addLayers().


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