Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
polyMeshGenModifier Class Reference
Inheritance diagram for polyMeshGenModifier:
Inheritance graph
[legend]
Collaboration diagram for polyMeshGenModifier:
Collaboration graph
[legend]

Public Member Functions

 polyMeshGenModifier (polyMeshGen &mesh)
 Construct from the reference to the mesh. More...
 
 ~polyMeshGenModifier ()
 
pointFieldPMGpointsAccess ()
 access to mesh points More...
 
faceListPMGfacesAccess ()
 access to mesh faces More...
 
cellListPMGcellsAccess ()
 access to cells More...
 
PtrList< processorBoundaryPatch > & procBoundariesAccess ()
 access to processor boundary data More...
 
PtrList< boundaryPatch > & boundariesAccess ()
 access to boundary data More...
 
void reorderBoundaryFaces ()
 
void removeUnusedVertices ()
 remove unused vertices More...
 
void removeFaces (const boolList &removeFace)
 remove faces More...
 
void removeDuplicateFaces ()
 remove duplicate faces from the mesh More...
 
void removeCells (const boolList &removeCell, const bool removeProcFaces=true)
 remove cells More...
 
void addCells (const LongList< faceList > &cellFaces)
 add cells (vertices must be added) More...
 
void addCells (const VRWGraphList &cellFaces)
 
void addCell (const faceList &cellFaces)
 
void replaceBoundary (const wordList &patchNames, const VRWGraph &boundaryFaces, const labelLongList &faceOwners, const labelLongList &facePatches)
 replace the boundary with new boundary faces More...
 
void addProcessorFaces (const VRWGraph &procFaces, const labelLongList &facePatches)
 add additional faces into processor patches More...
 
label addProcessorPatch (const label otherProcLabel)
 add new processor patch and return its label More...
 
bool removeEmptyProcessorPatches ()
 remove empty processor patch More...
 
void addBufferCells ()
 
void zipUpCells ()
 zip up topologically open cells More...
 
void renumberMesh ()
 reorder the cells and faces to reduce the matrix bandwidth More...
 
void clearOut ()
 clear out unnecessary data (pointFacesPtr_); More...
 
void clearAll ()
 clear out all allocated data More...
 

Protected Member Functions

VRWGraphpointFaces ()
 

Private Member Functions

void calculatePointFaces ()
 calculate and return point faces More...
 
void reorderProcBoundaryFaces ()
 

Private Attributes

polyMeshGenmesh_
 reference to the mesh More...
 
VRWGraphpointFacesPtr_
 helper data for adding cells More...
 

Detailed Description

Definition at line 52 of file polyMeshGenModifier.H.

Constructor & Destructor Documentation

◆ polyMeshGenModifier()

polyMeshGenModifier ( polyMeshGen mesh)
inline

Construct from the reference to the mesh.

Definition at line 91 of file polyMeshGenModifier.H.

◆ ~polyMeshGenModifier()

~polyMeshGenModifier ( )
inline

Definition at line 100 of file polyMeshGenModifier.H.

References polyMeshGenModifier::clearOut().

Here is the call graph for this function:

Member Function Documentation

◆ calculatePointFaces()

void calculatePointFaces ( )
inlineprivate

calculate and return point faces

Definition at line 63 of file polyMeshGenModifier.H.

References polyMeshGenFaces::faces(), polyMeshGenModifier::mesh_, polyMeshGenModifier::pointFaces(), polyMeshGenModifier::pointFacesPtr_, polyMeshGenPoints::points(), VRWGraph::reverseAddressing(), and pointFieldPMG::size().

Referenced by polyMeshGenModifier::pointFaces().

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

◆ reorderProcBoundaryFaces()

void reorderProcBoundaryFaces ( )
private

re-order positions of processor boundary faces they should comea immediately after the internal faces

check if there exist any internal or ordinary bnd faces which appear after processor bnd faces. Move those faces before the processor boundary

faces added after processor boundaries should be moved up front

shift proc faces

set patch start to the new value

store faces taken from the end

set correct patch size

renumber cells

update face subsets

delete invalid data

Definition at line 226 of file polyMeshGenModifierReorderBoundaryFaces.C.

References Foam::abort(), polyMeshGenFaces::boundaries_, Foam::constant::universal::c, cells, polyMeshGenCells::cells_, PtrList::clear(), polyMeshGenCells::clearOut(), polyMeshGenModifier::clearOut(), Foam::endl(), polyMeshGenFaces::faces_, Foam::FatalError, FatalErrorIn, forAll, forAllReverse, polyMeshGenModifier::mesh_, UPstream::myProcNo(), polyMeshGenFaces::procBoundaries_, PtrList::set(), PtrList::setSize(), faceListPMG::size(), PtrList::size(), faceListPMG::transfer(), List::transfer(), polyMeshGenFaces::updateFaceSubsets(), and Foam::Warning.

Referenced by polyMeshGenModifier::reorderBoundaryFaces().

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

◆ pointFaces()

