IOobjectList Class Reference

List of IOobjects with searching and retrieving facilities. More...

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

Public Member Functions

 IOobjectList ()
 Construct null with default (128) table capacity. More...
 
 IOobjectList (const label nObjects)
 Construct given initial table capacity. More...
 
 IOobjectList (const IOobjectList &list)
 Copy construct. More...
 
 IOobjectList (IOobjectList &&list)
 Move construct. More...
 
 IOobjectList (const objectRegistry &db, const fileName &instance, const fileName &local="", IOobject::readOption r=IOobject::MUST_READ, IOobject::writeOption w=IOobject::NO_WRITE, bool registerObject=true)
 Construct from objectRegistry and instance path. More...
 
 ~IOobjectList ()=default
 Destructor. More...
 
bool add (autoPtr< IOobject > &objectPtr)
 Add IOobject to the list. More...
 
bool add (autoPtr< IOobject > &&objectPtr)
 Add IOobject to the list. More...
 
label append (const IOobjectList &other)
 
label append (IOobjectList &&other)
 
bool remove (const IOobject &io)
 Remove IOobject from the list. More...
 
const IOobjectcfindObject (const word &objName) const
 Return const pointer to the object found by name. More...
 
template<class Type >
const IOobjectcfindObject (const word &objName) const
 
const IOobjectfindObject (const word &objName) const
 Return const pointer to the object found by name. More...
 
template<class Type >
const IOobjectfindObject (const word &objName) const
 
IOobjectfindObject (const word &objName)
 Return non-const pointer to the object found by name. More...
 
template<class Type >
IOobjectfindObject (const word &objName)
 
IOobjectgetObject (const word &objName) const
 
template<class Type >
IOobjectgetObject (const word &objName) const
 
template<class MatchPredicate >
IOobjectList lookup (const MatchPredicate &matchName) const
 The list of IOobjects that have a matching object name. More...
 
IOobjectList lookupClass (const char *clsName) const
 The list of IOobjects with the given headerClassName. More...
 
template<class MatchPredicate >
IOobjectList lookupClass (const MatchPredicate &matchClass) const
 The list of IOobjects with matching headerClassName. More...
 
template<class MatchPredicate1 , class MatchPredicate2 >
IOobjectList lookupClass (const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName) const
 
template<class Type >
IOobjectList lookupClass () const
 The list of IOobjects with headerClassName == Type::typeName. More...
 
template<class Type , class MatchPredicate >
IOobjectList lookupClass (const MatchPredicate &matchName) const
 
HashTable< wordHashSetclasses () const
 A summary hash of classes used and their associated object names. More...
 
template<class MatchPredicate >
HashTable< wordHashSetclasses (const MatchPredicate &matchName) const
 
label count (const char *clsName) const
 The number of objects of the given headerClassName. More...
 
template<class MatchPredicate >
label count (const MatchPredicate &matchClass) const
 The number of objects of the given headerClassName. More...
 
template<class MatchPredicate1 , class MatchPredicate2 >
label count (const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName) const
 
template<class Type >
label count () const
 The number of objects with headerClassName == Type::typeName. More...
 
template<class Type , class MatchPredicate >
label count (const MatchPredicate &matchName) const
 
wordList names () const
 The names of the IOobjects. More...
 
wordList names (const bool syncPar) const
 The names of the IOobjects. More...
 
wordList names (const char *clsName) const
 The names of IOobjects with the given headerClassName. More...
 
wordList names (const char *clsName, const bool syncPar) const
 The names of the IOobjects with the given headerClassName. More...
 
template<class MatchPredicate >
wordList names (const MatchPredicate &matchClass) const
 The names of IOobjects with the given headerClassName. More...
 
template<class MatchPredicate >
wordList names (const MatchPredicate &matchClass, const bool syncPar) const
 The names of the IOobjects with the given headerClassName. More...
 
template<class MatchPredicate1 , class MatchPredicate2 >
wordList names (const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName) const
 
template<class MatchPredicate1 , class MatchPredicate2 >
wordList names (const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName, const bool syncPar) const
 
template<class Type >
wordList names () const
 The names of objects with headerClassName == Type::typeName. More...
 
template<class Type >
wordList names (bool syncPar) const
 The names of objects with headerClassName == Type::typeName. More...
 
template<class Type , class MatchPredicate >
wordList names (const MatchPredicate &matchName) const
 
template<class Type , class MatchPredicate >
wordList names (const MatchPredicate &matchName, const bool syncPar) const
 
wordList sortedNames () const
 The sorted names of the IOobjects. More...
 
wordList sortedNames (const bool syncPar) const
 The sorted names of the IOobjects. More...
 
wordList sortedNames (const char *clsName) const
 The sorted names of IOobjects with the given headerClassName. More...
 
wordList sortedNames (const char *clsName, const bool syncPar) const
 The sorted names of the IOobjects with the given headerClassName. More...
 
template<class MatchPredicate >
wordList sortedNames (const MatchPredicate &matchClass) const
 The sorted names of IOobjects with the given headerClassName. More...
 
template<class MatchPredicate >
wordList sortedNames (const MatchPredicate &matchClass, const bool syncPar) const
 The sorted names of the IOobjects with the given headerClassName. More...
 
template<class MatchPredicate1 , class MatchPredicate2 >
wordList sortedNames (const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName) const
 
