216 #ifndef functionObjects_surfaceFieldValue_H 217 #define functionObjects_surfaceFieldValue_H 233 class sampledSurface;
236 namespace functionObjects
238 namespace fieldValues
245 class surfaceFieldValue
359 void setFaceZoneFaces();
362 void setPatchFaces();
365 void combineMeshGeometry
372 void combineSurfaceGeometry
379 scalar totalArea()
const;
446 template<
class WeightType>
449 const Field<WeightType>& weightField,
456 template<
class WeightType>
467 template<
class WeightType>
506 template<class WeightType>
521 const
word& fieldName,
522 const
bool mandatory = false
526 template<class Type, class WeightType>
531 const
Field<WeightType>& weightField
536 template<class Type, class WeightType>
541 const
Field<WeightType>& weightField
560 template<class WeightType>
564 const
Field<WeightType>& weightField,
570 template<class Type, class WeightType>
573 const
word& fieldName,
575 const
Field<WeightType>& weightField,
666 const
Field<scalar>& weightField,
674 const
Field<scalar>& weightField,
683 const
Field<scalar>& weightField,
716 #include "surfaceFieldValueI.H" wordList weightFieldNames_
Weight field name(s) - optional.
static const Enum< regionTypes > regionTypeNames_
Region type names.
Area integral in normal direction (output is always scalar)
A class for handling file names.
boolList faceFlip_
List representing the face flip map.
Uniformity index using abs weighting.
handlerTypes
Handling of errors. The exact handling depends on the local context.
Mesh data needed to do the Finite Volume discretisation.
Forwards and collection of common volume field types.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Sum of balance of values in given direction.
bool withSurfaceFields() const
Can the surface definition sample surface-fields?
fileName outputDir() const
Return the output directory.
virtual bool write()
Calculate and write.
Calculate with function object surface.
Component-wise mag after normal operation.
static const Enum< postOperationType > postOperationTypeNames_
Operation type names.
regionTypes regionType() const noexcept
Return the region type.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
regionTypes
Region type enumeration.
A face regionType variant of the fieldValues function object.
bool update()
Update the surface and surface information as required.
Generic GeometricField class.
virtual bool read(const dictionary &dict)
Read from dictionary.
error::handlerTypes emptySurfaceError_
Handling of empty surfaces (nFaces = 0). Default is Fatal.
Component-wise sqrt after normal operation.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
virtual void updateMesh(const mapPolyMesh &mpm)
Update for changes of mesh.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
tmp< Field< Type > > getFieldValues(const word &fieldName, const bool mandatory=false) const
Return field values by looking up field name.
const word & name() const noexcept
Return the name of this functionObject.
const dictionary & dict() const noexcept
Return the reference to the construction dictionary.
Average using abs weighting.
Area average using abs weighting.
const labelList & faceId() const noexcept
Return the local list of face IDs.
TypeName("surfaceFieldValue")
Declare type-name, virtual type (with debug switch)
operationType
Operation type enumeration.
postOperationType
Post-operation type enumeration.
scalar totalArea_
Total area of the surfaceFieldValue.
List< face > faceList
List of faces.
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
postOperationType postOperation_
Optional post-evaluation operation.
const boolList & faceFlip() const noexcept
Return the local true/false list representing the face flip map.
Mesh data needed to do the Finite Volume discretisation.
labelList faceId_
Local list of face IDs.
vectorField pointField
pointField is a vectorField.
Type processSameTypeValues(const Field< Type > &values, const vectorField &Sf, const Field< WeightType > &weightField) const
Apply the 'operation' to the values. Operation must preserve Type.
label writeAll(const vectorField &Sf, const Field< WeightType > &weightField, const pointField &points, const faceList &faces)
Templated helper function to output field values.
Generic templated field type.
regionTypes regionType_
Region type.
A class for handling words, derived from Foam::string.
bool needsUpdate_
Track if the surface needs an update.
labelList facePatchId_
Local list of patch ID per face.
Coefficient of variation.
Sum in a given direction.
bool validField(const word &fieldName) const
Return true if the field name is known and a valid type.
Area average in normal direction (output is always scalar)
virtual void writeFileHeader(Ostream &os)
Output file header information.
Sum of component magnitudes.
tmp< Field< Type > > filterField(const GeometricField< Type, fvsPatchField, surfaceMesh > &field) const
Filter a surface field according to faceIds.
autoPtr< sampledSurface > sampledPtr_
The sampledSurface (when operating on sampledSurface)
static const Enum< operationType > operationTypeNames_
Operation type names.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
bool withTopologicalMerge() const noexcept
Can use mesh topological merge?
Uniformity index (output is always scalar)
OBJstream os(runTime.globalPath()/outputName)
Area integral using abs weighting.
wordRes selectionNames_
Extended selections.
bool is_magOp() const noexcept
True if the operation variant uses mag.
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))
autoPtr< surfaceWriter > surfaceWriterPtr_
Surface writer.
List< word > wordList
List of word.
static tmp< scalarField > areaWeightingFactor(const Field< WeightType > &weightField, const vectorField &Sf, const bool useMag)
Weighting factor, weight field with area factor.
label nFaces_
Global number of faces.
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.
const objectRegistry & obr() const
The volume mesh or surface registry being used.
Type processValues(const Field< Type > &values, const vectorField &Sf, const Field< WeightType > &weightField) const
Apply the 'operation' to the values. Wrapper around.
Sample onto surface and calculate.
static tmp< scalarField > weightingFactor(const Field< WeightType > &weightField, const bool useMag)
Weighting factor.
bool is_weightedOp() const noexcept
True if the operation variant uses a weight-field.
No additional operation after calculation.
bool usesSf() const noexcept
True if the operation needs a surface Sf.
const labelList & facePatch() const noexcept
Return the local list of patch ID per face.
Mesh consisting of general polyhedral cells.
operationType operation_
Operation to apply to values.
bool canWeight(const Field< WeightType > &fld) const
True if field is non-empty on any processor.
List< label > labelList
A List of labels.
bool writeArea_
Optionally write the area of the surfaceFieldValue.
A class for managing temporary objects.
Registry of regIOobjects.
virtual void movePoints(const polyMesh &mesh)
Update for changes of mesh.
List< bool > boolList
A List of bools.
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
Calculate with faceZone(s)
Weighted uniformity index.
unsigned nWarnings_
Number of warnings emitted since the last valid update.