82 geomLimits.
max() += adjust;
103 <<
"Max bounds must be greater than min bounds" <<
nl
104 <<
" direction = " << cmpt <<
nl
120 <<
"Bin widths must be greater than zero" <<
nl
121 <<
" direction = " << cmpt <<
nl
140 bool faceInside =
true;
145 d[i][cmpt] < binLimits_.min()[cmpt]
146 || d[i][cmpt] > binLimits_.max()[cmpt]
157 Vector<label>
n(
Zero);
162 (d[i][cmpt] - binLimits_.min()[cmpt])/binWidth_[cmpt]
165 n[cmpt] =
min(
max(bini, 0), nBins_[cmpt] - 1);
169 binIndices[i] =
n.x() + nBins_[0]*
n.y() + nBins_[0]*nBins_[1]*
n.z();
183 faceToBin_.resize_nocopy(mesh_.nBoundaryFaces());
186 for (
const label patchi : patchIDs_)
188 const polyPatch&
pp = mesh_.boundaryMesh()[patchi];
189 const label i0 =
pp.start() - mesh_.nInternalFaces();
192 binAddr(coordSysPtr_->localPosition(
pp.faceCentres()));
195 cellToBin_.resize_nocopy(mesh_.nCells());
198 for (
const label zonei : cellZoneIDs_)
200 const cellZone& cZone = mesh_.cellZones()[zonei];
203 binAddr(coordSysPtr_->localPosition(
vectorField(mesh_.C(), cZone)))
208 const label celli = cZone[i];
209 cellToBin_[celli] = bins[i];
221 const word& outputPrefix
242 Info<<
" Activating a set of uniform bins" <<
endl;
248 for (
const label
n : nBins_)
256 <<
"Number of bins must be greater than zero" <<
nl
257 <<
" e1 bins = " << nBins_.x() <<
nl
258 <<
" e2 bins = " << nBins_.y() <<
nl
259 <<
" e3 bins = " << nBins_.z()
263 Info<<
" - Employing:" <<
nl
264 <<
" " << nBins_.x() <<
" e1 bins," <<
nl
265 <<
" " << nBins_.y() <<
" e2 bins," <<
nl
266 <<
" " << nBins_.z() <<
" e3 bins"
269 cumulative_ = binDict.
getOrDefault<
bool>(
"cumulative",
false);
270 Info<<
" - cumulative : " << cumulative_ <<
endl;
271 Info<<
" - decomposePatchValues : " << decomposePatchValues_ <<
endl;
277 const auto& minMaxDict = *minMaxDictPtr;
285 if (minMaxDict.readIfPresent(ei,
range))
287 binLimits_.min()[cmpt] =
range.min();
288 binLimits_.max()[cmpt] =
range.max();
290 Info<<
" - " << ei <<
" min/max : " <<
range <<
nl;
308 processField<scalar>(i)
309 || processField<vector>(i)
310 || processField<sphericalTensor>(i)
311 || processField<symmTensor>(i)
312 || processField<tensor>(i)
318 <<
"Unable to find field " << fieldNames_[i] <<
endl;
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
const polyBoundaryMesh & pbm
A min/max value pair with additional methods. In addition to conveniently storing values,...
A non-owning sub-view of a List (allocated or unallocated storage).
void size(const label n)
Older name for setAddressableSize.
static constexpr direction nComponents
Number of components in this vector space.
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
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.
autoPtr< coordinateSystem > coordSysPtr_
Local coordinate system of bins.
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 bounding box defined in terms of min/max extrema points.
const point & max() const noexcept
Maximum describing the bounding box.
void reduce()
Inplace parallel reduction of min/max values, using UPstream::worldComm.
const point & min() const noexcept
Minimum describing the bounding box.
void add(const boundBox &bb)
Extend to include the second box.
vector span() const
The bounding box span (from minimum to maximum).
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.
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...
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...
bool writtenHeader_
Flag to identify whether the header has been written.
Mesh data needed to do the Finite Volume discretisation.
const volVectorField & C() const
Return cell centres as volVectorField.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A polyBoundaryMesh is a polyPatch list with registered IO, a reference to the associated polyMesh,...
Mesh consisting of general polyhedral cells.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
const cellZoneMesh & cellZones() const noexcept
Return cell zone mesh.
A patch is a list of labels that address the faces in the global face list.
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.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
List< label > labelList
A List of labels.
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.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Field< vector > vectorField
Specialisation of Field<T> for vector.
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...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
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.