VRWGraph& pointFaces ( )
inlineprotected

◆ pointsAccess()

pointFieldPMG& pointsAccess ( )
inline

◆ facesAccess()

faceListPMG& facesAccess ( )
inline

◆ cellsAccess()

cellListPMG& cellsAccess ( )
inline

◆ procBoundariesAccess()

PtrList<processorBoundaryPatch>& procBoundariesAccess ( )
inline

◆ boundariesAccess()

PtrList<boundaryPatch>& boundariesAccess ( )
inline

◆ reorderBoundaryFaces()

void reorderBoundaryFaces ( )

functions which change the mesh reorder boundary faces

count internal and boundary faces

find faces which should be repositioned

find the boundary faces within the range of internal faces

find the internal faces within the range of boundary faces

perform reduction such that all threads know how many faces need to be swapped

swap with the face at the location the face should be

re-create boundary data

processor boundary faces must be contained at the end

update face subsets

delete invalid data

Definition at line 44 of file polyMeshGenModifierReorderBoundaryFaces.C.

References LongList< T, Offset >::append(), polyMeshGenFaces::boundaries_, Foam::constant::universal::c, cells, polyMeshGenCells::cells_, PtrList::clear(), polyMeshGenCells::clearOut(), polyMeshGenModifier::clearOut(), Foam::endl(), f(), polyMeshGenFaces::faces_, forAll, Foam::Info, polyMeshGenModifier::mesh_, polyMeshGenFaces::neighbour(), polyMeshGenFaces::nInternalFaces(), UPstream::parRun(), polyMeshGenFaces::procBoundaries_, polyMeshGenModifier::reorderProcBoundaryFaces(), PtrList::set(), List::setSize(), PtrList::setSize(), faceListPMG::size(), LongList< T, Offset >::size(), PtrList::size(), faceListPMG::transfer(), and polyMeshGenFaces::updateFaceSubsets().

Referenced by decomposeCells::addNewCells(), boundaryLayers::createLayerCells(), tetMeshExtractorOctree::createMesh(), voronoiMeshExtractor::createMesh(), boundaryLayers::createNewFacesAndCells(), cartesianMeshExtractor::createPolyMesh(), partTetMesh::createPolyMesh(), and extrudeLayer::updateBoundary().

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

◆ removeUnusedVertices()

void removeUnusedVertices ( )

◆ removeFaces()

void removeFaces ( const boolList removeFace)

remove faces

copy internal faces

copy boundary faces

copy processor faces into a separate list this preserves the order of faces after the modification is finished

create ordinary boundary faces from processor faces which are removed from one processor only these faces are stored in the latest ordinary patch

send data to other proc

this face becomes an ordinary boundary face because the face on the other side of the processor boundary has been deleted

remove faces from processor patches

all patches still exist

update face subsets in the mesh

change cells

Definition at line 40 of file polyMeshGenModifierRemoveFaces.C.

References Foam::abort(), DynList< T, staticSize >::append(), UPstream::blocking, polyMeshGenFaces::boundaries_, Foam::constant::universal::c, cells, polyMeshGenCells::cells_, polyMeshGenCells::clearOut(), Foam::endl(), polyMeshGenFaces::faces_, Foam::FatalError, FatalErrorIn, forAll, Foam::Info, polyMeshGenModifier::mesh_, polyMeshGenFaces::nInternalFaces(), UPstream::parRun(), polyMeshGenFaces::procBoundaries_, faceListPMG::setSize(), List::setSize(), faceListPMG::size(), List::size(), DynList< T, staticSize >::size(), PtrList::size(), faceListPMG::transfer(), and polyMeshGenFaces::updateFaceSubsets().

Referenced by surfaceMorpherCells::morphInternalFaces().

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

◆ removeDuplicateFaces()

void removeDuplicateFaces ( )

◆ removeCells()

void removeCells ( const boolList removeCell,
const bool  removeProcFaces = true 
)

remove cells

flip internal faces which will become boundary ones

remove unwanted cells

update cell subsets in the mesh

reorder positions of boundary faces this outs the newly-created bnd faces at the end of the list

remove unused faces

Definition at line 41 of file polyMeshGenModifierRemoveCells.C.

References Foam::abort(), Foam::constant::universal::c, cells, Foam::endl(), Foam::FatalError, FatalErrorIn, forAll, Foam::Info, UPstream::parRun(), Foam::reduce(), List::setSize(), faceListPMG::size(), List::size(), and List::transfer().

Referenced by checkCellConnectionsOverFaces::checkCellGroups(), checkIrregularSurfaceConnections::checkEdgeFaceConnections(), checkIrregularSurfaceConnections::checkFaceGroupsAtBndVertices(), topologicalCleaner::checkInvalidConnectionsForVerticesFaces(), checkNonMappableCellConnections::removeCells(), surfaceMorpherCells::removeCellsWithAllVerticesAtTheBoundary(), and decomposeCells::removeDecomposedCells().

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

◆ addCells() [1/2]

