The cellTable persistent data saved as a Map<dictionary>. More...
Public Member Functions | |
cellTable () | |
Construct null. More... | |
cellTable (const objectRegistry &, const word &name="cellTable", const fileName &instance="constant") | |
Construct read from registry, name. instance. More... | |
~cellTable () | |
Destructor. More... | |
label | append (const dictionary &) |
Append to the end, return index. More... | |
label | findIndex (const word &name) const |
Return index corresponding to name. More... | |
word | name (const label id) const |
Return the name corresponding to id. More... | |
Map< word > | names () const |
Return a Map of (id => name) More... | |
Map< word > | names (const UList< wordRe > &patterns) const |
Return a Map of (id => names) selected by patterns. More... | |
Map< word > | selectType (const word &materialType) const |
Return a Map of (id => name) for materialType. More... | |
Map< word > | fluids () const |
Return a Map of (id => name) for fluids. More... | |
Map< word > | shells () const |
Return a Map of (id => name) for shells. More... | |
Map< word > | solids () const |
Return a Map of (id => name) for solids. More... | |
Map< word > | materialTypes () const |
Return a Map of (id => fluid|solid|shell) More... | |
void | setMaterial (const label, const word &) |
Assign material Type. More... | |
void | setName (const label, const word &) |
Assign name. More... | |
void | setName (const label) |
Assign default name if not already set. More... | |
void | readDict (const objectRegistry &, const word &name="cellTable", const fileName &instance="constant") |
Read constant/cellTable. More... | |
void | writeDict (const objectRegistry &, const word &name="cellTable", const fileName &instance="constant") const |
Write constant/cellTable for later reuse. More... | |
void | operator= (const cellTable &) |
Assignment. More... | |
void | operator= (const Map< dictionary > &) |
Assign from Map<dictionary> More... | |
void | operator= (const polyMesh &) |
Assign from cellZones. More... | |
void | addCellZones (polyMesh &, const labelList &tableIds) const |
Classify tableIds into cellZones according to the cellTable. More... | |
void | combine (const dictionary &, labelList &tableIds) |
Combine tableIds together. More... | |
![]() | |
Map (const label size=128) | |
Construct given initial size. More... | |
Map (Istream &is) | |
Construct from Istream. More... | |
Map (const Map< T > &map) | |
Construct as copy. More... | |
Map (const Xfer< Map< T > > &map) | |
Construct by transferring the parameter contents. More... | |
Map (const Xfer< HashTable< T, label, Hash< label > > > &map) | |
Construct by transferring the parameter contents. More... | |
Private Member Functions | |
Map< label > | zoneMap () const |
Map from cellTable ID => zone number. More... | |
List< word > | namesList () const |
A contiguous list of cellTable names. More... | |
void | addDefaults () |
Add required entries - MaterialType. More... | |
void | setEntry (const label id, const word &keyWord, const word &value) |
cellTable (const cellTable &) | |
Disallow default bitwise copy construct. More... | |
Static Private Attributes | |
static const char *const | defaultMaterial_ = "fluid" |
Additional Inherited Members | |
![]() | |
typedef HashTable< T, label, Hash< label > >::iterator | iterator |
typedef HashTable< T, label, Hash< label > >::const_iterator | const_iterator |
The cellTable persistent data saved as a Map<dictionary>.
The meshReader supports cellTable information.
The constant/cellTable
file is an IOMap<dictionary>
that is used to save the information persistently. It contains the cellTable information of the following form:
( ID { Label WORD; MaterialType WORD; MaterialId INT; PorosityId INT; ColorIdx INT; ... } ... )
If the Label is missing, a value cellTable_{ID}
will be inferred. If the MaterialType is missing, the value fluid will be inferred.
Definition at line 77 of file cellTable.H.
cellTable | ( | ) |
Construct null.
Definition at line 103 of file cellTable.C.
cellTable | ( | const objectRegistry & | registry, |
const word & | name = "cellTable" , |
||
const fileName & | instance = "constant" |
||
) |
Construct read from registry, name. instance.
Definition at line 110 of file cellTable.C.
References Foam::name().
~cellTable | ( | ) |
Destructor.
Definition at line 124 of file cellTable.C.
|
private |
Map from cellTable ID => zone number.
Definition at line 38 of file cellTable.C.
References forAllConstIter(), and lookup().
|
private |
A contiguous list of cellTable names.
Definition at line 52 of file cellTable.C.
References forAllConstIter(), and lookup().
|
private |
Add required entries - MaterialType.
Definition at line 67 of file cellTable.C.
References forAllIter, and found.
Definition at line 80 of file cellTable.C.
References dictionary::add(), dict, and insert().
Foam::label append | ( | const dictionary & | dict | ) |
Append to the end, return index.
Definition at line 130 of file cellTable.C.
References dict, forAllConstIter(), and insert().
Foam::label findIndex | ( | const word & | name | ) | const |
Return index corresponding to name.
returns -1 if not found
Definition at line 206 of file cellTable.C.
References forAllConstIter(), Foam::name(), and word::null.
Foam::word name | ( | const label | id | ) | const |
Return the name corresponding to id.
returns cellTable_ID if not otherwise defined
Definition at line 192 of file cellTable.C.
References Foam::name().
Foam::Map< Foam::word > names | ( | ) | const |
Return a Map of (id => name)
Definition at line 146 of file cellTable.C.
References forAllConstIter(), lookup(), and Foam::name().
Foam::Map< Foam::word > names | ( | const UList< wordRe > & | patterns | ) | const |
Return a Map of (id => names) selected by patterns.
Definition at line 168 of file cellTable.C.
References Foam::findStrings(), forAllConstIter(), lookup(), and Foam::name().
Foam::Map< Foam::word > selectType | ( | const word & | materialType | ) | const |
Return a Map of (id => name) for materialType.
(fluid | solid | shell)
Definition at line 242 of file cellTable.C.
References forAllConstIter(), lookup(), and Foam::name().
Foam::Map< Foam::word > fluids | ( | ) | const |
Return a Map of (id => name) for fluids.
Definition at line 270 of file cellTable.C.
Foam::Map< Foam::word > shells | ( | ) | const |
Return a Map of (id => name) for shells.
Definition at line 282 of file cellTable.C.
Foam::Map< Foam::word > solids | ( | ) | const |
Return a Map of (id => name) for solids.
Definition at line 276 of file cellTable.C.
Foam::Map< Foam::word > materialTypes | ( | ) | const |
Return a Map of (id => fluid|solid|shell)
Definition at line 225 of file cellTable.C.
References forAllConstIter(), and lookup().
Assign material Type.
Definition at line 289 of file cellTable.C.
Assign name.
Definition at line 295 of file cellTable.C.
References Foam::name().
void setName | ( | const label | id | ) |
Assign default name if not already set.
Definition at line 301 of file cellTable.C.
References found, and Foam::name().
void readDict | ( | const objectRegistry & | registry, |
const word & | name = "cellTable" , |
||
const fileName & | instance = "constant" |
||
) |
Read constant/cellTable.
Definition at line 313 of file cellTable.C.
References clear(), Foam::endl(), IOobject::headerOk(), Foam::Info, Foam::name(), IOobject::NO_WRITE, and IOobject::READ_IF_PRESENT.
void writeDict | ( | const objectRegistry & | registry, |
const word & | name = "cellTable" , |
||
const fileName & | instance = "constant" |
||
) | const |
Write constant/cellTable for later reuse.
Definition at line 348 of file cellTable.C.
References Foam::endl(), Foam::Info, Foam::name(), IOobject::name(), IOobject::NO_READ, IOobject::NO_WRITE, IOobject::note(), IOobject::objectPath(), and IOobject::writeHeader().
void operator= | ( | const cellTable & | rhs | ) |
Assignment.
Definition at line 381 of file cellTable.C.
void operator= | ( | const Map< dictionary > & | rhs | ) |
Assign from Map<dictionary>
Definition at line 388 of file cellTable.C.
void operator= | ( | const polyMesh & | mesh | ) |
Assign from cellZones.
Definition at line 395 of file cellTable.C.
References dictionary::add(), polyMesh::cellZones(), dict, forAll, mesh, ZoneMesh::names(), primitiveMesh::nCells(), and List::size().
Classify tableIds into cellZones according to the cellTable.
Definition at line 441 of file cellTable.C.
References List::append(), IOobject::AUTO_WRITE, polyMesh::cellZones(), ZoneMesh::clear(), Foam::endl(), forAll, Foam::Info, mesh, List::setSize(), and List::size().
Referenced by meshReader::addCellZones().
void combine | ( | const dictionary & | mapDict, |
labelList & | tableIds | ||
) |
Combine tableIds together.
each dictionary entry is a wordList
Definition at line 507 of file cellTable.C.
References Foam::endl(), erase(), Foam::findIndex(), Foam::findStrings(), forAllConstIter(), Foam::identity(), Foam::Info, Foam::inplaceRenumber(), Foam::max(), and Foam::min().
|
staticprivate |
Definition at line 83 of file cellTable.H.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.