35 namespace functionObjects
69 void Foam::functionObjects::writeObjects::writeObject
101 <<
"Unknown writeOption "
114 Log <<
" automatically written object " << obj.
name() <<
endl;
122 regIOobject& objRef =
const_cast<regIOobject&
>(obj);
123 objRef.IOobject::rename(
"tmp<" +
name +
">");
125 objRef.IOobject::rename(
name);
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;
192 executeAtStart_ =
dict.lookupOrDefault<
Switch>(
"executeAtStart",
false);
Macros for easy insertion into run-time selection tables.
writeOption writeOpt() const
const objectRegistry & db() const
Return the local objectRegistry.
const word & name() const
Return name.
Initialise the NamedEnum HashTable from the static list of names.
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
bool writeTime() const
Return true if this is a write time.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Abstract base-class for Time/database functionObjects.
const Time & time_
Reference to time.
const word & name() const
Return the name of this functionObject.
virtual bool read(const dictionary &)
Read and set the functionObject if its data have changed.
Calculates the natural logarithm of the specified scalar field.
FunctionObject base class for writing a list of objects registered to the database,...
virtual void writeObject(const regIOobject &obj)
Write the requested registered IO object.
virtual bool write()
Write function.
virtual bool read(const dictionary &)
Read the list of objects to be written.
Allows specification of different writing frequency of objects registered to the database.
virtual ~writeObjects()
Destructor.
static const NamedEnum< writeOption, 3 > writeOptionNames_
writeOption
Re-enumeration defining the write options, based on the original.
virtual bool execute()
Do nothing.
writeObjects(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
virtual bool write()
Write the registered objects.
virtual bool read(const dictionary &)
Read the writeObjects data.
Registry of regIOobjects.
bool cacheTemporaryObject(const word &name) const
Return true if given name is in the cacheTemporaryObjects set.
Mesh consisting of general polyhedral cells.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define Log
Report write to Foam::Info if the local log switch is true.
defineTypeNameAndDebug(adjustTimeStepToCombustion, 0)
addToRunTimeSelectionTable(functionObject, adjustTimeStepToCombustion, dictionary)
errorManipArg< error, int > exit(error &err, const int errNo=1)
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.