template<class MatchPredicate1 , class MatchPredicate2 >
wordList sortedNames (const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName, const bool syncPar) const
 
template<class Type >
wordList sortedNames () const
 The sorted names of objects with headerClassName == Type::typeName. More...
 
template<class Type >
wordList sortedNames (bool syncPar) const
 The sorted names of objects with headerClassName == Type::typeName. More...
 
template<class Type , class MatchPredicate >
wordList sortedNames (const MatchPredicate &matchName) const
 
template<class Type , class MatchPredicate >
wordList sortedNames (const MatchPredicate &matchName, const bool syncPar) const
 
template<class UnaryPredicate >
label filterClasses (const UnaryPredicate &pred, const bool pruning=false)
 Filter to retain or prune given classes. More...
 
template<class UnaryPredicate >
label filterObjects (const UnaryPredicate &pred, const bool pruning=false)
 Filter to retain or prune given object names. More...
 
label prune_0 ()
 Remove objects with names ending with "_0" (restart fields) More...
 
wordList allNames () const
 The sorted names of all objects (synchronised across processors) More...
 
template<class Type >
wordList allNames () const
 
bool checkNames (const bool syncPar=true) const
 Verify that object names are synchronised across processors. More...
 
void operator= (const IOobjectList &)=delete
 No copy assignment. More...
 
void operator= (IOobjectList &&list)
 Move assignment. More...
 
IOobjectlookup (const char *objName) const
 
IOobjectlookup (const word &objName) const
 
template<class MatchPredicate >
Foam::HashTable< Foam::wordHashSetclassesImpl (const IOobjectList &list, const MatchPredicate &matchName)
 
template<class MatchPredicate1 , class MatchPredicate2 >
Foam::label countImpl (const IOobjectList &list, const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName)
 
template<class Type , class MatchPredicate >
Foam::label countTypeImpl (const IOobjectList &list, const MatchPredicate &matchName)
 
template<class MatchPredicate1 , class MatchPredicate2 >
Foam::wordList namesImpl (const IOobjectList &list, const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName, const bool doSort)
 
template<class Type , class MatchPredicate >
Foam::wordList namesTypeImpl (const IOobjectList &list, const MatchPredicate &matchName, const bool doSort)
 
template<class MatchPredicate >
Foam::IOobjectList lookupImpl (const IOobjectList &list, const MatchPredicate &matchName)
 
template<class MatchPredicate1 , class MatchPredicate2 >
Foam::IOobjectList lookupClassImpl (const IOobjectList &list, const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName)
 
template<class Type , class MatchPredicate >
Foam::IOobjectList lookupClassTypeImpl (const IOobjectList &list, const MatchPredicate &matchName)
 
template<class Type >
const Foam::IOobjectcfindObject (const word &objName) const
 
template<class Type >
const Foam::IOobjectfindObject (const word &objName) const
 
template<class Type >
Foam::IOobjectfindObject (const word &objName)
 
template<class Type >
Foam::IOobjectgetObject (const word &objName) const
 
template<class MatchPredicate >
Foam::IOobjectList lookup (const MatchPredicate &matchName) const
 
template<class MatchPredicate >
Foam::IOobjectList lookupClass (const MatchPredicate &matchClass) const
 
template<class MatchPredicate1 , class MatchPredicate2 >
Foam::IOobjectList lookupClass (const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName) const
 
template<class Type >
Foam::IOobjectList lookupClass () const
 
template<class Type , class MatchPredicate >
Foam::IOobjectList lookupClass (const MatchPredicate &matchName) const
 
template<class MatchPredicate >
Foam::HashTable< Foam::wordHashSetclasses (const MatchPredicate &matchName) const
 
template<class MatchPredicate >
Foam::label count (const MatchPredicate &matchClass) const
 
template<class MatchPredicate1 , class MatchPredicate2 >
Foam::label count (const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName) const
 
template<class Type >
Foam::label count () const
 
template<class Type , class MatchPredicate >
Foam::label count (const MatchPredicate &matchName) const
 
template<class MatchPredicate >
Foam::wordList names (const MatchPredicate &matchClass) const
 
template<class MatchPredicate >
Foam::wordList names (const MatchPredicate &matchClass, const bool syncPar) const
 
template<class MatchPredicate1 , class MatchPredicate2 >
Foam::wordList names (const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName) const
 
template<class MatchPredicate1 , class MatchPredicate2 >
Foam::wordList names (const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName, const bool syncPar) const
 
template<class Type >
Foam::wordList names () const
 
template<class Type >
Foam::wordList names (const bool syncPar) const
 
template<class Type , class MatchPredicate >
Foam::wordList names (const MatchPredicate &matchName) const
 
template<class Type , class MatchPredicate >
Foam::wordList names (const MatchPredicate &matchName, const bool syncPar) const
 
template<class MatchPredicate >
Foam::wordList sortedNames (const MatchPredicate &matchClass) const
 
template<class MatchPredicate >
Foam::wordList sortedNames (const MatchPredicate &matchClass, const bool syncPar) const
 
template<class MatchPredicate1 , class MatchPredicate2 >
Foam::wordList sortedNames (const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName) const
 
