OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

hexRef8 Class Reference

Refinement of (split) hexes using polyTopoChange. More...

Collaboration diagram for hexRef8:

List of all members.


Public Member Functions

 ClassName ("hexRef8")
 Runtime type information.
 hexRef8 (const polyMesh &mesh)
 Construct from mesh, read_if_present refinement data.
 hexRef8 (const polyMesh &mesh, const labelList &cellLevel, const labelList &pointLevel, const refinementHistory &history)
 Construct from mesh and un/refinement data.
 hexRef8 (const polyMesh &mesh, const labelList &cellLevel, const labelList &pointLevel)
 Construct from mesh and refinement data.
const labelIOList & cellLevel () const
const labelIOList & pointLevel () const
const refinementHistory & history () const
scalar level0EdgeLength () const
 Typical edge length between unrefined points.
label getAnchorLevel (const label faceI) const
 Gets level such that the face has four points <= level.
labelList consistentRefinement (const labelList &cellsToRefine, const bool maxSet) const
 Given valid mesh and current cell level and proposed.
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.
labelListList setRefinement (const labelList &cells, polyTopoChange &)
 Insert refinement. All selected cells will be split into 8.
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.
void subset (const labelList &pointMap, const labelList &faceMap, const labelList &cellMap)
 Update local numbering for subsetted mesh.
void distribute (const mapDistributePolyMesh &)
 Update local numbering for mesh redistribution.
void checkMesh () const
 Debug: Check coupled mesh for correctness.
void checkRefinementLevels (const label maxPointDiff, const labelList &pointsToCheck) const
 Debug: Check 2:1 consistency across faces.
labelList getSplitPoints () const
 Return the points at the centre of top-level split cells.
labelList consistentUnrefinement (const labelList &pointsToUnrefine, const bool maxSet) const
 Given proposed.
void setUnrefinement (const labelList &splitPointLabels, polyTopoChange &)
 Remove some refinement. Needs to be supplied output of.
void setInstance (const fileName &inst)
bool write () const
 Force writing refinement+history to polyMesh directory.

Detailed Description

Refinement of (split) hexes using polyTopoChange.

Source files

Definition at line 58 of file hexRef8.H.


Constructor & Destructor Documentation

hexRef8 ( const polyMesh &  mesh  ) 

Construct from mesh, read_if_present refinement data.

(from write below)

Definition at line 1736 of file hexRef8.C.

hexRef8 ( const polyMesh &  mesh,
const labelList &  cellLevel,
const labelList &  pointLevel,
const refinementHistory &  history 
)

Construct from mesh and un/refinement data.

Definition at line 1829 of file hexRef8.C.

References hexRef8::checkMesh().

Here is the call graph for this function:

hexRef8 ( const polyMesh &  mesh,
const labelList &  cellLevel,
const labelList &  pointLevel 
)

Construct from mesh and refinement data.

Definition at line 1926 of file hexRef8.C.

References hexRef8::checkMesh().

Here is the call graph for this function:


Member Function Documentation

ClassName ( "hexRef8"   ) 

Runtime type information.

const labelIOList& cellLevel (  )  const [inline]

Definition at line 354 of file hexRef8.H.

const labelIOList& pointLevel (  )  const [inline]

Definition at line 359 of file hexRef8.H.

const refinementHistory& history (  )  const [inline]

Definition at line 364 of file hexRef8.H.

scalar level0EdgeLength (  )  const [inline]

Typical edge length between unrefined points.

Definition at line 370 of file hexRef8.H.

Foam::label getAnchorLevel ( const label  faceI  )  const

Gets level such that the face has four points <= level.

Definition at line 778 of file hexRef8.C.

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 2011 of file hexRef8.C.

References hexRef8::checkMesh().

Here is the call graph for this function:

Foam::labelList consistentSlowRefinement ( const label  maxFaceDiff,
const labelList &  cellsToRefine,
const labelList &  facesToCheck,
const label  maxPointDiff,
const labelList &  pointsToCheck 
) const

