123 #ifndef functionObjects_volFieldValue_H 124 #define functionObjects_volFieldValue_H 133 namespace functionObjects
135 namespace fieldValues
242 const word& fieldName,
243 const
bool mandatory = false
250 const Field<Type>&
values,
266 const word& fieldName,
320 virtual
bool write();
332 #include "volFieldValueI.H"
operationType operation_
Operation to apply to values.
bool writeValues(const word &fieldName, const scalarField &V, const scalarField &weightField)
Templated helper function to output field values.
Coefficient of variation.
static const Enum< operationType > operationTypeNames_
Operation type names.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
static const Enum< postOperationType > postOperationTypeNames_
Operation type names.
No additional operation after calculation.
virtual void writeFileHeader(Ostream &os) const
Output file header information.
tmp< Field< Type > > getFieldValues(const word &fieldName, const bool mandatory=false) const
Insert field values into values list.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
const word & name() const noexcept
Return the name of this functionObject.
const dictionary & dict() const noexcept
Return the reference to the construction dictionary.
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
Generic templated field type.
bool validField(const word &fieldName) const
Return true if the field name is valid.
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
postOperationType postOperation_
Optional post-evaluation operation.
tmp< Field< Type > > filterField(const Field< Type > &field) const
Filter a field according to cellIds.
Type processValues(const Field< Type > &values, const scalarField &V, const scalarField &weightField) const
Apply the 'operation' to the values.
Weighted volume integral.
virtual bool read(const dictionary &dict)
Read from dictionary.
Component-wise mag after normal operation.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
scalar V() const
Return total volume of the selected region.
TypeName("volFieldValue")
Declare type-name, virtual type (with debug switch)
OBJstream os(runTime.globalPath()/outputName)
postOperationType
Post-operation type enumeration.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
label writeAll(const scalarField &V, const scalarField &weightField)
Helper function to output field values.
List< word > wordList
List of word.
operationType
Operation type enumeration.
wordList weightFieldNames_
Weight field name(s) - optional.
bool is_magOp() const noexcept
True if the operation variant uses mag.
Provides a 'volRegion' specialization of the fieldValue function object.
A class for managing temporary objects.
Registry of regIOobjects.
bool is_weightedOp() const noexcept
True if the operation variant uses a weight-field.
virtual bool write()
Calculate and write.
Component-wise sqrt after normal operation.
virtual const objectRegistry & obr() const
The region or sub-region registry being used.
bool usesVol() const noexcept
True if the operation needs the cell-volume.
Sum of component magnitudes.
bool canWeight(const scalarField &fld) const
True if field is non-empty on any processor.