FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

refinementHistory Class Reference

All refinement history. Used in unrefinement. More...

#include <dynamicMesh/refinementHistory.H>


Detailed Description

All refinement history. Used in unrefinement.

- visibleCells: valid for the current mesh and contains per cell -1 (cell unrefined) or an index into splitCells_.

  • splitCells: for every split contains the parent (also index into splitCells) and optionally a subsplit as 8 indices into splitCells. Note that the numbers in splitCells are not cell labels, they are purely indices into splitCells.

E.g. 2 cells, cell 1 gets refined so end up with 9 cells:

// splitCells
9
(
-1 (1 2 3 4 5 6 7 8)
0 0()
0 0()
0 0()
0 0()
0 0()
0 0()
0 0()
0 0()
)

// visibleCells
9(-1 1 2 3 4 5 6 7 8)

So cell0 (visibleCells=-1) is unrefined. Cells 1-8 have all valid splitCells entries which are:

  • parent:0
  • subsplits:0()

The parent 0 refers back to the splitcell entries.

Source files

Definition at line 94 of file refinementHistory.H.

Inheritance diagram for refinementHistory:
Collaboration diagram for refinementHistory:

List of all members.

Classes

class  splitCell8

Public Member Functions

 refinementHistory (const IOobject &)
 Construct (read) given an IOobject.
 refinementHistory (const IOobject &, const List< splitCell8 > &splitCells, const labelList &visibleCells)
 Construct (read) or construct null.
 refinementHistory (const IOobject &, const label nCells)
 Construct (read) or construct from initial number of cells.
 refinementHistory (const IOobject &, const refinementHistory &)
 Construct as copy.
 refinementHistory (const IOobject &, Istream &)
 Construct from Istream.
const labelList &  visibleCells () const
 Per cell in the current mesh (i.e. visible) either -1 (unrefined)
const DynamicList< splitCell8 > &  splitCells () const
 Storage for splitCell8s.
const DynamicList< label > &  freeSplitCells () const
 Cache of unused indices in splitCells.
bool  active () const
 Is there unrefinement history. Note that this will fall over if.
label  parentIndex (const label cellI) const
 Get parent of cell.
void  storeSplit (const label cellI, const labelList &addedCells)
 Store splitting of cell into 8.
void  combineCells (const label masterCellI, const labelList &combinedCells)
 Store combining 8 cells into master.
void  updateMesh (const mapPolyMesh &)
 Update numbering for mesh changes.
void  subset (const labelList &pointMap, const labelList &faceMap, const labelList &cellMap)
 Update numbering for subsetting.
void  distribute (const mapDistributePolyMesh &)
 Update local numbering for mesh redistribution.
void  compact ()
 Compact splitCells_. Removes all freeSplitCells_ elements.
void  resize (const label nCells)
 Extend/shrink storage. additional visibleCells_ elements get.
void  writeDebug () const
 Debug write.
virtual bool  readData (Istream &)
 ReadData function required for regIOobject read operation.
virtual bool  writeData (Ostream &) const
 WriteData function required for regIOobject write operation.

Friends

Istream &  operator>> (Istream &, refinementHistory &)
Ostream &  operator<< (Ostream &, const refinementHistory &)

Constructor & Destructor Documentation

refinementHistory ( const IOobject &   io,
const List< splitCell8 > &   splitCells,
const labelList &   visibleCells  
)

Construct (read) or construct null.

Read or construct.

Definition at line 357 of file refinementHistory.C.

References Foam::endl(), IOobject::MUST_READ, Foam::Pout, IOobject::READ_IF_PRESENT, and IOobject::readOpt().

refinementHistory ( const IOobject &   io,
const label   nCells  
)

Construct (read) or construct from initial number of cells.

(all visible)

Definition at line 394 of file refinementHistory.C.

References Foam::endl(), IOobject::MUST_READ, Foam::Pout, IOobject::READ_IF_PRESENT, and IOobject::readOpt().

refinementHistory ( const IOobject &   io,
const refinementHistory &   rh  
)

Construct as copy.

Definition at line 439 of file refinementHistory.C.

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

refinementHistory ( const IOobject &   io,
Istream &   is  
)

Construct from Istream.

Definition at line 458 of file refinementHistory.C.

References Foam::endl(), Foam::Pout, and List< T >::size().


Member Function Documentation

const labelList& visibleCells (  ) const [inline]

Per cell in the current mesh (i.e. visible) either -1 (unrefined)

or an index into splitCells.

Definition at line 262 of file refinementHistory.H.

Referenced by hexRef8::hexRef8().

const DynamicList<splitCell8>& splitCells (  ) const [inline]

Storage for splitCell8s.

Definition at line 268 of file refinementHistory.H.

const DynamicList<label>& freeSplitCells (  ) const [inline]

Cache of unused indices in splitCells.

Definition at line 274 of file refinementHistory.H.

bool active (  ) const [inline]

Is there unrefinement history. Note that this will fall over if.

there are 0 cells in the mesh. But this gives problems with lots of other programs anyway.

Definition at line 282 of file refinementHistory.H.

References List< T >::size().

Referenced by hexRef8::hexRef8().

label parentIndex ( const label   cellI  ) const [inline]

Get parent of cell.

Definition at line 288 of file refinementHistory.H.

References Foam::abort(), Foam::FatalError, and FatalErrorIn.

void storeSplit ( const label   cellI,
const labelList &   addedCells  
)

Store splitting of cell into 8.

Definition at line 1063 of file refinementHistory.C.

References forAll.

void combineCells ( const label   masterCellI,
const labelList &   combinedCells  
)

Store combining 8 cells into master.

Definition at line 1101 of file refinementHistory.C.

References refinementHistory::splitCell8::addedCellsPtr_, forAll, and autoPtr< T >::reset().

void updateMesh ( const mapPolyMesh &   map  )
void subset ( const labelList &   pointMap,
const labelList &   faceMap,
const labelList &   cellMap  
)

Update numbering for subsetting.

Definition at line 550 of file refinementHistory.C.

References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorIn, forAll, Foam::Pout, and List< T >::size().

void compact (  )
void resize ( const label   nCells  )

Extend/shrink storage. additional visibleCells_ elements get.

set to -1.

Definition at line 481 of file refinementHistory.C.

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

void writeDebug (  ) const

Debug write.

Definition at line 1056 of file refinementHistory.C.

bool readData ( Istream &   is  ) [virtual]

ReadData function required for regIOobject read operation.

Reimplemented from regIOobject.

Definition at line 1124 of file refinementHistory.C.

References IOstream::bad().

bool writeData ( Ostream &   os  ) const [virtual]

WriteData function required for regIOobject write operation.

Implements regIOobject.

Definition at line 1131 of file refinementHistory.C.

References IOstream::good().


Friends And Related Function Documentation

Istream& operator>> ( Istream &   ,
refinementHistory &    
) [friend]
Ostream& operator<< ( Ostream &   ,
const refinementHistory &    
) [friend]

The documentation for this class was generated from the following files: