36 namespace functionObjects
49 { limitType::CLAMP_MIN,
"min" },
50 { limitType::CLAMP_MAX,
"max" },
51 { limitType::CLAMP_RANGE,
"range" },
52 { limitType::CLAMP_RANGE,
"both" },
69 auto&
field = *fieldPtr;
77 Log <<
": min(" << currentRange.min() <<
')';
81 Log <<
": max(" << currentRange.max() <<
')';
113 withBounds_(limitType::CLAMP_NONE),
125 withBounds_ = limitType::CLAMP_NONE;
131 withBounds_ = limitTypeNames_.get(
"limit",
dict);
133 if (withBounds_ & limitType::CLAMP_MIN)
135 min_ =
dict.get<scalar>(
"min");
136 Info<<
" Imposing lower limit " << min_ <<
nl;
139 if (withBounds_ & limitType::CLAMP_MAX)
141 max_ =
dict.get<scalar>(
"max");
142 Info<<
" Imposing upper limit " << max_ <<
nl;
145 fieldSet_.read(
dict);
158 fieldSet_.updateSelection();
163 for (
const word& fieldName : fieldSet_.selectionNames())
167 limitScalarField(fieldName)
168 || limitField<vector>(fieldName)
169 || limitField<sphericalTensor>(fieldName)
170 || limitField<symmTensor>(fieldName)
171 || limitField<tensor>(fieldName)
180 Log <<
" - limited " <<
count <<
'/' 181 << fieldSet_.selectionNames().size() <<
" fields";
192 for (
const word& fieldName : fieldSet_.selectionNames())
194 lookupObject<regIOobject>(fieldName).
write();
virtual bool write()
Write the limitFields.
scalar min_
Minimum limit.
defineTypeNameAndDebug(ObukhovLength, 0)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
static const Enum< limitType > limitTypeNames_
Limit type names.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
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.
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
A class for handling words, derived from Foam::string.
Type * getObjectPtr(const word &name, const bool recursive=false) const
Return non-const pointer to the object of the given Type, using a const-cast to have it behave like a...
scalar max_
Maximum limit.
MinMax< Type > gMinMax(const FieldField< Field, Type > &f)
limitFields(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
int debug
Static debugging option.
bool limitScalarField(const word &fieldName)
Limit a scalar field.
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary)
limitType withBounds_
Limiting type.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
virtual bool read(const dictionary &dict)
Read the field min/max data.
const objectRegistry & obr_
Reference to the region objectRegistry.
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...
virtual bool execute()
Execute, currently does nothing.