39 namespace functionObjects
58 <<
"Bad result naming (no '@@' token found)." 66 <<
"Bad result naming (only a '@@' token found)." 80 int Foam::functionObjects::zeroGradient::process(
const word& fieldName)
83 apply<scalar>(fieldName, state);
84 apply<vector>(fieldName, state);
85 apply<sphericalTensor>(fieldName, state);
86 apply<symmTensor>(fieldName, state);
87 apply<tensor>(fieldName, state);
117 dict.readEntry(
"fields", selectFields_);
118 selectFields_.uniq();
120 Info<<
type() <<
" fields: " << selectFields_ <<
nl;
123 dict.getOrDefault<
word>(
"result", scopedName(
type() +
"(@@)"));
128 (selectFields_.size() == 1 && selectFields_.first().isLiteral())
149 if (!candidates.
erase(fieldName))
151 missing.
append(fieldName);
153 else if (process(fieldName) < 1)
155 ignored.append(fieldName);
160 for (
const word& fieldName : candidates)
168 <<
"Missing field " << missing <<
endl;
173 <<
"Unprocessed field " << ignored <<
endl;
188 for (
const word& fieldName : results_.sortedToc())
190 const regIOobject* ioptr = findObject<regIOobject>(fieldName);
194 Log <<
" " << fieldName <<
endl;
defineTypeNameAndDebug(ObukhovLength, 0)
bool contains(char c) const noexcept
True if string contains given character (cf. C++23)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
void append(const T &val)
Append an element at the end of the list.
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)
Ostream & endl(Ostream &os)
Add newline and flush stream.
StringListType subsetStrings(const regExp &matcher, const StringListType &input, const bool invert=false)
Extract elements of StringList when regular expression matches.
Operations on lists of strings.
virtual bool execute()
Calculate the zeroGradient fields.
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 *buf, int32_t &val)
Same as readInt32.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
zeroGradient(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
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.
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...
static bool checkFormatName(const word &str)
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary)
virtual bool write()
Write the zeroGradient fields.
bool erase(const iterator &iter)
Erase an entry specified by given iterator.
#define WarningInFunction
Report a warning using Foam::Warning.
virtual bool read(const dictionary &dict)
Read the zeroGradient specification.
messageStream Info
Information stream (stdout output on master, null elsewhere)
virtual bool read(const dictionary &dict)
Read optional controls.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...