void addCells ( const LongList< faceList > &  cellFaces)

◆ addCells() [2/2]

void addCells ( const VRWGraphList cellFaces)

◆ addCell()

void addCell ( const faceList cellFaces)

◆ replaceBoundary()

void replaceBoundary ( const wordList patchNames,
const VRWGraph boundaryFaces,
const labelLongList faceOwners,
const labelLongList facePatches 
)

◆ addProcessorFaces()

void addProcessorFaces ( const VRWGraph procFaces,
const labelLongList facePatches 
)

add additional faces into processor patches

set new size of the faceListPMG

move faces to their new positions

set new start for the given patch

add new faces into patches

renumber cells

Definition at line 41 of file polyMeshGenModifierAddProcessorFaces.C.

References Foam::constant::universal::c, cells, Foam::endl(), f(), forAll, forAllReverse, Foam::Info, Foam::max(), boundaryPatchBase::patchSize(), boundaryPatchBase::patchStart(), faceListPMG::setSize(), faceListPMG::size(), LongList< T, Offset >::size(), VRWGraph::size(), PtrList::size(), VRWGraph::sizeOfRow(), and faceListPMG::transfer().

Referenced by boundaryLayers::createNewFacesFromPointsParallel(), extrudeLayer::createNewFacesParallel(), and boundaryLayers::createNewFacesParallel().

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

◆ addProcessorPatch()

label addProcessorPatch ( const label  otherProcLabel)

add new processor patch and return its label

Definition at line 139 of file polyMeshGenModifierAddProcessorFaces.C.

References polyMeshGenModifier::mesh_, UPstream::myProcNo(), Foam::name(), polyMeshGenFaces::procBoundaries(), polyMeshGenModifier::procBoundariesAccess(), PtrList::set(), and PtrList::setSize().

Here is the call graph for this function:

◆ removeEmptyProcessorPatches()

bool removeEmptyProcessorPatches ( )

remove empty processor patch

Definition at line 171 of file polyMeshGenModifierAddProcessorFaces.C.

References forAll, polyMeshGenModifier::procBoundariesAccess(), PtrList::set(), PtrList::size(), and PtrList::transfer().

Here is the call graph for this function:

◆ addBufferCells()

void addBufferCells ( )

◆ zipUpCells()

void zipUpCells ( )

◆ renumberMesh()

void renumberMesh ( )

reorder the cells and faces to reduce the matrix bandwidth

the business bit of the renumbering

loop over the cells

find the first cell that has not been visited yet

use this cell as a start

loop through the nextCell list. Add the first cell into the cell order if it has not already been visited and ask for its neighbours. If the neighbour in question has not been visited, add it to the end of the nextCell list

add into cellOrder

find if the neighbours have been visited

not visited, add to the list

The reverse order list gives the new cell label for every old cell

Renumber the faces. Reverse face order gives the new face number for every old face

Mark the internal faces with -2 so that they are inserted first

Order internal faces

Note: Insertion cannot be done in one go as the faces need to be added into the list in the increasing order of neighbour cells. Therefore, all neighbours will be detected first and then added in the correct order.

Record the neighbour cell

Face is internal and gets reordered

Add the faces in the increasing order of neighbours

Find the lowest neighbour which is still valid

Face is internal and gets reordered

Stop the neighbour from being used again

Insert the boundary faces into reordering list

Face order gives the old face label for every new face

Renumber the cells

Turn the face that need to be turned Only loop through internal faces

transfer faces and cells back to the original lists

Definition at line 42 of file polyMeshGenModifierRenumberMesh.C.

References Foam::abort(), polyMeshGenCells::addressingData(), LongList< T, Offset >::append(), Foam::constant::universal::c, polyMeshGenAddressing::cellCells(), polyMeshGenCells::cells(), polyMeshGenModifier::cellsAccess(), polyMeshGenCells::clearOut(), polyMeshGenModifier::clearOut(), Foam::endl(), polyMeshGenModifier::facesAccess(), Foam::FatalError, FatalErrorIn, forAll, forAllRow, Foam::Info, polyMeshGenModifier::mesh_, polyMeshGenFaces::neighbour(), polyMeshGenFaces::owner(), LongList< T, Offset >::removeLastElement(), cellListPMG::size(), faceListPMG::size(), List::size(), LongList< T, Offset >::size(), VRWGraph::size(), cellListPMG::transfer(), faceListPMG::transfer(), List::transfer(), polyMeshGenCells::updateCellSubsets(), and polyMeshGenFaces::updateFaceSubsets().

Referenced by cartesian2DMeshGenerator::renumberMesh(), cartesianMeshGenerator::renumberMesh(), tetMeshGenerator::renumberMesh(), and voronoiMeshGenerator::renumberMesh().

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

◆ clearOut()

void clearOut ( )
inline

◆ clearAll()

void clearAll ( )
inline

Field Documentation

◆ mesh_

polyMeshGen& mesh_
private

◆ pointFacesPtr_

VRWGraph* pointFacesPtr_
private

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