Calculates binned data in multiple segments according to a specified Cartesian or cylindrical coordinate system. More...
#include <uniformBin.H>


Public Member Functions | |
| TypeName ("uniformBin") | |
| Runtime type information. | |
| uniformBin (const dictionary &dict, const fvMesh &mesh, const word &outputPrefix) | |
| Construct from components. | |
| uniformBin (const uniformBin &)=delete | |
| No copy construct. | |
| void | operator= (const uniformBin &)=delete |
| No copy assignment. | |
| virtual | ~uniformBin ()=default |
| Destructor. | |
| virtual bool | read (const dictionary &dict) |
| Read the function-object dictionary. | |
| virtual void | apply () |
| Apply bins. | |
| virtual void | updateMesh (const mapPolyMesh &mpm) |
| Update for changes of mesh. | |
| virtual void | movePoints (const polyMesh &mesh) |
| Update for changes of mesh. | |
| Public Member Functions inherited from binModel | |
| TypeName ("binModel") | |
| Runtime type information. | |
| declareRunTimeSelectionTable (autoPtr, binModel, dictionary,(const dictionary &dict, const fvMesh &mesh, const word &outputPrefix),(dict, mesh, outputPrefix)) | |
| binModel (const dictionary &dict, const fvMesh &mesh, const word &outputPrefix) | |
| Construct from components. | |
| binModel (const binModel &)=delete | |
| No copy construct. | |
| void | operator= (const binModel &)=delete |
| No copy assignment. | |
| virtual | ~binModel ()=default |
| Destructor. | |
| label | nBin () const noexcept |
| Return the total number of bins. | |
| template<> | |
| bool | decomposePatchValues (List< List< vector > > &data, const label bini, const vector &v, const vector &n) const |
| template<> | |
| bool | decomposePatchValues (List< List< vector > > &data, const label bini, const vector &v, const vector &n) const |
| template<class Type> | |
| Foam::string | writeComponents (const word &stem) const |
| Public Member Functions inherited from writeFile | |
| writeFile (const objectRegistry &obr, const fileName &prefix, const word &name="undefined", const bool writeToFile=true, const string &ext=".dat") | |
| Construct from objectRegistry, prefix, fileName. | |
| writeFile (const objectRegistry &obr, const fileName &prefix, const word &name, const dictionary &dict, const bool writeToFile=true, const string &ext=".dat") | |
| Construct from objectRegistry, prefix, fileName and read options from dictionary. | |
| writeFile (const writeFile &wf) | |
| Construct copy. | |
| virtual | ~writeFile ()=default |
| Destructor. | |
| virtual const string & | setExt (const string &ext) |
| Set extension. | |
| virtual OFstream & | file () |
| Return access to the file (if only 1). | |
| virtual bool | writeToFile () const |
| Flag to allow writing to file. | |
| virtual bool | canWriteToFile () const |
| Flag to allow writing to the file. | |
| virtual bool | canResetFile () const |
| Flag to allow resetting the file. | |
| virtual bool | canWriteHeader () const |
| Flag to allow writing the header. | |
| virtual label | charWidth () const |
| Return width of character stream output. | |
| virtual void | writeCommented (Ostream &os, const string &str) const |
| Write a commented string to stream. | |
| virtual void | writeTabbed (Ostream &os, const string &str) const |
| Write a tabbed string to stream. | |
| virtual void | writeHeader (Ostream &os, const string &str) const |
| Write a commented header to stream. | |
| virtual void | writeCurrentTime (Ostream &os) const |
| Write the current time to stream. | |
| virtual void | writeBreak (Ostream &os) const |
| Write a break marker to the stream. | |
| template<class Type> | |
| void | writeHeaderValue (Ostream &os, const string &property, const Type &value) const |
| Write a (commented) header property and value pair. | |
| template<class Type> | |
| void | writeValue (Ostream &os, const Type &val) const |
| Write a given value to stream with the space delimiter. | |
Protected Member Functions | |
| template<class Type> | |
| void | writeFileHeader (OFstream &os) const |
| Write header for an binned-data file. | |
| virtual void | initialise () |
| Initialise bin properties. | |
| virtual labelList | binAddr (const vectorField &d) const |
| Return list of bin indices corresponding to positions given by d. | |
| virtual void | setBinsAddressing () |
| Set/cache the bin addressing. | |
| template<class Type> | |
| bool | processField (const label fieldi) |
| Apply the binning to field fieldi. | |
| Protected Member Functions inherited from binModel | |
| void | setCoordinateSystem (const dictionary &dict, const word &e3Name=word::null, const word &e1Name=word::null) |
| Set the co-ordinate system from dictionary and axes names. | |
| template<class Type> | |
| bool | decomposePatchValues (List< List< Type > > &data, const label bini, const Type &v, const vector &n) const |
| Helper function to decompose patch values into normal and tangential components. | |
| template<class Type> | |
| string | writeComponents (const word &stem) const |
| Helper function to construct a string description for a given type. | |
| template<class Type> | |
| void | writeBinnedData (List< List< Type > > &data, Ostream &os) const |
| Write binned data to stream. | |
| Protected Member Functions inherited from writeFile | |
| void | initStream (Ostream &os) const |
| Initialise the output stream for writing. | |
| fileName | baseFileDir () const |
| Return the base directory for output. | |
| fileName | baseTimeDir () const |
| Return the base directory for the current time value. | |
| fileName | filePath (const fileName &fName) const |
| Return the full path for the supplied file name. | |
| virtual autoPtr< OFstream > | newFile (const fileName &fName) const |
| Return autoPtr to a new file using file name. | |
| virtual autoPtr< OFstream > | newFileAtTime (const word &name, scalar timeValue) const |
| Return autoPtr to a new file for a given time. | |
| virtual autoPtr< OFstream > | newFileAtStartTime (const word &name) const |
| Return autoPtr to a new file using the simulation start time. | |
| virtual void | resetFile (const word &name) |
| Reset internal file pointer to new file with new name. | |
| Omanip< int > | valueWidth (const label offset=0) const |
| Return the value width when writing to stream with optional offset. | |
| void | operator= (const writeFile &)=delete |
| No copy assignment. | |
| virtual autoPtr< OFstream > | createFile (const word &name, scalar timeValue) const |
| Deprecated(2022-09) Return autoPtr to a new file for a given time. | |
| virtual autoPtr< OFstream > | createFile (const word &name) const |
| Deprecated(2022-09) Return autoPtr to a new file using the simulation start time. | |
Protected Attributes | |
| Vector< label > | nBins_ |
| Numbers of bins in binning directions. | |
| vector | binWidth_ |
| Equidistant bin widths in binning directions. | |
| MinMax< vector > | binLimits_ |
| The geometric min/max bounds for the bins. | |
| labelList | faceToBin_ |
| Face index to bin index addressing. | |
| labelList | cellToBin_ |
| Cell index to bin index addressing. | |
| Protected Attributes inherited from binModel | |
| const fvMesh & | mesh_ |
| Reference to the mesh. | |
| bool | decomposePatchValues_ |
| Decompose patch values into normal and tangential components. | |
| bool | cumulative_ |
| Flag to accumulate bin data with increasing distance in binning direction. | |
| autoPtr< coordinateSystem > | coordSysPtr_ |
| Local coordinate system of bins. | |
| label | nBin_ |
| Total number of bins. | |
| labelList | patchIDs_ |
| Indices of operand patches. | |
| wordList | fieldNames_ |
| Names of operand fields. | |
| labelList | cellZoneIDs_ |
| Indices of operand cell zones. | |
| PtrList< OFstream > | filePtrs_ |
| List of file pointers; 1 file per field. | |
| Protected Attributes inherited from writeFile | |
| const objectRegistry & | fileObr_ |
| Reference to the region objectRegistry. | |
| const fileName | prefix_ |
| Prefix. | |
| word | fileName_ |
| Name of file. | |
| autoPtr< OFstream > | filePtr_ |
| File pointer. | |
| label | writePrecision_ |
| Write precision. | |
| bool | writeToFile_ |
| Flag to enable/disable writing to file. | |
| bool | updateHeader_ |
| Flag to update the header, e.g. on mesh changes. Default is true. | |
| bool | writtenHeader_ |
| Flag to identify whether the header has been written. | |
| bool | useUserTime_ |
| Flag to use the specified user time, e.g. CA deg instead of seconds. Default = true. | |
| scalar | startTime_ |
| Start time value. | |
| string | ext_ |
| File extension; default = .dat. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from binModel | |
| static autoPtr< binModel > | New (const dictionary &dict, const fvMesh &mesh, const word &outputPrefix) |
| Return a reference to the selected bin model. | |
| Static Public Attributes inherited from writeFile | |
| static label | addChars = 8 |
| Additional characters for writing. | |
Calculates binned data in multiple segments according to a specified Cartesian or cylindrical coordinate system.
system/controlDict.functions: binFieldFO
{
// Other binField entries
...
// Mandatory entries
binModel uniformBin;
binData
{
// Mandatory entries
nBin <Vector<label>>;
// Optional entries
cumulative <bool>;
minMax
{
e1 (<scalar> <scalar>); // (min max);
e2 (<scalar> <scalar>);
e3 (<scalar> <scalar>);
}
}
}
where the entries mean:
| Property | Description | Type | Reqd | Deflt |
|---|---|---|---|---|
binModel | Type name: uniformBin | word | yes | - |
binData | Entries of the chosen bin model | dict | yes | - |
nBin | Numbers of bins in specified directions | Vector<label> | yes | - |
cumulative | Flag to bin data accumulated with increasing distance in binning direction | bool | no | false |
minMax | Min-max bounds in binning directions with respect to the coordinateSystem's origin | dict | no | - |