template<class MatchPredicate1 , class MatchPredicate2 >
Foam::wordList sortedNames (const MatchPredicate1 &matchClass, const MatchPredicate2 &matchName, const bool syncPar) const
 
template<class Type >
Foam::wordList sortedNames () const
 
template<class Type >
Foam::wordList sortedNames (const bool syncPar) const
 
template<class Type , class MatchPredicate >
Foam::wordList sortedNames (const MatchPredicate &matchName) const
 
template<class Type , class MatchPredicate >
Foam::wordList sortedNames (const MatchPredicate &matchName, const bool syncPar) const
 
template<class UnaryPredicate >
Foam::label filterClasses (const UnaryPredicate &pred, const bool pruning)
 
template<class UnaryPredicate >
Foam::label filterObjects (const UnaryPredicate &pred, const bool pruning)
 
template<class Type >
Foam::wordList allNames () const
 
- Public Member Functions inherited from HashPtrTable< IOobject >
 HashPtrTable ()=default
 Default construct with default table capacity. More...
 
 HashPtrTable (const label size)
 Construct given initial table capacity. More...
 
 HashPtrTable (Istream &is, const INew &inew)
 Construct from Istream using given Istream constructor class. More...
 
 HashPtrTable (Istream &is)
 Construct from Istream using default Istream constructor class. More...
 
 HashPtrTable (const dictionary &dict)
 Construct from dictionary with default dictionary constructor class. More...
 
 HashPtrTable (const this_type &rhs)
 Copy construct, making a copy of each element. More...
 
 HashPtrTable (this_type &&rhs)
 Move construct. More...
 
 ~HashPtrTable ()
 Destructor. More...
 
const IOobjectget (const word &key) const
 
autoPtr< IOobjectrelease (iterator &iter)
 Release ownership of the pointer and replace with a nullptr. More...
 
autoPtr< IOobjectrelease (const word &key)
 Release ownership of the pointer and replace with a nullptr. More...
 
autoPtr< IOobjectremove (iterator &iter)
 Remove entry specified by given iterator. More...
 
autoPtr< IOobjectremove (const word &key)
 Remove entry specified by given key. More...
 
bool erase (iterator &iter)
 
bool erase (const word &key)
 
void clear ()
 Clear all entries from table and delete any allocated pointers. More...
 
void write (Ostream &os) const
 Invoke write() on each non-null entry. More...
 
void operator= (const this_type &rhs)
 Copy assignment. More...
 
void operator= (this_type &&rhs)
 Move assignment. More...
 
bool emplace (const word &key, Args &&... args)
 Emplace insert a new entry, not overwriting existing entries. More...
 
bool emplace_set (const word &key, Args &&... args)
 Emplace set an entry, overwriting any existing entries. More...
 
bool insert (const word &, IOobject *)=delete
 
bool insert (const word &key, autoPtr< IOobject > &ptr)
 Insert a new entry, not overwriting existing entries. More...
 
bool insert (const word &key, autoPtr< IOobject > &&ptr)
 Insert a new entry, not overwriting existing entries. More...
 
bool insert (const word &key, std::unique_ptr< IOobject > &&ptr)
 Insert a new entry, not overwriting existing entries. More...
 
bool set (const word &key, IOobject *ptr)
 Assign a new entry, overwriting existing entries. More...
 
bool set (const word &key, autoPtr< IOobject > &ptr)
 Assign a new entry, overwriting existing entries. More...
 
bool set (const word &key, autoPtr< IOobject > &&ptr)
 Assign a new entry, overwriting existing entries. More...
 
bool set (const word &key, std::unique_ptr< IOobject > &&ptr)
 Assign a new entry, overwriting existing entries. More...
 

Additional Inherited Members

- Public Types inherited from HashPtrTable< IOobject >
typedef HashPtrTable< IOobject, word, Foam::Hash< word > > this_type
 The template instance used for this table. More...
 
typedef HashTable< IOobject *, word, Foam::Hash< word > > 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

List of IOobjects with searching and retrieving facilities.

Source files

Definition at line 55 of file IOobjectList.H.

Constructor & Destructor Documentation

◆ IOobjectList() [1/5]

Construct null with default (128) table capacity.

Definition at line 81 of file IOobjectList.C.

◆ IOobjectList() [2/5]

IOobjectList ( const label  nObjects)
explicit

Construct given initial table capacity.

Definition at line 87 of file IOobjectList.C.

◆ IOobjectList() [3/5]

IOobjectList ( const IOobjectList list)

Copy construct.

Definition at line 93 of file IOobjectList.C.

◆ IOobjectList() [4/5]

IOobjectList ( IOobjectList &&  list)

Move construct.

Definition at line 99 of file IOobjectList.C.

◆ IOobjectList() [5/5]

IOobjectList ( const objectRegistry db,
const fileName instance,
const fileName local = "",
IOobject::readOption  r = IOobject::MUST_READ,
IOobject::writeOption  w = IOobject::NO_WRITE,
bool  registerObject = true 
)

Construct from objectRegistry and instance path.

Definition at line 106 of file IOobjectList.C.

References Foam::endl(), Foam::FatalIOError, Foam::fileHandler(), insert(), autoPtr< T >::New(), Foam::nl, fileOperation::readObjects(), error::throwing(), and Foam::Warning.

Here is the call graph for this function:

◆ ~IOobjectList()

