binModel Class Referenceabstract

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

Inheritance diagram for binModel:
[legend]
Collaboration diagram for binModel:
[legend]

Public Member Functions

 TypeName ("binModel")
 Runtime type information. More...
 
 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. More...
 
 binModel (const binModel &)=delete
 No copy construct. More...
 
void operator= (const binModel &)=delete
 No copy assignment. More...
 
virtual ~binModel ()=default
 Destructor. More...
 
virtual bool read (const dictionary &dict)
 Read the dictionary. More...
 
label nBin () const noexcept
 Return the total number of bins. More...
 
virtual void initialise ()=0
 Initialise bin properties. More...
 
virtual void apply ()=0
 Apply bins. More...
 
virtual void updateMesh (const mapPolyMesh &mpm)
 Update for changes of mesh. More...
 
virtual void movePoints (const polyMesh &mesh)
 Update for changes of mesh. More...
 
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)
 Construct from objectRegistry, prefix, fileName. More...
 
 writeFile (const objectRegistry &obr, const fileName &prefix, const word &name, const dictionary &dict, const bool writeToFile=true)
 
 writeFile (const writeFile &wf)
 Construct copy. More...
 
virtual ~writeFile ()=default
 Destructor. More...
 
virtual bool read (const dictionary &dict)
 Read. More...
 
virtual OFstreamfile ()
 Return access to the file (if only 1) More...
 
virtual bool writeToFile () const
 Flag to allow writing to file. More...
 
virtual bool canWriteHeader () const
 Flag to allow writing the header. More...
 
virtual label charWidth () const
 Return width of character stream output. More...
 
virtual void writeCommented (Ostream &os, const string &str) const
 Write a commented string to stream. More...
 
virtual void writeTabbed (Ostream &os, const string &str) const
 Write a tabbed string to stream. More...
 
virtual void writeHeader (Ostream &os, const string &str) const
 Write a commented header to stream. More...
 
virtual void writeCurrentTime (Ostream &os) const
 Write the current time to stream. More...
 
virtual void writeBreak (Ostream &os) const
 Write a break marker to the stream. More...
 
template<class Type >
void writeHeaderValue (Ostream &os, const string &property, const Type &value) const
 Write a (commented) header property and value pair. More...
 
template<class Type >
void writeValue (Ostream &os, const Type &val) const
 Write a given value to stream with the space delimiter. More...
 

Static Public Member Functions

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

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. More...
 
template<class Type >
bool decomposePatchValues (List< List< Type > > &data, const label bini, const Type &v, const vector &n) const
 
template<class Type >
string writeComponents (const word &stem) const
 Helper function to construct a string description for a given type. More...
 
template<class Type >
void writeBinnedData (List< List< Type > > &data, Ostream &os) const
 Write binned data to stream. More...
 
- Protected Member Functions inherited from writeFile
void initStream (Ostream &os) const
 Initialise the output stream for writing. More...
 
fileName baseFileDir () const
 Return the base directory for output. More...
 
fileName baseTimeDir () const
 Return the base directory for the current time value. More...
 
virtual autoPtr< OFstreamcreateFile (const word &name, scalar timeValue) const
 Return autoPtr to a new file for a given time. More...
 
virtual autoPtr< OFstreamcreateFile (const word &name) const
 Return autoPtr to a new file using the simulation start time. More...
 
virtual void resetFile (const word &name)
 Reset internal file pointer to new file with new name. More...
 
Omanip< int > valueWidth (const label offset=0) const
 Return the value width when writing to stream with optional offset. More...
 
void operator= (const writeFile &)=delete
 No copy assignment. More...
 

Protected Attributes

const fvMeshmesh_
 Reference to the mesh. More...
 
bool decomposePatchValues_
 Decompose patch values into normal and tangential components. More...
 
bool cumulative_
 
autoPtr< coordinateSystemcoordSysPtr_
 Local coordinate system of bins. More...
 
label nBin_
 Total number of bins. More...
 
labelHashSet patchSet_
 Indices of operand patches. More...
 
wordList fieldNames_
 Names of operand fields. More...
 
labelList cellZoneIDs_
 Indices of operand cell zones. More...
 
PtrList< OFstreamfilePtrs_
 List of file pointers; 1 file per field. More...
 
- Protected Attributes inherited from writeFile
const objectRegistryfileObr_
 Reference to the region objectRegistry. More...
 