|-------------------|
| 12 | | 14 |
| 11 | 13 |
| 9 | 15 |
| 10 | | 16 |
|-------------------|
/ / / /
/ / / /
|-------------------|
| 4 | | 6 |
| 3 | 5 |
| 1 | 7 |
| 2 | | 8 |
|-------------------|
Definition at line 157 of file uniformBin.H.
| uniformBin | ( | const dictionary & | dict, |
| const fvMesh & | mesh, | ||
| const word & | outputPrefix ) |
Construct from components.
Definition at line 212 of file uniformBin.C.
References binLimits_, binModel::binModel(), binWidth_, dict, mesh, nBins_, read(), and Foam::Zero.
Referenced by operator=(), and uniformBin().


|
delete |
|
virtualdefault |
|
protected |
Write header for an binned-data file.
Definition at line 24 of file uniformBinTemplates.C.
References binLimits_, binWidth_, binModel::coordSysPtr_, binModel::decomposePatchValues_, Foam::endl(), Foam::name(), binModel::nBin_, nBins_, VectorSpace< Form, Cmpt, Ncmpts >::nComponents, Foam::nl, os(), R, Foam::tab, writeFile::writeCommented(), binModel::writeComponents(), writeFile::writeHeader(), writeFile::writeHeaderValue(), and writeFile::writeTabbed().
Referenced by processField().


