50 const bool useGeomLimits
63 for (
const vector&
p :
pbm[patchi].faceCentres())
71 for (
const label celli :
mesh_.cellZones()[zonei])
78 reduce(geomLimits, sumOp<scalarMinMax>());
80 if (!geomLimits.
good())
83 <<
"No patches/cellZones provided"
89 const scalar adjust(1
e-4*geomLimits.
span());
90 geomLimits.
max() += adjust;
108 <<
"Max bound must be greater than min bound" <<
nl
123 const word& outputPrefix
144 Info<<
" Activating a set of single-direction bins" <<
endl;
150 Info<<
" Employing " << nBin_ <<
" bins" <<
nl;
154 Info<<
" - min : " << binLimits_.min() <<
nl;
158 Info<<
" - max : " << binLimits_.max() <<
nl;
161 cumulative_ = binDict.
getOrDefault<
bool>(
"cumulative",
false);
162 Info<<
" - cumulative : " << cumulative_ <<
nl
163 <<
" - decomposePatchValues : " << decomposePatchValues_ <<
nl;
165 binDir_ = binDict.
get<
vector>(
"direction");
166 if (binDir_.mag() < SMALL)
169 <<
"Input direction should not be zero valued" <<
nl
170 <<
" direction = " << binDir_ <<
nl
175 Info<<
" - direction : " << binDir_ <<
nl <<
endl;
189 processField<scalar>(i)
190 || processField<vector>(i)
191 || processField<sphericalTensor>(i)
192 || processField<symmTensor>(i)
193 || processField<tensor>(i)
199 <<
"Unable to find field " << fieldNames_[i]
200 <<
". Available objects are "
201 << mesh_.objectRegistry::sortedToc()
206 writtenHeader_ =
true;
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
const polyBoundaryMesh & pbm
const T & max() const noexcept
The max value.
const T & min() const noexcept
The min value.
static MinMax< label > ge(const label &minVal)
bool good() const
Range is non-inverted.
T span() const
The min to max span. Zero for invalid range.
MinMax< T > & add(const MinMax &other)
Extend the range to include the other min/max range.
Vector< Cmpt > & normalise(const scalar tol=ROOTVSMALL)
Inplace normalise the vector by its magnitude.
Base class for bin models to handle general bin characteristics.
const fvMesh & mesh_
Reference to the mesh.
wordList fieldNames_
Names of operand fields.
label nBin_
Total number of bins.
virtual bool read(const dictionary &dict)
Read the function-object dictionary.
bool decomposePatchValues_
Decompose patch values into normal and tangential components.
labelList cellZoneIDs_
Indices of operand cell zones.
bool cumulative_
Flag to accumulate bin data with increasing distance in binning direction.
binModel(const dictionary &dict, const fvMesh &mesh, const word &outputPrefix)
Construct from components.
labelList patchIDs_
Indices of operand patches.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T. FatalIOError if not found, or if the number of tokens is incorrect.
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T, or return the given default value. FatalIOError if it is found and the number of...
T getCheck(const word &keyword, const Predicate &pred, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T with additional checking FatalIOError if not found, or if the number of tokens is...
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...
bool writtenHeader_
Flag to identify whether the header has been written.
Mesh data needed to do the Finite Volume discretisation.
A polyBoundaryMesh is a polyPatch list with registered IO, a reference to the associated polyMesh,...
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define WarningInFunction
Report a warning using Foam::Warning.
bool read(const char *buf, int32_t &val)
Same as readInt32.
messageStream Info
Information stream (stdout output on master, null elsewhere).
MinMax< scalar > scalarMinMax
A scalar min/max range.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void reduce(T &value, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce).
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
static constexpr const zero Zero
Global zero (0).
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a).
#define forAll(list, i)
Loop across all elements in list.