62 geomLimits.
add(limits.min());
63 geomLimits.
add(limits.max());
74 MinMax<vector> limits(
pts);
76 geomLimits.
add(limits.min());
77 geomLimits.
add(limits.max());
86 geomLimits.
max() += adjust;
107 <<
"Max bounds must be greater than min bounds" <<
nl 108 <<
" direction = " << cmpt <<
nl 124 <<
"Bin widths must be greater than zero" <<
nl 125 <<
" direction = " << cmpt <<
nl 144 bool faceInside =
true;
149 d[i][cmpt] < binLimits_.min()[cmpt]
150 || d[i][cmpt] > binLimits_.max()[cmpt]
161 Vector<label>
n(
Zero);
166 (d[i][cmpt] - binLimits_.min()[cmpt])/binWidth_[cmpt]
169 n[cmpt] =
min(
max(bini, 0), nBins_[cmpt] - 1);
173 binIndices[i] =
n.x() + nBins_[0]*
n.y() + nBins_[0]*nBins_[1]*
n.z();
187 faceToBin_.resize_nocopy(mesh_.nBoundaryFaces());
190 for (
const label patchi : patchIDs_)
192 const polyPatch&
pp = mesh_.boundaryMesh()[patchi];
193 const label i0 =
pp.start() - mesh_.nInternalFaces();
196 binAddr(coordSysPtr_->localPosition(
pp.faceCentres()));
199 cellToBin_.resize_nocopy(mesh_.nCells());
202 for (
const label zonei : cellZoneIDs_)
204 const cellZone& cZone = mesh_.cellZones()[zonei];
207 binAddr(coordSysPtr_->localPosition(
vectorField(mesh_.C(), cZone)))
212 const label celli = cZone[i];
213 cellToBin_[celli] = bins[i];
225 const word& outputPrefix
246 Info<<
" Activating a set of uniform bins" <<
endl;
252 for (
const label
n : nBins_)
260 <<
"Number of bins must be greater than zero" <<
nl 261 <<
" e1 bins = " << nBins_.x() <<
nl 262 <<
" e2 bins = " << nBins_.y() <<
nl 263 <<
" e3 bins = " << nBins_.z()
267 Info<<
" - Employing:" <<
nl 268 <<
" " << nBins_.x() <<
" e1 bins," <<
nl 269 <<
" " << nBins_.y() <<
" e2 bins," <<
nl 270 <<
" " << nBins_.z() <<
" e3 bins" 273 cumulative_ = binDict.
getOrDefault<
bool>(
"cumulative",
false);
274 Info<<
" - cumulative : " << cumulative_ <<
endl;
275 Info<<
" - decomposePatchValues : " << decomposePatchValues_ <<
endl;
281 const auto& minMaxDict = *minMaxDictPtr;
289 if (minMaxDict.readIfPresent(ei,
range))
291 binLimits_.min()[cmpt] =
range.min();
292 binLimits_.max()[cmpt] =
range.max();
294 Info<<
" - " << ei <<
" min/max : " <<
range <<
nl;
312 processField<scalar>(i)
313 || processField<vector>(i)
314 || processField<sphericalTensor>(i)
315 || processField<symmTensor>(i)
316 || processField<tensor>(i)
322 <<
"Unable to find field " << fieldNames_[i] <<
endl;
326 writtenHeader_ =
true;
const polyBoundaryMesh & pbm
void size(const label n)
Older name for setAddressableSize.
MinMax< scalar > scalarMinMax
A scalar min/max range.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const fvMesh & mesh_
Reference to the mesh.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
constexpr char nl
The newline '\n' character (0x0a)
A min/max value pair with additional methods. In addition to conveniently storing values...
Ostream & endl(Ostream &os)
Add newline and flush stream.
A bounding box defined in terms of min/max extrema points.
::Foam::direction nComponents(const expressions::valueTypeCode) noexcept
The number of components associated with given valueTypeCode.
const point & min() const noexcept
Minimum describing the bounding box.
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.
defineTypeNameAndDebug(singleDirectionUniformBin, 0)
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
Base class for bin models to handle general bin characteristics.
const point & max() const noexcept
Maximum describing the bounding box.
void add(const boundBox &bb)
Extend to include the second box.
A List obtained as a section of another List.
const dimensionedScalar e
Elementary charge.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
A class for handling words, derived from Foam::string.
labelList patchIDs_
Indices of operand patches.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
void reduce()
Inplace parallel reduction of min/max values.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO...
autoPtr< coordinateSystem > coordSysPtr_
Local coordinate system of bins.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
addToRunTimeSelectionTable(binModel, singleDirectionUniformBin, dictionary)
#define WarningInFunction
Report a warning using Foam::Warning.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Mesh data needed to do the Finite Volume discretisation.
virtual bool read(const dictionary &dict)
Read the dictionary.
const cellZoneMesh & cellZones() const noexcept
Return cell zone mesh.
vector span() const
The bounding box span (from minimum to maximum)
messageStream Info
Information stream (stdout output on master, null elsewhere)
Field< vector > vectorField
Specialisation of Field<T> for vector.
Mesh consisting of general polyhedral cells.
const volVectorField & C() const
Return cell centres as volVectorField.
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...
labelList cellZoneIDs_
Indices of operand cell zones.
A patch is a list of labels that address the faces in the global face list.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
const dictionary * findDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary pointer if present (and it is a dictionary) otherwise return nullptr...
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)