113#ifndef Foam_functionObjects_volFieldValue_H
114#define Foam_functionObjects_volFieldValue_H
232 const word& fieldName,
233 const
bool mandatory = false
240 const Field<Type>& values,
256 const
word& fieldName,
310 virtual
bool write();
322#include "volFieldValueI.H"
Info<< nl;Info<< "Write faMesh in vtk format:"<< nl;{ vtk::uindirectPatchWriter writer(aMesh.patch(), fileName(aMesh.time().globalPath()/vtkBaseFileName));writer.writeGeometry();globalIndex procAddr(aMesh.nFaces());labelList cellIDs;if(UPstream::master()) { cellIDs.resize(procAddr.totalSize());for(const labelRange &range :procAddr.ranges()) { auto slice=cellIDs.slice(range);slice=identity(range);} } writer.beginCellData(4);writer.writeProcIDs();writer.write("cellID", cellIDs);writer.write("area", aMesh.S().field());writer.write("normal", aMesh.faceAreaNormals());writer.beginPointData(1);writer.write("normal", aMesh.pointAreaNormals());Info<< " "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.time().globalPath()/(vtkBaseFileName+"-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...
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
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.
fieldValue(const word &name, const Time &runTime, const dictionary &dict, const word &valueType)
Construct from name, Time and dictionary.
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.
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 the function-object 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.
volFieldValue(const word &name, const Time &runTime, const dictionary &dict)
Construct from name, Time and dictionary.
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.
TypeName("volFieldValue")
Declare type-name, virtual type (with debug switch).
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()
Write the function-object results.
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.
scalar V() const
Return total volume of the selected region.
volRegion(const fvMesh &mesh, const dictionary &dict)
Construct from fvMesh and dictionary.
Registry of regIOobjects.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
Function objects are OpenFOAM utilities to ease workflow configurations and enhance workflows.
List< word > wordList
List of word.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.