37 void Foam::IOobjectList::checkObjectOrder
39 const UPtrList<const IOobject>& objs,
47 auto iter = objectNames.
begin();
49 for (
const IOobject&
io : objs)
55 checkNameOrder(objectNames, syncPar);
60 void Foam::IOobjectList::checkNameOrder
71 masterNames = objectNames;
75 if (objectNames != masterNames)
78 <<
"Objects not synchronised across processors." <<
nl 88 void Foam::IOobjectList::syncNames(
wordList& objNames)
121 for (
const auto& objName : objNames)
149 insert(objectPtr->name(), objectPtr);
165 for (
const word&
key : keys)
174 if (
add(other.remove(
key)))
195 const const_iterator iter(cfind(objName));
222 return cfindObject(objName);
228 return const_cast<IOobject*
>(cfindObject(objName));
234 return const_cast<IOobject*
>(cfindObject(objName));
241 return lookupClass(static_cast<word>(clsName));
254 return count(static_cast<word>(clsName));
263 return sorted<void>();
270 return sorted<void>(syncPar);
284 return sortedNames(syncPar);
291 return names(static_cast<word>(clsName));
302 return sortedNames(static_cast<word>(clsName), syncPar);
318 checkNameOrder(objNames, syncPar);
326 return sortedNames(static_cast<word>(clsName));
337 return sortedNames(static_cast<word>(clsName), syncPar);
348 [](
const word&
k){
return k.ends_with(
"_0"); },
369 checkNameOrder(objNames, syncPar);
383 << iter.val()->headerClassName() <<
nl;
IOobjectList()
Default construct (empty) with default (128) table capacity.
label prune_0()
Remove objects with names ending with "_0" (restart fields)
List< word > names(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
List of names generated by calling name() for each list item and filtered for matches.
A class for handling file names.
List of IOobjects with searching and retrieving facilities. Implemented as a HashTable, so the various sorted methods should be used if traversing in parallel.
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
UPtrList< const IOobject > sorted() const
The sorted list of IOobjects.
IOobjectList lookupClass() const
The list of IOobjects with headerClassName == Type::typeName.
constexpr char nl
The newline '\n' character (0x0a)
bool throwing() const noexcept
Return the current exception throwing state (on or off)
wordList sortedNames() const
The sorted names of the IOobjects.
label merge(IOobjectList &&other)
Add objects from other to this list without overwriting existing keys.
Ostream & endl(Ostream &os)
Add newline and flush stream.
wordList names() const
The unsorted names of the IOobjects.
static bool & parRun() noexcept
Test if this a parallel run.
Begin list [isseparator].
autoPtr< fileOperation > fileHandler(std::nullptr_t)
Delete current file handler.
label k
Boltzmann constant.
A HashTable of pointers to objects of type <T>, with deallocation management of the pointers...
static int myProcNo(const label communicator=worldComm)
Number of this process (starting from masterNo() = 0)
static void broadcast(Type &value, const label comm=UPstream::worldComm)
Broadcast content (contiguous or non-contiguous) to all processes in communicator.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
Unary and binary predicates that always return true, useful for templating.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
A class for handling words, derived from Foam::string.
void sort(UList< T > &list)
Sort the list.
const IOobject * findObject(const word &objName) const
Return const pointer to the object found by name.
wordList allNames() const
The sorted names of all objects (synchronised across processors)
A HashTable similar to std::unordered_map.
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
iterator begin() noexcept
Return an iterator to begin traversing the UList.
static void combineReduce(const List< commsStruct > &comms, T &value, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce) applying cop to inplace combine value from different processors...
An Ostream is an abstract base class for all output systems (streams, files, token lists...
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
int debug
Static debugging option.
OBJstream os(runTime.globalPath()/outputName)
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 mut...
messageStream Warning
Warning stream (stdout output on master, null elsewhere), with additional 'FOAM Warning' header text...
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
List< word > wordList
A List of words.
bool insert(const word &, IOobject *)=delete
No insert() with raw pointers (potential memory leaks). Use insert() with autoPtr or set() ...
void checkNames(const bool syncPar=true) const
Verify that object names are synchronised across processors.
label count() const
The number of objects with headerClassName == Type::typeName.
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
List< Key > sortedToc() const
The table of contents (the keys) in sorted order.
static bool master(const label communicator=worldComm)
Am I the master rank.
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
label filterKeys(const UnaryPredicate &pred, const bool pruning=false)
Generalized means to filter table entries based on their keys.
List< Key > toc() const
The table of contents (the keys) in unsorted order.
Registry of regIOobjects.
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
Defines the attributes of an object for which implicit objectRegistry management is supported...
forAllConstIters(mixture.phases(), phase)
HashTable< wordHashSet > classes() const
A summary hash of classes used and their associated object names.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
#define InfoInFunction
Report an information message using Foam::Info.
const IOobject * cfindObject(const word &objName) const
Return const pointer to the object found by name.