|
protectedvirtual |
Initialise bin properties.
Compute bin widths in binning directions
Implements binModel.
Definition at line 37 of file uniformBin.C.
References boundBox::add(), binLimits_, binWidth_, binModel::cellZoneIDs_, binModel::coordSysPtr_, e, Foam::exit(), Foam::FatalError, FatalErrorInFunction, limits, boundBox::max(), binModel::mesh_, boundBox::min(), nBins_, VectorSpace< Form, Cmpt, Ncmpts >::nComponents, Foam::nl, binModel::patchIDs_, pbm, pts, boundBox::reduce(), setBinsAddressing(), and boundBox::span().
Referenced by read().


|
protectedvirtual |
Return list of bin indices corresponding to positions given by d.
Definition at line 128 of file uniformBin.C.
References binLimits_, binWidth_, forAll, Foam::max(), Foam::min(), n, nBins_, VectorSpace< Form, Cmpt, Ncmpts >::nComponents, UList< T >::size(), and Foam::Zero.
Referenced by setBinsAddressing().


|
protectedvirtual |
Set/cache the bin addressing.
Definition at line 176 of file uniformBin.C.
References binAddr(), cellToBin_, binModel::cellZoneIDs_, binModel::coordSysPtr_, faceToBin_, forAll, binModel::mesh_, binModel::patchIDs_, and pp().
Referenced by initialise(), and movePoints().


|
protected |
Apply the binning to field fieldi.
Definition at line 81 of file uniformBinTemplates.C.
References cellToBin_, binModel::cellZoneIDs_, binModel::decomposePatchValues(), binModel::decomposePatchValues_, faceToBin_, binModel::fieldNames_, binModel::filePtrs_, fld(), forAll, binModel::mesh_, binModel::nBin_, UPstream::parRun(), binModel::patchIDs_, pp(), Foam::reduce(), binModel::writeBinnedData(), writeFileHeader(), writeFile::writeToFile(), writeFile::writtenHeader_, and Foam::Zero.
Referenced by apply().


|
delete |
|
virtual |
Read the function-object dictionary.
Reimplemented from binModel.
Definition at line 230 of file uniformBin.C.
References binLimits_, binModel::cumulative_, binModel::decomposePatchValues_, dict, Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, dictionary::findDict(), dictionary::get(), dictionary::getOrDefault(), Foam::Info, initialise(), n, Foam::name(), binModel::nBin_, nBins_, VectorSpace< Form, Cmpt, Ncmpts >::nComponents, Foam::nl, range, and binModel::read().
Referenced by uniformBin().


|
virtual |
Apply bins.
Implements binModel.
Definition at line 297 of file uniformBin.C.
References Foam::endl(), binModel::fieldNames_, forAll, processField(), WarningInFunction, and writeFile::writtenHeader_.

|
virtual |
Update for changes of mesh.
Reimplemented from binModel.
Definition at line 321 of file uniformBin.C.
|
virtual |
Update for changes of mesh.
Reimplemented from binModel.
Definition at line 325 of file uniformBin.C.
References mesh, and setBinsAddressing().

|
protected |
Numbers of bins in binning directions.
Definition at line 168 of file uniformBin.H.
Referenced by binAddr(), initialise(), read(), uniformBin(), and writeFileHeader().
|
protected |
Equidistant bin widths in binning directions.
Definition at line 173 of file uniformBin.H.
Referenced by binAddr(), initialise(), uniformBin(), and writeFileHeader().
The geometric min/max bounds for the bins.
Definition at line 178 of file uniformBin.H.
Referenced by binAddr(), initialise(), read(), uniformBin(), and writeFileHeader().
|
protected |
Face index to bin index addressing.
Definition at line 183 of file uniformBin.H.
Referenced by processField(), and setBinsAddressing().
|
protected |
Cell index to bin index addressing.
Definition at line 188 of file uniformBin.H.
Referenced by processField(), and setBinsAddressing().