Go to the documentation of this file.
50 template<
class UnaryMatchPredicate>
54 const UnaryMatchPredicate& matcher,
58 const label len = list.size();
63 for (label i = 0; i < len; ++i)
65 const word& itemName = list[i].name();
67 if (matcher(itemName))
69 output[
count++] = itemName;
85 template<
class UnaryMatchPredicate>
89 const UnaryMatchPredicate& matcher
92 const label len = list.size();
97 for (label i = 0; i < len; ++i)
99 if (matcher(list[i].
name()))
112 template<
class UnaryMatchPredicate>
116 const UnaryMatchPredicate& matcher
119 const label len = list.size();
121 for (label i = 0; i < len; ++i)
123 if (matcher(list[i].
name()))
138 void Foam::coordinateSystems::readFromStream(
const bool valid)
153 <<
"--> FOAM IOWarning :" <<
nl
155 <<
"' instead of '" << typeName <<
"'" <<
nl;
166 <<
" expected " << typeName
168 <<
" while reading object " <<
name()
175 bool Foam::coordinateSystems::readObject(
const IOobject& io)
197 Foam::coordinateSystems::coordinateSystems(
const IOobject& io)
206 Foam::coordinateSystems::coordinateSystems
222 Foam::coordinateSystems::coordinateSystems
286 const word& matcher = key;
314 const word& matcher = key;
335 const label index = this->
findIndex(name);
340 <<
"Global coordinate system: "
349 return this->operator()(index);
356 const label index = this->
findIndex(name);
361 <<
"Could not find coordinate system: " <<
name <<
nl
362 <<
"available coordinate systems: "
369 <<
"Global coordinate system: "
373 return this->operator[](index);
385 result[i] = list[i].name();
408 const word& matcher = key;
435 csys.writeEntry(csys.name(), os);
int debug
Static debugging option.
List< label > labelList
A List of labels.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
static wordList namesImpl(const PtrList< coordinateSystem > &list, const UnaryMatchPredicate &matcher, const bool doSort)
label findIndex(const keyType &key) const
Find and return index for the first match, return -1 if not found.
#define InfoInFunction
Report an information message using Foam::Info.
const word & name() const
Return name.
A class for handling words, derived from Foam::string.
labelList indices(const keyType &key) const
Find and return indices for all matches.
bool isPattern() const
The keyType is treated as a pattern, not as literal string.
const Time & time() const
Return time.
Ostream & endl(Ostream &os)
Add newline and flush stream.
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
#define forAll(list, i)
Loop across all elements in list.
label findIndexImpl(const faPatchList &list, const UnaryMatchPredicate &matcher)
static labelList indicesImpl(const faPatchList &list, const UnaryMatchPredicate &matcher)
const coordinateSystem & lookup(const word &name) const
Return reference to named coordinateSystem or FatalErrror.
List< word > wordList
A List of words.
Registry of regIOobjects.
A class for handling keywords in dictionaries.
static const char * headerTypeCompat
Header name for 1806 and earlier.
word name(const complex &c)
Return string representation of complex.
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.
defineTypeName(ensightPart)
The IOstreamOption is a simple container for options an IOstream can normally have.
void readIstream(Istream &is, const INew &inew)
Read from Istream using Istream constructor class.
bool writeData(Ostream &os) const
Write data.
Wrapper around C++11 regular expressions.
void resize(const label newSize)
Adjust allocated size of list.
A centralized collection of named coordinate systems.
virtual bool writeObject(IOstreamOption streamOpt, const bool valid) const
Write using stream options.
virtual bool writeObject(IOstreamOption streamOpt, const bool valid=true) const
Write using stream options.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const word & headerClassName() const
Return name of the class name read from header.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static void warnAboutAge(const char *what, const int version)
Emit warning on stderr about something being old.
const Type * findObject(const word &name, const bool recursive=false) const
Return const pointer to the object of the given Type.
FlatOutput< Container > flatOutput(const Container &obj, label len=0)
Global flatOutput function.
void close()
Close Istream.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
wordList names() const
A list of the coordinate-system names.
A List of wordRe with additional matching capabilities.
static const word null
An empty word.
const coordinateSystem * cfind(const word &name) const
Return pointer to named coordinateSystem or nullptr on error.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Istream & readStream(const word &, const bool valid=true)
Return Istream and check object type against that given.
bool good() const
Return true if next operation might succeed.
static const coordinateSystems & New(const objectRegistry &obr)
Return previously registered or read construct from "constant".
const word & constant() const
Return constant name.
Begin list [isseparator].
bool found(const keyType &key) const
Search if given key exists.
Base class for coordinate system specification, the default coordinate system type is cartesian .