68 mesh_.time().timeName(),
95 const scalar sumData =
sum(dataNormalised);
102 dataNormalised /= sumData;
110 << magBinMidPoint[i] <<
tab
111 << dataCount[i] <<
tab
142 fieldName_ =
dict.get<word>(
"field");
144 if (writeToFile() && !writtenHeader_)
146 writeFileHeader(file());
Various functions to operate on Lists.
@ REGISTER
Request registration (bool: true).
@ MUST_READ
Reading required.
@ AUTO_WRITE
Automatically write from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const Type & value() const noexcept
Return const reference to value.
virtual void writeTabbed(Ostream &os, const string &str) const
Write a tabbed string to stream.
writeFile(const objectRegistry &obr, const fileName &prefix, const word &name="undefined", const bool writeToFile=true, const string &ext=".dat")
Construct from objectRegistry, prefix, fileName.
virtual void writeHeader(Ostream &os, const string &str) const
Write a commented header to stream.
virtual bool read(const dictionary &dict)
Read.
bool writtenHeader_
Flag to identify whether the header has been written.
virtual OFstream & file()
Return access to the file (if only 1).
virtual void writeCommented(Ostream &os, const string &str) const
Write a commented string to stream.
virtual bool writeToFile() const
Flag to allow writing to file.
Mesh data needed to do the Finite Volume discretisation.
const Time & time() const
Return the top-level database.
A base class for histogram models.
const fvMesh & mesh() const noexcept
Return const reference to the mesh.
volScalarField & getOrReadField(const word &fieldName) const
Return requested field from the object registry or read+register the field to the object registry.
void write(scalarField &dataNormalised, const labelField &dataCount, const scalarField &magMidBin)
Write histogram data.
virtual bool read(const dictionary &dict)
Read the function-object dictionary.
virtual void writeFileHeader(Ostream &os)
Output file header information.
const word & fieldName() const noexcept
Return const reference to the operand field name.
histogramModel(const word &name, const fvMesh &mesh, const dictionary &dict)
Construct from components.
bool store()
Register object with its registry and transfer ownership to the registry.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
OBJstream os(runTime.globalPath()/outputName)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Field< label > labelField
Specialisation of Field<T> for label.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1, const label comm)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
constexpr char tab
The tab '\t' character(0x09).
#define defineRunTimeSelectionTable(baseType, argNames)
Define run-time selection table.
#define forAll(list, i)
Loop across all elements in list.