35 namespace functionObjects
62 void Foam::functionObjects::writeObjects::writeObject
64 const regIOobject& obj
99 Log <<
" automatically written object " << obj.name() <<
endl;
103 if (obj.db().cacheTemporaryObject(obj.name()))
106 const word
name(obj.name());
107 regIOobject& objRef =
const_cast<regIOobject&
>(obj);
108 objRef.IOobject::rename(
"tmp<" +
name +
">");
110 objRef.IOobject::rename(
name);
154 if (
dict.found(
"field"))
156 writeObjectNames_.setSize(1);
157 dict.lookup(
"field") >> writeObjectNames_[0];
159 else if (
dict.found(
"fields"))
161 dict.lookup(
"fields") >> writeObjectNames_;
168 if (
dict.found(
"writeOption"))
170 writeOption_ = writeOptionNames_.read(
dict.lookup(
"writeOption"));
174 writeOption_ = writeOption::ANY_WRITE;
177 executeAtStart_ =
dict.lookupOrDefault<
Switch>(
"executeAtStart",
false);
Macros for easy insertion into run-time selection tables.
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 keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
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.
Mesh consisting of general polyhedral cells.
A class for handling words, derived from string.
#define Log
Report write to Foam::Info if the local log switch is true.
defineTypeNameAndDebug(adjustTimeStepToCombustion, 0)
addToRunTimeSelectionTable(functionObject, adjustTimeStepToCombustion, dictionary)
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.