59 <<
"Bad result naming (no '@@' token found)."
67 <<
"Bad result naming (only a '@@' token found)."
81bool Foam::functionObjects::ddt2::accept(
const word& fieldName)
const
85 return !denyField_.
match(fieldName);
89int Foam::functionObjects::ddt2::process(
const word& fieldName)
91 if (!accept(fieldName))
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(
"@@",
"(.+)")
181 for (
const wordRe& select : selectFields_)
183 if (select.isLiteral())
185 const word& fieldName = select;
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;
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void append(const T &val)
Copy append an element to the end of this list.
bool erase(const iterator &iter)
Erase an entry specified by given iterator.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
void size(const label n)
Older name for setAddressableSize.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Abstract base-class for Time/database function objects.
virtual bool read(const dictionary &dict)
Read and set the function object if its data have changed.
Computes the magnitude or magnitude squared of the Eulerian time derivative of an input volume field ...
ddt2(const word &name, const Time &runTime, const dictionary &dict)
Construct from name, Time and dictionary.
virtual bool read(const dictionary &dict)
Read the function-object dictionary.
virtual bool execute()
Execute the function-object operations.
virtual bool write()
Write the function-object results.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
const fvMesh & mesh_
Reference to the fvMesh.
fvMeshFunctionObject(const fvMeshFunctionObject &)=delete
No copy construct.
const ObjectType & lookupObject(const word &fieldName) const
Lookup and return object (eg, a field) from the (sub) objectRegistry.
bool foundObject(const word &fieldName) const
Find object (eg, a field) in the (sub) objectRegistry.
bool match(const std::string &text) const
True if the regex matches the entire text.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
bool contains(char c) const noexcept
True if string contains given character (cf. C++23).
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define WarningInFunction
Report a warning using Foam::Warning.
Function objects are OpenFOAM utilities to ease workflow configurations and enhance workflows.
StringType quotemeta(const StringType &str, const UnaryPredicate &meta, const char quote='\\')
Quote any meta-characters in given string.
static bool checkFormatName(const word &str)
List< word > wordList
List of word.
HashSet< word, Hash< word > > wordHashSet
A HashSet of words, uses string hasher.
bool read(const char *buf, int32_t &val)
Same as readInt32.
messageStream Info
Information stream (stdout output on master, null elsewhere).
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
static void apply(bitSet &selection, const Detail::parcelSelection::actionType action, const Predicate &accept, const UList< Type > &list, const AccessOp &aop)
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
constexpr char nl
The newline '\n' character (0x0a).