214#ifndef functionObjects_surfaceFieldValue_H
215#define functionObjects_surfaceFieldValue_H
234namespace functionObjects
243class surfaceFieldValue
361 void setFaceZoneFaces();
364 void setPatchFaces();
367 void combineMeshGeometry
374 void combineSurfaceGeometry
381 scalar totalArea()
const;
442 template<
class WeightType>
445 const Field<WeightType>& weightField,
452 template<
class WeightType>
463 template<
class WeightType>
502 template<class WeightType>
517 const
word& fieldName,
518 const
bool mandatory = false
522 template<class Type, class WeightType>
525 const
Field<Type>& values,
527 const
Field<WeightType>& weightField
532 template<class Type, class WeightType>
537 const
Field<WeightType>& weightField
556 template<class WeightType>
560 const
Field<WeightType>& weightField,
566 template<class Type, class WeightType>
569 const
word& fieldName,
571 const
Field<WeightType>& weightField,
642 const
Field<scalar>& values,
670 const
Field<scalar>& weightField,
679 const
Field<scalar>& weightField,
712#include "surfaceFieldValueI.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...
Generic GeometricField class.
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.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A class for handling file names.
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.
A face regionType variant of the fieldValues function object.
const boolList & faceFlip() const noexcept
Return the local true/false list representing the face flip map.
static const Enum< regionTypes > regionTypeNames_
Region type names.
regionTypes regionType() const noexcept
Return the region type.
regionTypes
Region type enumeration.
@ stPatch
Calculate with patch(es)
@ stObject
Calculate with function object surface.
@ stFaceZone
Calculate with faceZone(s)
@ stSampled
Sample onto surface and calculate.
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.
label nFaces_
Global number of faces.
static tmp< scalarField > weightingFactor(const Field< WeightType > &weightField, const bool useMag)
Weighting factor.
wordRes selectionNames_
Extended selections.
autoPtr< sampledSurface > sampledPtr_
The sampledSurface (when operating on sampledSurface)
bool writeArea_
Optionally write the area of the surfaceFieldValue.
tmp< Field< Type > > getFieldValues(const word &fieldName, const bool mandatory=false) const
Return field values by looking up field name.
postOperationType postOperation_
Optional post-evaluation operation.
bool usesSf() const noexcept
True if the operation needs a surface Sf.
const objectRegistry & obr() const
The volume mesh or surface registry being used.
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 void movePoints(const polyMesh &mesh)
Update for changes of mesh.
virtual bool read(const dictionary &dict)
Read from dictionary.
bool is_magOp() const noexcept
True if the operation variant uses mag.
label writeAll(const vectorField &Sf, const Field< WeightType > &weightField, const pointField &points, const faceList &faces)
Templated helper function to output field values.
operationType operation_
Operation to apply to values.
bool canWeight(const Field< WeightType > &fld) const
True if field is non-empty on any processor.
const labelList & faceId() const noexcept
Return the local list of face IDs.
virtual void updateMesh(const mapPolyMesh &mpm)
Update for changes of mesh.
fileName outputDir() const
Return the output directory.
wordList weightFieldNames_
Weight field name(s) - optional.
Type processSameTypeValues(const Field< Type > &values, const vectorField &Sf, const Field< WeightType > &weightField) const
Apply the 'operation' to the values. Operation must preserve Type.
bool withSurfaceFields() const
Can the surface definition sample surface-fields?
bool update()
Update the surface and surface information as required.
bool validField(const word &fieldName) const
Return true if the field name is known and a valid type.
regionTypes regionType_
Region type.
boolList faceFlip_
List representing the face flip map.
static const Enum< postOperationType > postOperationTypeNames_
Operation type names.
bool is_weightedOp() const noexcept
True if the operation variant uses a weight-field.
bool withTopologicalMerge() const noexcept
Can use mesh topological merge?
bool needsUpdate_
Track if the surface needs an update.
bool writeValues(const word &fieldName, const vectorField &Sf, const Field< WeightType > &weightField, const pointField &points, const faceList &faces)
Templated helper function to output field values.
autoPtr< surfaceWriter > surfaceWriterPtr_
Surface writer.
virtual void writeFileHeader(Ostream &os)
Output file header information.
static tmp< scalarField > areaWeightingFactor(const Field< WeightType > &weightField, const vectorField &Sf, const bool useMag)
Weighting factor, weight field with area factor.
labelList faceId_
Local list of face IDs.
static tmp< scalarField > weightingFactor(const Field< WeightType > &weightField, const vectorField &Sf, const bool useMag)
Weighting factor, weight field projected onto unit-normal.
static const Enum< operationType > operationTypeNames_
Operation type names.
tmp< Field< Type > > filterField(const GeometricField< Type, fvsPatchField, surfaceMesh > &field) const
Filter a surface field according to faceIds.
labelList facePatchId_
Local list of patch ID per face.
virtual bool write()
Calculate and write.
scalar totalArea_
Total area of the surfaceFieldValue.
Type processValues(const Field< Type > &values, const vectorField &Sf, const Field< WeightType > &weightField) const
Apply the 'operation' to the values. Wrapper around.
const labelList & facePatch() const noexcept
Return the local list of patch ID per face.
operationType
Operation type enumeration.
@ opAbsWeightedAreaAverage
Area average using abs weighting.
@ opAbsWeightedUniformity
Uniformity index using abs weighting.
@ opAreaNormalAverage
Area average in normal direction (output is always scalar)
@ opSumDirectionBalance
Sum of balance of values in given direction.
@ opWeightedSum
Weighted sum.
@ opWeightedAverage
Weighted average.
@ opWeightedAreaIntegrate
Weighted area integral.
@ opAverage
Ensemble average.
@ opAreaIntegrate
Area integral.
@ opCoV
Coefficient of variation.
@ opUniformity
Uniformity index (output is always scalar)
@ opAreaAverage
Area average.
@ opAreaNormalIntegrate
Area integral in normal direction (output is always scalar)
@ opAbsWeightedAreaIntegrate
Area integral using abs weighting.
@ opWeightedUniformity
Weighted uniformity index.
@ opWeightedAreaAverage
Weighted area average.
@ opAbsWeightedAverage
Average using abs weighting.
@ opSumDirection
Sum in a given direction.
@ opSumMag
Sum of component magnitudes.
@ opAbsWeightedSum
Sum using abs weighting.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Registry of regIOobjects.
Mesh consisting of general polyhedral cells.
Mesh data needed to do the Finite Volume discretisation.
A class for managing temporary objects.
Mesh data needed to do the Finite Volume discretisation.
A List of wordRe with additional matching capabilities.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
List< word > wordList
A List of words.
List< label > labelList
A List of labels.
vectorField pointField
pointField is a vectorField.
List< bool > boolList
A List of bools.
List< face > faceList
A List of faces.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.