54 const word& modelType,
91 label nFacesAbove = 0;
96 for (
const label facei : faces_)
98 auto& hval = hif[facei];
102 hval *= max_/
max(hval, SMALL);
108 label nEdgesAbove = 0;
114 if (!hp.fixesValue())
116 for (
auto& hval : hp)
120 hval *= max_/
max(hval, SMALL);
129 const auto percent = [](scalar num, label denom) -> scalar
131 return (denom ? 1
e-2*round(1e4*num/denom) : 0);
135 reduce(nFacesAbove, sumOp<label>());
136 reduce(nEdgesAbove, sumOp<label>());
138 Info<<
type() <<
' ' << name_ <<
" Limited " 139 << nFacesAbove <<
" (" 140 << percent(nFacesAbove, nTotFaces)
141 <<
"%) of faces, with max limit " << max_ <<
endl;
143 if (nFacesAbove || nEdgesAbove)
147 h.correctBoundaryConditions();
addToRunTimeSelectionTable(option, limitHeight, dictionary)
wordList fieldNames_
Field names to apply source to - populated by derived models.
void resize(const label len)
Adjust allocated size of list.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
scalar max_
Maximum height [m].
Ostream & endl(Ostream &os)
Add newline and flush stream.
faPatchField<Type> abstract base class. This class gives a fat-interface to all derived classes cover...
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
Base abstract class for handling finite area options (i.e. faOption).
Macros for easy insertion into run-time selection tables.
bool useSubMesh() const noexcept
True if sub-selection should be used.
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, IOobjectOption::readOption readOpt=IOobjectOption::MUST_READ) const
Find entry and assign to T val. FatalIOError if it is found and the number of tokens is incorrect...
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
const dimensionedScalar e
Elementary charge.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
A class for handling words, derived from Foam::string.
defineTypeNameAndDebug(limitHeight, 0)
limitHeight(const limitHeight &)=delete
No copy construct.
Limits the film height to a specified max value.
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry if present, and assign to T val. FatalIOError if it is found and the number of tokens i...
const dimensionedScalar h
Planck constant.
word hName_
Name of operand height field.
virtual void correct(areaScalarField &h)
Correct the height field.
virtual bool read(const dictionary &dict)
Read dictionary.
Mesh data needed to do the Finite Volume discretisation.
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
Reduce inplace (cf. MPI Allreduce) using specified communication schedule.
virtual bool read(const dictionary &dict)
Read source dictionary.
messageStream Info
Information stream (stdout output on master, null elsewhere)
List< bool > applied_
Applied flag list - corresponds to each fieldNames_ entry.
dictionary coeffs_
Dictionary containing source coefficients.