Go to the documentation of this file.
37 bool Foam::IOobjectList::checkNames(
wordList& masterNames,
const bool syncPar)
45 const wordList localNames(masterNames);
48 if (localNames != masterNames)
51 <<
"Objects not synchronised across processors." <<
nl
65 void Foam::IOobjectList::syncNames(
wordList& objNames)
126 for (
const auto& objName : objNames)
156 insert(objectPtr->name(), objectPtr);
179 return insert(objectPtr->name(), objectPtr);
192 if (!
found(iter.key()))
225 if (
add(other.remove(
key)))
274 return cfindObject(objName);
280 return const_cast<IOobject*
>(cfindObject(objName));
286 return const_cast<IOobject*
>(cfindObject(objName));
293 return lookupClass(
static_cast<word>(clsName));
306 return count(
static_cast<word>(clsName));
320 checkNames(objNames, syncPar);
328 return names(
static_cast<word>(clsName));
339 return names(
static_cast<word>(clsName), syncPar);
355 checkNames(objNames, syncPar);
363 return sortedNames(
static_cast<word>(clsName));
374 return names(
static_cast<word>(clsName), syncPar);
385 [](
const word&
k){
return k.ends_with(
"_0"); },
400 bool Foam::IOobjectList::checkNames(
const bool syncPar)
const
406 return checkNames(objNames, syncPar);
430 << iter.val()->headerClassName() <<
nl;
int debug
Static debugging option.
static autoPtr< T > New(Args &&... args)
Construct autoPtr of T with forwarding arguments.
srcOptions insert("case", fileName(rootDirSource/caseDirSource))
Defines the attributes of an object for which implicit objectRegistry management is supported,...
#define InfoInFunction
Report an information message using Foam::Info.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
void set(List< bool > &bools, const labelRange &range)
Set the specified range 'on' in a boolList.
A class for handling words, derived from Foam::string.
A class for handling file names.
const IOobject * findObject(const word &objName) const
Return const pointer to the object found by name.
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
bool throwing() const noexcept
Return the current exception throwing state (on or off)
wordList sortedNames() const
The sorted names of the IOobjects.
static void scatter(const List< commsStruct > &comms, T &Value, const int tag, const label comm)
Scatter data. Distribute without modification. Reverse of gather.
const fileOperation & fileHandler()
Get current file handler.
Ostream & endl(Ostream &os)
Add newline and flush stream.
label append(const IOobjectList &other)
label count() const
The number of objects with headerClassName == Type::typeName.
wordList names() const
The names of the IOobjects.
Unary and binary predicates that always return true, useful for templating.
List< word > wordList
A List of words.
Registry of regIOobjects.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
writeOption
Enumeration defining the write options.
HashTable< wordHashSet > classes() const
A summary hash of classes used and their associated object names.
IOobject * getObject(const word &objName) const
bool remove(const IOobject &io)
Remove IOobject from the list.
const IOobject * cfindObject(const word &objName) const
Return const pointer to the object found by name.
label prune_0()
Remove objects with names ending with "_0" (restart fields)
virtual bool check(const char *operation) const
Check IOstream status for given operation.
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
OBJstream os(runTime.globalPath()/outputName)
wordList allNames() const
The sorted names of all objects (synchronised across processors)
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
static void combineGather(const List< commsStruct > &comms, T &Value, const CombineOp &cop, const int tag, const label comm)
List of IOobjects with searching and retrieving facilities.
IOobjectList()
Construct null with default (128) table capacity.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A HashTable similar to std::unordered_map.
typename parent_type::const_iterator const_iterator
const word & name() const noexcept
Return name.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
bool add(autoPtr< IOobject > &objectPtr)
Add IOobject to the list.
static int myProcNo(const label communicator=worldComm)
Number of this process (starting from masterNo() = 0)
forAllConstIters(mixture.phases(), phase)
A HashTable of pointers to objects of type <T>, with deallocation management of the pointers.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
IOobjectList lookupClass() const
The list of IOobjects with headerClassName == Type::typeName.
static bool & parRun() noexcept
Test if this a parallel run.
void operator=(const IOobjectList &)=delete
No copy assignment.
label k
Boltzmann constant.
virtual fileNameList readObjects(const objectRegistry &db, const fileName &instance, const fileName &local, word &newInstance) const
Search directory for objects. Used in IOobjectList.
readOption
Enumeration defining the read options.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Begin list [isseparator].
List< word > names(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
static void combineScatter(const List< commsStruct > &comms, T &Value, const int tag, const label comm)
Scatter data. Reverse of combineGather.