37void Foam::IOobjectList::checkObjectOrder
39 const UPtrList<const IOobject>& objs,
47 auto iter = objectNames.begin();
49 for (
const IOobject&
io : objs)
55 checkNameOrder(objectNames, syncPar);
60void Foam::IOobjectList::checkNameOrder
71 masterNames = objectNames;
75 if (objectNames != masterNames)
78 <<
"Objects not synchronised across processors." <<
nl
88void Foam::IOobjectList::syncNames(
wordList& objNames)
149 for (
const auto& objName : objNames)
179 insert(objectPtr->name(), objectPtr);
191 return insert(objectPtr->name(), objectPtr);
202 return insert(objectPtr->name(), objectPtr);
215 if (!
found(iter.key()))
222 set(iter.key(),
new IOobject(*iter.val()));
239 for (
const word& key : keys)
248 if (
add(other.remove(key)))
283 else if (IOobject::debug)
297 return cfindObject(objName);
303 return const_cast<IOobject*
>(cfindObject(objName));
309 return const_cast<IOobject*
>(cfindObject(objName));
316 return lookupClass(
static_cast<word>(clsName));
329 return count(
static_cast<word>(clsName));
338 return sorted<void>();
345 return sorted<void>(syncPar);
359 return sortedNames(syncPar);
366 return names(
static_cast<word>(clsName));
377 return sortedNames(
static_cast<word>(clsName), syncPar);
393 checkNameOrder(objNames, syncPar);
401 return sortedNames(
static_cast<word>(clsName));
412 return sortedNames(
static_cast<word>(clsName), syncPar);
423 [](
const word&
k){
return k.ends_with(
"_0"); },
444 checkNameOrder(objNames, syncPar);
466 << iter.val()->headerClassName() <<
nl;
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
A HashTable of pointers to objects of type <T>, with deallocation management of the pointers.
bool insert(const word &, IOobject *)=delete
bool found() const noexcept
True if iterator points to an entry - same as good()
Forward iterator with const access.
reference val() const
Const access to referenced object (value)
A HashTable similar to std::unordered_map.
label size() const noexcept
The number of elements in table.
label filterKeys(const UnaryPredicate &pred, const bool pruning=false)
Generalized means to filter table entries based on their keys.
A List of objects of type <T> with automated input and output.
List of IOobjects with searching and retrieving facilities.
const IOobject * findObject(const word &objName) const
Return const pointer to the object found by name.
IOobjectList()
Construct null with default (128) table capacity.
wordList sortedNames() const
The sorted names of the IOobjects.
void operator=(const IOobjectList &)=delete
No copy assignment.
const IOobject * cfindObject(const word &objName) const
Return const pointer to the object found by name.
IOobject * getObject(const word &objName) const
HashTable< wordHashSet > classes() const
A summary hash of classes used and their associated object names.
void checkNames(const bool syncPar=true) const
Verify that object names are synchronised across processors.
label prune_0()
Remove objects with names ending with "_0" (restart fields)
wordList allNames() const
The sorted names of all objects (synchronised across processors)
label count() const
The number of objects with headerClassName == Type::typeName.
UPtrList< const IOobject > sorted() const
The sorted list of IOobjects.
IOobjectList lookupClass() const
The list of IOobjects with headerClassName == Type::typeName.
wordList names() const
The unsorted names of the IOobjects.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const word & name() const noexcept
Return the object name.
writeOption
Enumeration defining the write options.
readOption
Enumeration defining the read options.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
unsigned int remove()
Remove and return the last element.
static void combineGather(const List< commsStruct > &comms, T &value, const CombineOp &cop, const int tag, const label comm)
static void broadcast(Type &value, const label comm=UPstream::worldComm)
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
static bool & parRun() noexcept
Test if this a parallel run.
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
labelList sortedToc() const
The indices of the on bits as a sorted labelList.
labelList toc() const
The indices of the on bits as a sorted labelList.
bool throwing() const noexcept
Return the current exception throwing state (on or off)
A class for handling file names.
virtual fileNameList readObjects(const objectRegistry &db, const fileName &instance, const fileName &local, word &newInstance) const
Search directory for objects. Used in IOobjectList.
Sums a given list of (at least two or more) fields and outputs the result into a new field,...
Registry of regIOobjects.
int myProcNo() const noexcept
Return processor number.
splitCell * master() const
@ BEGIN_LIST
Begin list [isseparator].
@ END_LIST
End list [isseparator].
bool append() const noexcept
True if output format uses an append mode.
A class for handling words, derived from Foam::string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
#define InfoInFunction
Report an information message using Foam::Info.
const fileOperation & fileHandler()
Get current file handler.
List< word > wordList
A List of words.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Ostream & endl(Ostream &os)
Add newline and flush stream.
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
void sort(UList< T > &list)
Sort the list.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)
srcOptions insert("case", fileName(rootDirSource/caseDirSource))
#define forAllConstIters(container, iter)
Iterate across all elements of the container object with const access.
Unary and binary predicates that always return true, useful for templating.