const fileName prefix_
 Prefix. More...
 
word fileName_
 Name of file. More...
 
autoPtr< OFstreamfilePtr_
 File pointer. More...
 
label writePrecision_
 Write precision. More...
 
bool writeToFile_
 Flag to enable/disable writing to file. More...
 
bool updateHeader_
 
bool writtenHeader_
 Flag to identify whether the header has been written. More...
 
bool useUserTime_
 
scalar startTime_
 Start time value. More...
 

Additional Inherited Members

- Static Public Attributes inherited from writeFile
static label addChars = 8
 Additional characters for writing. More...
 

Detailed Description

Base class for bin models to handle general bin characteristics.

Source files

Definition at line 61 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 127 of file binModel.C.

◆ binModel() [2/2]

binModel ( const binModel )
delete

No copy construct.

◆ ~binModel()

virtual ~binModel ( )
virtualdefault

Destructor.

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 73 of file binModel.C.

References dict, Foam::endl(), dictionary::found(), dictionary::get(), Foam::Info, Time::New(), and Foam::nl.

Here is the call graph for this function:

◆ decomposePatchValues() [1/2]

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 31 of file binModelTemplates.C.

References binModel::decomposePatchValues_.

◆ writeComponents() [1/2]

string writeComponents ( const word stem) const
protected

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

◆ writeBinnedData()

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

Write binned data to stream.

Definition at line 62 of file binModelTemplates.C.

References Foam::endl(), os(), and Foam::Zero.

Here is the call 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)   
)

◆ 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 33 of file binModelNew.C.

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

Here is the call graph for this function:

◆ operator=()

void operator= ( const binModel )
delete

No copy assignment.

◆ read()

bool read ( const dictionary dict)
virtual

Read the dictionary.

Reimplemented from writeFile.

Reimplemented in singleDirectionUniformBin, and uniformBin.

Definition at line 149 of file binModel.C.

References DynamicList< T, SizeMin >::append(), List< T >::append(), dict, UList< T >::empty(), Foam::endl(), forAll, dictionary::found(), dictionary::get(), Foam::nl, UList< T >::size(), WarningInFunction, and zoneIDs.

Here is the call graph for this function:

◆ nBin()

label nBin ( ) const
inlinenoexcept

Return the total number of bins.

Definition at line 195 of file binModel.H.

References binModel::nBin_.

◆ 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.

◆ updateMesh()

void updateMesh ( const mapPolyMesh mpm)
virtual

Update for changes of mesh.

Reimplemented in uniformBin.

Definition at line 197 of file binModel.C.

◆ movePoints()

void movePoints ( const polyMesh mesh)
virtual

Update for changes of mesh.

Reimplemented in uniformBin.

Definition at line 201 of file binModel.C.

◆ decomposePatchValues() [2/2]

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

Definition at line 44 of file binModel.C.

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

Here is the call graph for this function:

◆ writeComponents() [2/2]

Foam::string writeComponents ( const word stem) const

Definition at line 44 of file binModelTemplates.C.

Member Data Documentation

◆ mesh_

const fvMesh& mesh_
protected

Reference to the mesh.

Definition at line 70 of file binModel.H.

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

◆ decomposePatchValues_

bool decomposePatchValues_
protected

Decompose patch values into normal and tangential components.

Definition at line 73 of file binModel.H.

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

◆ cumulative_

bool cumulative_
protected

Flag to accumulate bin data with increasing distance in binning direction

Definition at line 77 of file binModel.H.

◆ coordSysPtr_

autoPtr<coordinateSystem> coordSysPtr_
protected

Local coordinate system of bins.

Definition at line 80 of file binModel.H.

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

◆ nBin_

label nBin_
protected

◆ patchSet_

labelHashSet patchSet_
protected

Indices of operand patches.

Definition at line 86 of file binModel.H.

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

◆ fieldNames_

wordList fieldNames_
protected

Names of operand fields.

Definition at line 89 of file binModel.H.

◆ cellZoneIDs_

labelList cellZoneIDs_
protected

Indices of operand cell zones.

Definition at line 92 of file binModel.H.

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

◆ filePtrs_

PtrList<OFstream> filePtrs_
protected

List of file pointers; 1 file per field.

Definition at line 95 of file binModel.H.


The documentation for this class was generated from the following files: