123#ifndef functionObjects_volFieldValue_H
124#define functionObjects_volFieldValue_H
133namespace functionObjects
244 const word& fieldName,
245 const
bool mandatory = false
252 const Field<Type>& values,
268 const word& fieldName,
322 virtual
bool write();
334#include "volFieldValueI.H"
Info<< nl<< "Wrote faMesh in vtk format: "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.mesh().time().globalPath()/"finiteArea-edges"));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const word & name() const noexcept
Return the name of this functionObject.
Intermediate class for handling field value-based function objects.
const dictionary & dict() const noexcept
Return the reference to the construction dictionary.
Provides a 'volRegion' specialization of the fieldValue function object.
bool writeValues(const word &fieldName, const scalarField &V, const scalarField &weightField)
Templated helper function to output field values.
operationVariant
Bitmask values for operation variants.
@ typeScalar
Operation returns a scalar.
@ typeAbsolute
Operation using mag (eg, for weighting)
@ typeBase
Base operation.
@ typeWeighted
Operation using weighting.
tmp< Field< Type > > getFieldValues(const word &fieldName, const bool mandatory=false) const
Insert field values into values list.
postOperationType postOperation_
Optional post-evaluation operation.
Type processValues(const Field< Type > &values, const scalarField &V, const scalarField &weightField) const
Apply the 'operation' to the values.
bool usesVol() const noexcept
True if the operation needs the cell-volume.
bool canWeight(const scalarField &fld) const
True if field is non-empty on any processor.
postOperationType
Post-operation type enumeration.
@ postOpNone
No additional operation after calculation.
@ postOpSqrt
Component-wise sqrt after normal operation.
@ postOpMag
Component-wise mag after normal operation.
virtual bool read(const dictionary &dict)
Read from dictionary.
bool is_magOp() const noexcept
True if the operation variant uses mag.
operationType operation_
Operation to apply to values.
label writeAll(const scalarField &V, const scalarField &weightField)
Helper function to output field values.
static const Enum< operationType > operationTypeNames_
Operation type names.
wordList weightFieldNames_
Weight field name(s) - optional.
virtual void writeFileHeader(Ostream &os) const
Output file header information.
bool validField(const word &fieldName) const
Return true if the field name is valid.
tmp< Field< Type > > filterField(const Field< Type > &field) const
Filter a field according to cellIds.
bool is_weightedOp() const noexcept
True if the operation variant uses a weight-field.
static const Enum< postOperationType > postOperationTypeNames_
Operation type names.
virtual bool write()
Calculate and write.
operationType
Operation type enumeration.
@ opWeightedSum
Weighted sum.
@ opWeightedAverage
Weighted average.
@ opVolIntegrate
Volume integral.
@ opAverage
Ensemble average.
@ opCoV
Coefficient of variation.
@ opWeightedVolIntegrate
Weighted volume integral.
@ opVolAverage
Volume average.
@ opSumMag
Sum of component magnitudes.
@ opWeightedVolAverage
Weighted volume average.
virtual const objectRegistry & obr() const
The region or sub-region registry being used.
Volume (cell) region selection class.
scalar V() const
Return total volume of the selected region.
Registry of regIOobjects.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
List< word > wordList
A List of words.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.