Does multiple pass refinement to refine cells in multiple directions. More...
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 labelListList & | addedCells () 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... | |
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.
Definition at line 74 of file multiDirRefinement.H.
|
private |
Disallow default bitwise copy construct.
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().
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().
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().
|
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().
|
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().
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().
|
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().
|
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().
Refine cells (hex only) in all 3 directions.
Definition at line 226 of file multiDirRefinement.C.
References Foam::abort(), mapPolyMesh::cellMap(), polyTopoChange::changeMesh(), hexRef8::consistentRefinement(), Foam::endl(), polyMesh::facesInstance(), Foam::FatalError, FatalErrorInFunction, forAll, forAllConstIter(), mapPolyMesh::hasMotionPoints(), mesh, polyMesh::meshSubDir, fvMesh::movePoints(), primitiveMesh::nCells(), IOobject::NO_READ, IOobject::NO_WRITE, primitiveMesh::nPoints(), Foam::Pout, mapPolyMesh::preMotionPoints(), hexRef8::setRefinement(), List::size(), fvMesh::time(), Time::timeName(), hexRef8::updateMesh(), fvMesh::write(), and 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().
|
private |
Refine based on dictionary. Calls refineAllDirs.
Definition at line 445 of file multiDirRefinement.C.
References dict, dictionary::lookup(), mesh, autoPtr::reset(), and writeMesh().
|
private |
Disallow default bitwise assignment.
ClassName | ( | "multiDirRefinement" | ) |
Runtime type information.
|
inline |
Access to addedCells (on the original mesh; see above)
Definition at line 190 of file multiDirRefinement.H.
References multiDirRefinement::addedCells_.
|
private |
Current set of cells to refine. Extended with added cells.
Definition at line 79 of file multiDirRefinement.H.
Referenced by multiDirRefinement::splitOffHex().
|
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().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.