Adds layers of cells to outside (or inside) of polyMesh. Can optionally create stand-alone extruded mesh (addToMesh=false). More...
#include <addPatchCellLayer.H>
Public Member Functions | |
| ClassName ("addPatchCellLayer") | |
| Runtime type information. | |
| addPatchCellLayer (const polyMesh &, const bool addToMesh=true, const bool extrude=true) | |
| 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 globalIndex &globalFaces, const labelListList &globalEdgeFaces, const scalarField &expansionRatio, const indirectPrimitivePatch &pp, const bitSet &flip, 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. | |
| 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. | |
| 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 labelListList | globalEdgeFaces (const polyMesh &, const globalIndex &globalFaces, const indirectPrimitivePatch &pp, const bitSet &orientation) |
| Per patch edge the pp faces (in global indices) using it. | |
| static labelListList | globalEdgeFaces (const polyMesh &, const globalIndex &globalFaces, const indirectPrimitivePatch &pp) |
| Per patch edge the pp faces (in global indices) using it. | |
| 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: | |
| static void | findDuplicatedPoints (const polyMesh &mesh, const indirectPrimitivePatch &pp, const bitSet &ppFlip, const bitSet &isBlockedFace, const bitSet &isDupPatchPoint, const bool extrude, faceList &isDupMeshPoint) |
| Helper: given patch and points on patch that are extruded. | |
Adds layers of cells to outside (or inside) of polyMesh. 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.
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:
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
+------+------+
Extrusion:
added added
face cell
---- ----
a b <- patch of boundary face
+------+------+ 3
| | | 2
+ +------+ 2
| | | 1
+------+------+ 1
| | | 0
+------+------+ 0 <- original boundary faces
| | | <- original cells
+------+------+
Intrusion:
face cell
---- ----
a b <- patch of boundary face
+------+------+ 0
| | | 0
+------+------+ 1
| | | 1
+ +------+ 2
| | | 2
+------+------+ 3
| | | <- 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
| | | |
+------+------+------+
(shown for extrusion mode only):
^ ^ <- 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.
| | | |
+------+------+------+
Definition at line 152 of file addPatchCellLayer.H.
|
explicit |
| ClassName | ( | "addPatchCellLayer" | ) |
Runtime type information.
|
inline |
Added points per patch point.
Definition at line 359 of file addPatchCellLayer.H.
|
inline |
Layer faces per patch face. See above.
Definition at line 367 of file addPatchCellLayer.H.
Referenced by addedCells().

|
static |
Helper: get added cells per patch face.
addedCells[patchFace] is list of cells added. extrude : first element : next to original cell last element : is the top cell (i.e. the boundary cell) intrude : first element : top cell last element : next to original cell
Definition at line 629 of file addPatchCellLayer.C.
References faceLabels(), forAll, layerFaces(), mesh, and List< T >::setSize().
Referenced by addedCells(), and setRefinement().


| Foam::labelListList addedCells | ( | ) | const |
Added cells given current mesh & layerfaces.
Definition at line 656 of file addPatchCellLayer.C.
References addedCells().

|
static |
Per patch edge the pp faces (in global indices) using it.
Uses ListOps::uniqueEqOp to remove duplicates. On coupled faces only selects the one with the correct orientation/flip (assumes the orientation is opposite on a coupled face pair)
Definition at line 662 of file addPatchCellLayer.C.
References DynamicList< T, SizeMin >::append(), DynamicList< T, SizeMin >::clear(), PackedList< Width >::empty(), forAll, globalEdgeFaces(), mesh, pp(), syncTools::syncEdgeList(), and globalIndex::toGlobal().
Referenced by snappyLayerDriver::addLayers(), snappyLayerDriver::addLayersSinglePass(), calcExtrudeInfo(), globalEdgeFaces(), globalEdgeFaces(), setRefinement(), and setRefinement().


|
static |
Per patch edge the pp faces (in global indices) using it.
Uses ListOps::uniqueEqOp to remove duplicates.
Definition at line 720 of file addPatchCellLayer.C.
References globalEdgeFaces(), mesh, bitSet::null(), and pp().