~IOobjectList ( )
default

Destructor.

Member Function Documentation

◆ add() [1/2]

bool add ( autoPtr< IOobject > &  objectPtr)

Add IOobject to the list.

Definition at line 164 of file IOobjectList.C.

References insert(), and IOobject::name().

Here is the call graph for this function:

◆ add() [2/2]

bool add ( autoPtr< IOobject > &&  objectPtr)

Add IOobject to the list.

Definition at line 175 of file IOobjectList.C.

References insert().

Here is the call graph for this function:

◆ append() [1/2]

Foam::label append ( const IOobjectList other)

Copy append objects from other to this list, but do not overwrite existing keys.

Returns
number of items added

Definition at line 186 of file IOobjectList.C.

References Foam::BitOps::count(), Foam::expressions::patchExpr::debug, forAllConstIters(), found, InfoInFunction, Foam::nl, and Foam::BitOps::set().

Here is the call graph for this function:

◆ append() [2/2]

Foam::label append ( IOobjectList &&  other)

Move append objects from other to this list, but do not overwrite existing keys.

After calling this, the other parameter will contains any items that could not be moved.

Returns
number of items added

Definition at line 208 of file IOobjectList.C.

References Foam::add(), Foam::BitOps::count(), Foam::expressions::patchExpr::debug, found, InfoInFunction, Foam::glTF::key(), and Foam::nl.

Here is the call graph for this function:

◆ remove()

bool remove ( const IOobject io)

Remove IOobject from the list.

Returns
True if object was removed

Definition at line 236 of file IOobjectList.C.

References erase(), and IOobject::name().

Here is the call graph for this function:

◆ cfindObject() [1/3]

const Foam::IOobject * cfindObject ( const word objName) const

Return const pointer to the object found by name.

Returns
IOobject ptr if found else nullptr

Definition at line 245 of file IOobjectList.C.

References Foam::expressions::patchExpr::debug, Foam::endl(), and InfoInFunction.

Referenced by pointFieldReconstructor::reconstructFields(), lagrangianReconstructor::reconstructFields(), fvFieldReconstructor::reconstructFvSurfaceFields(), fvFieldReconstructor::reconstructFvVolumeFields(), and fvFieldReconstructor::reconstructFvVolumeInternalFields().

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

◆ cfindObject() [2/3]

const IOobject* cfindObject ( const word objName) const

Return const pointer to the object found by name that also has headerClassName == Type::typeName

Returns
IOobject ptr if found and the correct type, else nullptr
Note
If Type is void, no headerClassName check is used (always true).

◆ findObject() [1/6]

const Foam::IOobject * findObject ( const word objName) const

Return const pointer to the object found by name.

Returns
IOobject ptr if found else nullptr

Definition at line 270 of file IOobjectList.C.

Referenced by Foam::getField(), Foam::lumpedPointTools::lumpedPointPatchList(), Foam::lumpedPointTools::setInterpolators(), Foam::lumpedPointTools::setPatchControls(), Foam::writeAreaFields(), Foam::writeDimFields(), and Foam::writeVolFields().

Here is the caller graph for this function:

◆ findObject() [2/6]

const IOobject* findObject ( const word objName) const

Return const pointer to the object found by name that also has headerClassName == Type::typeName

Returns
IOobject ptr if found and the correct type, else nullptr
Note
If Type is void, no headerClassName check is used (always true).

◆ findObject() [3/6]

Foam::IOobject * findObject ( const word objName)

Return non-const pointer to the object found by name.

Returns
IOobject ptr if found else nullptr

Definition at line 278 of file IOobjectList.C.

◆ findObject() [4/6]

IOobject* findObject ( const word objName)

Return non-const pointer to the object found by name that also has headerClassName == Type::typeName

Returns
IOobject ptr if found and the correct type, else nullptr
Note
If Type is void, no headerClassName check is used (always true).

◆ getObject() [1/3]

Foam::IOobject * getObject ( const word objName) const

Return non-const pointer to the object found by name, using a const-cast to have it behave like a mutable.

Exercise caution when using.

Returns
IOobject ptr if found else nullptr

Definition at line 284 of file IOobjectList.C.

◆ getObject() [2/3]

IOobject* getObject ( const word objName) const

Return non-const pointer to the object found by name that also has headerClassName == Type::typeName, using a const-cast to have it behave like a mutable.

Exercise caution when using.

Returns
IOobject ptr if found and the correct type, else nullptr
Note
If Type is void, no headerClassName check is used (always true).

◆ lookup() [1/4]

IOobjectList lookup ( const MatchPredicate &  matchName) const

The list of IOobjects that have a matching object name.

◆ lookupClass() [1/9]

Foam::IOobjectList lookupClass ( const char *  clsName) const

The list of IOobjects with the given headerClassName.

Definition at line 290 of file IOobjectList.C.

Referenced by Foam::MapConsistentVolFields(), Foam::MapLagrangianFields(), Foam::MapVolFields(), faFieldDecomposer::readFields(), and Foam::UnMapped().

Here is the caller graph for this function:

◆ lookupClass() [2/9]

IOobjectList lookupClass ( const MatchPredicate &  matchClass) const

The list of IOobjects with matching headerClassName.

◆ lookupClass() [3/9]

IOobjectList lookupClass ( const MatchPredicate1 &  matchClass,
const MatchPredicate2 &  matchName 
) const

