surfaceFieldValue.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
9  Copyright (C) 2015-2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::functionObjects::fieldValues::surfaceFieldValue
29 
30 Group
31  grpFieldFunctionObjects
32 
33 Description
34  Provides a 'face regionType' variant of the \c fieldValues function object.
35 
36  Given a list of user-specified fields and a selection of mesh (or general
37  surface) faces, a number of operations can be performed, such as sums,
38  averages and integrations.
39 
40  For example, to calculate the volumetric or mass flux across a patch,
41  apply the 'sum' operator to the flux field (typically \c phi).
42 
43 Usage
44  Minimal example by using \c system/controlDict.functions:
45  \verbatim
46  surfaceFieldValuePatch1
47  {
48  // Mandatory entries (unmodifiable)
49  type surfaceFieldValue;
50  libs (fieldFunctionObjects);
51 
52  // Mandatory entries (runtime modifiable)
53  fields (<field1> <field2> ... <fieldN>);
54  operation <operationType>;
55  regionType patch;
56  name <patch>;
57 
58  // Optional entries (runtime modifiable)
59  postOperation none;
60  weightField alpha1;
61  scaleFactor 1.0;
62  writeArea false;
63  surfaceFormat none;
64 
65  // Optional (inherited) entries
66  ...
67  }
68 
69  surfaceFieldValueFaceZone1
70  {
71  // Mandatory entries (unmodifiable)
72  type surfaceFieldValue;
73  libs (fieldFunctionObjects);
74 
75  // Mandatory entries (runtime modifiable)
76  fields (<field1> <field2> ... <fieldN>);
77  operation <operationType>;
78  regionType faceZone;
79  name <faceZone>;
80 
81  // Optional entries (runtime modifiable)
82  postOperation none;
83  weightField alpha1;
84  scaleFactor 1.0;
85  writeArea false;
86  surfaceFormat none;
87 
88  // Optional (inherited) entries
89  ...
90  }
91  \endverbatim
92 
93  where the entries mean:
94  \table
95  Property | Description | Type | Req'd | Dflt
96  type | Type name: surfaceFieldValue | word | yes | -
97  libs | Library name: fieldFunctionObjects | word | yes | -
98  fields | Names of operand fields | wordList | yes | -
99  regionType | Face regionType: see below | word | yes | -
100  name | Name for regionType | word | yes | -
101  operation | Operation type: see below | word | yes | -
102  postOperation | Post-operation type: see below | word | no | none
103  weightField | Name of field to apply weighting | word | no | none
104  scaleFactor | Output value scaling factor | scalar | no | 1.0
105  writeArea | Write the surface area | bool | no | false
106  surfaceFormat | Output value format | word <!--
107  --> | conditional on writeFields | none
108  \endtable
109 
110  The inherited entries are elaborated in:
111  - \link fieldValue.H \endlink
112 
113  Options for the \c regionType entry:
114  \plaintable
115  faceZone | The \b name entry to specify the faceZone
116  patch | The \b name entry to specify the patch
117  functionObjectSurface | The \b name entry to specify a polySurface
118  sampledSurface | A \b sampledSurfaceDict sub-dictionary and \b name
119  \endplaintable
120 
121  Options for the \c operation entry:
122  \plaintable
123  none | no operation
124  min | minimum
125  max | maximum
126  sum | sum
127  sumMag | sum of component magnitudes
128  sumDirection | sum values that are positive in given direction
129  sumDirectionBalance | sum of balance of values in given direction
130  average | ensemble average
131  areaAverage | area-weighted average
132  areaIntegrate | area integral
133  CoV | coefficient of variation: standard deviation/mean
134  areaNormalAverage | area-weighted average in face normal direction
135  areaNormalIntegrate | area-weighted integral in face normal directon
136  uniformity | uniformity index
137  weightedSum | weighted sum
138  weightedAverage | weighted average
139  weightedAreaAverage | weighted area average
140  weightedAreaIntegrate | weighted area integral
141  weightedUniformity | weighted uniformity index
142  absWeightedSum | sum using absolute weighting
143  absWeightedAverage | average using absolute weighting
144  absWeightedAreaAverage | area average using absolute weighting
145  absWeightedAreaIntegrate | area integral using absolute weighting
146  absWeightedUniformity | uniformity index using absolute weighting
147  \endplaintable
148 
149  Options for the \c postOperation entry:
150  \plaintable
151  none | No additional operation after calculation
152  mag | Component-wise \c mag() after normal operation
153  sqrt | Component-wise \c sqrt() after normal operation
154  \endplaintable
155 
156  Usage by the \c postProcess utility is not available.
157 
158 Note
159  - The values reported by the \c areaNormalAverage and \c areaNormalIntegrate
160  operations are written as the first component of a field with the same
161  rank as the input field.
162  - Faces on empty patches get ignored.
163  - If the field is a volField the \c faceZone
164  can only consist of boundary faces.
165  - Using \c functionObjectSurface:
166  - The keyword %subRegion should not be used to select surfaces.
167  Instead specify the regionType 'functionObjectSurface' and provide
168  the name.
169  - Using \c sampledSurface:
170  - not available for surface fields
171  - if interpolate=true they use \c interpolationCellPoint
172  otherwise they use cell values
173  - each triangle in \c sampledSurface is logically only in one cell
174  so interpolation will be wrong when triangles are larger than
175  cells. This can only happen for sampling on a \c triSurfaceMesh
176  - take care when using isoSurfaces - these might have duplicate
177  triangles and so integration might be wrong
178 
179  Uniformity:
180  \f[
181  UI(\phi) = 1 - \frac{1}{2 \overline{\phi} A}
182  \int{\left| W \phi \cdot \hat{n} - \bar{W} \bar{\phi}\right| d\vec{A}}
183  \,,\;
184  \bar{\phi} = \frac{\int{W \phi \cdot d\vec{A}}}{\int{W \cdot d\vec{A}}}
185  \f]
186 
187  A velocity uniformity index is calculated with no weighting (W=1) and
188  \f$ \phi = \vec{U} \f$.
189 
190  A scalar concentration uniformity index is calculated with either
191  \f$ \rho \vec U \f$ or \f$ \vec U \f$ for weighting and
192  \f$ \phi = conc \f$.
193 
194 See also
195  - Foam::functionObject
196  - Foam::functionObjects::fieldValues::fieldValue
197  - ExtendedCodeGuide::functionObjects::field::surfaceFieldValue
198 
199 SourceFiles
200  surfaceFieldValue.C
201  surfaceFieldValueTemplates.C
202 
203 \*---------------------------------------------------------------------------*/
204 
205 #ifndef functionObjects_surfaceFieldValue_H
206 #define functionObjects_surfaceFieldValue_H
207 
208 #include "fieldValue.H"
209 #include "Enum.H"
210 #include "surfaceMesh.H"
211 #include "polySurface.H"
212 #include "fvsPatchField.H"
213 #include "volFieldsFwd.H"
214 #include "polySurfaceFieldsFwd.H"
215 
216 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
217 
218 namespace Foam
219 {
220 
221 // Forward Declarations
222 class sampledSurface;
223 class surfaceWriter;
224 
225 namespace functionObjects
226 {
227 namespace fieldValues
228 {
229 
230 /*---------------------------------------------------------------------------*\
231  Class surfaceFieldValue Declaration
232 \*---------------------------------------------------------------------------*/
233 
234 class surfaceFieldValue
235 :
236  public fieldValue
237 {
238 public:
239 
240  // Public Data Types
241 
242  //- Region type enumeration
243  enum regionTypes
244  {
245  stFaceZone = 0x01,
246  stPatch = 0x02,
247  stObject = 0x11,
248  stSampled = 0x12
249  };
250 
251  //- Region type names
252  static const Enum<regionTypes> regionTypeNames_;
253 
254  //- Bitmask values for operation variants
255  enum operationVariant
256  {
257  typeBase = 0,
258  typeScalar = 0x100,
259  typeWeighted = 0x200,
260  typeAbsolute = 0x400,
261  };
262 
263  //- Operation type enumeration
264  enum operationType
265  {
266  // Normal operations
267 
268  opNone = 0,
269  opMin,
270  opMax,
271  opSum,
272  opSumMag,
274 
277 
278  opAverage,
279  opAreaAverage,
281  opCoV,
282 
283  // Scalar return values
284 
287 
290 
292  opUniformity,
293 
294  // Weighted variants
295 
298 
301 
304 
307 
310 
311  // Variants using absolute weighting
312 
315 
318 
321 
325 
329  };
330 
331  //- Operation type names
332  static const Enum<operationType> operationTypeNames_;
333 
334 
335  //- Post-operation type enumeration
336  enum postOperationType
337  {
338  postOpNone,
339  postOpMag,
340  postOpSqrt
341  };
342 
343  //- Operation type names
344  static const Enum<postOperationType> postOperationTypeNames_;
345 
346 
347 private:
348 
349  // Private Member Functions
350 
351  //- Set faces to evaluate based on a face zone
352  void setFaceZoneFaces();
353 
354  //- Set faces to evaluate based on a patch
355  void setPatchFaces();
356 
357  //- Combine mesh faces and points from multiple processors
358  void combineMeshGeometry
359  (
360  faceList& faces,
362  ) const;
363 
364  //- Combine surface faces and points from multiple processors
365  void combineSurfaceGeometry
366  (
367  faceList& faces,
369  ) const;
370 
371  //- Calculate and return total area of the surfaceFieldValue: sum(magSf)
372  scalar totalArea() const;
373 
374 
375 protected:
376 
377  // Protected Data
378 
379  //- Region type
381 
382  //- Operation to apply to values
384 
385  //- Optional post-evaluation operation
387 
388  //- Weight field name - optional
389  word weightFieldName_;
390 
391  //- Track if the surface needs an update
392  bool needsUpdate_;
393 
394  //- Optionally write the area of the surfaceFieldValue
395  bool writeArea_;
396 
397  //- Total area of the surfaceFieldValue
398  scalar totalArea_;
399 
400  //- Global number of faces
401  label nFaces_;
402 
403 
404  // If operating on mesh faces (faceZone, patch)
405 
406  //- Local list of face IDs
408 
409  //- Local list of patch ID per face
411 
412  //- List representing the face flip map
413  // (false: use as-is, true: negate)
415 
416  //- The sampledSurface (when operating on sampledSurface)
417  autoPtr<sampledSurface> sampledPtr_;
418 
419  //- Surface writer
420  autoPtr<surfaceWriter> surfaceWriterPtr_;
421 
422 
423  // Protected Member Functions
424 
425  //- The volume mesh or surface registry being used
426  const objectRegistry& obr() const;
427 
428  //- Can the surface definition sample surface-fields?
429  inline bool withSurfaceFields() const;
430 
431  //- Can use mesh topological merge?
432  inline bool withTopologicalMerge() const;
433 
434  //- Return the local list of face IDs
435  inline const labelList& faceId() const;
436 
437  //- Return the local list of patch ID per face
438  inline const labelList& facePatch() const;
439 
440  //- Return the local true/false list representing the face flip map
441  inline const boolList& faceFlip() const;
442 
443  //- True if the operation needs a surface Sf
444  bool usesSf() const;
445 
446  //- True if the operation variant uses mag
447  inline bool usesMag() const;
448 
449  //- True if the operation variant uses a weight-field
450  inline bool usesWeight() const;
451 
452  //- True if operation variant uses a weight-field that is available.
453  // Checks for availability on any processor.
454  template<class WeightType>
455  inline bool canWeight(const Field<WeightType>& weightField) const;
456 
457  //- Update the surface and surface information as required.
458  // Do nothing (and return false) if no update was required
459  bool update();
460 
461  //- Return true if the field name is known and a valid type
462  template<class Type>
463  bool validField(const word& fieldName) const;
464 
465  //- Return field values by looking up field name
466  template<class Type>
468  (
469  const word& fieldName,
470  const bool mandatory = false
471  ) const;
472 
473  //- Apply the 'operation' to the values. Operation must preserve Type.
474  template<class Type, class WeightType>
476  (
478  const vectorField& Sf,
479  const Field<WeightType>& weightField
480  ) const;
481 
482  //- Apply the 'operation' to the values. Wrapper around
483  // processSameTypeValues. See also template specialisation below.
484  template<class Type, class WeightType>
485  Type processValues
486  (
487  const Field<Type>& values,
488  const vectorField& Sf,
489  const Field<WeightType>& weightField
490  ) const;
491 
492 
493  //- Filter a surface field according to faceIds
494  template<class Type>
496  (
498  ) const;
499 
500  //- Filter a volume field according to faceIds
501  template<class Type>
503  (
505  ) const;
506 
507 
508  //- Weighting factor.
509  // Possibly applies mag() depending on the operation type.
510  template<class WeightType>
512  (
513  const Field<WeightType>& weightField
514  ) const;
515 
516  //- Weighting factor, weight field with the area.
517  // Possibly applies mag() depending on the operation type.
518  // Reverts to mag(Sf) if the weight field is not available.
519  template<class WeightType>
521  (
522  const Field<WeightType>& weightField,
523  const vectorField& Sf
524  ) const;
525 
526 
527  //- Templated helper function to output field values
528  template<class WeightType>
529  label writeAll
530  (
531  const vectorField& Sf,
532  const Field<WeightType>& weightField,
534  const faceList& faces
535  );
536 
537  //- Templated helper function to output field values
538  template<class Type, class WeightType>
539  bool writeValues
540  (
541  const word& fieldName,
542  const vectorField& Sf,
543  const Field<WeightType>& weightField,
544  const pointField& points,
545  const faceList& faces
546  );
547 
548 
549  //- Output file header information
550  virtual void writeFileHeader(Ostream& os);
551 
552 
553 public:
554 
555  //- Declare type-name, virtual type (with debug switch)
556  TypeName("surfaceFieldValue");
557 
558 
559  // Constructors
560 
561  //- Construct from name, Time and dictionary
563  (
564  const word& name,
565  const Time& runTime,
566  const dictionary& dict
567  );
568 
569  //- Construct from name, objectRegistry and dictionary
571  (
572  const word& name,
573  const objectRegistry& obr,
574  const dictionary& dict
575  );
576 
577  //- No copy construct
578  surfaceFieldValue(const surfaceFieldValue&) = delete;
579 
580  //- No copy assignment
581  void operator=(const surfaceFieldValue&) = delete;
582 
583 
584  //- Destructor
585  virtual ~surfaceFieldValue() = default;
586 
587 
588  // Member Functions
589 
590  //- Return the region type
591  inline regionTypes regionType() const;
592 
593  //- Return the output directory
594  inline fileName outputDir() const;
595 
596  //- Read from dictionary
597  virtual bool read(const dictionary& dict);
598 
599  //- Calculate and write
600  virtual bool write();
601 
602  //- Update for changes of mesh
603  virtual void updateMesh(const mapPolyMesh& mpm);
604 
605  //- Update for changes of mesh
606  virtual void movePoints(const polyMesh& mesh);
607 };
608 
609 
610 //- Specialisation for scalar fields
611 template<>
613 (
615  const vectorField& Sf,
616  const scalarField& weightField
617 ) const;
618 
619 
620 //- Specialisation for vector fields
621 template<>
623 (
624  const Field<vector>& values,
625  const vectorField& Sf,
626  const scalarField& weightField
627 ) const;
628 
629 
630 //- Specialisation for scalar - pass through
631 template<>
633 (
634  const Field<scalar>& weightField
635 ) const;
636 
637 
638 //- Specialisation for scalar - scalar * Area
639 template<>
641 (
642  const Field<scalar>& weightField,
643  const vectorField& Sf
644 ) const;
645 
646 
647 //- Specialisation for vector - vector (dot) Area
648 template<>
650 (
651  const Field<vector>& weightField,
652  const vectorField& Sf
653 ) const;
654 
655 
656 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
657 
658 } // End namespace fieldValues
659 } // End namespace functionObjects
660 } // End namespace Foam
661 
662 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
663 
664 #include "surfaceFieldValueI.H"
665 
666 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
667 
668 #ifdef NoRepository
670 #endif
671 
672 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
673 
674 #endif
675 
676 // ************************************************************************* //
Foam::functionObjects::fieldValues::surfaceFieldValue::opAbsWeightedAreaIntegrate
Area integral using abs weighting.
Definition: surfaceFieldValue.H:520
Foam::functionObjects::fieldValues::surfaceFieldValue::opWeightedUniformity
Weighted uniformity index.
Definition: surfaceFieldValue.H:506
Foam::labelList
List< label > labelList
A List of labels.
Definition: List.H:71
Foam::pointField
vectorField pointField
pointField is a vectorField.
Definition: pointFieldFwd.H:44
Foam::functionObjects::fieldValues::surfaceFieldValue::operation_
operationType operation_
Operation to apply to values.
Definition: surfaceFieldValue.H:580
runTime
engineTime & runTime
Definition: createEngineTime.H:13
volFieldsFwd.H
Foam::functionObjects::fieldValues::surfaceFieldValue::opMin
Minimum value.
Definition: surfaceFieldValue.H:466
Foam::Enum< regionTypes >
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::functionObjects::fieldValues::surfaceFieldValue::opSumDirectionBalance
Sum of balance of values in given direction.
Definition: surfaceFieldValue.H:473
fvsPatchField.H
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
polySurface.H
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:59
Foam::functionObjects::fieldValues::surfaceFieldValue::operationType
operationType
Operation type enumeration.
Definition: surfaceFieldValue.H:461
Foam::functionObjects::fieldValues::surfaceFieldValue::read
virtual bool read(const dictionary &dict)
Read from dictionary.
Definition: surfaceFieldValue.C:873
Foam::functionObjects::fieldValues::surfaceFieldValue::postOperationType
postOperationType
Post-operation type enumeration.
Definition: surfaceFieldValue.H:533
Foam::functionObjects::fieldValues::surfaceFieldValue::typeScalar
Operation returns a scalar.
Definition: surfaceFieldValue.H:455
Foam::HashTableOps::values
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
Definition: HashOps.H:149
Foam::functionObjects::fieldValues::surfaceFieldValue::opAreaIntegrate
Area integral.
Definition: surfaceFieldValue.H:477
Foam::functionObjects::fieldValues::surfaceFieldValue::typeWeighted
Operation using weighting.
Definition: surfaceFieldValue.H:456
Foam::functionObjects::fieldValues::surfaceFieldValue::processSameTypeValues
Type processSameTypeValues(const Field< Type > &values, const vectorField &Sf, const Field< WeightType > &weightField) const
Apply the 'operation' to the values. Operation must preserve Type.
Definition: surfaceFieldValueTemplates.C:132
Foam::functionObjects::fieldValue::dict
const dictionary & dict() const
Return the reference to the construction dictionary.
Definition: fieldValueI.H:31
Foam::functionObjects::fieldValues::surfaceFieldValue::usesSf
bool usesSf() const
True if the operation needs a surface Sf.
Definition: surfaceFieldValue.C:461
Foam::functionObjects::fieldValues::surfaceFieldValue::faceFlip
const boolList & faceFlip() const
Return the local true/false list representing the face flip map.
Definition: surfaceFieldValueI.H:68
Foam::boolList
List< bool > boolList
A List of bools.
Definition: List.H:69
Foam::functionObjects::fieldValues::surfaceFieldValue::canWeight
bool canWeight(const Field< WeightType > &weightField) const
True if operation variant uses a weight-field that is available.
Definition: surfaceFieldValueTemplates.C:42
Foam::functionObjects::fieldValues::surfaceFieldValue::withTopologicalMerge
bool withTopologicalMerge() const
Can use mesh topological merge?
Definition: surfaceFieldValueI.H:47
Foam::functionObjects::fieldValues::surfaceFieldValue::postOpNone
No additional operation after calculation.
Definition: surfaceFieldValue.H:535
Foam::functionObjects::fieldValues::surfaceFieldValue::postOperation_
postOperationType postOperation_
Optional post-evaluation operation.
Definition: surfaceFieldValue.H:583
Foam::functionObjects::fieldValues::surfaceFieldValue::opAbsWeightedAreaAverage
Area average using abs weighting.
Definition: surfaceFieldValue.H:517
Foam::functionObjects::fieldValues::surfaceFieldValue::opUniformity
Uniformity index (output is always scalar)
Definition: surfaceFieldValue.H:489
Foam::functionObjects::fieldValues::surfaceFieldValue::filterField
tmp< Field< Type > > filterField(const GeometricField< Type, fvsPatchField, surfaceMesh > &field) const
Filter a surface field according to faceIds.
Foam::functionObjects::fieldValues::surfaceFieldValue::opAbsWeightedUniformity
Uniformity index using abs weighting.
Definition: surfaceFieldValue.H:524
Foam::functionObjects::fieldValues::surfaceFieldValue::stSampled
Sample onto surface and calculate.
Definition: surfaceFieldValue.H:445
Foam::functionObjects::fieldValues::surfaceFieldValue::stFaceZone
Calculate on a faceZone.
Definition: surfaceFieldValue.H:442
Foam::functionObjects::fieldValues::surfaceFieldValue::regionTypeNames_
static const Enum< regionTypes > regionTypeNames_
Region type names.
Definition: surfaceFieldValue.H:449
Foam::functionObjects::fieldValues::surfaceFieldValue::writeAll
label writeAll(const vectorField &Sf, const Field< WeightType > &weightField, const pointField &points, const faceList &faces)
Templated helper function to output field values.
Foam::functionObjects::fieldValues::surfaceFieldValue::regionType_
regionTypes regionType_
Region type.
Definition: surfaceFieldValue.H:577
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::functionObjects::fieldValues::surfaceFieldValue::surfaceFieldValue
surfaceFieldValue(const word &name, const Time &runTime, const dictionary &dict)
Construct from name, Time and dictionary.
Definition: surfaceFieldValue.C:805
Foam::functionObjects::fieldValues::surfaceFieldValue::stObject
Calculate with function object surface.
Definition: surfaceFieldValue.H:444
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:60
Foam::functionObjects::fieldValues::surfaceFieldValue::weightingFactor
tmp< scalarField > weightingFactor(const Field< WeightType > &weightField) const
Weighting factor.
Foam::functionObjects::fieldValues::surfaceFieldValue::withSurfaceFields
bool withSurfaceFields() const
Can the surface definition sample surface-fields?
Definition: surfaceFieldValueI.H:35
Foam::functionObjects::fieldValues::surfaceFieldValue::update
bool update()
Update the surface and surface information as required.
Definition: surfaceFieldValue.C:483
Foam::functionObjects::fieldValues::surfaceFieldValue::opMax
Maximum value.
Definition: surfaceFieldValue.H:467
Foam::functionObjects::fieldValues::surfaceFieldValue::typeAbsolute
Operation using mag (eg, for weighting)
Definition: surfaceFieldValue.H:457
Foam::Field< vector >
Foam::functionObjects::fieldValues::surfaceFieldValue::surfaceWriterPtr_
autoPtr< surfaceWriter > surfaceWriterPtr_
Surface writer.
Definition: surfaceFieldValue.H:617
Foam::functionObjects::fieldValues::surfaceFieldValue::opWeightedAreaIntegrate
Weighted area integral.
Definition: surfaceFieldValue.H:503
Foam::functionObjects::fieldValues::surfaceFieldValue::opSumDirection
Sum in a given direction.
Definition: surfaceFieldValue.H:470
Foam::functionObjects::fieldValues::surfaceFieldValue::getFieldValues
tmp< Field< Type > > getFieldValues(const word &fieldName, const bool mandatory=false) const
Return field values by looking up field name.
Foam::functionObjects::fieldValues::surfaceFieldValue::updateMesh
virtual void updateMesh(const mapPolyMesh &mpm)
Update for changes of mesh.
Definition: surfaceFieldValue.C:1103
Foam::functionObjects::fieldValues::surfaceFieldValue::opAreaNormalIntegrate
Area integral in normal direction (output is always scalar)
Definition: surfaceFieldValue.H:486
Foam::functionObjects::fieldValues::surfaceFieldValue::regionTypes
regionTypes
Region type enumeration.
Definition: surfaceFieldValue.H:440
Foam::functionObjects::fieldValues::surfaceFieldValue::opSum
Sum of values.
Definition: surfaceFieldValue.H:468
field
rDeltaTY field()
Foam::functionObjects::fieldValues::surfaceFieldValue::regionType
regionTypes regionType() const
Return the region type.
Definition: surfaceFieldValueI.H:93
Foam::functionObjects::fieldValues::surfaceFieldValue::opWeightedSum
Weighted sum.
Definition: surfaceFieldValue.H:494
Foam::functionObjects::fieldValues::surfaceFieldValue::totalArea_
scalar totalArea_
Total area of the surfaceFieldValue.
Definition: surfaceFieldValue.H:595
Foam::functionObjects::fieldValues::surfaceFieldValue::opAbsWeightedAverage
Average using abs weighting.
Definition: surfaceFieldValue.H:514
Foam::functionObjects::fieldValues::surfaceFieldValue::TypeName
TypeName("surfaceFieldValue")
Declare type-name, virtual type (with debug switch)
Foam::functionObjects::fieldValues::surfaceFieldValue::usesWeight
bool usesWeight() const
True if the operation variant uses a weight-field.
Definition: surfaceFieldValueI.H:85
polySurfaceFieldsFwd.H
Foam::functionObjects::fieldValues::surfaceFieldValue::nFaces_
label nFaces_
Global number of faces.
Definition: surfaceFieldValue.H:598
Foam::functionObjects::fieldValues::surfaceFieldValue::opCoV
Coefficient of variation.
Definition: surfaceFieldValue.H:478
Foam::functionObjects::fieldValues::surfaceFieldValue::faceId_
labelList faceId_
Local list of face IDs.
Definition: surfaceFieldValue.H:604
Foam::functionObjects::fieldValues::surfaceFieldValue::opSumMag
Sum of component magnitudes.
Definition: surfaceFieldValue.H:469
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
surfaceMesh.H
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::functionObjects::fieldValues::surfaceFieldValue::opWeightedAverage
Weighted average.
Definition: surfaceFieldValue.H:497
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::functionObjects::fieldValues::surfaceFieldValue::obr
const objectRegistry & obr() const
The volume mesh or surface registry being used.
Definition: surfaceFieldValue.C:120
Foam::functionObjects::fieldValues::surfaceFieldValue::facePatchId_
labelList facePatchId_
Local list of patch ID per face.
Definition: surfaceFieldValue.H:607
Foam::functionObjects::fieldValues::surfaceFieldValue::movePoints
virtual void movePoints(const polyMesh &mesh)
Update for changes of mesh.
Definition: surfaceFieldValue.C:1112
Foam::functionObjects::fieldValues::surfaceFieldValue::~surfaceFieldValue
virtual ~surfaceFieldValue()=default
Destructor.
Foam::functionObjects::fieldValues::surfaceFieldValue::validField
bool validField(const word &fieldName) const
Return true if the field name is known and a valid type.
Definition: surfaceFieldValueTemplates.C:56
Foam::functionObjects::fieldValues::surfaceFieldValue::postOpMag
Component-wise mag after normal operation.
Definition: surfaceFieldValue.H:536
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::functionObjects::fieldValues::surfaceFieldValue::writeArea_
bool writeArea_
Optionally write the area of the surfaceFieldValue.
Definition: surfaceFieldValue.H:592
Foam::functionObjects::fieldValues::surfaceFieldValue::operator=
void operator=(const surfaceFieldValue &)=delete
No copy assignment.
Foam::functionObjects::fieldValues::surfaceFieldValue::opAverage
Ensemble average.
Definition: surfaceFieldValue.H:475
Foam::functionObjects::fieldValues::surfaceFieldValue::operationTypeNames_
static const Enum< operationType > operationTypeNames_
Operation type names.
Definition: surfaceFieldValue.H:529
Foam::functionObject::name
const word & name() const
Return the name of this functionObject.
Definition: functionObject.C:131
fieldValue.H
Foam::faceList
List< face > faceList
A List of faces.
Definition: faceListFwd.H:47
Foam::functionObjects::fieldValues::surfaceFieldValue::weightFieldName_
word weightFieldName_
Weight field name - optional.
Definition: surfaceFieldValue.H:586
Foam::Vector
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
Definition: Vector.H:62
surfaceFieldValueI.H
Foam::functionObjects::fieldValues::surfaceFieldValue::opAbsWeightedSum
Sum using abs weighting.
Definition: surfaceFieldValue.H:511
Foam::functionObjects::fieldValues::surfaceFieldValue::needsUpdate_
bool needsUpdate_
Track if the surface needs an update.
Definition: surfaceFieldValue.H:589
Foam::List< face >
Foam::functionObjects::fieldValue
Intermediate class for handling field value-based function objects.
Definition: fieldValue.H:119
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::functionObjects::fieldValues::surfaceFieldValue::writeFileHeader
virtual void writeFileHeader(Ostream &os)
Output file header information.
Definition: surfaceFieldValue.C:544
Foam::functionObjects::fieldValues::surfaceFieldValue::opWeightedAreaAverage
Weighted area average.
Definition: surfaceFieldValue.H:500
Foam::functionObjects::fieldValues::surfaceFieldValue::postOpSqrt
Component-wise sqrt after normal operation.
Definition: surfaceFieldValue.H:537
Foam::functionObjects::fieldValues::surfaceFieldValue
Provides a 'face regionType' variant of the fieldValues function object.
Definition: surfaceFieldValue.H:431
Foam::functionObjects::fieldValues::surfaceFieldValue::sampledPtr_
autoPtr< sampledSurface > sampledPtr_
The sampledSurface (when operating on sampledSurface)
Definition: surfaceFieldValue.H:614
Foam::functionObjects::fieldValues::surfaceFieldValue::facePatch
const labelList & facePatch() const
Return the local list of patch ID per face.
Definition: surfaceFieldValueI.H:61
Foam::functionObjects::fieldValues::surfaceFieldValue::typeBase
Base operation.
Definition: surfaceFieldValue.H:454
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:160
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::functionObjects::fieldValues::surfaceFieldValue::opAreaNormalAverage
Area average in normal direction (output is always scalar)
Definition: surfaceFieldValue.H:483
Foam::functionObjects::fieldValues::surfaceFieldValue::stPatch
Calculate on a patch.
Definition: surfaceFieldValue.H:443
Foam::functionObjects::fieldValues::surfaceFieldValue::usesMag
bool usesMag() const
True if the operation variant uses mag.
Definition: surfaceFieldValueI.H:77
Foam::functionObjects::fieldValues::surfaceFieldValue::outputDir
fileName outputDir() const
Return the output directory.
Definition: surfaceFieldValueI.H:100
Foam::functionObjects::fieldValues::surfaceFieldValue::operationVariant
operationVariant
Bitmask values for operation variants.
Definition: surfaceFieldValue.H:452
Foam::functionObjects::fieldValues::surfaceFieldValue::write
virtual bool write()
Calculate and write.
Definition: surfaceFieldValue.C:991
Foam::GeometricField
Generic GeometricField class.
Definition: areaFieldsFwd.H:53
Foam::functionObjects::fieldValues::surfaceFieldValue::writeValues
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.
Definition: surfaceFieldValueTemplates.C:358
Foam::functionObjects::fieldValues::surfaceFieldValue::faceFlip_
boolList faceFlip_
List representing the face flip map.
Definition: surfaceFieldValue.H:611
Foam::functionObjects::fieldValues::surfaceFieldValue::processValues
Type processValues(const Field< Type > &values, const vectorField &Sf, const Field< WeightType > &weightField) const
Apply the 'operation' to the values. Wrapper around.
Definition: surfaceFieldValueTemplates.C:293
Foam::functionObjects::fieldValues::surfaceFieldValue::opNone
No operation.
Definition: surfaceFieldValue.H:465
Foam::functionObjects::fieldValues::surfaceFieldValue::opAreaAverage
Area average.
Definition: surfaceFieldValue.H:476
Foam::functionObjects::fieldValues::surfaceFieldValue::postOperationTypeNames_
static const Enum< postOperationType > postOperationTypeNames_
Operation type names.
Definition: surfaceFieldValue.H:541
Foam::functionObjects::fieldValues::surfaceFieldValue::faceId
const labelList & faceId() const
Return the local list of face IDs.
Definition: surfaceFieldValueI.H:54
surfaceFieldValueTemplates.C
Enum.H