57 <<
"Bad result naming (no '@@' token found)."
65 <<
"Bad result naming (only a '@@' token found)."
79int Foam::functionObjects::zeroGradient::process(
const word& fieldName)
82 apply<scalar>(fieldName, state);
83 apply<vector>(fieldName, state);
84 apply<sphericalTensor>(fieldName, state);
85 apply<symmTensor>(fieldName, state);
86 apply<tensor>(fieldName, state);
116 dict.readEntry(
"fields", selectFields_);
117 selectFields_.uniq();
119 Info<<
type() <<
" fields: " << selectFields_ <<
nl;
122 dict.getOrDefault<
word>(
"result", scopedName(
type() +
"(@@)"));
127 (selectFields_.size() == 1 && selectFields_.first().isLiteral())
143 for (
const wordRe& select : selectFields_)
145 if (select.isLiteral())
147 const word& fieldName = select;
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;
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.
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
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.
word scopedName(const word &name) const
Return a scoped (prefixed) name.
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 * findObject(const word &fieldName) const
Return const pointer to the object (eg, a field) in the (sub) objectRegistry.
Creates a volume field with zero-gradient boundary conditions from another volume field.
virtual bool read(const dictionary &dict)
Read the function-object dictionary.
virtual bool execute()
Execute the function-object operations.
zeroGradient(const word &name, const Time &runTime, const dictionary &dict)
Construct from name, Time and dictionary.
virtual bool write()
Write the function-object results.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
virtual bool write(const bool writeOnProc=true) const
Write using setting from DB.
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.
static bool checkFormatName(const word &str)
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.
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).