cellTable Class Reference

The cellTable persistent data saved as a Map<dictionary>. More...

Inheritance diagram for cellTable:
[legend]
Collaboration diagram for cellTable:
[legend]

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 ()=default
 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< wordnames () const
 Return a Map of (id => name) More...
 
Map< wordnames (const wordRes &patterns) const
 Return a Map of (id => names) selected by patterns. More...
 
Map< wordselectType (const word &materialType) const
 Return a Map of (id => name) for materialType. More...
 
Map< wordfluids () const
 Return a Map of (id => name) for fluids. More...
 
Map< wordshells () const
 Return a Map of (id => name) for shells. More...
 
Map< wordsolids () const
 Return a Map of (id => name) for solids. More...
 
Map< wordmaterialTypes () 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 &mapDict, labelList &tableIds)
 Combine tableIds together. More...
 
- Public Member Functions inherited from Map< dictionary >
 Map ()
 Default construct with default table capacity. More...
 
 Map (const label size)
 Construct with given initial table capacity. More...
 
 Map (Istream &is)
 Construct from Istream with default table capacity. More...
 
 Map (const this_type &map)
 Copy construct. More...
 
 Map (this_type &&map)
 Move construct. More...
 
 Map (std::initializer_list< std::pair< label, dictionary >> map)
 Construct from an initializer list. More...
 
void operator= (const this_type &rhs)
 Copy assignment. More...
 
void operator= (this_type &&rhs)
 Move assignment. More...
 
void operator= (const this_type &rhs)
 Copy assign. More...
 
void operator= (std::initializer_list< std::pair< Key, dictionary >> rhs)
 Copy assign from an initializer list. More...
 
void operator= (this_type &&rhs)
 Move assign. More...
 

Additional Inherited Members

- Public Types inherited from Map< dictionary >
typedef Map< dictionarythis_type
 The template instance used for this Map. More...
 
typedef HashTable< dictionary, label, Hash< label > > parent_type
 The template instance used for the parent HashTable. More...
 
using iterator = typename parent_type::iterator
 
using const_iterator = typename parent_type::const_iterator
 

Detailed Description

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.

Source files

Definition at line 80 of file cellTable.H.

Constructor & Destructor Documentation

◆ cellTable() [1/2]

cellTable ( )

Construct null.

Definition at line 105 of file cellTable.C.

◆ cellTable() [2/2]

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.

References Foam::name().

Here is the call graph for this function:

◆ ~cellTable()

~cellTable ( )
default

Destructor.

Member Function Documentation

◆ append()

Foam::label append ( const dictionary dict)

Append to the end, return index.

Definition at line 126 of file cellTable.C.

References dict, forAllConstIters(), and insert().

Here is the call graph for this function:

◆ findIndex()

Foam::label findIndex ( const word name) const

Return index corresponding to name.

returns -1 if not found

Definition at line 202 of file cellTable.C.

References forAllConstIters(), Foam::name(), and word::null.

Here is the call graph for this function:

◆ name()

Foam::word name ( const label  id) const

Return the name corresponding to id.

returns cellTable_ID if not otherwise defined

Definition at line 188 of file cellTable.C.

References Foam::name().

Here is the call graph for this function:

◆ names() [1/2]

Foam::Map< Foam::word > names ( ) const

Return a Map of (id => name)

Definition at line 142 of file cellTable.C.

References forAllConstIters(), and Foam::name().

Here is the call graph for this function:

◆ names() [2/2]

Foam::Map< Foam::word > names ( const wordRes patterns) const

Return a Map of (id => names) selected by patterns.

Definition at line 164 of file cellTable.C.

References forAllConstIters(), wordRes::match(), and Foam::name().

Here is the call graph for this function:

◆ selectType()

Foam::Map< Foam::word > selectType ( const word materialType) const

Return a Map of (id => name) for materialType.

(fluid | solid | shell)

Definition at line 238 of file cellTable.C.

References dict, forAllConstIters(), dictionary::getOrDefault(), and Foam::name().

Here is the call graph for this function:

◆ fluids()

