60 meshRefiner_(meshRefiner),
61 cellWalker_(cellWalker),
81 Time& runTime =
const_cast<Time&
>(mesh_.time());
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()
123 fileName cutsFile(
"failedCuts_" + runTime.timeName() +
".obj");
125 Pout<<
"Writing cuts for time " << runTime.timeName()
126 <<
" to " << cutsFile <<
endl;
132 forAll(currentRefCells, i)
134 refCells[i] = currentRefCells[i].cellNo();
151 fileName cutsFile(
"cuts_" + runTime.timeName() +
".obj");
153 Pout<<
"Writing cuts for time " << runTime.timeName()
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 "
190 << runTime.timeName() <<
endl;
213 const Map<label>& addedNow = meshRefiner_.addedCells();
218 iter != addedNow.end();
222 if (!addedCells.insert(iter.key(), iter()))
225 <<
"Master cell " << iter.key()
226 <<
" already has been refined" <<
endl
246 forAll(currentRefCells, refI)
248 const refineCell& refCell = currentRefCells[refI];
250 if (!addedNow.found(refCell.
cellNo()))
252 if (nRefCells != refI)
254 currentRefCells[nRefCells++] =
264 oldRefCells = currentRefCells.
size();
266 currentRefCells.
setSize(nRefCells);
274 stop = (nRefCells == 0) || (nRefCells == oldRefCells);
280 if (nRefCells == oldRefCells)
283 <<
"stopped refining."
284 <<
"Did not manage to refine a single cell" <<
endl
285 <<
"Wanted :" << oldRefCells <<
endl;