Go to the documentation of this file.
61 printCellRefTree(os, subIndent, splitCellPtr->
master());
63 printCellRefTree(os, subIndent, splitCellPtr->
slave());
86 splitPtr = splitPtr->
parent();
110 bool changed =
false;
119 <<
"Problem: null pointer on liveSplitCells list"
125 if (cellI != map[cellI])
148 label newCellI = map[cellI];
150 if (debug && (cellI != newCellI))
152 Pout<<
"undoableMeshCutter::updateLabels :"
153 <<
" Updating live (split)cell from " << cellI
154 <<
" to " << newCellI <<
endl;
164 newLiveSplitCells.insert(newCellI, splitPtr);
167 liveSplitCells = newLiveSplitCells;
212 otherSidePtr->
parent() = NULL;
214 splitPtr->
parent() = NULL;
220 splitPtr = parentPtr;
242 label cellI = iter.key();
244 label addedCellI = iter();
251 liveSplitCells_.find(cellI);
253 if (findCell == liveSplitCells_.end())
268 parentPtr->
master() = masterPtr;
269 parentPtr->
slave() = slavePtr;
273 if (liveSplitCells_.found(addedCellI))
276 <<
"problem addedCell:" << addedCellI
280 liveSplitCells_.insert(cellI, masterPtr);
281 liveSplitCells_.insert(addedCellI, slavePtr);
289 liveSplitCells_.erase(findCell);
297 parentPtr->
master() = masterPtr;
298 parentPtr->
slave() = slavePtr;
302 if (liveSplitCells_.found(addedCellI))
305 <<
"problem addedCell:" << addedCellI
309 liveSplitCells_.insert(cellI, masterPtr);
310 liveSplitCells_.insert(addedCellI, slavePtr);
316 Pout<<
"** After refinement: liveSplitCells_:" <<
endl;
332 faceRemover_.updateMesh(morphMap);
347 <<
"Only call if constructed with unrefinement capability"
360 <<
"Live split cell without parent" <<
endl
372 liveSplitCells_.found(slavePtr->
cellLabel())
392 liveSplitFaces.
append(commonFaceI);
397 return liveSplitFaces.
shrink();
408 <<
"Only call if constructed with unrefinement capability"
412 Map<label> addedCells(liveSplitCells_.size());
421 <<
"Live split cell without parent" <<
endl
433 liveSplitCells_.found(slavePtr->
cellLabel())
456 <<
"Only call if constructed with unrefinement capability"
466 faceRemover().compatibleRemoves
474 if (facesToRemove.
size() != splitFaces.
size())
476 Pout<<
"cellRegion:" << cellRegion <<
endl;
477 Pout<<
"cellRegionMaster:" << cellRegionMaster <<
endl;
480 <<
"Faces to remove:" << splitFaces <<
endl
481 <<
"to be removed:" << facesToRemove
488 forAll(facesToRemove, facesToRemoveI)
490 label faceI = facesToRemove[facesToRemoveI];
492 if (!
mesh().isInternalFace(faceI))
495 <<
"Trying to remove face that is not internal"
509 (ownFind == liveSplitCells_.end())
510 || (nbrFind == liveSplitCells_.end())
530 Pout<<
"Updating for removed splitFace " << faceI
531 <<
" own:" << own <<
" nbr:" << nbr
539 <<
"No parent for owner " << ownPtr->
cellLabel()
546 <<
"No parent for neighbour " << nbrPtr->
cellLabel()
550 if (parentPtr != nbrPtr->
parent())
553 <<
"Owner and neighbour liveSplitCell entries do not have"
554 <<
" same parent. faceI:" << faceI <<
" owner:" << own
555 <<
" ownparent:" << parentPtr->
cellLabel()
556 <<
" neighbour:" << nbr
570 <<
"Owner and neighbour liveSplitCell entries are"
571 <<
" refined themselves or the parent is not refined"
574 <<
" neighbour unrefined:" << nbrPtr->
isUnrefined()
575 <<
" master unrefined:" << parentPtr->
isUnrefined()
580 liveSplitCells_.erase(ownFind);
583 liveSplitCells_.erase(liveSplitCells_.find(nbr));
603 liveSplitCells_.insert(own, parentPtr);
616 faceRemover().setRefinement
624 return facesToRemove;
void updateMesh(const mapPolyMesh &morphMap)
Update stored refinement pattern for changes to mesh. Only.
labelList getSplitFaces() const
Calculate split faces from current liveCells. Only.
Map< splitCell * > liveSplitCells_
Current split cells which are 'visible'. Only set if undoable.
A class for handling words, derived from string.
~undoableMeshCutter()
Destructor.
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
An STL-conforming iterator.
#define forAll(list, i)
Loop across all elements in list.
splitCell * slave() const
labelList removeSplitFaces(const labelList &splitFaces, polyTopoChange &)
Remove some refinement. Needs to be supplied subset of.
bool isUnrefined() const
Check if this is unrefined (i.e. has no master or slave)
Direct mesh changes based on v1.3 polyTopoChange syntax.
splitCell * parent() const
A HashTable to objects of type <T> with a label key.
Unit conversion functions.
static void updateLabels(const labelList &map, Map< splitCell * > &)
Update labels on splitCell structure after morphing.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Map< label > getAddedCells() const
Like getSplitFaces but returns map from original to added cell.
void updateMesh(const mapPolyMesh &)
Force recalculation of locally stored data on topological change.
Mesh consisting of general polyhedral cells.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
void printCellRefTree(Ostream &os, const word &, const splitCell *) const
Debug print.
splitCell * getOther() const
Returns other half of split cell. I.e. slave if this is master.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
virtual const labelList & faceOwner() const
Return face owner.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & shrink()
Shrink the allocated space to the number of elements used.
undoableMeshCutter(const undoableMeshCutter &)
Disallow default bitwise copy construct.
errorManip< error > abort(error &err)
Ostream & indent(Ostream &os)
Indent stream.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
void printRefTree(Ostream &os) const
Debug print.
const labelList & reverseCellMap() const
Reverse cell map.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Description of cell after splitting. Contains cellLabel and pointers to cells it it split in....
prefixOSstream Pout(cout, "Pout")
void setRefinement(const cellCuts &cuts, polyTopoChange &meshMod)
Do actual cutting with cut description. Inserts mesh changes.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
void size(const label)
Override size to be inconsistent with allocated storage.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
void setRefinement(const cellCuts &cuts, polyTopoChange &)
Refine cells acc. to cellCuts. Plays topology changes.
splitCell * master() const
defineTypeNameAndDebug(combustionModel, 0)
bool isMaster() const
Check if this is master cell of split.
virtual const labelList & faceNeighbour() const
Return face neighbour.
Description of cuts across cells.
scalar degToRad(const scalar deg)
Conversion from degrees to radians.
dimensionedScalar cos(const dimensionedScalar &ds)