Foam::Map< Foam::word > fluids ( ) const

Return a Map of (id => name) for fluids.

Definition at line 269 of file cellTable.C.

Referenced by reader::fluids().

Here is the caller graph for this function:

◆ shells()

Foam::Map< Foam::word > shells ( ) const

Return a Map of (id => name) for shells.

Definition at line 281 of file cellTable.C.

◆ solids()

Foam::Map< Foam::word > solids ( ) const

Return a Map of (id => name) for solids.

Definition at line 275 of file cellTable.C.

Referenced by reader::solids().

Here is the caller graph for this function:

◆ materialTypes()

Foam::Map< Foam::word > materialTypes ( ) const

Return a Map of (id => fluid|solid|shell)

Definition at line 221 of file cellTable.C.

References forAllConstIters().

Here is the call graph for this function:

◆ setMaterial()

void setMaterial ( const label  id,
const word matlType 
)

Assign material Type.

Definition at line 288 of file cellTable.C.

Referenced by STARCDMeshReader::readCells().

Here is the caller graph for this function:

◆ setName() [1/2]

void setName ( const label  id,
const word name 
)

Assign name.

Definition at line 294 of file cellTable.C.

References Foam::name().

Referenced by STARCDMeshReader::readCells().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setName() [2/2]

void setName ( const label  id)

Assign default name if not already set.

Definition at line 300 of file cellTable.C.

References Foam::ListOps::find(), and Foam::name().

Here is the call graph for this function:

◆ readDict()

void readDict ( const objectRegistry registry,
const word name = "cellTable",
const fileName instance = "constant" 
)

Read constant/cellTable.

Definition at line 312 of file cellTable.C.

References clear(), Foam::endl(), regIOobject::headerOk(), Foam::Info, Foam::name(), IOobject::NO_WRITE, and IOobject::READ_IF_PRESENT.

Here is the call graph for this function:

◆ writeDict()

void writeDict ( const objectRegistry registry,
const word name = "cellTable",
const fileName instance = "constant" 
) const

Write constant/cellTable for later reuse.

Definition at line 347 of file cellTable.C.

References Foam::endl(), Foam::Info, Foam::name(), IOobject::name(), IOobject::NO_READ, IOobject::NO_WRITE, IOobject::note(), IOobject::objectPath(), os(), and IOobject::writeHeader().

Here is the call graph for this function:

◆ operator=() [1/3]

void operator= ( const cellTable rhs)

Assignment.

Definition at line 380 of file cellTable.C.

References Map< T >::operator=().

Here is the call graph for this function:

◆ operator=() [2/3]

void operator= ( const Map< dictionary > &  rhs)

Assign from Map<dictionary>

Definition at line 387 of file cellTable.C.

References Map< T >::operator=().

Here is the call graph for this function:

◆ operator=() [3/3]

void operator= ( const polyMesh mesh)

Assign from cellZones.

Definition at line 394 of file cellTable.C.

References dictionary::add(), polyMesh::cellZones(), dict, forAll, mesh, ZoneMesh< ZoneType, MeshType >::names(), primitiveMesh::nCells(), and Map< T >::operator=().

Here is the call graph for this function:

◆ addCellZones()

void addCellZones ( polyMesh mesh,
const labelList tableIds 
) const

Classify tableIds into cellZones according to the cellTable.

Definition at line 440 of file cellTable.C.

References List< T >::append(), IOobject::AUTO_WRITE, polyMesh::cellZones(), ZoneMesh< ZoneType, MeshType >::clear(), Foam::endl(), forAll, Foam::Info, mesh, and List< T >::setSize().

Here is the call graph for this function:

◆ combine()

void combine ( const dictionary mapDict,
labelList tableIds 
)

Combine tableIds together.

each dictionary entry is a wordList

Definition at line 506 of file cellTable.C.

References Foam::endl(), erase(), Foam::findIndex(), forAllConstIters(), Foam::identity(), Foam::Info, Foam::inplaceRenumber(), wordRes::match(), Foam::max(), Foam::min(), and Foam::PtrListOps::names().

Here is the call graph for this function:

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