|
static |
Determine extrude information per patch edge:
Definition at line 1138 of file addPatchCellLayer.C.
References HashTable< T, Key, Hash >::clear(), globalMeshData::coupledPatch(), e, Foam::endl(), forAll, globalEdgeFaces(), globalMeshData::globalEdgeSlaves(), globalMeshData::globalEdgeSlavesMap(), globalMeshData::globalEdgeTransformedSlaves(), globalMeshData::globalTransforms(), HashTable< T, Key, Hash >::insert(), globalIndex::isLocal(), k, HashTable< T, Key, Hash >::lookup(), PatchTools::matchEdges(), mesh, PrimitivePatch< FaceList, PointField >::nEdges(), nPatches, UPstream::parRun(), patches, pp(), processorTopology::procPatchLookup(), List< T >::setSize(), UList< T >::size(), globalMeshData::syncData(), globalIndex::toLocal(), globalMeshData::topology(), WarningInFunction, and globalIndex::whichProcID().
Referenced by snappyLayerDriver::determineSidePatches().


| void setRefinement | ( | const globalIndex & | globalFaces, |
| const labelListList & | globalEdgeFaces, | ||
| const scalarField & | expansionRatio, | ||
| const indirectPrimitivePatch & | pp, | ||
| const bitSet & | flip, | ||
| 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.
Definition at line 1468 of file addPatchCellLayer.C.
References Foam::abort(), addedCells(), bitSet::count(), e, UList< T >::empty(), Foam::endl(), Foam::exit(), f(), Foam::FatalError, FatalErrorInFunction, findDuplicatedPoints(), faceZone::flipMap(), forAll, forAllReverse, globalEdgeFaces(), Foam::gMax(), HashSet< Key, Hash >::insert(), isBlockedFace(), UList< T >::last(), Foam::mag(), Foam::max(), VectorSpace< Form, Cmpt, Ncmpts >::max, polyTopoChange::modifyFace(), polyTopoChange::modifyPoint(), n, Foam::nl, patches, patchID, polyTopoChange::points(), Foam::Pout, pp(), face::reverseFace(), bitSet::set(), polyTopoChange::setAction(), List< T >::setSize(), PackedList< Width >::size(), UList< T >::size(), syncTools::swapBoundaryFaceList(), syncTools::syncEdgeList(), syncTools::syncPointList(), globalIndex::toGlobal(), bitSet::unset(), faceZone::whichFace(), Foam::Zero, and VectorSpace< Form, Cmpt, Ncmpts >::zero.
Referenced by snappyLayerDriver::addLayers(), and setRefinement().


|
inline |
Add with constant expansion ratio and same nLayers everywhere.
Definition at line 507 of file addPatchCellLayer.H.
References globalEdgeFaces(), pp(), and 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 3190 of file addPatchCellLayer.C.
References Foam::faceMap(), forAll, newPointi, mapPolyMesh::reverseFaceMap(), mapPolyMesh::reversePointMap(), List< T >::setSize(), and UList< T >::size().
Referenced by snappyLayerDriver::addLayers().


|
static |
Helper: given patch and points on patch that are extruded.
(to slave side or master side) find the affected points. Calculates by walking across faces which vertices on which face are affected. isDupMeshPoint: -1 : unaffected >=0 : should use local duplicate of point (though it does not tell us whether it should use slave side or master side)
Definition at line 3253 of file addPatchCellLayer.C.
References HashTable< T, Key, Hash >::clear(), List< T >::clear(), bitSet::count(), Foam::endl(), Foam::exit(), f(), Foam::FatalError, FatalErrorInFunction, HashTable< T, Key, Hash >::find(), forAll, HashTable< T, Key, Hash >::insert(), isBlockedFace(), mesh, Foam::Pout, pp(), List< T >::resize_nocopy(), Foam::returnReduceOr(), bitSet::set(), List< T >::setSize(), PackedList< Width >::size(), and syncTools::syncBoundaryFaceList().
Referenced by setRefinement().

