49bool Foam::coordinateSystems::readIOcontents()
75 <<
"--> FOAM IOWarning :" <<
nl
91 <<
" while reading object " <<
name()
133 if (!readIOcontents())
143 PtrList<coordinateSystem>&& content
147 PtrList<coordinateSystem>(std::move(content))
170 return obr.
store(
new coordinateSystems(obr));
230 if (coordinateSystem::debug)
233 <<
"Global coordinate system: "
250 <<
"Could not find coordinate system: " <<
name <<
nl
251 <<
"available coordinate systems: "
288 const PtrList<coordinateSystem>& list = *
this;
292 for (
const coordinateSystem& csys : list)
295 csys.writeEntry(csys.name(),
os);
307 const bool writeOnProc
Functions to operate on Pointer Lists.
bool isReadOptional() const noexcept
True if (LAZY_READ) bits are set [same as READ_IF_PRESENT].
bool isReadRequired() const noexcept
True if (MUST_READ | READ_MODIFIED) bits are set.
@ READ_IF_PRESENT
Reading is optional [identical to LAZY_READ].
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const Time & time() const noexcept
Return Time associated with the objectRegistry.
const word & name() const noexcept
Return the object name.
const word & headerClassName() const noexcept
Return name of the class name read from header.
A simple container for options an IOstream can normally have.
@ ASCII
"ascii" (normal default)
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
void readIstream(Istream &is, const INew &inew)
constexpr PtrList() noexcept
bool empty() const noexcept
True if List is empty (ie, size() is zero).
const T * test(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie,...
label size() const noexcept
Base class for coordinate system specification, the default coordinate system type is cartesian .
A centralized collection of named coordinate systems.
labelList indices(const wordRe &key) const
Find and return indices for all matches.
const coordinateSystem * cfind(const word &name) const
Return pointer to named coordinateSystem or nullptr on error.
virtual bool writeObject(IOstreamOption streamOpt, const bool writeOnProc=true) const
Write using stream options.
static const coordinateSystems & New(const objectRegistry &obr)
Return previously registered or read construct from "constant".
bool writeData(Ostream &os) const
Write data.
const coordinateSystem & lookup(const word &name) const
Return reference to named coordinateSystem or FatalErrror.
coordinateSystems(const coordinateSystems &)=delete
No copy construct.
wordList names() const
A list of the coordinate-system names.
label findIndex(const wordRe &key) const
Find and return index for the first match, return -1 if not found.
bool found(const wordRe &key) const
Search if given key exists.
static bool master(const int communicator=-1)
Like Pstream::master but with a Pstream::parRun guard in case Pstream has not yet been initialised.
static bool warnAboutAge(const int version) noexcept
Test if an age warning should be emitted.
Registry of regIOobjects.
const Type * findObject(const word &name, const bool recursive=false) const
Return const pointer to the object of the given Type.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
virtual bool writeObject(IOstreamOption streamOpt, const bool writeOnProc) const
Write using stream options.
void close()
Close Istream.
regIOobject(const IOobject &io, const bool isTimeObject=false)
Construct from IOobject. The optional flag adds special handling if the object is the top-level regIO...
bool headerOk()
Read and check header info. Does not check the headerClassName.
bool store()
Register object with its registry and transfer ownership to the registry.
@ BEGIN_LIST
Begin list [isseparator].
@ END_LIST
End list [isseparator].
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
A List of wordRe with additional matching capabilities.
A class for handling words, derived from Foam::string.
static const word null
An empty word.
#define defineTypeName(Type)
Define the typeName.
static const char * headerTypeCompat
Header name for 1806 and earlier.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
#define InfoInFunction
Report an information message using Foam::Info.
labelList findMatching(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
Extract list indices for all items with 'name()' that matches.
label firstMatching(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
Find first list item with 'name()' that matches, -1 on failure.
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.
Different types of constants.
List< word > wordList
List of word.
label findIndex(const ListType &input, typename ListType::const_reference val, const label start=0)
Deprecated(2017-10) search for first occurrence of the given element.
List< label > labelList
A List of labels.
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
Ostream & endl(Ostream &os)
Add newline and flush stream.
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 ...
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a).