The list of IOobjects with matching headerClassName that also have a matching object name.

◆ lookupClass() [4/9]

IOobjectList lookupClass ( ) const

The list of IOobjects with headerClassName == Type::typeName.

Note
If Type is void, no headerClassName check is used (always true).

◆ lookupClass() [5/9]

IOobjectList lookupClass ( const MatchPredicate &  matchName) const

The list of IOobjects with headerClassName == Type::typeName that also have a matching object name.

◆ classes() [1/3]

Foam::HashTable< Foam::wordHashSet > classes ( ) const

A summary hash of classes used and their associated object names.

The HashTable representation allows us to leverage various HashTable methods. This hashed summary view can be useful when querying particular aspects. For example,

IOobjectList objects(runTime, runTime.timeName());
HashTable<wordHashSet> classes = objects.classes();
// How many volScalarField?
word checkType = volScalarField::typeName;
Info<< checkType << "="
<< (classes.found(checkType) ? classes[checkType].size() : 0)
<< nl;

Using the two-parameter HashTable::lookup method lets us avoid the '?' ternary, but still looks fairly ugly:

Info<< checkType << "="
<< classes.lookup(checkType, wordHashSet()).size() << nl;

If we have non-const access to the hash table, and don't mind incidentally creating empty entries, we can use the HashTable::operator() directly:

Info<< checkType << "=" << classes(checkType).size() << nl;

Of course, for a single query it would have been easier and simpler to have used a direct query of the names:

Info<< checkType << "=" << objects.names(checkType).size() << nl;

The summary hash, however, becomes most useful when reducing the objects in consideration to a particular subset. For example,

const wordHashSet interestingTypes
{
volScalarField::typeName,
volVectorField::typeName
};
classes.retain(interestingTypes);

Or do just the opposite:

classes.erase(unsupportedTypes);

This also works with a hashedWordList, since it provides the expected '()' operator. But in this case the more general HashTable::filterKeys is required:

const hashedWordList interestingTypes
{
volScalarField::typeName,
volVectorField::typeName
};
classes.filterKeys(interestingTypes);

Of course, there are many other ways to use and manipulate the summary information.

Returns
HashTable of class-names for keys and wordHashSet of of object-names for the values.

Definition at line 297 of file IOobjectList.C.

◆ classes() [2/3]

HashTable<wordHashSet> classes ( const MatchPredicate &  matchName) const

A summary hash of classes used and their associated object names, restricted to objects that have a matching object name.

◆ count() [1/9]

Foam::label count ( const char *  clsName) const

The number of objects of the given headerClassName.

Note
uses the class type() method

Definition at line 303 of file IOobjectList.C.

References Foam::BitOps::count().

Here is the call graph for this function:

◆ count() [2/9]

label count ( const MatchPredicate &  matchClass) const

The number of objects of the given headerClassName.

◆ count() [3/9]

label count ( const MatchPredicate1 &  matchClass,
const MatchPredicate2 &  matchName 
) const

The number of objects of the given headerClassName that also have a matching object name.

◆ count() [4/9]

label count ( ) const

The number of objects with headerClassName == Type::typeName.

◆ count() [5/9]

label count ( const MatchPredicate &  matchName) const

The number of objects with headerClassName == Type::typeName that also have a matching object name.

Note
If Type is void, no headerClassName check is used (always true).

◆ names() [1/20]

Foam::wordList names ( ) const

The names of the IOobjects.

Definition at line 310 of file IOobjectList.C.

Referenced by fileFieldSelection::addFromFile(), Foam::readUniformFields(), and lagrangianReconstructor::reconstructFieldFields().

Here is the caller graph for this function:

◆ names() [2/20]

Foam::wordList names ( const bool  syncPar) const

The names of the IOobjects.

With syncPar = true, sorts the names and triggers FatalError if the names are not consistent on all processors.

Definition at line 316 of file IOobjectList.C.

◆ names() [3/20]

Foam::wordList names ( const char *  clsName) const

The names of IOobjects with the given headerClassName.

Definition at line 325 of file IOobjectList.C.

References Foam::PtrListOps::names().

Here is the call graph for this function:

◆ names() [4/20]

Foam::wordList names ( const char *  clsName,
const bool  syncPar 
) const

The names of the IOobjects with the given headerClassName.

With syncPar = true, sorts the names and triggers FatalError if the names are not consistent on all processors.

Definition at line 333 of file IOobjectList.C.

References Foam::PtrListOps::names().

Here is the call graph for this function:

◆ names() [5/20]

wordList names ( const MatchPredicate &  matchClass) const

The names of IOobjects with the given headerClassName.

◆ names() [6/20]

wordList names ( const MatchPredicate &  matchClass,
const bool  syncPar 
) const

The names of the IOobjects with the given headerClassName.

With syncPar = true, sorts the names and triggers FatalError if the names are not consistent on all processors.

◆ names() [7/20]

wordList names ( const MatchPredicate1 &  matchClass,
const MatchPredicate2 &  matchName 
) const

The names of IOobjects with the given headerClassName that also have a matching object name.

◆ names() [8/20]

wordList names ( const MatchPredicate1 &  matchClass,
const MatchPredicate2 &  matchName,
const bool  syncPar 
) const

