36 namespace functionObjects
66 writeFileHeader<scalar>(
os, fieldName);
67 writeFileHeader<vector>(
os, fieldName);
68 writeFileHeader<sphericalTensor>(
os, fieldName);
69 writeFileHeader<symmTensor>(
os, fieldName);
70 writeFileHeader<tensor>(
os, fieldName);
84 if (!writeResidualFields_)
89 const word residualName
104 mesh_.time().timeName(),
115 residualFieldNames_.insert(residualName);
130 writeFile(obr_,
name, typeName,
dict),
132 residualFieldNames_(),
133 writeResidualFields_(false),
148 fieldSet_.read(
dict);
150 writeResidualFields_ =
dict.getOrDefault(
"writeResidualFields",
false);
152 residualFieldNames_.clear();
167 writeFileHeader(file());
169 if (writeResidualFields_)
171 for (
const word& fieldName : fieldSet_.selectionNames())
173 initialiseResidualField<scalar>(fieldName);
174 initialiseResidualField<vector>(fieldName);
175 initialiseResidualField<sphericalTensor>(fieldName);
176 initialiseResidualField<symmTensor>(fieldName);
177 initialiseResidualField<tensor>(fieldName);
184 writeCurrentTime(file());
186 for (
const word& fieldName : fieldSet_.selectionNames())
188 updateSolverInfo<scalar>(fieldName);
189 updateSolverInfo<vector>(fieldName);
190 updateSolverInfo<sphericalTensor>(fieldName);
191 updateSolverInfo<symmTensor>(fieldName);
192 updateSolverInfo<tensor>(fieldName);
203 for (
const word& residualName : residualFieldNames_)
205 const auto* residualPtr =
215 mesh_.time().timeName(),
227 residual.correctBoundaryConditions();
static const word & zeroGradientType() noexcept
The type name for zeroGradient patch fields.
virtual OFstream & file()
Return access to the file (if only 1)
Writes solver information for a list of user-specified fields.
defineTypeNameAndDebug(ObukhovLength, 0)
static bool initialised_(false)
virtual void writeHeader(Ostream &os, const string &str) const
Write a commented header to stream.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
virtual void writeBreak(Ostream &os) const
Write a break marker to the stream.
Ostream & endl(Ostream &os)
Add newline and flush stream.
wordList selectionNames() const
Return the current field selection, in sorted order.
bool writtenHeader_
Flag to identify whether the header has been written.
Ignore writing from objectRegistry::writeObject()
const dimensionSet dimless
Dimensionless.
Abstract base-class for Time/database function objects.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
virtual bool execute()
Execute solverInfo.
Macros for easy insertion into run-time selection tables.
bool read(const char *buf, int32_t &val)
Same as readInt32.
virtual bool updateSelection()
Update the selection using current contents of obr_.
virtual void writeCommented(Ostream &os, const string &str) const
Write a commented string to stream.
static word scopedName(const std::string &scope, const word &name)
Create scope:name or scope_name string.
void writeFileHeader(Ostream &os)
Output file header information.
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.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary)
solverFieldSelection fieldSet_
Names of operand fields.
Internal::FieldType & primitiveFieldRef(const bool updateAccessTime=true)
Return a reference to the internal field values.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
virtual bool read(const dictionary &dict)
Read optional controls.
void createResidualField(const word &fieldName)
Create and store a residual field on the mesh database.
solverInfo(const solverInfo &)=delete
No copy construct.
virtual bool write()
Write solverInfo results.
Defines the attributes of an object for which implicit objectRegistry management is supported...
Request registration (bool: true)
A primitive field of type <T> with automated input and output.
Do not request registration (bool: false)
virtual bool read(const dictionary &)
Read solverInfo settings.
static constexpr const zero Zero
Global zero (0)