FreeFOAM The Cross-Platform CFD Toolkit
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 labelListvisibleCells () 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.
- Public Member Functions inherited from regIOobject
 TypeName ("regIOobject")
 Runtime type information.
 regIOobject (const IOobject &, const bool isTime=false)
 Construct from IOobject. Optional flag for if IOobject is the.
 regIOobject (const regIOobject &)
 Construct as copy.
 regIOobject (const regIOobject &, bool registerCopy)
 Construct as copy, and transferring registry registration to copy.
virtual ~regIOobject ()
bool checkIn ()
 Add object to registry.
bool checkOut ()
 Remove object from registry.
bool ownedByRegistry () const
 Is this object owned by the registry?
void store ()
 Transfer ownership of this object to its registry.
void release ()
 Release ownership of this object from its registry.
label eventNo () const
 Event number at last update.
label & eventNo ()
 Event number at last update.
bool upToDate (const word &) const
 Am I uptodate with respect to other regIOobjects.
bool upToDate (const word &, const word &) const
bool upToDate (const word &, const word &, const word &) const
bool upToDate (const word &, const word &, const word &, const word &) const
void setUpToDate ()
 Flag me as up to date.
virtual void rename (const word &newName)
 Rename.
IstreamreadStream (const word &)
 Return Istream and check object type against that given.
void close ()
 Close Istream.
virtual bool read ()
 Read object.
virtual bool modified () const
 Return true if the object's file has been modified.
virtual bool readIfModified ()
 Read object if modified.
virtual bool writeObject (IOstream::streamFormat, IOstream::versionNumber, IOstream::compressionType) const
 Write using given format, version and compression.
virtual bool write () const
 Write using setting from DB.
void operator= (const IOobject &)
- Public Member Functions inherited from IOobject
 TypeName ("IOobject")
 Runtime type information.
 IOobject (const word &name, const fileName &instance, const objectRegistry &registry, readOption r=NO_READ, writeOption w=NO_WRITE, bool registerObject=true)
 Construct from name, instance, registry, io options.
 IOobject (const word &name, const fileName &instance, const fileName &local, const objectRegistry &registry, readOption r=NO_READ, writeOption w=NO_WRITE, bool registerObject=true)
 Construct from name, instance, local, registry, io options.
 IOobject (const fileName &path, const objectRegistry &registry, readOption r=NO_READ, writeOption w=NO_WRITE, bool registerObject=true)
 Construct from path, registry, io options.
Foam::autoPtr< IOobjectclone () const
 Clone.
virtual ~IOobject ()
const Timetime () const
 Return time.
const objectRegistrydb () const
 Return the local objectRegistry.
const wordname () const
 Return name.
const wordheaderClassName () const
 Return name of the class name read from header.
stringnote ()
 Return non-constant access to the optional note.
const stringnote () const
 Return the optional note.
bool registerObject () const
 Register object created from this IOobject with registry if true.
readOption readOpt () const
readOptionreadOpt ()
writeOption writeOpt () const
writeOptionwriteOpt ()
const fileNamerootPath () const
const fileNamecaseName () const
const fileNameinstance () const
fileNameinstance ()
const fileNamelocal () const
fileName path () const
 Return complete path.
fileName path (const word &instance, const fileName &local="") const
 Return complete path with alternative instance and local.
fileName objectPath () const
 Return complete path + object name.
fileName filePath () const
 Return complete path + object name if the file exists.
bool readHeader (Istream &)
 Read header.
bool headerOk ()
 Read and check header info.
bool writeHeader (Ostream &) const
 Write header.
bool good () const
bool bad () const
InfoProxy< IOobjectinfo () const
 Return info proxy.

Friends

Istreamoperator>> (Istream &, refinementHistory &)
Ostreamoperator<< (Ostream &, const refinementHistory &)

Additional Inherited Members

- Static Public Member Functions inherited from regIOobject
template<class Type >
static Type & store (Type *)
 Transfer ownership of the given object pointer to its registry.
template<class Type >
static Type & store (autoPtr< Type > &)
 Transfer ownership of the given object pointer to its registry.
- Static Public Member Functions inherited from IOobject
static bool fileNameComponents (const fileName &path, fileName &instance, fileName &local, word &name)
 Split path into instance, local, name components.
template<class Stream >
static Stream & writeBanner (Stream &os, bool noHint=false)
 Write the standard OpenFOAM file/dictionary banner.
template<class Stream >
static Stream & writeDivider (Stream &os)
 Write the standard file section divider.
template<class Stream >
static Stream & writeEndDivider (Stream &os)
 Write the standard end file divider.
- Static Public Attributes inherited from regIOobject
static int fileModificationSkew

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: