58 meshRefiner_(meshRefiner),
59 cellWalker_(cellWalker),
79 Time& runTime =
const_cast<Time&
>(mesh_.time());
83 label oldRefCells = -1;
102 Pout<<
"refinementIterator : refining "
103 << currentRefCells.
size() <<
" cells." <<
endl;
107 cellCuts cuts(mesh_, cellWalker_, currentRefCells);
116 Pout<<
"refinementIterator : exiting iteration since no valid"
117 <<
" loops found for " << currentRefCells.
size()
121 fileName cutsFile(
"failedCuts_" + runTime.
name() +
".obj");
123 Pout<<
"Writing cuts for time " << runTime.
name()
124 <<
" to " << cutsFile <<
endl;
130 forAll(currentRefCells, i)
132 refCellsDebug[i] = currentRefCells[i].cellNo();
151 Pout<<
"Writing cuts for time " << runTime.
name()
152 <<
" to " << cutsFile <<
endl;
155 cuts.writeOBJ(cutsStream);
160 meshRefiner_.setRefinement(cuts, meshMod);
170 meshRefiner_.topoChange(map());
177 Pout<<
"Writing refined polyMesh to time "
188 map->reverseCellMap(),
195 map->reverseCellMap(),
201 const Map<label>& addedNow = meshRefiner_.addedCells();
205 if (!addedCells.
insert(iter.key(), iter()))
208 <<
"Master cell " << iter.key()
209 <<
" already has been refined" <<
endl
222 map->reverseCellMap(),
229 forAll(currentRefCells, refI)
231 const refineCell& refCell = currentRefCells[refI];
235 if (nRefCells != refI)
237 currentRefCells[nRefCells++] =
247 oldRefCells = currentRefCells.
size();
249 currentRefCells.
setSize(nRefCells);
257 stop = (nRefCells == 0) || (nRefCells == oldRefCells);
266 <<
"stopped refining."
267 <<
"Did not manage to refine a single cell" <<
endl
268 <<
"Wanted :" << oldRefCells <<
endl;
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
bool found(const Key &) const
Return true if hashedEntry is found in table.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void size(const label)
Override size to be inconsistent with allocated storage.
void setSize(const label)
Reset size of List.
A HashTable to objects of type <T> with a label key.
virtual Ostream & write(const char)=0
Write character.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Description of cuts across cells.
label nLoops() const
Number of valid cell loops.
Abstract base class. Concrete implementations know how to cut a cell (i.e. determine a loop around th...
const word & name() const
Return const reference to name.
Combines edge or vertex in single label. Used to specify cuts across cell circumference.
A class for handling file names.
Mesh consisting of general polyhedral cells.
Direct mesh changes based on v1.3 polyTopoChange syntax.
autoPtr< polyTopoChangeMap > changeMesh(polyMesh &mesh, const bool syncParallel=true, const bool orderCells=false, const bool orderPoints=false)
Inplace changes mesh without change of patches.
Container with cells to refine. Refinement given as single direction.
const vector & direction() const
Utility class to do iterating meshCutter until all requests satisfied.
~refinementIterator()
Destructor.
refinementIterator(polyMesh &mesh, undoableMeshCutter &meshRefiner, const cellLooper &cellWalker, const bool writeMesh=false)
Construct from mesh, refinementEngine and cell walking routine.
Map< label > setRefinement(const List< refineCell > &)
Try to refine cells in given direction. Constructs intermediate.
The main refinement handler. Gets cellCuts which is structure that describes which cells are to be cu...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define WarningInFunction
Report a warning using Foam::Warning.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
defineTypeNameAndDebug(combustionModel, 0)
prefixOSstream Pout(cout, "Pout")