Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
multiDirRefinement Class Reference

Does multiple pass refinement to refine cells in multiple directions. More...

Collaboration diagram for multiDirRefinement:
Collaboration graph
[legend]

Public Member Functions

 ClassName ("multiDirRefinement")
 Runtime type information. More...
 
 multiDirRefinement (polyMesh &mesh, const labelList &cellLabels, const dictionary &dict)
 Construct from dictionary. After construction all refinement will. More...
 
 multiDirRefinement (polyMesh &mesh, const labelList &cellLabels, const List< vectorField > &, const dictionary &dict)
 Explicitly provided directions to split in. More...
 
 multiDirRefinement (polyMesh &mesh, undoableMeshCutter &cutter, const cellLooper &cellCutter, const labelList &cellLabels, const List< vectorField > &directions, const bool writeMesh=false)
 Construct from components. Only this one would allow undo actions. More...
 
const labelListListaddedCells () const
 Access to addedCells (on the original mesh; see above) More...
 

Private Member Functions

void addCells (const primitiveMesh &, const Map< label > &)
 Add new cells from map to overall list (addedCells_). More...
 
labelList splitOffHex (const primitiveMesh &mesh)
 Remove hexes from cellLabels_ and return these in a list. More...
 
void refineHex8 (polyMesh &mesh, const labelList &hexCells, const bool writeMesh)
 Refine cells (hex only) in all 3 directions. More...
 
void refineAllDirs (polyMesh &mesh, List< vectorField > &cellDirections, const cellLooper &cellWalker, undoableMeshCutter &cutter, const bool writeMesh)
 Refine cells in cellLabels_ in directions mentioned. More...
 
void refineFromDict (polyMesh &mesh, List< vectorField > &cellDirections, const dictionary &dict, const bool writeMesh)
 Refine based on dictionary. Calls refineAllDirs. More...
 
 multiDirRefinement (const multiDirRefinement &)
 Disallow default bitwise copy construct. More...
 
void operator= (const multiDirRefinement &)
 Disallow default bitwise assignment. More...
 

Static Private Member Functions

static void addCells (const Map< label > &, List< refineCell > &)
 Given map from original to added cell set the refineCell for. More...
 
static void update (const Map< label > &, vectorField &)
 Given map from original to added cell set the vectorField for. More...
 
static void addCells (const Map< label > &, labelList &labels)
 Given map from original to added cell add the added cell to the. More...
 

Private Attributes

labelList cellLabels_
 Current set of cells to refine. Extended with added cells. More...
 
labelListList addedCells_
 From original to added cells. More...
 

Detailed Description

Does multiple pass refinement to refine cells in multiple directions.

Gets a list of cells to refine and vectorFields for the whole mesh. It then tries to refine in one direction after the other the wanted cells. After construction the mesh will have been refined in multiple directions.

Holds the list of cells to refine and the map from original to added for every refinement level.

Gets constructed from a dictionary or from components. Uses an undoableMeshCutter which does the actual cutting. Undo facility is switched of unless constructed from external one which allows this.

The cut cells get stored in addedCells which is for every vectorField to cut with the map from uncut to added cell (i.e. from master to slave). Note: map is only valid for a given direction.

Parallel: should be ok. Uses 'reduce' whenever it needs to make a local decision.

Source files

Definition at line 74 of file multiDirRefinement.H.

Constructor & Destructor Documentation

◆ multiDirRefinement() [1/4]

multiDirRefinement ( const multiDirRefinement )
private

Disallow default bitwise copy construct.

◆ multiDirRefinement() [2/4]

multiDirRefinement ( polyMesh mesh,
const labelList cellLabels,
const dictionary dict 
)

Construct from dictionary. After construction all refinement will.

have been done (and runTime will have increased a few time steps if writeMesh = true)

Definition at line 480 of file multiDirRefinement.C.

References dict, dictionary::lookup(), mesh, Foam::reduce(), List::size(), and writeMesh().

Here is the call graph for this function:

◆ multiDirRefinement() [3/4]

multiDirRefinement ( polyMesh mesh,
const labelList cellLabels,
const List< vectorField > &  cellDirs,
const dictionary dict 
)

Explicitly provided directions to split in.

Definition at line 522 of file multiDirRefinement.C.

References dict, dictionary::lookup(), mesh, Foam::reduce(), List::size(), and writeMesh().

Here is the call graph for this function:

