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... | |
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 | updateMesh (const mapPolyMesh &) |
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 | updateMesh (const mapPolyMesh &, 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 mapDistributePolyMesh &) |
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 |
Force writing refinement+history to polyMesh directory. More... | |
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... | |
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 | updateMesh (const mapPolyMesh &) |
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 | updateMesh (const mapPolyMesh &, 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 mapDistributePolyMesh &) |
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 |
Force writing refinement+history to polyMesh directory. More... | |
Private Member Functions | |
void | getFaceInfo (const label faceI, label &patchID, label &zoneID, label &zoneFlip) const |
Get patch and zone info. More... | |
label | addFace (polyTopoChange &meshMod, const label faceI, const face &newFace, const label own, const label nei) const |
Adds a face on top of existing faceI. Reverses if necessary. More... | |
label | addInternalFace (polyTopoChange &meshMod, const label meshFaceI, const label meshPointI, const face &newFace, const label own, const label nei) const |
Adds internal face from point. No checks on reversal. More... | |
void | modFace (polyTopoChange &meshMod, const label faceI, const face &newFace, const label own, const label nei) const |
Modifies existing faceI for either new owner/neighbour or new face. More... | |
scalar | getLevel0EdgeLength () const |
label | getAnchorCell (const labelListList &cellAnchorPoints, const labelListList &cellAddedCells, const label cellI, const label faceI, const label pointI) const |
Get cell added to point of cellI (if any) More... | |
void | getFaceNeighbours (const labelListList &cellAnchorPoints, const labelListList &cellAddedCells, const label faceI, const label pointI, label &own, label &nei) const |
Get new owner and neighbour (in unspecified order) of pointI. More... | |
label | findMinLevel (const labelList &f) const |
Get index of minimum pointlevel. More... | |
label | findMaxLevel (const labelList &f) const |
Get maximum pointlevel. More... | |
label | countAnchors (const labelList &, const label) const |
Count number of vertices <= anchorLevel. More... | |
void | dumpCell (const label cellI) const |
Debugging: dump cell as .obj file. More... | |
label | findLevel (const label faceI, const face &f, const label startFp, const bool searchForward, const label wantedLevel) const |
Find index of point with wantedLevel, starting from fp. More... | |
void | insertEdgeSplit (const labelList &edgeMidPoint, const label p0, const label p1, DynamicList< label > &verts) const |
If p0 and p1 are existing vertices check if edge is split and insert. More... | |
label | storeMidPointInfo (const labelListList &cellAnchorPoints, const labelListList &cellAddedCells, const labelList &cellMidPoint, const labelList &edgeMidPoint, const label cellI, const label faceI, const bool faceOrder, const label midPointI, const label anchorPointI, const label faceMidPointI, Map< edge > &midPointToAnchors, Map< edge > &midPointToFaceMids, polyTopoChange &meshMod) const |
Store in maps correspondence from midpoint to anchors and faces. More... | |
void | createInternalFromSplitFace (const labelListList &cellAnchorPoints, const labelListList &cellAddedCells, const labelList &cellMidPoint, const labelList &faceMidPoint, const labelList &edgeMidPoint, const label cellI, const label faceI, Map< edge > &midPointToAnchors, Map< edge > &midPointToFaceMids, polyTopoChange &meshMod, label &nFacesAdded) const |
Create all internal faces from an unsplit face. More... | |
void | createInternalFaces (const labelListList &cellAnchorPoints, const labelListList &cellAddedCells, const labelList &cellMidPoint, const labelList &faceMidPoint, const labelList &faceAnchorLevel, const labelList &edgeMidPoint, const label cellI, polyTopoChange &meshMod) const |
Create all internal faces to split cellI into 8. More... | |
void | walkFaceToMid (const labelList &edgeMidPoint, const label cLevel, const label faceI, const label startFp, DynamicList< label > &faceVerts) const |
Store vertices from startFp upto face split point. More... | |
void | walkFaceFromMid (const labelList &edgeMidPoint, const label cLevel, const label faceI, const label startFp, DynamicList< label > &faceVerts) const |
Same as walkFaceToMid but now walk back. More... | |
label | faceConsistentRefinement (const bool maxSet, PackedBoolList &refineCell) const |
Updates refineCell so consistent 2:1 refinement. Returns local. More... | |
void | checkWantedRefinementLevels (const labelList &) const |
Check wanted refinement for 2:1 consistency. More... | |
void | collectLevelPoints (const labelList &f, const label level, DynamicList< label > &points) const |
Collect all points on face of certain level. More... | |
void | collectLevelPoints (const labelList &meshPoints, const labelList &f, const label level, DynamicList< label > &points) const |
Collect all points on face (in local numbering) of certain level. More... | |
bool | matchHexShape (const label cellI, const label cellLevel, DynamicList< face > &quads) const |
Collect all faces with four corner points and return true if. More... | |
hexRef8 (const hexRef8 &) | |
Disallow default bitwise copy construct. More... | |
void | operator= (const hexRef8 &) |
Disallow default bitwise assignment. More... | |
void | getFaceInfo (const label faceI, label &patchID, label &zoneID, label &zoneFlip) const |
Get patch and zone info. More... | |
label | addFace (polyTopoChange &meshMod, const label faceI, const face &newFace, const label own, const label nei) const |
Adds a face on top of existing faceI. Reverses if necessary. More... | |
label | addInternalFace (polyTopoChange &meshMod, const label meshFaceI, const label meshPointI, const face &newFace, const label own, const label nei) const |
Adds internal face from point. No checks on reversal. More... | |
void | modFace (polyTopoChange &meshMod, const label faceI, const face &newFace, const label own, const label nei) const |
Modifies existing faceI for either new owner/neighbour or new face. More... | |
scalar | getLevel0EdgeLength () const |
label | getAnchorCell (const labelListList &cellAnchorPoints, const labelListList &cellAddedCells, const label cellI, const label faceI, const label pointI) const |
Get cell added to point of cellI (if any) More... | |
void | getFaceNeighbours (const labelListList &cellAnchorPoints, const labelListList &cellAddedCells, const label faceI, const label pointI, label &own, label &nei) const |
Get new owner and neighbour (in unspecified order) of pointI. More... | |
label | findMinLevel (const labelList &f) const |
Get index of minimum pointlevel. More... | |
label | findMaxLevel (const labelList &f) const |
Get maximum pointlevel. More... | |
label | countAnchors (const labelList &, const label) const |
Count number of vertices <= anchorLevel. More... | |
void | dumpCell (const label cellI) const |
Debugging: dump cell as .obj file. More... | |
label | findLevel (const label faceI, const face &f, const label startFp, const bool searchForward, const label wantedLevel) const |
Find index of point with wantedLevel, starting from fp. More... | |
void | insertEdgeSplit (const labelList &edgeMidPoint, const label p0, const label p1, DynamicList< label > &verts) const |
If p0 and p1 are existing vertices check if edge is split and insert. More... | |
label | storeMidPointInfo (const labelListList &cellAnchorPoints, const labelListList &cellAddedCells, const labelList &cellMidPoint, const labelList &edgeMidPoint, const label cellI, const label faceI, const bool faceOrder, const label midPointI, const label anchorPointI, const label faceMidPointI, Map< edge > &midPointToAnchors, Map< edge > &midPointToFaceMids, polyTopoChange &meshMod) const |
Store in maps correspondence from midpoint to anchors and faces. More... | |
void | createInternalFromSplitFace (const labelListList &cellAnchorPoints, const labelListList &cellAddedCells, const labelList &cellMidPoint, const labelList &faceMidPoint, const labelList &edgeMidPoint, const label cellI, const label faceI, Map< edge > &midPointToAnchors, Map< edge > &midPointToFaceMids, polyTopoChange &meshMod, label &nFacesAdded) const |
Create all internal faces from an unsplit face. More... | |
void | createInternalFaces (const labelListList &cellAnchorPoints, const labelListList &cellAddedCells, const labelList &cellMidPoint, const labelList &faceMidPoint, const labelList &faceAnchorLevel, const labelList &edgeMidPoint, const label cellI, polyTopoChange &meshMod) const |
Create all internal faces to split cellI into 8. More... | |
void | walkFaceToMid (const labelList &edgeMidPoint, const label cLevel, const label faceI, const label startFp, DynamicList< label > &faceVerts) const |
Store vertices from startFp upto face split point. More... | |
void | walkFaceFromMid (const labelList &edgeMidPoint, const label cLevel, const label faceI, const label startFp, DynamicList< label > &faceVerts) const |
Same as walkFaceToMid but now walk back. More... | |
label | faceConsistentRefinement (const bool maxSet, PackedBoolList &refineCell) const |
Updates refineCell so consistent 2:1 refinement. Returns local. More... | |
void | checkWantedRefinementLevels (const labelList &) const |
Check wanted refinement for 2:1 consistency. More... | |
void | collectLevelPoints (const labelList &f, const label level, DynamicList< label > &points) const |
Collect all points on face of certain level. More... | |
void | collectLevelPoints (const labelList &meshPoints, const labelList &f, const label level, DynamicList< label > &points) const |
Collect all points on face (in local numbering) of certain level. More... | |
bool | matchHexShape (const label cellI, const label cellLevel, DynamicList< face > &quads) const |
Collect all faces with four corner points and return true if. More... | |
hexRef8 (const hexRef8 &) | |
Disallow default bitwise copy construct. More... | |
void | operator= (const hexRef8 &) |
Disallow default bitwise assignment. More... | |
Static Private Member Functions | |
static void | reorder (const labelList &map, const label len, const label null, labelList &elems) |
Reorder according to map. More... | |
static void | checkInternalOrientation (polyTopoChange &meshMod, const label cellI, const label faceI, const point &ownPt, const point &neiPt, const face &newFace) |
debug:check orientation of added internal face More... | |
static void | checkBoundaryOrientation (polyTopoChange &meshMod, const label cellI, const label faceI, const point &ownPt, const point &boundaryPt, const face &newFace) |
debug:check orientation of new boundary face More... | |
static void | reorder (const labelList &map, const label len, const label null, labelList &elems) |
Reorder according to map. More... | |
static void | checkInternalOrientation (polyTopoChange &meshMod, const label cellI, const label faceI, const point &ownPt, const point &neiPt, const face &newFace) |
debug:check orientation of added internal face More... | |
static void | checkBoundaryOrientation (polyTopoChange &meshMod, const label cellI, const label faceI, const point &ownPt, const point &boundaryPt, const face &newFace) |
debug:check orientation of new boundary face More... | |
Private Attributes | |
const polyMesh & | mesh_ |
Reference to underlying mesh. More... | |
labelIOList | cellLevel_ |
Per cell the refinement level. More... | |
labelIOList | pointLevel_ |
Per point the refinement level. More... | |
uniformDimensionedScalarField | level0Edge_ |
Typical edge length between unrefined points. More... | |
refinementHistory | history_ |
Refinement history. More... | |
removeFaces | faceRemover_ |
Face remover engine. More... | |
Map< label > | savedPointLevel_ |
Level of saved points. More... | |
Map< label > | savedCellLevel_ |
Level of saved cells. More... | |
autoPtr< cellShapeList > | cellShapesPtr_ |
Cell shapes when seen as split hexes. 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 1929 of file hexRef4.C.
References Foam::abort(), refinementHistory::active(), hexRef8::cellLevel_, hexRef8::checkMesh(), hexRef8::checkRefinementLevels(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, regIOobject::fileModificationChecking, IOobject::headerOk(), hexRef8::history_, hexRef8::mesh_, primitiveMesh::nCells(), primitiveMesh::nPoints(), IOobject::objectPath(), hexRef8::pointLevel_, refinementHistory::read(), IOobject::READ_IF_PRESENT, IOobject::readOpt(), List::size(), regIOobject::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 2048 of file hexRef4.C.
References Foam::abort(), Foam::polyMeshGenChecks::checkMesh(), Foam::endl(), Foam::FatalError, and FatalErrorInFunction.
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 2157 of file hexRef4.C.
References Foam::abort(), Foam::polyMeshGenChecks::checkMesh(), Foam::endl(), Foam::FatalError, and FatalErrorInFunction.
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
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
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
|
staticprivate |
Reorder according to map.
Definition at line 69 of file hexRef8.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, and List::transfer().
|
private |
Get patch and zone info.
Definition at line 98 of file hexRef8.C.
References faceZone::flipMap(), and faceZone::whichFace().
|
private |
Adds a face on top of existing faceI. Reverses if necessary.
Definition at line 127 of file hexRef8.C.
References face::reverseFace(), and polyTopoChange::setAction().
|
private |
Adds internal face from point. No checks on reversal.
Definition at line 192 of file hexRef8.C.
References polyTopoChange::setAction().
|
private |
Modifies existing faceI for either new owner/neighbour or new face.
points. Reverses if necessary.
Definition at line 288 of file hexRef4.C.
References face::reverseFace(), and polyTopoChange::setAction().
|
private |
Definition at line 351 of file hexRef4.C.
References Foam::abort(), primitiveMesh::cellEdges(), hexRef8::cellLevel_, Foam::e, primitiveMesh::edges(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::gMax(), Foam::labelMax, Foam::labelMin, Pstream::listCombineGather(), Pstream::listCombineScatter(), Foam::magSqr(), Foam::max(), hexRef8::mesh_, Foam::min(), primitiveMesh::nCells(), primitiveMesh::nEdges(), polyMesh::points(), Foam::Pout, List::size(), Foam::sqr(), Foam::sqrt(), and syncTools::syncEdgeList().
|
private |
Get cell added to point of cellI (if any)
Definition at line 536 of file hexRef4.C.
References Foam::abort(), Foam::endl(), f(), Foam::FatalError, FatalErrorInFunction, Foam::findIndex(), forAll, and Foam::Perr.
|
private |
|
private |
Get index of minimum pointlevel.
Definition at line 632 of file hexRef4.C.
References f(), forAll, and Foam::labelMax.
|
private |
Get maximum pointlevel.
Definition at line 653 of file hexRef4.C.
References f(), forAll, and Foam::labelMin.
|
private |
|
private |
Debugging: dump cell as .obj file.
Definition at line 692 of file hexRef4.C.
References Foam::endl(), f(), forAll, OFstream::name(), Foam::name(), Foam::nl, Foam::Pout, and Foam::meshTools::writeOBJ().
|
private |
Find index of point with wantedLevel, starting from fp.
Definition at line 734 of file hexRef4.C.
References Foam::abort(), f(), Foam::FatalError, FatalErrorInFunction, and forAll.
|
staticprivate |
debug:check orientation of added internal face
Definition at line 825 of file hexRef4.C.
References Foam::abort(), face::centre(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, Foam::identity(), n, face::normal(), polyTopoChange::points(), s(), and List::size().
|
staticprivate |
debug:check orientation of new boundary face
Definition at line 871 of file hexRef4.C.
References Foam::abort(), face::centre(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, Foam::identity(), Foam::magSqr(), n, face::normal(), polyTopoChange::points(), s(), List::size(), and WarningInFunction.
|
private |
If p0 and p1 are existing vertices check if edge is split and insert.
splitPoint.
Definition at line 920 of file hexRef4.C.
References DynamicList::append(), and Foam::meshTools::findEdge().
|
private |
Store in maps correspondence from midpoint to anchors and faces.
Definition at line 948 of file hexRef4.C.
References DynamicList::append(), Foam::e, face::flip(), edge::otherVertex(), and List::transfer().
|
private |
Create all internal faces from an unsplit face.
|
private |
Create all internal faces to split cellI into 8.
Definition at line 1178 of file hexRef4.C.
References Foam::abort(), f(), Foam::FatalError, FatalErrorInFunction, and forAll.
|
private |
Store vertices from startFp upto face split point.
Used when splitting face into 4.
Definition at line 1460 of file hexRef4.C.
References DynamicList::append(), and f().
|
private |
Same as walkFaceToMid but now walk back.
Definition at line 1509 of file hexRef4.C.
References DynamicList::append(), and f().
|
private |
Updates refineCell so consistent 2:1 refinement. Returns local.
number of cells changed.
Definition at line 1564 of file hexRef4.C.
References forAll, and syncTools::swapBoundaryFaceList().
|
private |
Check wanted refinement for 2:1 consistency.
Definition at line 1651 of file hexRef4.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::mag(), Foam::nl, and syncTools::swapBoundaryFaceList().
|
private |
|
private |
|
private |
Collect all faces with four corner points and return true if.
hex was matched (6 faces of each four corner points)
Definition at line 1786 of file hexRef4.C.
References DynamicList::append(), DynamicList::clear(), PrimitivePatch< Face, FaceList, PointField, PointType >::edgeLoops(), f(), Foam::findIndex(), forAll, forAllConstIter(), PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), pFaces, Foam::reverse(), List::size(), and List::transfer().
|
private |
Disallow default bitwise assignment.
ClassName | ( | "hexRef8" | ) |
Runtime type information.
|
inline |
Definition at line 384 of file hexRef4.H.
References hexRef8::mesh_.
|
inline |
Definition at line 389 of file hexRef4.H.
References hexRef8::cellLevel_.
Referenced by dynamicRefineFvMesh::dynamicRefineFvMesh(), autoRefineDriver::refinementInterfaceRefine(), and autoSnapDriver::smoothInternalDisplacement().
|
inline |
Definition at line 394 of file hexRef4.H.
References hexRef8::pointLevel_.
Referenced by dynamicRefineFvMesh::dynamicRefineFvMesh().
|
inline |
Definition at line 399 of file hexRef4.H.
References hexRef8::history_.
|
inline |
Typical edge length between unrefined points.
Definition at line 405 of file hexRef4.H.
References hexRef8::level0Edge_, and dimensioned::value().
Foam::label faceLevel | ( | const label | faceI | ) | const |
Gets level such that the face has four points <= level.
Definition at line 796 of file hexRef4.C.
References f(), and List::size().
Referenced by autoRefineDriver::refinementInterfaceRefine().
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 2258 of file hexRef4.C.
References Foam::endl(), forAll, Foam::Pout, and Foam::reduce().
Referenced by multiDirRefinement::refineHex8().
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 2333 of file hexRef4.C.
References Foam::abort(), DynamicList::append(), DynamicList::clear(), refinementData::count(), Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::findIndices(), forAll, forAllConstIter(), FaceCellWave< Type, TrackingData >::iterate(), Foam::labelMin, Foam::mag(), Foam::max(), Foam::nl, Foam::Pout, Foam::reduce(), DynamicList::setCapacity(), FaceCellWave< Type, TrackingData >::setFaceInfo(), DynamicList::shrink(), List::size(), syncTools::swapBoundaryFaceList(), syncTools::syncPointList(), and refinementData::updateFace().
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 2817 of file hexRef4.C.
References Foam::abort(), DynamicList::append(), Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::findIndices(), forAll, PackedList::get(), HashSet< Key, Hash >::insert(), Foam::nl, IOobject::objectPath(), Foam::Pout, FaceCellWave< Type, TrackingData >::propagationTol(), Foam::reduce(), DynamicList::shrink(), List::size(), HashTable::size(), 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!). Note: could make this inflate from point but that will allocate interpolation. -points added to split edge: added from edge start() -midpoints added: added from cellPoints[0].
Definition at line 3242 of file hexRef4.C.
References Foam::abort(), DynamicList::append(), Foam::polyMeshGenChecks::checkMesh(), Foam::e, Foam::endl(), f(), Foam::FatalError, FatalErrorInFunction, forAll, PackedList::get(), HashSet< Key, Hash >::insert(), Foam::labelMax, Foam::labelMin, Foam::max(), Foam::min(), OFstream::name(), Foam::nl, IOobject::objectPath(), Foam::Pout, PackedBoolList::set(), polyTopoChange::setAction(), List::setSize(), List::size(), HashTable::size(), syncTools::swapBoundaryFaceList(), syncTools::syncBoundaryFacePositions(), syncTools::syncEdgeList(), syncTools::syncEdgePositions(), syncTools::syncFaceList(), List::transfer(), PackedBoolList::unset(), regIOobject::write(), and Foam::meshTools::writeOBJ().
Referenced by multiDirRefinement::refineHex8().
void updateMesh | ( | const mapPolyMesh & | map | ) |
Update local numbering for changed mesh.
Definition at line 4287 of file hexRef4.C.
Referenced by multiDirRefinement::refineHex8().
void storeData | ( | const labelList & | pointsToStore, |
const labelList & | facesToStore, | ||
const labelList & | cellsToStore | ||
) |
Signal points/face/cells for which to store data.
Definition at line 4262 of file hexRef4.C.
References forAll, List::resize(), and List::size().
void updateMesh | ( | const mapPolyMesh & | 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 4299 of file hexRef4.C.
References Foam::abort(), mapPolyMesh::cellMap(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAll, forAllConstIter(), mapPolyMesh::nOldCells(), mapPolyMesh::nOldPoints(), mapPolyMesh::pointMap(), Foam::Pout, Foam::reorder(), mapPolyMesh::reverseCellMap(), mapPolyMesh::reversePointMap(), List::size(), and List::transfer().
Update local numbering for subsetted mesh.
Gets new-to-old maps. Not compatible with unrefinement.
Definition at line 4489 of file hexRef4.C.
References Foam::abort(), Foam::endl(), Foam::faceMap(), Foam::FatalError, FatalErrorInFunction, Foam::findIndex(), forAll, Foam::nl, Foam::Pout, List::size(), List::transfer(), and WarningInFunction.
void distribute | ( | const mapDistributePolyMesh & | map | ) |
Update local numbering for mesh redistribution.
Definition at line 4572 of file hexRef4.C.
References mapDistributePolyMesh::distributeCellData(), mapDistributePolyMesh::distributePointData(), Foam::endl(), and Foam::Pout.
void checkMesh | ( | ) | const |
Debug: Check coupled mesh for correctness.
Definition at line 4600 of file hexRef4.C.
References Foam::abort(), polyPatch::coupled(), Foam::e, Foam::endl(), f(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::mag(), patchIdentifier::name(), IOstream::name(), patches, Foam::Pout, List::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 4810 of file hexRef4.C.
References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::labelMax, Foam::labelMin, Foam::mag(), Foam::max(), Foam::nl, 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 5062 of file hexRef4.C.
References Foam::endl(), forAll, degenerateMatcher::match(), Foam::nl, Foam::Pout, and DynamicList::xfer().
Foam::labelList getSplitPoints | ( | ) | const |
Return the points at the centre of top-level split cells.
that can be unsplit.
Definition at line 5129 of file hexRef4.C.
References Foam::abort(), Foam::endl(), f(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::Pout, and List::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 5333 of file hexRef4.C.
References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAll, PackedList::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 5567 of file hexRef4.C.
References Foam::abort(), Foam::polyMeshGenChecks::checkMesh(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAll, HashSet< Key, Hash >::insert(), Foam::min(), Foam::nl, IOobject::objectPath(), pFaces, Foam::Pout, List::size(), HashTable::size(), HashTable::toc(), and regIOobject::write().
void setInstance | ( | const fileName & | inst | ) |
Definition at line 1733 of file hexRef4.C.
References Foam::endl(), and Foam::Pout.
bool write | ( | ) | const |
|
staticprivate |
Reorder according to map.
|
private |
Get patch and zone info.
|
private |
Adds a face on top of existing faceI. Reverses if necessary.
|
private |
Adds internal face from point. No checks on reversal.
|
private |
Modifies existing faceI for either new owner/neighbour or new face.
points. Reverses if necessary.
|
private |
|
private |
Get cell added to point of cellI (if any)
|
private |
Get new owner and neighbour (in unspecified order) of pointI.
on faceI.
Count number of vertices <= anchorLevel.
|
private |
Debugging: dump cell as .obj file.
|
private |
Find index of point with wantedLevel, starting from fp.
|
staticprivate |
debug:check orientation of added internal face
|
staticprivate |
debug:check orientation of new boundary face
|
private |
If p0 and p1 are existing vertices check if edge is split and insert.
splitPoint.
|
private |
Store in maps correspondence from midpoint to anchors and faces.
|
private |
Create all internal faces from an unsplit face.
|
private |
Create all internal faces to split cellI into 8.
|
private |
Store vertices from startFp upto face split point.
Used when splitting face into 4.
|
private |
Same as walkFaceToMid but now walk back.
|
private |
Updates refineCell so consistent 2:1 refinement. Returns local.
number of cells changed.
|
private |
Check wanted refinement for 2:1 consistency.
|
private |
Collect all points on face of certain level.
|
private |
Collect all points on face (in local numbering) of certain level.
|
private |
Collect all faces with four corner points and return true if.
hex was matched (6 faces of each four corner points)
|
private |
Disallow default bitwise assignment.
ClassName | ( | "hexRef8" | ) |
Runtime type information.
|
inline |
Definition at line 384 of file hexRef8.H.
References hexRef8::mesh_.
|
inline |
Definition at line 389 of file hexRef8.H.
References hexRef8::cellLevel_.
|
inline |
Definition at line 394 of file hexRef8.H.
References hexRef8::pointLevel_.
|
inline |
Definition at line 399 of file hexRef8.H.
References hexRef8::history_.
|
inline |
Typical edge length between unrefined points.
Definition at line 405 of file hexRef8.H.
References hexRef8::level0Edge_, and dimensioned::value().
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)
labelList consistentSlowRefinement | ( | const label | maxFaceDiff, |
const labelList & | cellsToRefine, | ||
const labelList & | facesToCheck, | ||
const label | maxPointDiff, | ||
const labelList & | pointsToCheck | ||
) | const |
Like consistentRefinement but slower:
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.
labelListList setRefinement | ( | const labelList & | cells, |
polyTopoChange & | |||
) |
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!). Note: could make this inflate from point but that will allocate interpolation. -points added to split edge: added from edge start() -midpoints added: added from cellPoints[0].
void updateMesh | ( | const mapPolyMesh & | ) |
Update local numbering for changed mesh.
void storeData | ( | const labelList & | pointsToStore, |
const labelList & | facesToStore, | ||
const labelList & | cellsToStore | ||
) |
Signal points/face/cells for which to store data.
void updateMesh | ( | const mapPolyMesh & | , |
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)
Update local numbering for subsetted mesh.
Gets new-to-old maps. Not compatible with unrefinement.
void distribute | ( | const mapDistributePolyMesh & | ) |
Update local numbering for mesh redistribution.
void checkMesh | ( | ) | const |
Debug: Check coupled mesh for correctness.
Debug: Check 2:1 consistency across faces.
maxPointDiff==-1 : only check 2:1 across faces maxPointDiff!=-1 : check point-connected cells.
const cellShapeList& cellShapes | ( | ) | const |
Utility: get hexes as cell shapes.
labelList getSplitPoints | ( | ) | const |
Return the points at the centre of top-level split cells.
that can be unsplit.
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)
void setUnrefinement | ( | const labelList & | splitPointLabels, |
polyTopoChange & | |||
) |
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.
void setInstance | ( | const fileName & | inst | ) |
bool write | ( | ) | const |
Force writing refinement+history to polyMesh directory.
|
private |
Reference to underlying mesh.
Definition at line 69 of file hexRef4.H.
Referenced by hexRef8::getLevel0EdgeLength(), hexRef8::hexRef8(), and hexRef8::mesh().
|
private |
Per cell the refinement level.
Definition at line 72 of file hexRef4.H.
Referenced by hexRef8::cellLevel(), hexRef8::getLevel0EdgeLength(), and hexRef8::hexRef8().
|
private |
Per point the refinement level.
Definition at line 75 of file hexRef4.H.
Referenced by hexRef8::hexRef8(), and hexRef8::pointLevel().
|
private |
Typical edge length between unrefined points.
Definition at line 78 of file hexRef4.H.
Referenced by hexRef8::level0EdgeLength().
|
private |
Refinement history.
Definition at line 81 of file hexRef4.H.
Referenced by hexRef8::hexRef8(), and hexRef8::history().
|
private |
|
mutableprivate |
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.