35 namespace functionObjects
69 void Foam::functionObjects::writeObjects::writeObject
76 case writeOption::AUTO_WRITE:
85 case writeOption::NO_WRITE:
94 case writeOption::ANY_WRITE:
101 <<
"Unknown writeOption " 102 << writeOptionNames_[writeOption_]
103 <<
". Valid writeOption types are" << writeOptionNames_
111 && writeObr_.time().writeTime()
114 Log <<
" automatically written object " << obj.
name() <<
endl;
123 objRef.IOobject::rename(
"tmp<" + name +
">");
125 objRef.IOobject::rename(name);
153 writeOption_(writeOption::ANY_WRITE)
169 if (dict.
found(
"field"))
171 writeObjectNames_.setSize(1);
172 dict.
lookup(
"field") >> writeObjectNames_[0];
174 else if (dict.
found(
"fields"))
176 dict.
lookup(
"fields") >> writeObjectNames_;
183 if (dict.
found(
"writeOption"))
185 writeOption_ = writeOptionNames_.read(dict.
lookup(
"writeOption"));
189 writeOption_ = writeOption::ANY_WRITE;
virtual bool write()
Write function.
Calculates the natural logarithm of the specified scalar field.
bool cacheTemporaryObject(const word &name) const
Return true if given name is in the cacheTemporaryObjects set.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
const word & name() const
Return name.
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_
addToRunTimeSelectionTable(functionObject, Qdot, dictionary)
static word defaultRegion
Return the default region name.
Ostream & endl(Ostream &os)
Add newline and flush stream.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none/any.
Abstract base-class for Time/database functionObjects.
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.
writeObjects(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
writeOption
Re-enumeration defining the write options, based on the original.
virtual bool read(const dictionary &)
Read and set the functionObject 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.
defineTypeNameAndDebug(Qdot, 0)
writeOption writeOpt() const
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
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.
Registry of regIOobjects.
const objectRegistry & db() const
Return the local objectRegistry.
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.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.