◆ multiDirRefinement() [4/4]

multiDirRefinement ( polyMesh mesh,
undoableMeshCutter cutter,
const cellLooper cellCutter,
const labelList cellLabels,
const List< vectorField > &  directions,
const bool  writeMesh = false 
)

Construct from components. Only this one would allow undo actions.

Definition at line 564 of file multiDirRefinement.C.

References mesh, and writeMesh().

Here is the call graph for this function:

Member Function Documentation

◆ addCells() [1/3]

void addCells ( const Map< label > &  splitMap,
List< refineCell > &  refCells 
)
staticprivate

Given map from original to added cell set the refineCell for.

the added cells to be equal to the one on the original cells.

Definition at line 51 of file multiDirRefinement.C.

References Foam::abort(), refineCell::cellNo(), refineCell::direction(), Foam::FatalError, FatalErrorInFunction, List::setSize(), and List::size().

Here is the call graph for this function:

◆ update()

void update ( const Map< label > &  splitMap,
vectorField field 
)
staticprivate

Given map from original to added cell set the vectorField for.

the added cells to be equal to the one on the original cells.

Definition at line 83 of file multiDirRefinement.C.

References forAllConstIter().

Here is the call graph for this function:

◆ addCells() [2/3]

void addCells ( const Map< label > &  splitMap,
labelList labels 
)
staticprivate

Given map from original to added cell add the added cell to the.

list of labels

Definition at line 99 of file multiDirRefinement.C.

References forAllConstIter(), List::setSize(), and List::size().

Here is the call graph for this function:

◆ addCells() [3/3]

void addCells ( const primitiveMesh mesh,
const Map< label > &  splitMap 
)
private

Add new cells from map to overall list (addedCells_).

Definition at line 118 of file multiDirRefinement.C.

References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, Foam::findIndex(), forAll, forAllConstIter(), mesh, List::setSize(), and List::size().

Here is the call graph for this function:

◆ splitOffHex()

Foam::labelList splitOffHex ( const primitiveMesh mesh)
private

Remove hexes from cellLabels_ and return these in a list.

Definition at line 187 of file multiDirRefinement.C.

References multiDirRefinement::cellLabels_, cellShapes, forAll, Foam::hex(), cellModeller::lookup(), mesh, List::setSize(), List::size(), and List::transfer().

Here is the call graph for this function:

◆ refineHex8()

void refineHex8 ( polyMesh mesh,
const labelList hexCells,
const bool  writeMesh 
)
private

◆ refineAllDirs()

void refineAllDirs ( polyMesh mesh,
List< vectorField > &  cellDirections,
const cellLooper cellWalker,
undoableMeshCutter cutter,
const bool  writeMesh 
)
private

Refine cells in cellLabels_ in directions mentioned.

Definition at line 362 of file multiDirRefinement.C.

References Foam::endl(), forAll, mesh, Foam::nl, Foam::Pout, refinementIterator::setRefinement(), and writeMesh().

Here is the call graph for this function:

◆ refineFromDict()

void refineFromDict ( polyMesh mesh,
List< vectorField > &  cellDirections,
const dictionary dict,
const bool  writeMesh 
)
private

Refine based on dictionary. Calls refineAllDirs.

Definition at line 445 of file multiDirRefinement.C.

References dict, dictionary::lookup(), mesh, autoPtr::reset(), and writeMesh().

Here is the call graph for this function:

◆ operator=()

void operator= ( const multiDirRefinement )
private

Disallow default bitwise assignment.

◆ ClassName()

ClassName ( "multiDirRefinement"  )

Runtime type information.

◆ addedCells()

const labelListList& addedCells ( ) const
inline

Access to addedCells (on the original mesh; see above)

Definition at line 190 of file multiDirRefinement.H.

References multiDirRefinement::addedCells_.

Field Documentation

◆ cellLabels_

labelList cellLabels_
private

Current set of cells to refine. Extended with added cells.

Definition at line 79 of file multiDirRefinement.H.

Referenced by multiDirRefinement::splitOffHex().

◆ addedCells_

labelListList addedCells_
private

From original to added cells.

Gives for every cell in the original mesh an empty list or the list of cells this one has been split into (note: will include itself so e.g. for hex will be 8 if 2x2x2 refinement)

Definition at line 85 of file multiDirRefinement.H.

Referenced by multiDirRefinement::addedCells().


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