35 namespace functionObjects
69 void Foam::functionObjects::writeObjects::writeObject
101 <<
"Unknown writeOption " 102 << writeOptionNames_[writeOption_]
103 <<
". Valid writeOption types are" << writeOptionNames_
111 && writeObr_.time().writeTime()
114 Log <<
" automatically written object " << obj.
name() <<
endl;
125 Foam::functionObjects::writeObjects::writeObjects
141 writeOption_(ANY_WRITE)
157 if (dict.
found(
"field"))
159 writeObjectNames_.setSize(1);
160 dict.
lookup(
"field") >> writeObjectNames_[0];
162 else if (dict.
found(
"fields"))
164 dict.
lookup(
"fields") >> writeObjectNames_;
171 if (dict.
found(
"writeOption"))
173 writeOption_ = writeOptionNames_.read(dict.
lookup(
"writeOption"));
177 writeOption_ = ANY_WRITE;
virtual bool write()
Write function.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
const word & name() const
Return name.
dimensionedScalar log(const dimensionedScalar &ds)
errorManipArg< error, int > exit(error &err, const int errNo=1)
virtual bool write()
Write the registered objects.
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static const NamedEnum< writeOption, 3 > writeOptionNames_
static word defaultRegion
Return the default region name.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Abstract base-class for Time/database function objects.
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type.
Initialise the NamedEnum HashTable from the static list of names.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Macros for easy insertion into run-time selection tables.
bool read(const char *, int32_t &)
A class for handling words, derived from string.
writeOption
Re-enumeration defining the write options, based on the original.
virtual bool read(const dictionary &)
Read and set the function object if its data have changed.
virtual void writeObject(const regIOobject &obj)
Write the requested registered IO object.
word name(const complex &)
Return a string representation of a complex.
fileName::Type type(const fileName &, const bool followLink=true)
Return the file type: DIRECTORY or FILE.
writeOption writeOpt() const
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
FunctionObject base class for writing a list of objects registered to the database, on behalf of the inheriting function object, on when those should be written to disk.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
#define Log
Report write to Foam::Info if the local log switch is true.
defineTypeNameAndDebug(fvMeshFunctionObject, 0)
Registry of regIOobjects.
virtual bool execute()
Do nothing.
virtual ~writeObjects()
Destructor.
virtual bool read(const dictionary &)
Read the writeObjects data.
virtual bool read(const dictionary &)
Read the list of objects to be written.
addToRunTimeSelectionTable(functionObject, add, dictionary)
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.