40 namespace functionObjects
59 <<
"Bad result naming (no '@@' token found)." 67 <<
"Bad result naming (only a '@@' token found)." 81 bool Foam::functionObjects::ddt2::accept(
const word& fieldName)
const 85 return !denyField_.
match(fieldName);
89 int Foam::functionObjects::ddt2::process(
const word& fieldName)
91 if (!accept(fieldName))
98 apply<volScalarField>(fieldName, state);
99 apply<volVectorField>(fieldName, state);
119 mag_(
dict.getOrDefault(
"mag", false))
131 if (
word(mesh_.ddtScheme(
"default")) ==
"steadyState")
134 << typeName <<
" function object not appropriate for steady-state" 139 dict.readEntry(
"fields", selectFields_);
140 selectFields_.uniq();
142 Info<<
type() <<
" fields: " << selectFields_ <<
nl;
144 resultName_ =
dict.getOrDefault<
word>
147 ( mag_ ?
"mag(ddt(@@))" :
"magSqr(ddt(@@))" )
153 (selectFields_.size() == 1 && selectFields_.first().isLiteral())
160 .replace(
"@@",
"(.+)")
187 if (!candidates.
erase(fieldName))
189 missing.
append(fieldName);
191 else if (process(fieldName) < 1)
193 ignored.append(fieldName);
198 for (
const word& fieldName : candidates)
206 <<
"Missing field " << missing <<
endl;
211 <<
"Unprocessed field " << ignored <<
endl;
226 const wordList outputList = results_.sortedToc();
227 for (
const word& fieldName : outputList)
229 if (foundObject<regIOobject>(fieldName))
231 const regIOobject&
io = lookupObject<regIOobject>(fieldName);
233 Log <<
" " << fieldName <<
endl;
defineTypeNameAndDebug(ObukhovLength, 0)
virtual bool execute()
Calculate the ddt2 fields.
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.
ddt2(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
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)
virtual bool write()
Write the ddt2 fields.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
virtual bool read(const dictionary &)
Read the ddt2 specification.
Macros for easy insertion into run-time selection tables.
StringType quotemeta(const StringType &str, const UnaryPredicate &meta, const char quote='\\')
Quote any meta-characters in given string.
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.
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.
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)
bool match(const std::string &text) const
True if the regex matches the entire text.
bool erase(const iterator &iter)
Erase an entry specified by given iterator.
List< word > wordList
List of word.
#define WarningInFunction
Report a warning using Foam::Warning.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
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...
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)