Go to the documentation of this file.
39 namespace functionObjects
58 { writeOption::AUTO_WRITE,
"autoWrite" },
59 { writeOption::NO_WRITE,
"noWrite" },
60 { writeOption::ANY_WRITE,
"anyWrite" },
66 Foam::functionObjects::writeObjects::writeObjects
78 dict.getOrDefault(
"region", polyMesh::defaultRegion)
81 writeOption_(ANY_WRITE),
94 if (
dict.found(
"field"))
97 dict.readEntry(
"field", objectNames_.first());
99 else if (
dict.found(
"fields"))
101 dict.readEntry(
"fields", objectNames_);
105 dict.readEntry(
"objects", objectNames_);
112 writeOption::ANY_WRITE
129 if (!obr_.time().writeTime())
131 obr_.time().writeTimeDict();
138 bitSet missed(objectNames_.size());
141 for (
const wordRe& select : objectNames_)
153 <<
"No corresponding selection for "
155 <<
"Available objects in database:"
156 <<
nl << obr_.sortedToc()
160 for (
const word& objName : selectedNames)
164 switch (writeOption_)
191 <<
"Unknown writeOption "
192 << writeOptionNames_[writeOption_]
193 <<
". Valid writeOption types are "
205 && obr_.time().writeTime()
208 Log <<
" automatically written object " << obj.
name() <<
endl;
virtual bool write()
Write the registered objects.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A class for handling words, derived from Foam::string.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
void resize(const label len)
Adjust allocated size of list.
List< T > subset(const BoolListType &select, const UList< T > &input, const bool invert=false)
Extract elements of the input list when select is true.
void set(const bitSet &bitset)
Set specified bits from another bitset.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static const Enum< writeOption > writeOptionNames_
writeOption writeOpt() const noexcept
The write option.
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
Abstract base-class for Time/database function objects.
writeOption
Re-enumeration defining the write options, based on the original.
Registry of regIOobjects.
virtual bool write(const bool valid=true) const
Write using setting from DB.
EnumType getOrDefault(const word &key, const dictionary &dict, const EnumType deflt, const bool failsafe=false) const
virtual bool read(const dictionary &dict)
Read and set the function object if its data have changed.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Macros for easy insertion into run-time selection tables.
virtual bool execute()
Do nothing.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const word & name() const noexcept
Return name.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary)
virtual bool read(const dictionary &)
Read the writeObjects data.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
defineTypeNameAndDebug(ObukhovLength, 0)
bool found(const ListType &input, const UnaryPredicate &pred, const label start=0)
True if there is a value in the list that satisfies the predicate.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Various functions to operate on Lists.
#define WarningInFunction
Report a warning using Foam::Warning.