The names of the IOobjects with the given headerClassName that also have a matching object name.

With syncPar = true, sorts the names and triggers FatalError if the names are not consistent on all processors.

◆ names() [9/20]

wordList names ( ) const

The names of objects with headerClassName == Type::typeName.

◆ names() [10/20]

wordList names ( bool  syncPar) const

The names of objects with headerClassName == Type::typeName.

With syncPar = true, sorts the names and triggers FatalError if the names are not consistent on all processors.

◆ names() [11/20]

wordList names ( const MatchPredicate &  matchName) const

The names of objects with headerClassName == Type::typeName that also have a matching object name.

With syncPar = true, sorts the names and triggers FatalError if the names are not consistent on all processors.

◆ names() [12/20]

wordList names ( const MatchPredicate &  matchName,
const bool  syncPar 
) const

The names of objects with headerClassName == Type::typeName that also have a matching object name.

With syncPar = true, sorts the names and triggers FatalError if the names are not consistent on all processors.

◆ sortedNames() [1/20]

◆ sortedNames() [2/20]

Foam::wordList sortedNames ( const bool  syncPar) const

The sorted names of the IOobjects.

With syncPar = true, sorts the names and triggers FatalError if the names are not consistent on all processors.

Definition at line 351 of file IOobjectList.C.

◆ sortedNames() [3/20]

Foam::wordList sortedNames ( const char *  clsName) const

The sorted names of IOobjects with the given headerClassName.

Definition at line 360 of file IOobjectList.C.

◆ sortedNames() [4/20]

Foam::wordList sortedNames ( const char *  clsName,
const bool  syncPar 
) const

The sorted names of the IOobjects with the given headerClassName.

With syncPar = true, sorts the names and triggers FatalError if the names are not consistent on all processors.

Definition at line 368 of file IOobjectList.C.

References Foam::PtrListOps::names().

Here is the call graph for this function:

◆ sortedNames() [5/20]

wordList sortedNames ( const MatchPredicate &  matchClass) const

The sorted names of IOobjects with the given headerClassName.

◆ sortedNames() [6/20]

wordList sortedNames ( const MatchPredicate &  matchClass,
const bool  syncPar 
) const

The sorted names of the IOobjects with the given headerClassName.

With syncPar = true, sorts the names and triggers FatalError if the names are not consistent on all processors.

◆ sortedNames() [7/20]

wordList sortedNames ( const MatchPredicate1 &  matchClass,
const MatchPredicate2 &  matchName 
) const

The sorted names of IOobjects with the given headerClassName that also have a matching object name.

◆ sortedNames() [8/20]

wordList sortedNames ( const MatchPredicate1 &  matchClass,
const MatchPredicate2 &  matchName,
const bool  syncPar 
) const

The sorted names of the IOobjects with the given headerClassName that also have a matching object name.

With syncPar = true, sorts the names and triggers FatalError if the names are not consistent on all processors.

◆ sortedNames() [9/20]

wordList sortedNames ( ) const

The sorted names of objects with headerClassName == Type::typeName.

◆ sortedNames() [10/20]

wordList sortedNames ( bool  syncPar) const

The sorted names of objects with headerClassName == Type::typeName.

With syncPar = true, sorts the names and triggers FatalError if the names are not consistent on all processors.

◆ sortedNames() [11/20]

wordList sortedNames ( const MatchPredicate &  matchName) const

The sorted names of objects with headerClassName == Type::typeName that also have a matching object name.

With syncPar = true, sorts the names and triggers FatalError if the names are not consistent on all processors.

◆ sortedNames() [12/20]

wordList sortedNames ( const MatchPredicate &  matchName,
const bool  syncPar 
) const

The sorted names of objects with headerClassName == Type::typeName that also have a matching object name.

With syncPar = true, sorts the names and triggers FatalError if the names are not consistent on all processors.

◆ filterClasses() [1/2]

label filterClasses ( const UnaryPredicate &  pred,
const bool  pruning = false 
)

Filter to retain or prune given classes.

Returns
The number of items changed (removed)

◆ filterObjects() [1/2]

label filterObjects ( const UnaryPredicate &  pred,
const bool  pruning = false 
)

Filter to retain or prune given object names.

Returns
The number of items changed (removed)

◆ prune_0()

Foam::label prune_0 ( )

Remove objects with names ending with "_0" (restart fields)

Returns
The number of items changed (removed)

Definition at line 380 of file IOobjectList.C.

References k.

◆ allNames() [1/3]

Foam::wordList allNames ( ) const

The sorted names of all objects (synchronised across processors)

Definition at line 391 of file IOobjectList.C.

Referenced by lagrangianWriter::writeFields().

Here is the caller graph for this function:

◆ allNames() [2/3]

wordList allNames ( ) const

The sorted names of all objects (synchronised across processors) with headerClassName == Type::typeName

◆ checkNames()

bool checkNames ( const bool  syncPar = true) const

Verify that object names are synchronised across processors.

Triggers FatalError if the names are not consistent on all processors.

Definition at line 400 of file IOobjectList.C.

References UPstream::parRun().

Here is the call graph for this function:

◆ operator=() [1/2]

void operator= ( const IOobjectList )
delete

No copy assignment.

◆ operator=() [2/2]

void operator= ( IOobjectList &&  list)

Move assignment.

