Go to the documentation of this file.
60 meshRefiner_(meshRefiner),
61 cellWalker_(cellWalker),
83 label nRefCells = refCells.size();
85 label oldRefCells = -1;
104 Pout<<
"refinementIterator : refining "
105 << currentRefCells.size() <<
" cells." <<
endl;
109 cellCuts cuts(mesh_, cellWalker_, currentRefCells);
111 label nCuts = cuts.
nLoops();
118 Pout<<
"refinementIterator : exiting iteration since no valid"
119 <<
" loops found for " << currentRefCells.size()
126 <<
" to " << cutsFile <<
endl;
131 labelList refCellsDebug(currentRefCells.size());
132 forAll(currentRefCells, i)
134 refCellsDebug[i] = currentRefCells[i].cellNo();
154 <<
" to " << cutsFile <<
endl;
157 cuts.writeOBJ(cutsStream);
162 meshRefiner_.setRefinement(cuts, meshMod);
176 if (morphMap().hasMotionPoints())
178 mesh_.movePoints(morphMap().preMotionPoints());
182 meshRefiner_.updateMesh(morphMap());
189 Pout<<
"Writing refined polyMesh to time "
213 const Map<label>& addedNow = meshRefiner_.addedCells();
217 if (!addedCells.insert(iter.key(), iter.val()))
220 <<
"Master cell " << iter.key()
221 <<
" already has been refined" <<
endl
241 forAll(currentRefCells, refI)
243 const refineCell& refCell = currentRefCells[refI];
245 if (!addedNow.found(refCell.
cellNo()))
247 if (nRefCells != refI)
249 currentRefCells[nRefCells++] =
259 oldRefCells = currentRefCells.size();
261 currentRefCells.
setSize(nRefCells);
269 stop = (nRefCells == 0) || (nRefCells == oldRefCells);
278 <<
"stopped refining."
279 <<
"Did not manage to refine a single cell" <<
endl
280 <<
"Wanted :" << oldRefCells <<
endl;
int debug
Static debugging option.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
label nLoops() const
Number of valid cell loops.
A class for handling file names.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
autoPtr< mapPolyMesh > changeMesh(polyMesh &mesh, const bool inflate, const bool syncParallel=true, const bool orderCells=false, const bool orderPoints=false)
Inplace changes mesh without change of patches.
Map< label > setRefinement(const List< refineCell > &)
Try to refine cells in given direction. Constructs intermediate.
static word timeName(const scalar t, const int precision=precision_)
Direct mesh changes based on v1.3 polyTopoChange syntax.
Combines edge or vertex in single label. Used to specify cuts across cell circumference.
A HashTable to objects of type <T> with a label key.
Ostream & endl(Ostream &os)
Add newline and flush stream.
prefixOSstream Pout
An Ostream wrapper for parallel output to std::cout.
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
Abstract base class. Concrete implementations know how to cut a cell (i.e. determine a loop around th...
const vector & direction() const
~refinementIterator()
Destructor.
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
errorManip< error > abort(error &err)
Output to file stream, using an OSstream.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
const labelList & reverseCellMap() const
Reverse cell map.
Container with cells to refine. Refinement given as single direction.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
forAllConstIters(mixture.phases(), phase)
void setSize(const label newSize)
Alias for resize(const label)
defineTypeNameAndDebug(combustionModel, 0)
#define WarningInFunction
Report a warning using Foam::Warning.
refinementIterator(polyMesh &mesh, undoableMeshCutter &meshRefiner, const cellLooper &cellWalker, const bool writeMesh=false)
Construct from mesh, refinementEngine and cell walking routine.
The main refinement handler. Gets cellCuts which is structure that describes which cells are to be cu...
Description of cuts across cells.