Go to the documentation of this file.
28 #include "primitiveMesh.H"
54 Pout<<
"void layerAdditionRemoval::extrusionDir() const "
55 <<
" for object " <<
name() <<
" : "
56 <<
"Using edges for point insertion" <<
endl;
71 Pout<<
"void layerAdditionRemoval::extrusionDir() const "
72 <<
" for object " <<
name() <<
" : "
73 <<
"A valid layer could not be found in front of "
74 <<
"the addition face layer. Using face-based "
75 <<
"point normals for point addition"
107 Pout<<
"void layerAdditionRemoval::addCellLayer("
108 <<
"polyTopoChange& ref) const for object " <<
name() <<
" : "
109 <<
"Adding cell layer" <<
endl;
132 addedPoints[pointI] =
138 + addDelta_*pointOffsets[pointI],
148 Pout<<
"mp: " <<
mp <<
" addedPoints: " << addedPoints <<
endl;
168 label cellI = mc[faceI];
199 const face oldFace = zoneFaces[faceI].reverseFace();
205 newFace[pointI] = addedPoints[oldFace[pointI]];
208 bool flipFaceFlux =
false;
214 || mc[faceI] == nei[mf[faceI]]
240 Pout<<
"adding face: " << newFace
241 <<
" own: " << mc[faceI]
242 <<
" nei: " << addedCells[faceI]
255 const label curfaceID = mf[faceI];
279 Pout<<
"Modifying a boundary face. Face: " << curfaceID
280 <<
" flip: " << mfFlip[faceI]
288 else if (sc[faceI] == own[curfaceID])
309 Pout<<
"modify face, no flip " << curfaceID
310 <<
" own: " << own[curfaceID]
311 <<
" nei: " << addedCells[faceI]
336 Pout<<
"modify face, with flip " << curfaceID
337 <<
" own: " << own[curfaceID]
338 <<
" nei: " << addedCells[faceI]
356 for (
label curEdgeID = 0; curEdgeID < nInternalEdges; curEdgeID++)
360 newFace[0] =
mp[zoneLocalEdges[curEdgeID].start()];
361 newFace[1] =
mp[zoneLocalEdges[curEdgeID].end()];
362 newFace[2] = addedPoints[zoneLocalEdges[curEdgeID].end()];
363 newFace[3] = addedPoints[zoneLocalEdges[curEdgeID].start()];
370 addedCells[edgeFaces[curEdgeID][0]],
371 addedCells[edgeFaces[curEdgeID][1]],
373 meshEdges[curEdgeID],
384 Pout<<
"Add internal face off edge: " << newFace
385 <<
" own: " << addedCells[edgeFaces[curEdgeID][0]]
386 <<
" nei: " << addedCells[edgeFaces[curEdgeID][1]]
408 label curEdgeID = nInternalEdges;
409 curEdgeID < zoneLocalEdges.
size();
414 newFace[0] =
mp[zoneLocalEdges[curEdgeID].start()];
415 newFace[1] =
mp[zoneLocalEdges[curEdgeID].end()];
416 newFace[2] = addedPoints[zoneLocalEdges[curEdgeID].end()];
417 newFace[3] = addedPoints[zoneLocalEdges[curEdgeID].start()];
420 const labelList& curFaces = meshEdgeFaces[meshEdges[curEdgeID]];
427 const label cf = curFaces[faceI];
432 if (zoneMesh.
whichZone(cf) != faceZoneID_.index())
446 <<
"Cannot find patch for edge " << meshEdges[curEdgeID]
447 <<
". Edge: " <<
mesh.
edges()[meshEdges[curEdgeID]]
456 addedCells[edgeFaces[curEdgeID][0]],
459 meshEdges[curEdgeID],
470 Pout<<
"add boundary face: " << newFace
471 <<
" into patch " << patchID
472 <<
" own: " << addedCells[edgeFaces[curEdgeID][0]]
502 if (zoneMesh.
whichZone(curFaces[faceI]) != faceZoneID_.index())
504 masterCellFaceMap.
insert(curFaces[faceI]);
514 masterLayerPointMap.insert
522 const labelList masterCellFaces = masterCellFaceMap.
toc();
524 forAll(masterCellFaces, faceI)
529 const label curFaceID = masterCellFaces[faceI];
531 const face& oldFace = faces[curFaceID];
535 bool changed =
false;
539 if (masterLayerPointMap.found(oldFace[pointI]))
543 newFace[pointI] = masterLayerPointMap.find(oldFace[pointI])();
547 newFace[pointI] = oldFace[pointI];
556 bool modifiedFaceZoneFlip =
false;
558 if (modifiedFaceZone >= 0)
560 modifiedFaceZoneFlip =
587 Pout<<
"modifying stick-out face. Internal Old face: "
589 <<
" new face: " << newFace
590 <<
" own: " << own[curFaceID]
591 <<
" nei: " << nei[curFaceID]
616 Pout<<
"modifying stick-out face. Boundary Old face: "
618 <<
" new face: " << newFace
619 <<
" own: " << own[curFaceID]
630 Pout<<
"void layerAdditionRemoval::addCellLayer(polyTopoChange&) const "
631 <<
" for object " <<
name() <<
": "
632 <<
"Finished adding cell layer" <<
endl;
tmp< vectorField > extrusionDir() const
Calculate the offset to the next layer.
virtual const pointField & points() const
Return raw points.
const dimensionedScalar mp
Proton mass.
const labelListList & edgeFaces() const
Return edge-face addressing.
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
List< Key > toc() const
Return the table of contents.
#define forAll(list, i)
Loop across all elements in list.
A class for managing temporary objects.
const polyTopoChanger & topoChanger() const
Return reference to morph engine.
static const unsigned facesPerCell_
Estimated number of faces per cell.
const labelListList & edgeFaces() const
const cellList & cells() const
Direct mesh changes based on v1.3 polyTopoChange syntax.
const cellZoneMesh & cellZones() const
Return cell zone mesh.
Class describing modification of a face.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
Mesh consisting of general polyhedral cells.
Field< vector > vectorField
Specialisation of Field<T> for vector.
const faceZoneMesh & faceZones() const
Return face zone mesh.
const labelList & pointsPairing() const
Return points pairing in a layer (not automatic!)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void addCellLayer(polyTopoChange &) const
Add a layer of cells.
Pre-declare SubField and related Field type.
virtual const labelList & faceOwner() const
Return face owner.
faceZoneID faceZoneID_
Master face zone ID.
label whichPatch(const label faceIndex) const
Return patch index for a given face label.
label whichZone(const label objectIndex) const
Given a global object index, return the zone it is in.
errorManip< error > abort(error &err)
Class containing data for cell addition.
label nInternalEdges() const
Number of internal edges.
const word & name() const
Return name of this modifier.
const Field< PointType > & pointNormals() const
Return point normals for patch.
virtual const faceList & faces() const
Return raw faces.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label setAction(const topoAction &action)
For compatibility with polyTopoChange: set topological action.
prefixOSstream Pout(cout, "Pout")
const polyMesh & mesh() const
Return the mesh reference.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
bool isInternalFace(const label faceIndex) const
Return true if given face label is internal to the mesh.
bool insert(const Key &key)
Insert a new entry.
Class containing data for point addition.
A face addition data class. A face can be inflated either from a point or from another face and can e...
const List< Face > & localFaces() const
Return patch faces addressing into local point list.
A face is a list of labels corresponding to mesh vertices.
void size(const label)
Override size to be inconsistent with allocated storage.
const labelList & meshPoints() const
Return labelList of mesh points in patch.
scalar minLayerThickness_
Min thickness of extrusion layer. Triggers layer removal.
faceType reverseFace(const faceType &f)
reverse the face
word name(const complex &)
Return a string representation of a complex.
virtual const labelList & faceNeighbour() const
Return face neighbour.
label index() const
Return index of first matching zone.
bool setLayerPairing() const
Set layer pairing. Return true if a valid layer exists.
A list of faces which address into the list of points.