Definition at line 415 of file IOobjectList.C.

◆ lookup() [2/4]

IOobject* lookup ( const char *  objName) const
inline

Deprecated(2018-11) Locate an object by name (c-string). Disambiguated from multiple-lookup version by calling parameter.

Deprecated:
(2018-11) use findObject() for non-ambiguous resolution

Definition at line 641 of file IOobjectList.H.

◆ lookup() [3/4]

IOobject* lookup ( const word objName) const
inline

Deprecated(2018-11) Locate an object by name (const word&). Disambiguated from multiple-lookup version by calling parameter.

Deprecated:
(2018-11) use findObject() for non-ambiguous resolution

Definition at line 649 of file IOobjectList.H.

◆ classesImpl()

Foam::HashTable<Foam::wordHashSet> classesImpl ( const IOobjectList list,
const MatchPredicate &  matchName 
)

Definition at line 36 of file IOobjectListTemplates.C.

References forAllConstIters(), IOobject::headerClassName(), insert(), and Foam::glTF::key().

Here is the call graph for this function:

◆ countImpl()

Foam::label countImpl ( const IOobjectList list,
const MatchPredicate1 &  matchClass,
const MatchPredicate2 &  matchName 
)

Definition at line 63 of file IOobjectListTemplates.C.

References Foam::BitOps::count(), forAllConstIters(), IOobject::headerClassName(), and IOobject::name().

Here is the call graph for this function:

◆ countTypeImpl()

Foam::label countTypeImpl ( const IOobjectList list,
const MatchPredicate &  matchName 
)

Definition at line 88 of file IOobjectListTemplates.C.

References Foam::BitOps::count(), forAllConstIters(), IOobject::isHeaderClassName(), and IOobject::name().

Here is the call graph for this function:

◆ namesImpl()

Foam::wordList namesImpl ( const IOobjectList list,
const MatchPredicate1 &  matchClass,
const MatchPredicate2 &  matchName,
const bool  doSort 
)

Definition at line 112 of file IOobjectListTemplates.C.

References Foam::BitOps::count(), forAllConstIters(), IOobject::headerClassName(), Foam::glTF::key(), and Foam::sort().

Here is the call graph for this function:

◆ namesTypeImpl()

Foam::wordList namesTypeImpl ( const IOobjectList list,
const MatchPredicate &  matchName,
const bool  doSort 
)

Definition at line 148 of file IOobjectListTemplates.C.

References Foam::BitOps::count(), forAllConstIters(), IOobject::isHeaderClassName(), Foam::glTF::key(), and Foam::sort().

Here is the call graph for this function:

◆ lookupImpl()

Foam::IOobjectList lookupImpl ( const IOobjectList list,
const MatchPredicate &  matchName 
)

Definition at line 183 of file IOobjectListTemplates.C.

References Foam::expressions::patchExpr::debug, Foam::endl(), forAllConstIters(), InfoInFunction, and Foam::glTF::key().

Here is the call graph for this function:

◆ lookupClassImpl()

Foam::IOobjectList lookupClassImpl ( const IOobjectList list,
const MatchPredicate1 &  matchClass,
const MatchPredicate2 &  matchName 
)

Definition at line 213 of file IOobjectListTemplates.C.

References Foam::expressions::patchExpr::debug, Foam::endl(), forAllConstIters(), IOobject::headerClassName(), InfoInFunction, and Foam::glTF::key().

Here is the call graph for this function:

◆ lookupClassTypeImpl()

Foam::IOobjectList lookupClassTypeImpl ( const IOobjectList list,
const MatchPredicate &  matchName 
)

Definition at line 244 of file IOobjectListTemplates.C.

References Foam::expressions::patchExpr::debug, Foam::endl(), forAllConstIters(), InfoInFunction, IOobject::isHeaderClassName(), and Foam::glTF::key().

Here is the call graph for this function:

◆ cfindObject() [3/3]

const Foam::IOobject* cfindObject ( const word objName) const

Definition at line 275 of file IOobjectListTemplates.C.

References Foam::expressions::patchExpr::debug, Foam::endl(), InfoInFunction, and IOobject::isHeaderClassName().

Here is the call graph for this function:

◆ findObject() [5/6]

const Foam::IOobject* findObject ( const word objName) const

Definition at line 311 of file IOobjectListTemplates.C.

◆ findObject() [6/6]

Foam::IOobject* findObject ( const word objName)

Definition at line 320 of file IOobjectListTemplates.C.

◆ getObject() [3/3]

Foam::IOobject* getObject ( const word objName) const

Definition at line 327 of file IOobjectListTemplates.C.

◆ lookup() [4/4]

Foam::IOobjectList lookup ( const MatchPredicate &  matchName) const

Definition at line 335 of file IOobjectListTemplates.C.

◆ lookupClass() [6/9]

Foam::IOobjectList lookupClass ( const MatchPredicate &  matchClass) const

Definition at line 345 of file IOobjectListTemplates.C.

◆ lookupClass() [7/9]

Foam::IOobjectList lookupClass ( const MatchPredicate1 &  matchClass,
const MatchPredicate2 &  matchName 
) const

Definition at line 355 of file IOobjectListTemplates.C.

◆ lookupClass() [8/9]

Foam::IOobjectList lookupClass ( ) const

