Refinement of (split) hexes using polyTopoChange. More...
Public Member Functions | |
ClassName ("hexRef8") | |
Runtime type information. More... | |
hexRef8 (const polyMesh &mesh, const bool readHistory=true) | |
Construct from mesh, read_if_present refinement data. More... | |
hexRef8 (const polyMesh &mesh, const labelList &cellLevel, const labelList &pointLevel, const refinementHistory &history, const scalar level0Edge=-great) | |
Construct from mesh and un/refinement data and optional size of. More... | |
hexRef8 (const polyMesh &mesh, const labelList &cellLevel, const labelList &pointLevel, const scalar level0Edge=-great) | |
Construct from mesh and refinement data and optional size of. More... | |
hexRef8 (const hexRef8 &)=delete | |
Disallow default bitwise copy construction. More... | |
const polyMesh & | mesh () const |
const labelIOList & | cellLevel () const |
const labelIOList & | pointLevel () const |
const refinementHistory & | history () const |
scalar | level0EdgeLength () const |
Typical edge length between unrefined points. More... | |
label | faceLevel (const label facei) const |
Gets level such that the face has four points <= level. More... | |
labelList | consistentRefinement (const labelList &cellsToRefine, const bool maxSet) const |
Given valid mesh and current cell level and proposed. More... | |
labelList | consistentSlowRefinement (const label maxFaceDiff, const labelList &cellsToRefine, const labelList &facesToCheck, const label maxPointDiff, const labelList &pointsToCheck) const |
Like consistentRefinement but slower: More... | |
labelList | consistentSlowRefinement2 (const label maxFaceDiff, const labelList &cellsToRefine, const labelList &facesToCheck) const |
Like consistentSlowRefinement but uses different meshWave. More... | |
labelListList | setRefinement (const labelList &cells, polyTopoChange &) |
Insert refinement. All selected cells will be split into 8. More... | |
void | topoChange (const polyTopoChangeMap &) |
Update local numbering for changed mesh. More... | |
void | storeData (const labelList &pointsToStore, const labelList &facesToStore, const labelList &cellsToStore) |
Signal points/face/cells for which to store data. More... | |
void | topoChange (const polyTopoChangeMap &, const Map< label > &pointsToRestore, const Map< label > &facesToRestore, const Map< label > &cellsToRestore) |
Update local numbering + undo. More... | |
void | subset (const labelList &pointMap, const labelList &faceMap, const labelList &cellMap) |
Update local numbering for subsetted mesh. More... | |
void | distribute (const polyDistributionMap &) |
Update local numbering for mesh redistribution. More... | |
void | checkMesh () const |
Debug: Check coupled mesh for correctness. More... | |
void | checkRefinementLevels (const label maxPointDiff, const labelList &pointsToCheck) const |
Debug: Check 2:1 consistency across faces. More... | |
const cellShapeList & | cellShapes () const |
Utility: get hexes as cell shapes. More... | |
labelList | getSplitPoints () const |
Return the points at the centre of top-level split cells. More... | |
labelList | consistentUnrefinement (const labelList &pointsToUnrefine, const bool maxSet) const |
Given proposed. More... | |
void | setUnrefinement (const labelList &splitPointLabels, polyTopoChange &) |
Remove some refinement. Needs to be supplied output of. More... | |
void | setInstance (const fileName &inst) |
bool | write (const bool write=true) const |
Force writing refinement+history to polyMesh directory. More... | |
void | operator= (const hexRef8 &)=delete |
Disallow default bitwise assignment. More... | |
Refinement of (split) hexes using polyTopoChange.
Construct from mesh, read_if_present refinement data.
(from write below). If readHistory is true does read_if_present of refinement history. If false clears all history
Definition at line 1789 of file hexRef8.C.
References Foam::abort(), refinementHistory::active(), hexRef8::checkMesh(), hexRef8::checkRefinementLevels(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, IOobject::fileModificationChecking, regIOobject::headerOk(), primitiveMesh::nCells(), primitiveMesh::nPoints(), regIOobject::objectPath(), refinementHistory::read(), IOobject::READ_IF_PRESENT, IOobject::readOpt(), List< T >::size(), IOobject::timeStamp, and refinementHistory::visibleCells().
hexRef8 | ( | const polyMesh & | mesh, |
const labelList & | cellLevel, | ||
const labelList & | pointLevel, | ||
const refinementHistory & | history, | ||
const scalar | level0Edge = -great |
||
) |
Construct from mesh and un/refinement data and optional size of.
starting cells
Definition at line 1907 of file hexRef8.C.
References Foam::abort(), refinementHistory::active(), hexRef8::checkMesh(), hexRef8::checkRefinementLevels(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, primitiveMesh::nCells(), primitiveMesh::nPoints(), List< T >::size(), and refinementHistory::visibleCells().
hexRef8 | ( | const polyMesh & | mesh, |
const labelList & | cellLevel, | ||
const labelList & | pointLevel, | ||
const scalar | level0Edge = -great |
||
) |
Construct from mesh and refinement data and optional size of.
starting cells
Definition at line 2014 of file hexRef8.C.
References Foam::abort(), hexRef8::checkMesh(), hexRef8::checkRefinementLevels(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, primitiveMesh::nCells(), and primitiveMesh::nPoints().
ClassName | ( | "hexRef8" | ) |
Runtime type information.
|
inline |
Definition at line 397 of file hexRef8.H.
Referenced by refiner::refiner().
|
inline |
Definition at line 402 of file hexRef8.H.
Referenced by refiner::refiner().
|
inline |
|
inline |
Typical edge length between unrefined points.
Definition at line 413 of file hexRef8.H.
References UniformDimensionedField< Type >::value().
Referenced by meshRefinement::meshRefinement().
Foam::label faceLevel | ( | const label | facei | ) | const |
Gets level such that the face has four points <= level.
Definition at line 675 of file hexRef8.C.
References f(), and List< T >::size().
Foam::labelList consistentRefinement | ( | const labelList & | cellsToRefine, |
const bool | maxSet | ||
) | const |
Given valid mesh and current cell level and proposed.
cells to refine calculate any clashes (due to 2:1) and return ok list of cells to refine. Either adds cells to refine to set (maxSet = true) or removes cells to refine (maxSet = false)
Definition at line 2114 of file hexRef8.C.
References Foam::endl(), forAll, Foam::Pout, and Foam::reduce().
Foam::labelList consistentSlowRefinement | ( | const label | maxFaceDiff, |
const labelList & | cellsToRefine, | ||
const labelList & | facesToCheck, | ||
const label | maxPointDiff, | ||
const labelList & | pointsToCheck | ||
) | const |
Like consistentRefinement but slower:
Definition at line 2183 of file hexRef8.C.
References Foam::abort(), DynamicList< T, SizeInc, SizeMult, SizeDiv >::append(), DynamicList< T, SizeInc, SizeMult, SizeDiv >::clear(), refinementData::count(), Foam::count(), Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::findIndices(), forAll, forAllConstIter, HashTable< T, Key, Hash >::insert(), FaceCellWave< Type, TrackingData >::iterate(), Foam::labelMin, UList< T >::last(), Foam::mag(), Foam::max(), Foam::nl, patchi, Foam::Pout, Foam::reduce(), DynamicList< T, SizeInc, SizeMult, SizeDiv >::setCapacity(), FaceCellWave< Type, TrackingData >::setFaceInfo(), DynamicList< T, SizeInc, SizeMult, SizeDiv >::shrink(), HashTable< T, Key, Hash >::size(), List< T >::size(), syncTools::swapBoundaryFaceList(), syncTools::syncPointList(), refinementData::updateFace(), and Foam::blendedInterfacialModel::valid().
Foam::labelList consistentSlowRefinement2 | ( | const label | maxFaceDiff, |
const labelList & | cellsToRefine, | ||
const labelList & | facesToCheck | ||
) | const |
Like consistentSlowRefinement but uses different meshWave.
(proper distance instead of toplogical count). No point checks yet.
Definition at line 2667 of file hexRef8.C.
References Foam::abort(), DynamicList< T, SizeInc, SizeMult, SizeDiv >::append(), Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::findIndices(), forAll, PackedList< nBits >::get(), HashSet< Key, Hash >::insert(), Foam::nl, regIOobject::objectPath(), Foam::Pout, FaceCellWave< Type, TrackingData >::propagationTol(), Foam::reduce(), DynamicList< T, SizeInc, SizeMult, SizeDiv >::shrink(), HashTable< T, Key, Hash >::size(), List< T >::size(), Foam::blendedInterfacialModel::valid(), and regIOobject::write().
Foam::labelListList setRefinement | ( | const labelList & | cells, |
polyTopoChange & | meshMod | ||
) |
Insert refinement. All selected cells will be split into 8.
Returns per element in cells the 8 cells they were split into. Guarantees that the 0th element is the original cell label. Mapping: -split cells: 7 new ones get added from original -split faces: original gets modified; 3 new ones get added from original -added internal faces: added from original cell face(if that was internal) or created out-of-nothing (so will not get mapped!). -points added to split edge: added from edge start() -midpoints added: added from cellPoints[0].
Definition at line 3089 of file hexRef8.C.
References Foam::abort(), polyTopoChange::addCell(), polyTopoChange::addPoint(), DynamicList< T, SizeInc, SizeMult, SizeDiv >::append(), Foam::meshCheck::checkMesh(), Foam::e, Foam::endl(), f(), Foam::FatalError, FatalErrorInFunction, forAll, PackedList< nBits >::get(), HashSet< Key, Hash >::insert(), Foam::labelMax, Foam::labelMin, Foam::max(), Foam::min(), OFstream::name(), Foam::nl, regIOobject::objectPath(), Foam::Pout, PackedBoolList::set(), List< T >::setSize(), HashTable< T, Key, Hash >::size(), List< T >::size(), syncTools::swapBoundaryFaceList(), syncTools::syncBoundaryFacePositions(), syncTools::syncEdgeList(), syncTools::syncEdgePositions(), syncTools::syncFaceList(), List< T >::transfer(), PackedBoolList::unset(), regIOobject::write(), and Foam::meshTools::writeOBJ().
void topoChange | ( | const polyTopoChangeMap & | map | ) |
void storeData | ( | const labelList & | pointsToStore, |
const labelList & | facesToStore, | ||
const labelList & | cellsToStore | ||
) |
Signal points/face/cells for which to store data.
Definition at line 4085 of file hexRef8.C.
References forAll, List< T >::resize(), and List< T >::size().
void topoChange | ( | const polyTopoChangeMap & | map, |
const Map< label > & | pointsToRestore, | ||
const Map< label > & | facesToRestore, | ||
const Map< label > & | cellsToRestore | ||
) |
Update local numbering + undo.
Data to restore given as new pointlabel + stored pointlabel (i.e. what was in pointsToStore)
Definition at line 4116 of file hexRef8.C.
References Foam::abort(), polyTopoChangeMap::cellMap(), HashTableCore::end(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, HashTable< T, Key, Hash >::find(), forAll, forAllConstIter, newPointi, polyTopoChangeMap::nOldCells(), polyTopoChangeMap::nOldPoints(), polyTopoChangeMap::pointMap(), Foam::Pout, Foam::reorder(), polyTopoChangeMap::reverseCellMap(), polyTopoChangeMap::reversePointMap(), List< T >::size(), and List< T >::transfer().
Update local numbering for subsetted mesh.
Gets new-to-old maps. Not compatible with unrefinement.
Definition at line 4274 of file hexRef8.C.
References Foam::abort(), Foam::endl(), Foam::faceMap(), Foam::FatalError, FatalErrorInFunction, Foam::findIndex(), forAll, newPointi, Foam::nl, Foam::Pout, List< T >::size(), List< T >::transfer(), and WarningInFunction.
void distribute | ( | const polyDistributionMap & | map | ) |
Update local numbering for mesh redistribution.
Definition at line 4357 of file hexRef8.C.
References polyDistributionMap::distributeCellData(), polyDistributionMap::distributePointData(), Foam::endl(), and Foam::Pout.
void checkMesh | ( | ) | const |
Debug: Check coupled mesh for correctness.
Definition at line 4386 of file hexRef8.C.
References Foam::abort(), polyPatch::coupled(), Foam::e, Foam::endl(), f(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::mag(), patchIdentifier::name(), patches, patchi, Foam::Pout, UList< T >::size(), List< T >::size(), polyPatch::start(), and syncTools::swapBoundaryFaceList().
Referenced by hexRef8::hexRef8().
Debug: Check 2:1 consistency across faces.
maxPointDiff==-1 : only check 2:1 across faces maxPointDiff!=-1 : check point-connected cells.
Gives problems after first splitting off inside mesher.
// Hanging points { Any patches with points having only two edges.
boolList isHangingPoint(mesh_.nPoints(), false);
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
forAll(patches, patchi) { const polyPatch& pp = patches[patchi];
const labelList& meshPoints = pp.meshPoints();
forAll(meshPoints, i) { label pointi = meshPoints[i];
const labelList& pEdges = mesh_.pointEdges()[pointi];
if (pEdges.size() == 2) { isHangingPoint[pointi] = true; } } }
syncTools::syncPointList ( mesh_, isHangingPoint, andEqOp<bool>(), // only if all decide it is hanging point true, // null false // no separation );
OFstream str(mesh_.time().path()/"hangingPoints.obj");
label nHanging = 0;
forAll(isHangingPoint, pointi) { if (isHangingPoint[pointi]) { nHanging++;
Pout<< "Hanging boundary point " << pointi << " at " << mesh_.points()[pointi] << endl; meshTools::writeOBJ(str, mesh_.points()[pointi]); } }
if (returnReduce(nHanging, sumOp<label>()) > 0) { FatalErrorInFunction << "Detected a point used by two edges only (hanging point)" << nl << "This is not allowed" << abort(FatalError); } }
Definition at line 4595 of file hexRef8.C.
References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::labelMax, Foam::labelMin, Foam::mag(), Foam::max(), Foam::nl, patchi, Foam::Pout, syncTools::swapBoundaryFaceList(), and syncTools::syncPointList().
Referenced by hexRef8::hexRef8().
const Foam::cellShapeList & cellShapes | ( | ) | const |
Utility: get hexes as cell shapes.
Definition at line 4848 of file hexRef8.C.
References Foam::endl(), forAll, Foam::nl, and Foam::Pout.
Foam::labelList getSplitPoints | ( | ) | const |
Return the points at the centre of top-level split cells.
that can be unsplit.
Definition at line 4908 of file hexRef8.C.
References Foam::abort(), Foam::endl(), f(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::Pout, and List< T >::size().
Foam::labelList consistentUnrefinement | ( | const labelList & | pointsToUnrefine, |
const bool | maxSet | ||
) | const |
Given proposed.
splitPoints to unrefine according to calculate any clashes (due to 2:1) and return ok list of points to unrefine. Either adds points to refine to set (maxSet = true) or removes points to refine (maxSet = false)
Definition at line 5049 of file hexRef8.C.
References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAll, PackedList< nBits >::get(), Foam::Pout, Foam::reduce(), PackedBoolList::set(), syncTools::swapBoundaryFaceList(), and PackedBoolList::unset().
void setUnrefinement | ( | const labelList & | splitPointLabels, |
polyTopoChange & | meshMod | ||
) |
Remove some refinement. Needs to be supplied output of.
consistentUnrefinement. Only call if undoable set. All 8 pointCells of a split point will be combined into the lowest numbered cell of those 8.
Definition at line 5283 of file hexRef8.C.
References Foam::abort(), Foam::meshCheck::checkMesh(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAll, HashSet< Key, Hash >::insert(), Foam::min(), Foam::nl, regIOobject::objectPath(), pFaces, Foam::Pout, HashTable< T, Key, Hash >::size(), List< T >::size(), HashTable< T, Key, Hash >::toc(), and regIOobject::write().
void setInstance | ( | const fileName & | inst | ) |
Definition at line 1595 of file hexRef8.C.
References Foam::endl(), and Foam::Pout.
bool write | ( | const bool | write = true | ) | const |
Force writing refinement+history to polyMesh directory.
Definition at line 5472 of file hexRef8.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and Foam::vtkWriteOps::write().
Referenced by refiner::write().
|
delete |
Disallow default bitwise assignment.