Like consistentRefinement but slower:.

  • specify number of cells between consecutive refinement levels (consistentRefinement equivalent to 1)
  • specify max level difference between point-connected cells. (-1 to disable) Note that with normal 2:1 limitation (maxFaceDiff=1) there can be 8:1 size difference across point connected cells so maxPointDiff allows you to make that less. cellsToRefine : cells we're thinking about refining. It will extend this set. All refinement levels will be at least maxFaceDiff layers thick. facesToCheck : additional faces where to implement the maxFaceDiff thickness (usually only boundary faces)

Definition at line 2086 of file hexRef8.C.

References Foam::abort(), polyMesh::boundaryMesh(), primitiveMesh::cells(), refinementData::count(), Foam::endl(), Foam::exit(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), Foam::FatalError, FatalErrorIn, Foam::findIndices(), forAll, forAllConstIter, polyMesh::globalData(), primitiveMesh::isInternalFace(), refinementData::isRefined(), FaceCellWave< Type >::iterate(), Foam::mag(), Foam::max(), IOobject::name(), primitiveMesh::nCells(), primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), Foam::nl, primitiveMesh::nPoints(), globalMeshData::nTotalFaces(), primitiveMesh::pointCells(), Foam::Pout, Foam::reduce(), refinementData::refinementCount(), FaceCellWave< Type >::setFaceInfo(), syncTools::swapBoundaryFaceList(), syncTools::syncPointList(), refinementData::updateFace(), and polyBoundaryMesh::whichPatch().

Here is the call graph for this function:

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 2579 of file hexRef8.C.

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 3005 of file hexRef8.C.

void updateMesh ( const mapPolyMesh &  map  ) 

Update local numbering for changed mesh.

Definition at line 4060 of file hexRef8.C.

void storeData ( const labelList &  pointsToStore,
const labelList &  facesToStore,
const labelList &  cellsToStore 
)

Signal points/face/cells for which to store data.

Definition at line 4035 of file hexRef8.C.

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 4072 of file hexRef8.C.

void subset ( const labelList &  pointMap,
const labelList &  faceMap,
const labelList &  cellMap 
)

Update local numbering for subsetted mesh.

Gets new-to-old maps. Not compatible with unrefinement.

Definition at line 4259 of file hexRef8.C.

void distribute ( const mapDistributePolyMesh &  map  ) 

Update local numbering for mesh redistribution.

Definition at line 4342 of file hexRef8.C.

void checkMesh (  )  const

Debug: Check coupled mesh for correctness.

Definition at line 4367 of file hexRef8.C.

References refinementHistory::distribute().

Referenced by hexRef8::consistentRefinement(), and hexRef8::hexRef8().

Here is the call graph for this function:

Here is the caller graph for this function:

void checkRefinementLevels ( const label  maxPointDiff,
const labelList &  pointsToCheck 
) const

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) { FatalErrorIn ( "hexRef8::checkRefinementLevels(const label)" ) << "Detected a point used by two edges only (hanging point)" << nl << "This is not allowed" << abort(FatalError); } }

Definition at line 4577 of file hexRef8.C.

References Foam::endl(), and Foam::Pout.

Referenced by hexRef8::getSplitPoints().

Here is the call graph for this function:

Here is the caller graph for this function:

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 5054 of file hexRef8.C.

References Foam::abort(), Foam::endl(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), Foam::FatalError, FatalErrorIn, forAll, primitiveMesh::nCells(), primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), primitiveMesh::nPoints(), primitiveMesh::pointCells(), Foam::Pout, Foam::reduce(), and syncTools::swapBoundaryFaceList().

Here is the call graph for this function:

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.

void setInstance ( const fileName &  inst  ) 

Definition at line 1719 of file hexRef8.C.

bool write (  )  const

Force writing refinement+history to polyMesh directory.

Definition at line 5480 of file hexRef8.C.


The documentation for this class was generated from the following files:
  • src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.H
  • src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.C
Copyright © 2000-2009 OpenCFD Ltd