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;
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 "
200 morphMap->reverseCellMap(),
207 morphMap->reverseCellMap(),
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
234 morphMap->reverseCellMap(),
241 forAll(currentRefCells, refI)
243 const refineCell& refCell = currentRefCells[refI];
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;
bool found(const Key &key) const
Return true if hashed entry is found in table.
bool insert(const Key &key, const T &obj)
Copy insert a new entry, not overwriting existing entries.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void setSize(const label n)
Alias for resize()
A HashTable to objects of type <T> with a label key.
Output to file stream, using an OSstream.
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
static word timeName(const scalar t, const int precision=precision_)
void size(const label n)
Older name for setAddressableSize.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
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...
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< mapPolyMesh > changeMesh(polyMesh &mesh, const labelUList &patchMap, const bool inflate, 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.
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 defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define WarningInFunction
Report a warning using Foam::Warning.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
errorManip< error > abort(error &err)
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce (copy) and return value.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIters(container, iter)
Iterate across all elements of the container object with const access.