39namespace functionObjects
58 { writeOption::AUTO_WRITE,
"autoWrite" },
59 { writeOption::NO_WRITE,
"noWrite" },
60 { writeOption::ANY_WRITE,
"anyWrite" },
91 writeOption_(ANY_WRITE),
104 if (
dict.found(
"field"))
106 objectNames_.resize(1);
107 dict.readEntry(
"field", objectNames_.first());
109 else if (
dict.found(
"fields"))
111 dict.readEntry(
"fields", objectNames_);
115 dict.readEntry(
"objects", objectNames_);
118 writeOption_ = writeOptionNames_.getOrDefault
122 writeOption::ANY_WRITE
139 if (!obr_.time().writeTime())
141 obr_.time().writeTimeDict();
148 bitSet missed(objectNames_.size());
151 for (
const wordRe& select : objectNames_)
163 <<
"No corresponding selection for "
165 <<
"Available objects in database:"
166 <<
nl << obr_.sortedToc()
170 for (
const word& objName : selectedNames)
174 switch (writeOption_)
201 <<
"Unknown writeOption "
202 << writeOptionNames_[writeOption_]
203 <<
". Valid writeOption types are "
215 && obr_.time().writeTime()
218 Log <<
" automatically written object " << obj.
name() <<
endl;
Various functions to operate on Lists.
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
const word & name() const noexcept
Return the object name.
writeOption writeOpt() const noexcept
The write option.
virtual bool read()
Re-read model coefficients if they have changed.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
void set(const bitSet &bitset)
Set specified bits from another bitset.
bool any() const
True if any bits in this bitset are set.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Abstract base-class for Time/database function objects.
Allows specification of different writing frequency of objects registered to the database.
static const Enum< writeOption > writeOptionNames_
writeOption
Re-enumeration defining the write options, based on the original.
virtual bool execute()
Do nothing.
virtual bool write()
Write the registered objects.
virtual bool read(const dictionary &)
Read the writeObjects data.
Registry of regIOobjects.
static word defaultRegion
Return the default region name.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
virtual bool write(const bool valid=true) const
Write using setting from DB.
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Foam::word regionName(Foam::polyMesh::defaultRegion)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define WarningInFunction
Report a warning using Foam::Warning.
bool found(const ListType &input, const UnaryPredicate &pred, const label start=0)
Same as found_if.
List< T > subset(const BoolListType &select, const UList< T > &input, const bool invert=false)
Extract elements of the input list when select is true.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
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.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)
const Foam::objectRegistry & setRegistry(const Foam::Time &runTime, const Foam::dictionary &dict)