histogramModel Class Referenceabstract

A base class for histogram models. More...

Inheritance diagram for histogramModel:
Collaboration diagram for histogramModel:

Public Member Functions

 TypeName ("histogramModel")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, histogramModel, dictionary,(const word &name, const fvMesh &mesh, const dictionary &dict),(name, mesh, dict))
 
 histogramModel (const word &name, const fvMesh &mesh, const dictionary &dict)
 Construct from components. More...
 
 histogramModel (const histogramModel &)=delete
 No copy construct. More...
 
void operator= (const histogramModel &)=delete
 No copy assignment. More...
 
virtual ~histogramModel ()=default
 Destructor. More...
 
const fvMeshmesh () const noexcept
 Return const reference to the mesh. More...
 
const wordfieldName () const noexcept
 Return const reference to the operand field name. More...
 
virtual bool read (const dictionary &dict)
 Read top-level dictionary. More...
 
virtual bool write (const bool log)=0
 Write data to stream and files. More...
 
- 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)
 Construct from objectRegistry, prefix, fileName and read options from dictionary. More...
 
 writeFile (const writeFile &wf)
 Construct copy. More...
 
virtual ~writeFile ()=default
 Destructor. 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 canWriteToFile () const
 Flag to allow writing to the file. More...
 
virtual bool canResetFile () const
 Flag to allow resetting the 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< histogramModelNew (const word &name, const fvMesh &mesh, const dictionary &dict)
 Return a reference to the selected histogram model. More...
 

Protected Member Functions

virtual void writeFileHeader (Ostream &os)
 Output file header information. More...
 
volScalarFieldgetOrReadField (const word &fieldName) const
 Return requested field from the object registry or read+register the field to the object registry. More...
 
void write (scalarField &dataNormalised, const labelField &dataCount, const scalarField &magMidBin)
 Write histogram data. 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...
 
fileName filePath (const fileName &fName) const
 Return the full path for the supplied file name. More...
 
virtual autoPtr< OFstreamnewFile (const fileName &fName) const
 Return autoPtr to a new file using file name. More...
 
virtual autoPtr< OFstreamnewFileAtTime (const word &name, scalar timeValue) const
 Return autoPtr to a new file for a given time. More...
 
virtual autoPtr< OFstreamnewFileAtStartTime (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...
 
virtual autoPtr< OFstreamcreateFile (const word &name, scalar timeValue) const
 Deprecated(2022-09) Return autoPtr to a new file for a given time. More...
 
virtual autoPtr< OFstreamcreateFile (const word &name) const
 Deprecated(2022-09) Return autoPtr to a new file using the simulation start time. More...
 

Additional Inherited Members

- Static Public Attributes inherited from writeFile
static label addChars = 8
 Additional characters for writing. 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_
 Flag to update the header, e.g. on mesh changes. Default is true. More...
 
bool writtenHeader_
 Flag to identify whether the header has been written. More...
 
bool useUserTime_
 Flag to use the specified user time, e.g. CA deg instead of seconds. Default = true. More...
 
scalar startTime_
 Start time value. More...
 

Detailed Description

A base class for histogram models.

Source files

Definition at line 58 of file histogramModel.H.

Constructor & Destructor Documentation

◆ histogramModel() [1/2]

histogramModel ( const word name,
const fvMesh mesh,
const dictionary dict 
)

Construct from components.

Definition at line 114 of file histogramModel.C.

◆ histogramModel() [2/2]

histogramModel ( const histogramModel )
delete

No copy construct.

◆ ~histogramModel()

virtual ~histogramModel ( )
virtualdefault

Destructor.

Member Function Documentation

◆ writeFileHeader()

void writeFileHeader ( Ostream os)
protectedvirtual

Output file header information.

Definition at line 36 of file histogramModel.C.

References Foam::endl(), os(), writeFile::writeCommented(), writeFile::writeHeader(), and writeFile::writeTabbed().

Here is the call graph for this function:

◆ getOrReadField()

Foam::volScalarField & getOrReadField ( const word fieldName) const
protected

Return requested field from the object registry or read+register the field to the object registry.

Definition at line 48 of file histogramModel.C.

References IOobjectOption::AUTO_WRITE, IOobjectOption::MUST_READ, and IOobjectOption::REGISTER.

Referenced by unequalBinWidth::write(), and equalBinWidth::write().

Here is the caller graph for this function:

◆ write() [1/2]

void write ( scalarField dataNormalised,
const labelField dataCount,
const scalarField magMidBin 
)
protected

Write histogram data.

Definition at line 77 of file histogramModel.C.

References Foam::endl(), forAll, UPstream::master(), mesh, Foam::sum(), Foam::tab, fvMesh::time(), and dimensioned< Type >::value().

Referenced by unequalBinWidth::write(), and equalBinWidth::write().

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

◆ TypeName()

TypeName ( "histogramModel"  )

Runtime type information.

◆ declareRunTimeSelectionTable()

declareRunTimeSelectionTable ( autoPtr  ,
histogramModel  ,
dictionary  ,
(const word &name, const fvMesh &mesh, const dictionary &dict ,
(name, mesh, dict  
)

◆ New()

Foam::autoPtr< Foam::histogramModel > New ( const word name,
const fvMesh mesh,
const dictionary dict 
)
static

Return a reference to the selected histogram model.

Definition at line 28 of file histogramModelNew.C.

References dict, Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInLookup, Foam::Info, mesh, Foam::name(), and Foam::nl.

Referenced by histogram::read().

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

◆ operator=()

void operator= ( const histogramModel )
delete

No copy assignment.

◆ mesh()

const fvMesh& mesh ( ) const
inlinenoexcept

Return const reference to the mesh.

Definition at line 174 of file histogramModel.H.

◆ fieldName()

const word& fieldName ( ) const
inlinenoexcept

Return const reference to the operand field name.

Definition at line 182 of file histogramModel.H.

◆ read()

bool read ( const dictionary dict)
virtual

Read top-level dictionary.

Reimplemented from writeFile.

Reimplemented in equalBinWidth, and unequalBinWidth.

Definition at line 128 of file histogramModel.C.

References dict, dictionary::get(), and writeFile::read().

Referenced by unequalBinWidth::read(), and equalBinWidth::read().

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

◆ write() [2/2]

virtual bool write ( const bool  log)
pure virtual

Write data to stream and files.

Implemented in equalBinWidth, and unequalBinWidth.


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