Loading...
Searching...
No Matches
binModel Class Referenceabstract

Base class for bin models to handle general bin characteristics. More...

#include <binModel.H>

Inheritance diagram for binModel:
Collaboration diagram for binModel:

Public Member Functions

 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.
virtual bool read (const dictionary &dict)
 Read the function-object dictionary.
label nBin () const noexcept
 Return the total number of bins.
virtual void initialise ()=0
 Initialise bin properties.
virtual void apply ()=0
 Apply bins.
virtual void updateMesh (const mapPolyMesh &mpm)
 Update for changes of mesh.
virtual void movePoints (const polyMesh &mesh)
 Update for changes of mesh.
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 stringsetExt (const string &ext)
 Set extension.
virtual OFstreamfile ()
 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.

Static Public Member Functions

static autoPtr< binModelNew (const dictionary &dict, const fvMesh &mesh, const word &outputPrefix)
 Return a reference to the selected bin model.

Protected Member Functions

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< OFstreamnewFile (const fileName &fName) const
 Return autoPtr to a new file using file name.
virtual autoPtr< OFstreamnewFileAtTime (const word &name, scalar timeValue) const
 Return autoPtr to a new file for a given time.
virtual autoPtr< OFstreamnewFileAtStartTime (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< OFstreamcreateFile (const word &name, scalar timeValue) const
 Deprecated(2022-09) Return autoPtr to a new file for a given time.
virtual autoPtr< OFstreamcreateFile (const word &name) const
 Deprecated(2022-09) Return autoPtr to a new file using the simulation start time.

Protected Attributes

const fvMeshmesh_
 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< coordinateSystemcoordSysPtr_
 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< OFstreamfilePtrs_
 List of file pointers; 1 file per field.
Protected Attributes inherited from writeFile
const objectRegistryfileObr_
 Reference to the region objectRegistry.
const fileName prefix_
 Prefix.
word fileName_
 Name of file.
autoPtr< OFstreamfilePtr_
 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 Attributes inherited from writeFile
static label addChars = 8
 Additional characters for writing.

Detailed Description

Base class for bin models to handle general bin characteristics.

Source files

Definition at line 57 of file binModel.H.

Constructor & Destructor Documentation

◆ binModel() [1/2]

binModel ( const dictionary & dict,
const fvMesh & mesh,
const word & outputPrefix )

Construct from components.

Definition at line 107 of file binModel.C.

References coordSysPtr_, cumulative_, decomposePatchValues_, dict, mesh, mesh_, nBin_, and writeFile::writeFile().

Referenced by binModel(), declareRunTimeSelectionTable(), operator=(), singleDirectionUniformBin::singleDirectionUniformBin(), and uniformBin::uniformBin().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ binModel() [2/2]

binModel ( const binModel & )
delete

No copy construct.

References binModel().

Here is the call graph for this function:

◆ ~binModel()

virtual ~binModel ( )
virtualdefault

Destructor.

References dict.

Member Function Documentation

◆ setCoordinateSystem()

void setCoordinateSystem ( const dictionary & dict,
const word & e3Name = word::null,
const word & e1Name = word::null )
protected

Set the co-ordinate system from dictionary and axes names.

Definition at line 66 of file binModel.C.

References coordSysPtr_, dict, Foam::endl(), Foam::Info, Foam::nl, and Foam::Zero.

Referenced by read().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ decomposePatchValues() [1/3]

template<class Type>
bool decomposePatchValues ( List< List< Type > > & data,
const label bini,
const Type & v,
const vector & n ) const
protected

Helper function to decompose patch values into normal and tangential components.

Definition at line 24 of file binModelTemplates.C.

References decomposePatchValues_, and n.

Referenced by singleDirectionUniformBin::processField(), and uniformBin::processField().

Here is the caller graph for this function:

◆ writeComponents() [1/2]

template<class Type>
string writeComponents ( const word & stem) const
protected

Helper function to construct a string description for a given type.

References os().

Referenced by singleDirectionUniformBin::writeFileHeader(), and uniformBin::writeFileHeader().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeBinnedData()

template<class Type>
void writeBinnedData ( List< List< Type > > & data,
Ostream & os ) const
protected

Write binned data to stream.

Definition at line 55 of file binModelTemplates.C.

References cumulative_, Foam::endl(), nBin_, os(), writeFile::writeCurrentTime(), writeFile::writeValue(), and Foam::Zero.

Referenced by singleDirectionUniformBin::processField(), and uniformBin::processField().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TypeName()

TypeName ( "binModel" )

Runtime type information.

◆ declareRunTimeSelectionTable()

declareRunTimeSelectionTable ( autoPtr ,
binModel ,
dictionary ,
(const dictionary &dict, const fvMesh &mesh, const word &outputPrefix) ,
(dict, mesh, outputPrefix)  )

References binModel(), dict, and mesh.

Here is the call graph for this function:

◆ New()

Foam::autoPtr< Foam::binModel > New ( const dictionary & dict,
const fvMesh & mesh,
const word & outputPrefix )
static

Return a reference to the selected bin model.

Definition at line 26 of file binModelNew.C.

References dict, Foam::exit(), Foam::FatalIOError, FatalIOErrorInLookup, and mesh.

Referenced by binField::read().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

void operator= ( const binModel & )
delete

No copy assignment.

References binModel().

Here is the call graph for this function:

◆ read()

bool read ( const dictionary & dict)
virtual

Read the function-object dictionary.

Reimplemented from writeFile.

Reimplemented in singleDirectionUniformBin, and uniformBin.

Definition at line 125 of file binModel.C.

References DynamicList< T, SizeMin >::append(), cellZoneIDs_, decomposePatchValues_, dict, UList< T >::empty(), Foam::endl(), fieldNames_, filePtrs_, forAll, mesh_, writeFile::newFileAtStartTime(), Foam::nl, patchIDs_, pbm, writeFile::read(), setCoordinateSystem(), UList< T >::size(), WarningInFunction, and zoneIDs.

Referenced by singleDirectionUniformBin::read(), and uniformBin::read().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nBin()

label nBin ( ) const
inlinenoexcept

Return the total number of bins.

Definition at line 233 of file binModel.H.

References nBin_, and Foam::noexcept.

◆ initialise()

virtual void initialise ( )
pure virtual

Initialise bin properties.

Implemented in singleDirectionUniformBin, and uniformBin.

◆ apply()

virtual void apply ( )
pure virtual

Apply bins.

Implemented in singleDirectionUniformBin, and uniformBin.

References mesh.

◆ updateMesh()

void updateMesh ( const mapPolyMesh & mpm)
virtual

Update for changes of mesh.

Reimplemented in uniformBin.

Definition at line 182 of file binModel.C.

◆ movePoints()

void movePoints ( const polyMesh & mesh)
virtual

Update for changes of mesh.

Reimplemented in uniformBin.

Definition at line 186 of file binModel.C.

References mesh.

◆ decomposePatchValues() [2/3]

template<>
bool decomposePatchValues ( List< List< vector > > & data,
const label bini,
const vector & v,
const vector & n ) const

Definition at line 37 of file binModel.C.

References Foam::abort(), decomposePatchValues_, Foam::FatalError, FatalErrorInFunction, and n.

Here is the call graph for this function:

◆ decomposePatchValues() [3/3]

template<>
bool decomposePatchValues ( List< List< vector > > & data,
const label bini,
const vector & v,
const vector & n ) const

References n.

◆ writeComponents() [2/2]

template<class Type>
Foam::string writeComponents ( const word & stem) const

Definition at line 37 of file binModelTemplates.C.

Member Data Documentation

◆ mesh_

◆ decomposePatchValues_

◆ cumulative_

bool cumulative_
protected

Flag to accumulate bin data with increasing distance in binning direction.

Definition at line 79 of file binModel.H.

Referenced by binModel(), singleDirectionUniformBin::read(), uniformBin::read(), and writeBinnedData().

◆ coordSysPtr_

autoPtr<coordinateSystem> coordSysPtr_
protected

Local coordinate system of bins.

Definition at line 84 of file binModel.H.

Referenced by binModel(), uniformBin::initialise(), uniformBin::setBinsAddressing(), setCoordinateSystem(), and uniformBin::writeFileHeader().

◆ nBin_

◆ patchIDs_

◆ fieldNames_

wordList fieldNames_
protected

◆ cellZoneIDs_

◆ filePtrs_

PtrList<OFstream> filePtrs_
protected

List of file pointers; 1 file per field.

Definition at line 109 of file binModel.H.

Referenced by singleDirectionUniformBin::processField(), uniformBin::processField(), and read().


The documentation for this class was generated from the following files:
  • src/functionObjects/field/binField/binModels/binModel/binModel.H
  • src/functionObjects/field/binField/binModels/binModel/binModel.C
  • src/functionObjects/field/binField/binModels/binModel/binModelNew.C
  • src/functionObjects/field/binField/binModels/binModel/binModelTemplates.C