The cellTable persistent data saved as a Map<dictionary>. More...
#include <conversion/cellTable.H>
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; MaterialTypeWORD; MaterialId INT; PorosityId INT; ColorIdxINT; ... } ... )
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 78 of file cellTable.H.
Public Member Functions | |
cellTable () | |
Construct null.
| |
cellTable (const objectRegistry &, const word &name="cellTable", const fileName &instance="constant") | |
Construct read from registry, name. instance.
| |
~cellTable () | |
Destructor.
| |
label | append (const dictionary &) |
Append to the end, return index.
| |
label | findIndex (const word &name) const |
Return index corresponding to name.
| |
word | name (const label &id) const |
Return the name corresponding to id.
| |
Map< word > | names () const |
Return a Map of (id => name)
| |
Map< word > | names (const List< wordRe > &patterns) const |
Return a Map of (id => names) selected by patterns.
| |
Map< word > | selectType (const word &materialType) const |
Return a Map of (id => name) for materialType (fluid | solid | shell)
| |
Map< word > | fluids () const |
Return a Map of (id => name) for fluids.
| |
Map< word > | shells () const |
Return a Map of (id => name) for shells.
| |
Map< word > | solids () const |
Return a Map of (id => name) for solids.
| |
Map< word > | materialTypes () const |
Return a Map of (id => fluid|solid|shell)
| |
void | setMaterial (const label &, const word &) |
Assign material Type.
| |
void | setName (const label &, const word &) |
Assign name.
| |
void | setName (const label &) |
Assign default name if not already set.
| |
void | readDict (const objectRegistry &, const word &name="cellTable", const fileName &instance="constant") |
Read constant/cellTable.
| |
void | writeDict (const objectRegistry &, const word &name="cellTable", const fileName &instance="constant") const |
write constant/cellTable for later reuse
| |
void | operator= (const cellTable &) |
Assignment.
| |
void | operator= (const Map< dictionary > &) |
Assign from Map<dictionary>
| |
void | operator= (const polyMesh &) |
Assign from cellZones.
| |
void | addCellZones (polyMesh &, const labelList &tableIds) const |
Classify tableIds into cellZones according to the cellTable.
| |
void | combine (const dictionary &, labelList &tableIds) |
Combine tableIds together.
|
cellTable | ( | ) |
Construct null.
Definition at line 105 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 112 of file cellTable.C.
~cellTable | ( | ) |
Destructor.
Definition at line 126 of file cellTable.C.
Foam::label append | ( | const dictionary & | dict ) |
Append to the end, return index.
Definition at line 132 of file cellTable.C.
References forAllConstIter, and insert().
Foam::label findIndex | ( | const word & | name ) | const |
Return index corresponding to name.
returns -1 if not found
Definition at line 208 of file cellTable.C.
References forAllConstIter, 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 194 of file cellTable.C.
References Foam::name().
Foam::Map< Foam::word > names | ( | ) | const |
Return a Map of (id => name)
Definition at line 148 of file cellTable.C.
References forAllConstIter, HashTable< T, label, Hash< label > >::insert(), and Foam::name().
Foam::Map< Foam::word > names | ( | const List< wordRe > & | patterns ) | const |
Return a Map of (id => names) selected by patterns.
Definition at line 170 of file cellTable.C.
References Foam::findStrings(), forAllConstIter, HashTable< T, label, Hash< label > >::insert(), 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 244 of file cellTable.C.
References forAllConstIter, HashTable< T, label, Hash< label > >::insert(), and Foam::name().
Foam::Map< Foam::word > fluids | ( | ) | const |
Return a Map of (id => name) for fluids.
Definition at line 272 of file cellTable.C.
Foam::Map< Foam::word > shells | ( | ) | const |
Return a Map of (id => name) for shells.
Definition at line 284 of file cellTable.C.
Foam::Map< Foam::word > solids | ( | ) | const |
Return a Map of (id => name) for solids.
Definition at line 278 of file cellTable.C.
Foam::Map< Foam::word > materialTypes | ( | ) | const |
Return a Map of (id => fluid|solid|shell)
Definition at line 227 of file cellTable.C.
References forAllConstIter, and HashTable< T, label, Hash< label > >::insert().
void setMaterial | ( | const label & | id, |
const word & | matlType | ||
) |
Assign material Type.
Definition at line 291 of file cellTable.C.
void setName | ( | const label & | id, |
const word & | name | ||
) |
Assign name.
Definition at line 297 of file cellTable.C.
void setName | ( | const label & | id ) |
Assign default name if not already set.
Definition at line 303 of file cellTable.C.
References Foam::name().
void readDict | ( | const objectRegistry & | registry, |
const word & | name = "cellTable" ,
|
||
const fileName & | instance = "constant"
|
||
) |
Read constant/cellTable.
Definition at line 315 of file cellTable.C.
References clear(), Foam::endl(), IOobject::headerOk(), Foam::Info, 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 350 of file cellTable.C.
References Foam::endl(), Foam::Info, IOobject::name(), IOobject::NO_READ, IOobject::NO_WRITE, IOobject::note(), IOobject::objectPath(), and IOobject::writeHeader().
void operator= | ( | const cellTable & | rhs ) |
Assignment.
Definition at line 383 of file cellTable.C.
References HashTable< T, label, Hash< label > >::operator=().
void operator= | ( | const Map< dictionary > & | rhs ) |
Assign from Map<dictionary>
Definition at line 390 of file cellTable.C.
References HashTable< T, label, Hash< label > >::operator=().
void operator= | ( | const polyMesh & | mesh ) |
Assign from cellZones.
Definition at line 397 of file cellTable.C.
References dictionary::add(), polyMesh::cellZones(), HashTable< T, Key, Hash >::clear(), forAll, HashTable< T, Key, Hash >::insert(), ZoneMesh< ZoneType, MeshType >::names(), primitiveMesh::nCells(), HashTable< T, label, Hash< label > >::operator=(), and List< T >::size().
Classify tableIds into cellZones according to the cellTable.
Definition at line 443 of file cellTable.C.
References List< T >::append(), IOobject::AUTO_WRITE, polyMesh::cellZones(), ZoneMesh< ZoneType, MeshType >::clear(), HashTable< T, Key, Hash >::end(), Foam::endl(), HashTable< T, Key, Hash >::find(), forAll, Foam::Info, PtrList< T >::set(), PtrList< T >::setSize(), List< T >::setSize(), List< T >::size(), and IOobject::writeOpt().
void combine | ( | const dictionary & | mapDict, |
labelList & | tableIds | ||
) |
Combine tableIds together.
each dictionary entry is a wordList
Definition at line 509 of file cellTable.C.
References DLListBase::empty(), Foam::endl(), HashTable< T, label, Hash< label > >::erase(), Foam::findIndex(), Foam::findStrings(), forAllConstIter, Foam::identity(), Foam::Info, Foam::inplaceRenumber(), HashTable< T, label, Hash< label > >::insert(), Foam::max(), Foam::min(), HashTable< T, label, Hash< label > >::size(), and HashTable< T, label, Hash< label > >::toc().