36 void Foam::IOobjectList::checkObjectOrder
38 const UPtrList<const IOobject>& objs,
46 auto iter = objectNames.
begin();
48 for (
const IOobject&
io : objs)
54 checkNameOrder(objectNames, syncPar);
59 void Foam::IOobjectList::checkNameOrder
70 masterNames = objectNames;
77 <<
"Objects not synchronised across processors." <<
nl 87 void Foam::IOobjectList::syncNames(
wordList& objNames)
116 for (
const auto& objName : objNames)
133 ok = objectPtr->typeHeaderOk<
regIOobject>(
false,
false);
144 insert(objectPtr->name(), objectPtr);
158 const IOobject*
io =
nullptr;
160 const const_iterator iter(cfind(objName));
187 return cfindObject(objName);
193 return const_cast<IOobject*
>(cfindObject(objName));
199 return const_cast<IOobject*
>(cfindObject(objName));
206 return lookupClass(static_cast<word>(clsName));
219 return count(static_cast<word>(clsName));
233 return sortedNames(syncPar);
240 return names(static_cast<word>(clsName));
251 return sortedNames(static_cast<word>(clsName), syncPar);
267 checkNameOrder(objNames, syncPar);
275 return sortedNames(static_cast<word>(clsName));
286 return sortedNames(static_cast<word>(clsName), syncPar);
297 [](
const word&
k){
return k.ends_with(
"_0"); },
318 checkNameOrder(objNames, syncPar);
332 << iter.val()->headerClassName() <<
nl;
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.
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.
Ostream & endl(Ostream &os)
Add newline and flush stream.
wordList names() const
The unsorted names of the IOobjects.
Begin list [isseparator].
refPtr< fileOperation > fileHandler(std::nullptr_t)
Delete current file handler - forwards to fileOperation::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)
Rank of this process in the communicator (starting from masterNo()). Can be negative if the process i...
static void broadcast(Type &value, const label comm=UPstream::worldComm)
Broadcast content (contiguous or non-contiguous) to all communicator ranks. Does nothing in non-paral...
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.
A class for handling words, derived from Foam::string.
void sort(UList< T > &list)
Sort the list.
static void combineReduce(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...
const IOobject * findObject(const word &objName) const
Return const pointer to the object found by name.
static bool is_parallel(const label communicator=worldComm)
True if parallel algorithm or exchange is required.
wordList allNames() const
The sorted names of all objects (synchronised across processors)
A HashTable similar to std::unordered_map.
iterator begin() noexcept
Return an iterator to begin traversing the UList.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
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
List of word.
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.
List< Key > sortedToc() const
The table of contents (the keys) in sorted order.
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
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.
IOobjectList() noexcept=default
Default construct: empty without allocation (capacity=0).
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
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.