39 namespace functionObjects
58 { writeOption::NO_WRITE,
"noWrite" },
59 { writeOption::AUTO_WRITE,
"autoWrite" },
60 { writeOption::ANY_WRITE,
"anyWrite" },
82 Foam::functionObjects::writeObjects::writeObjects
91 writeOption_(ANY_WRITE),
104 if (
dict.found(
"field"))
107 dict.readEntry(
"field", objectNames_.
first());
109 else if (
dict.found(
"fields"))
111 dict.readEntry(
"fields", objectNames_);
115 dict.readEntry(
"objects", objectNames_);
122 writeOption::ANY_WRITE
139 if (!obr_.time().writeTime())
141 obr_.time().writeTimeDict();
148 bitSet missed(objectNames_.size());
163 <<
"No corresponding selection for " 165 <<
"Available objects in database:" 166 <<
nl << obr_.sortedToc()
170 for (
const word& objName : selectedNames)
172 regIOobject& obj = obr_.lookupObjectRef<regIOobject>(objName);
174 switch (writeOption_)
176 case writeOption::NO_WRITE:
185 case writeOption::AUTO_WRITE:
194 case writeOption::ANY_WRITE:
201 <<
"Unknown writeOption " 202 << writeOptionNames_[writeOption_]
203 <<
". Valid writeOption types are " 215 && obr_.time().writeTime()
218 Log <<
" automatically written object " << obj.name() <<
endl;
236 Log <<
" writing object " << obj.name() <<
endl;
defineTypeNameAndDebug(ObukhovLength, 0)
void set(const bitSet &bitset)
Set specified bits from another bitset.
errorManipArg< error, int > exit(error &err, const int errNo=1)
virtual bool write()
Write the registered objects.
void resize(const label len)
Adjust allocated size of list.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
bool found(const ListType &input, const UnaryPredicate &pred, const label start=0)
Same as found_if.
List< bool > select(const label n, const labelUList &locations)
Construct a selection list of bools (all false) with the given pre-size, subsequently add specified l...
constexpr char nl
The newline '\n' character (0x0a)
T & first()
Access first element of the list, position [0].
Ostream & endl(Ostream &os)
Add newline and flush stream.
Ignore writing from objectRegistry::writeObject()
Abstract base-class for Time/database function objects.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
EnumType getOrDefault(const word &key, const dictionary &dict, const EnumType deflt, const bool warnOnly=false) const
Find the key in the dictionary and return the corresponding enumeration element based on its name...
Macros for easy insertion into run-time selection tables.
Various functions to operate on Lists.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
A class for handling words, derived from Foam::string.
static word defaultRegion
Return the default region name.
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings...
writeOption
Re-enumeration defining the write options, Naming based on the IOobjectOption::writeOption.
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary)
List< T > subset(const BoolListType &select, const UList< T > &input, const bool invert=false)
Extract elements of the input list when select is true.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
#define WarningInFunction
Report a warning using Foam::Warning.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Foam::word regionName(args.getOrDefault< word >("region", Foam::polyMesh::defaultRegion))
static const Enum< writeOption > writeOptionNames_
virtual bool read(const dictionary &dict)
Read and set the function object if its data have changed.
Automatically write from objectRegistry::writeObject()
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
const Foam::objectRegistry & setRegistry(const Foam::Time &runTime, const Foam::dictionary &dict)
Registry of regIOobjects.
virtual bool execute()
Do nothing.
virtual bool read(const dictionary &)
Read the writeObjects data.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.