Definition at line 365 of file IOobjectListTemplates.C.

◆ lookupClass() [9/9]

Foam::IOobjectList lookupClass ( const MatchPredicate &  matchName) const

Definition at line 373 of file IOobjectListTemplates.C.

◆ classes() [3/3]

Foam::HashTable<Foam::wordHashSet> classes ( const MatchPredicate &  matchName) const

Definition at line 384 of file IOobjectListTemplates.C.

◆ count() [6/9]

Foam::label count ( const MatchPredicate &  matchClass) const

Definition at line 394 of file IOobjectListTemplates.C.

◆ count() [7/9]

Foam::label count ( const MatchPredicate1 &  matchClass,
const MatchPredicate2 &  matchName 
) const

Definition at line 404 of file IOobjectListTemplates.C.

◆ count() [8/9]

Foam::label count ( ) const

Definition at line 414 of file IOobjectListTemplates.C.

◆ count() [9/9]

Foam::label count ( const MatchPredicate &  matchName) const

Definition at line 422 of file IOobjectListTemplates.C.

◆ names() [13/20]

Foam::wordList names ( const MatchPredicate &  matchClass) const

Definition at line 434 of file IOobjectListTemplates.C.

◆ names() [14/20]

Foam::wordList names ( const MatchPredicate &  matchClass,
const bool  syncPar 
) const

Definition at line 444 of file IOobjectListTemplates.C.

◆ names() [15/20]

Foam::wordList names ( const MatchPredicate1 &  matchClass,
const MatchPredicate2 &  matchName 
) const

Definition at line 461 of file IOobjectListTemplates.C.

◆ names() [16/20]

Foam::wordList names ( const MatchPredicate1 &  matchClass,
const MatchPredicate2 &  matchName,
const bool  syncPar 
) const

Definition at line 472 of file IOobjectListTemplates.C.

◆ names() [17/20]

Foam::wordList names ( ) const

Definition at line 486 of file IOobjectListTemplates.C.

◆ names() [18/20]

Foam::wordList names ( const bool  syncPar) const

Definition at line 493 of file IOobjectListTemplates.C.

◆ names() [19/20]

Foam::wordList names ( const MatchPredicate &  matchName) const

Definition at line 504 of file IOobjectListTemplates.C.

◆ names() [20/20]

Foam::wordList names ( const MatchPredicate &  matchName,
const bool  syncPar 
) const

Definition at line 514 of file IOobjectListTemplates.C.

◆ sortedNames() [13/20]

Foam::wordList sortedNames ( const MatchPredicate &  matchClass) const

Definition at line 530 of file IOobjectListTemplates.C.

◆ sortedNames() [14/20]

Foam::wordList sortedNames ( const MatchPredicate &  matchClass,
const bool  syncPar 
) const

Definition at line 540 of file IOobjectListTemplates.C.

◆ sortedNames() [15/20]

Foam::wordList sortedNames ( const MatchPredicate1 &  matchClass,
const MatchPredicate2 &  matchName 
) const

Definition at line 557 of file IOobjectListTemplates.C.

◆ sortedNames() [16/20]

Foam::wordList sortedNames ( const MatchPredicate1 &  matchClass,
const MatchPredicate2 &  matchName,
const bool  syncPar 
) const

Definition at line 567 of file IOobjectListTemplates.C.

◆ sortedNames() [17/20]

Foam::wordList sortedNames ( ) const

Definition at line 581 of file IOobjectListTemplates.C.

◆ sortedNames() [18/20]

Foam::wordList sortedNames ( const bool  syncPar) const

Definition at line 588 of file IOobjectListTemplates.C.

◆ sortedNames() [19/20]

Foam::wordList sortedNames ( const MatchPredicate &  matchName) const

Definition at line 599 of file IOobjectListTemplates.C.

◆ sortedNames() [20/20]

Foam::wordList sortedNames ( const MatchPredicate &  matchName,
const bool  syncPar 
) const

Definition at line 609 of file IOobjectListTemplates.C.

◆ filterClasses() [2/2]

Foam::label filterClasses ( const UnaryPredicate &  pred,
const bool  pruning 
)

Definition at line 622 of file IOobjectListTemplates.C.

References stdFoam::begin(), stdFoam::end(), and erase().

Here is the call graph for this function:

◆ filterObjects() [2/2]

Foam::label filterObjects ( const UnaryPredicate &  pred,
const bool  pruning 
)

Definition at line 659 of file IOobjectListTemplates.C.

References stdFoam::begin(), stdFoam::end(), and erase().

Here is the call graph for this function:

◆ allNames() [3/3]

Foam::wordList allNames ( ) const

Definition at line 691 of file IOobjectListTemplates.C.


The documentation for this class was generated from the following files:
runTime
engineTime & runTime
Definition: createEngineTime.H:13
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
Foam::IOobjectList::classes
HashTable< wordHashSet > classes() const
A summary hash of classes used and their associated object names.
Definition: IOobjectList.C:297
Foam::IOobjectList::IOobjectList
IOobjectList()
Construct null with default (128) table capacity.
Definition: IOobjectList.C:81
Foam::nl
constexpr char nl
Definition: Ostream.H:404
Foam::wordHashSet
HashSet< word, Hash< word > > wordHashSet
A HashSet of words, uses string hasher.
Definition: HashSet.H:77