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  A \c 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 \c sum operator to the flux field (typically \c phi).
42 
43 Usage
44  A minimal example:
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  names (<patch-name> <patch-regex>);
60 
61  postOperation none;
62  weightField alpha1;
63  scaleFactor 1.0;
64  writeArea false;
65  surfaceFormat none;
66 
67  // Optional (inherited) entries
68  ...
69  }
70 
71  surfaceFieldValueFaceZone1
72  {
73  // Mandatory entries (unmodifiable)
74  type surfaceFieldValue;
75  libs (fieldFunctionObjects);
76 
77  // Mandatory entries (runtime modifiable)
78  fields (<field1> <field2> ... <fieldN>);
79  operation <operationType>;
80  regionType faceZone;
81  name <faceZone>;
82 
83  // Optional entries (runtime modifiable)
84  names (<zone-name> <zone-regex>);
85 
86  postOperation none;
87  weightFields (rho U);
88  scaleFactor 1.0;
89  writeArea false;
90  surfaceFormat none;
91 
92  // Optional (inherited) entries
93  ...
94  }
95  \endverbatim
96 
97  where the entries mean:
98  \table
99  Property | Description | Type | Reqd | Dflt
100  type | Type name: surfaceFieldValue | word | yes | -
101  libs | Libraries: fieldFunctionObjects | wordList | yes | -
102  regionType | Face regionType: see below | word | yes | -
103  fields | Names of operand fields | wordList | yes | -
104  name | Name of the regionType | word | yes | -
105  names | Extended selection | word/regex list | no | -
106  operation | Operation type: see below | word | yes | -
107  postOperation | Post-operation type: see below | word | no | none
108  weightField | Name of field to apply weighting | word | maybe |
109  weightFields | Names of fields to apply weighting | wordList | maybe |
110  scaleFactor | Output value scaling factor | scalar | no | 1.0
111  writeArea | Write the surface area | bool | no | false
112  surfaceFormat | Output value format | word <!--
113  --> | conditional on writeFields | none
114  \endtable
115 
116  The inherited entries are elaborated in:
117  - \link fieldValue.H \endlink
118 
119  Options for the \c regionType entry:
120  \plaintable
121  faceZone | The \b name entry specifies a faceZone. Supports \b names
122  patch | The \b name entry specifies a patch. Supports \b names
123  functionObjectSurface | The \b name entry specifies a polySurface
124  sampledSurface | A \b sampledSurfaceDict sub-dictionary and \b name
125  \endplaintable
126 
127  Options for the \c operation entry:
128  \plaintable
129  none | no operation
130  min | minimum
131  max | maximum
132  sum | sum
133  sumMag | sum of component magnitudes
134  sumDirection | sum values that are positive in given direction
135  sumDirectionBalance | sum of balance of values in given direction
136  average | ensemble average
137  areaAverage | area-weighted average
138  areaIntegrate | area integral
139  CoV | coefficient of variation: standard deviation/mean
140  areaNormalAverage | area-weighted average in face normal direction
141  areaNormalIntegrate | area-weighted integral in face normal directon
142  uniformity | uniformity index
143  weightedSum | weighted sum
144  weightedAverage | weighted average
145  weightedAreaAverage | weighted area average
146  weightedAreaIntegrate | weighted area integral
147  weightedUniformity | weighted uniformity index
148  absWeightedSum | sum using absolute weighting
149  absWeightedAverage | average using absolute weighting
150  absWeightedAreaAverage | area average using absolute weighting
151  absWeightedAreaIntegrate | area integral using absolute weighting
152  absWeightedUniformity | uniformity index using absolute weighting
153  \endplaintable
154 
155  Options for the \c postOperation entry:
156  \plaintable
157  none | No additional operation after calculation
158  mag | Component-wise \c mag() after normal operation
159  sqrt | Component-wise \c sqrt() after normal operation
160  \endplaintable
161 
162  Usage by the \c postProcess utility is not available.
163 
164 Note
165  - Some types (eg, patch or faceZone) support the selection of multiple
166  entries, which can be specified as list of words or regular expressions
167  by \b names entry.<br>
168  If the \b names enty exists \em and contains a literal that can be used
169  as a suitable value for \b name, the \b name entry becomes optional
170  instead of being mandatory.
171  - The values reported by the \c areaNormalAverage and \c areaNormalIntegrate
172  operations are written as the first component of a field with the same
173  rank as the input field.
174  - Faces on empty patches are ignored.
175  - Using \c functionObjectSurface:
176  - The keyword %subRegion should not be used to select surfaces.
177  Instead specify the regionType 'functionObjectSurface' and provide
178  the name.
179  - Using \c sampledSurface:
180  - not available for surface fields
181  - if interpolate=true they use \c interpolationCellPoint
182  otherwise they use cell values
183  - each triangle in \c sampledSurface is logically only in one cell
184  so interpolation will be wrong when triangles are larger than
185  cells. This can only happen for sampling on a \c triSurfaceMesh
186  - take care when using isoSurfaces - these might have duplicate
187  triangles and so integration might be wrong
188 
189  Uniformity:
190  \f[
191  UI(\phi) = 1 - \frac{1}{2 \overline{\phi} A}
192  \int{\left| W \phi \cdot \hat{n} - \bar{W} \bar{\phi}\right| d\vec{A}}
193  \,,\;
194  \bar{\phi} = \frac{\int{W \phi \cdot d\vec{A}}}{\int{W \cdot d\vec{A}}}
195  \f]
196 
197  A velocity uniformity index is calculated with no weighting (W=1) and
198  \f$ \phi = \vec{U} \f$.
199 
200  A scalar concentration uniformity index is calculated with either
201  \f$ \rho \vec U \f$ or \f$ \vec U \f$ for weighting and
202  \f$ \phi = conc \f$.
203 
204 See also
205  - Foam::functionObject
206  - Foam::functionObjects::fieldValues::fieldValue
207  - ExtendedCodeGuide::functionObjects::field::surfaceFieldValue
208 
209 SourceFiles
210  surfaceFieldValue.C
211  surfaceFieldValueTemplates.C
212 
213 \*---------------------------------------------------------------------------*/
214 
215 #ifndef functionObjects_surfaceFieldValue_H
216 #define functionObjects_surfaceFieldValue_H
217 
218 #include "fieldValue.H"
219 #include "Enum.H"
220 #include "surfaceMesh.H"
221 #include "polySurface.H"
222 #include "fvsPatchField.H"
223 #include "volFieldsFwd.H"
224 #include "polySurfaceFieldsFwd.H"
225 
226 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
227 
228 namespace Foam
229 {
230 
231 // Forward Declarations
232 class sampledSurface;
233 class surfaceWriter;
234 
235 namespace functionObjects
236 {
237 namespace fieldValues
238 {
239 
240 /*---------------------------------------------------------------------------*\
241  Class surfaceFieldValue Declaration
242 \*---------------------------------------------------------------------------*/
243 
244 class surfaceFieldValue
245 :
246  public fieldValue
247 {
248 public:
249 
250  // Public Data Types
251 
252  //- Region type enumeration
253  enum regionTypes
254  {
255  stFaceZone = 0x01,
256  stPatch = 0x02,
257  stObject = 0x11,
258  stSampled = 0x12
259  };
260 
261  //- Region type names
262  static const Enum<regionTypes> regionTypeNames_;
263 
264  //- Bitmask values for operation variants
265  enum operationVariant
266  {
267  typeBase = 0,
268  typeScalar = 0x100,
269  typeWeighted = 0x200,
270  typeAbsolute = 0x400,
271  };
272 
273  //- Operation type enumeration
274  enum operationType
275  {
276  // Normal operations
277 
278  opNone = 0,
279  opMin,
280  opMax,
281  opSum,
282  opSumMag,
284 
287 
288  opAverage,
289  opAreaAverage,
291  opCoV,
292 
293  // Scalar return values
294 
297 
300 
302  opUniformity,
303 
304  // Weighted variants
305 
308 
311 
314 
317 
320 
321  // Variants using absolute weighting
322 
325 
328 
331 
335 
339  };
340 
341  //- Operation type names
342  static const Enum<operationType> operationTypeNames_;
343 
344 
345  //- Post-operation type enumeration
346  enum postOperationType
347  {
348  postOpNone,
349  postOpMag,
350  postOpSqrt
351  };
352 
353  //- Operation type names
354  static const Enum<postOperationType> postOperationTypeNames_;
355 
356 
357 private:
358 
359  // Private Member Functions
360 
361  //- Set faces to evaluate based on a face zone
362  void setFaceZoneFaces();
363 
364  //- Set faces to evaluate based on a patch
365  void setPatchFaces();
366 
367  //- Combine mesh faces and points from multiple processors
368  void combineMeshGeometry
369  (
370  faceList& faces,
372  ) const;
373 
374  //- Combine surface faces and points from multiple processors
375  void combineSurfaceGeometry
376  (
377  faceList& faces,
379  ) const;
380 
381  //- Calculate and return total area of the surfaceFieldValue: sum(magSf)
382  scalar totalArea() const;
383 
384 
385 protected:
386 
387  // Protected Data
388 
389  //- Region type
391 
392  //- Operation to apply to values
394 
395  //- Optional post-evaluation operation
397 
398  //- Track if the surface needs an update
399  bool needsUpdate_;
400 
401  //- Optionally write the area of the surfaceFieldValue
402  bool writeArea_;
403 
404  //- Extended selections
405  wordRes selectionNames_;
406 
407  //- Weight field name(s) - optional
409 
410  //- Total area of the surfaceFieldValue
411  scalar totalArea_;
412 
413  //- Global number of faces
414  label nFaces_;
415 
416 
417  // If operating on mesh faces (faceZone, patch)
418 
419  //- Local list of face IDs
421 
422  //- Local list of patch ID per face
424 
425  //- List representing the face flip map
426  // (false: use as-is, true: negate)
428 
429 
430  // Demand-driven
431 
432  //- The sampledSurface (when operating on sampledSurface)
433  autoPtr<sampledSurface> sampledPtr_;
434 
435  //- Surface writer
436  autoPtr<surfaceWriter> surfaceWriterPtr_;
437 
438 
439  // Protected Member Functions
440 
441  //- The volume mesh or surface registry being used
442  const objectRegistry& obr() const;
443 
444  //- Can the surface definition sample surface-fields?
445  inline bool withSurfaceFields() const;
446 
447  //- Can use mesh topological merge?
448  inline bool withTopologicalMerge() const;
449 
450  //- Return the local list of face IDs
451  inline const labelList& faceId() const;
452 
453  //- Return the local list of patch ID per face
454  inline const labelList& facePatch() const;
455 
456  //- Return the local true/false list representing the face flip map
457  inline const boolList& faceFlip() const;
458 
459  //- True if the operation needs a surface Sf
460  bool usesSf() const;
461 
462  //- True if the operation variant uses mag
463  inline bool usesMag() const;
464 
465  //- True if the operation variant uses a weight-field
466  inline bool usesWeight() const;
467 
468  //- True if operation variant uses a weight-field that is available.
469  // Checks for availability on any processor.
470  template<class WeightType>
471  inline bool canWeight(const Field<WeightType>& weightField) const;
472 
473  //- Update the surface and surface information as required.
474  // Do nothing (and return false) if no update was required
475  bool update();
476 
477  //- Return true if the field name is known and a valid type
478  template<class Type>
479  bool validField(const word& fieldName) const;
480 
481  //- Return field values by looking up field name
482  template<class Type>
484  (
485  const word& fieldName,
486  const bool mandatory = false
487  ) const;
488 
489  //- Apply the 'operation' to the values. Operation must preserve Type.
490  template<class Type, class WeightType>
492  (
493  const Field<Type>& values,
494  const vectorField& Sf,
495  const Field<WeightType>& weightField
496  ) const;
497 
498  //- Apply the 'operation' to the values. Wrapper around
499  // processSameTypeValues. See also template specialisation below.
500  template<class Type, class WeightType>
501  Type processValues
502  (
503  const Field<Type>& values,
504  const vectorField& Sf,
505  const Field<WeightType>& weightField
506  ) const;
507 
508 
509  //- Filter a surface field according to faceIds
510  template<class Type>
512  (
514  ) const;
515 
516  //- Filter a volume field according to faceIds
517  template<class Type>
519  (
521  ) const;
522 
523 
524  //- Weighting factor.
525  // Possibly applies mag() depending on the operation type.
526  template<class WeightType>
528  (
529  const Field<WeightType>& weightField
530  ) const;
531 
532  //- Weighting factor, weight field with the area.
533  // Possibly applies mag() depending on the operation type.
534  // Reverts to mag(Sf) if the weight field is not available.
535  template<class WeightType>
537  (
538  const Field<WeightType>& weightField,
539  const vectorField& Sf
540  ) const;
541 
542 
543  //- Templated helper function to output field values
544  template<class WeightType>
545  label writeAll
546  (
547  const vectorField& Sf,
548  const Field<WeightType>& weightField,
549  const pointField& points,
550  const faceList& faces
551  );
552 
553  //- Templated helper function to output field values
554  template<class Type, class WeightType>
556  (
557  const word& fieldName,
558  const vectorField& Sf,
559  const Field<WeightType>& weightField,
560  const pointField& points,
561  const faceList& faces
562  );
563 
564 
565  //- Output file header information
566  virtual void writeFileHeader(Ostream& os);
567 
568 
569 public:
570 
571  //- Declare type-name, virtual type (with debug switch)
572  TypeName("surfaceFieldValue");
573 
574 
575  // Constructors
576 
577  //- Construct from name, Time and dictionary
579  (
580  const word& name,
581  const Time& runTime,
582  const dictionary& dict
583  );
584 
585  //- Construct from name, objectRegistry and dictionary
587  (
588  const word& name,
589  const objectRegistry& obr,
590  const dictionary& dict
591  );
592 
593  //- No copy construct
594  surfaceFieldValue(const surfaceFieldValue&) = delete;
595 
596  //- No copy assignment
597  void operator=(const surfaceFieldValue&) = delete;
598 
599 
600  //- Destructor
601  virtual ~surfaceFieldValue() = default;
602 
603 
604  // Member Functions
605 
606  //- Return the region type
607  inline regionTypes regionType() const;
608 
609  //- Return the output directory
610  inline fileName outputDir() const;
611 
612  //- Read from dictionary
613  virtual bool read(const dictionary& dict);
614 
615  //- Calculate and write
616  virtual bool write();
617 
618  //- Update for changes of mesh
619  virtual void updateMesh(const mapPolyMesh& mpm);
620 
621  //- Update for changes of mesh
622  virtual void movePoints(const polyMesh& mesh);
623 };
624 
625 
626 //- Specialisation for scalar fields
627 template<>
629 (
630  const Field<scalar>& values,
631  const vectorField& Sf,
632  const scalarField& weightField
633 ) const;
634 
635 
636 //- Specialisation for vector fields
637 template<>
639 (
640  const Field<vector>& values,
641  const vectorField& Sf,
642  const scalarField& weightField
643 ) const;
644 
645 
646 //- Specialisation for scalar - pass through
647 template<>
649 (
650  const Field<scalar>& weightField
651 ) const;
652 
653 
654 //- Specialisation for scalar - scalar * Area
655 template<>
657 (
658  const Field<scalar>& weightField,
659  const vectorField& Sf
660 ) const;
661 
662 
663 //- Specialisation for vector - vector (dot) Area
664 template<>
666 (
667  const Field<vector>& weightField,
668  const vectorField& Sf
669 ) const;
670 
671 
672 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
673 
674 } // End namespace fieldValues
675 } // End namespace functionObjects
676 } // End namespace Foam
677 
678 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
679 
680 #include "surfaceFieldValueI.H"
681 
682 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
683 
684 #ifdef NoRepository
686 #endif
687 
688 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
689 
690 #endif
691 
692 // ************************************************************************* //
Foam::functionObjects::fieldValues::surfaceFieldValue::opAbsWeightedAreaIntegrate
Area integral using abs weighting.
Definition: surfaceFieldValue.H:542
Foam::functionObjects::fieldValues::surfaceFieldValue::opWeightedUniformity
Weighted uniformity index.
Definition: surfaceFieldValue.H:528
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:602
runTime
engineTime & runTime
Definition: createEngineTime.H:13
volFieldsFwd.H
Foam::functionObjects::fieldValues::surfaceFieldValue::opMin
Minimum value.
Definition: surfaceFieldValue.H:488
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:495
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:61
Foam::functionObjects::fieldValues::surfaceFieldValue::operationType
operationType
Operation type enumeration.
Definition: surfaceFieldValue.H:483
Foam::functionObjects::fieldValues::surfaceFieldValue::read
virtual bool read(const dictionary &dict)
Read from dictionary.
Definition: surfaceFieldValue.C:971
Foam::functionObjects::fieldValues::surfaceFieldValue::postOperationType
postOperationType
Post-operation type enumeration.
Definition: surfaceFieldValue.H:555
Foam::functionObjects::fieldValues::surfaceFieldValue::typeScalar
Operation returns a scalar.
Definition: surfaceFieldValue.H:477
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:499
Foam::functionObjects::fieldValues::surfaceFieldValue::typeWeighted
Operation using weighting.
Definition: surfaceFieldValue.H:478
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:552
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:557
Foam::functionObjects::fieldValues::surfaceFieldValue::postOperation_
postOperationType postOperation_
Optional post-evaluation operation.
Definition: surfaceFieldValue.H:605
Foam::functionObjects::fieldValues::surfaceFieldValue::weightFieldNames_
wordList weightFieldNames_
Weight field name(s) - optional.
Definition: surfaceFieldValue.H:617
Foam::functionObjects::fieldValues::surfaceFieldValue::opAbsWeightedAreaAverage
Area average using abs weighting.
Definition: surfaceFieldValue.H:539
Foam::functionObjects::fieldValues::surfaceFieldValue::opUniformity
Uniformity index (output is always scalar)
Definition: surfaceFieldValue.H:511
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:546
Foam::functionObjects::fieldValues::surfaceFieldValue::stSampled
Sample onto surface and calculate.
Definition: surfaceFieldValue.H:467
Foam::functionObjects::fieldValues::surfaceFieldValue::stFaceZone
Calculate with faceZone(s)
Definition: surfaceFieldValue.H:464
Foam::functionObjects::fieldValues::surfaceFieldValue::regionTypeNames_
static const Enum< regionTypes > regionTypeNames_
Region type names.
Definition: surfaceFieldValue.H:471
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:599
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:901
Foam::functionObjects::fieldValues::surfaceFieldValue::stObject
Calculate with function object surface.
Definition: surfaceFieldValue.H:466
Foam::wordList
List< word > wordList
A List of words.
Definition: fileName.H:59
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:574
Foam::functionObjects::fieldValues::surfaceFieldValue::opMax
Maximum value.
Definition: surfaceFieldValue.H:489
Foam::functionObjects::fieldValues::surfaceFieldValue::typeAbsolute
Operation using mag (eg, for weighting)
Definition: surfaceFieldValue.H:479
Foam::Field< vector >
Foam::functionObjects::fieldValues::surfaceFieldValue::surfaceWriterPtr_
autoPtr< surfaceWriter > surfaceWriterPtr_
Surface writer.
Definition: surfaceFieldValue.H:645
Foam::functionObjects::fieldValues::surfaceFieldValue::opWeightedAreaIntegrate
Weighted area integral.
Definition: surfaceFieldValue.H:525
Foam::functionObjects::fieldValues::surfaceFieldValue::opSumDirection
Sum in a given direction.
Definition: surfaceFieldValue.H:492
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:1299
Foam::functionObjects::fieldValues::surfaceFieldValue::opAreaNormalIntegrate
Area integral in normal direction (output is always scalar)
Definition: surfaceFieldValue.H:508
Foam::functionObjects::fieldValues::surfaceFieldValue::regionTypes
regionTypes
Region type enumeration.
Definition: surfaceFieldValue.H:462
Foam::functionObjects::fieldValues::surfaceFieldValue::opSum
Sum of values.
Definition: surfaceFieldValue.H:490
field
rDeltaTY field()
Foam::functionObjects::fieldValues::surfaceFieldValue::regionType
regionTypes regionType() const
Return the region type.
Definition: surfaceFieldValueI.H:93
Foam::functionObjects::fieldValues::surfaceFieldValue::selectionNames_
wordRes selectionNames_
Extended selections.
Definition: surfaceFieldValue.H:614
Foam::functionObjects::fieldValues::surfaceFieldValue::opWeightedSum
Weighted sum.
Definition: surfaceFieldValue.H:516
Foam::functionObjects::fieldValues::surfaceFieldValue::totalArea_
scalar totalArea_
Total area of the surfaceFieldValue.
Definition: surfaceFieldValue.H:620
Foam::functionObjects::fieldValues::surfaceFieldValue::opAbsWeightedAverage
Average using abs weighting.
Definition: surfaceFieldValue.H:536
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:623
Foam::functionObjects::fieldValues::surfaceFieldValue::opCoV
Coefficient of variation.
Definition: surfaceFieldValue.H:500
Foam::functionObjects::fieldValues::surfaceFieldValue::faceId_
labelList faceId_
Local list of face IDs.
Definition: surfaceFieldValue.H:629
Foam::functionObjects::fieldValues::surfaceFieldValue::opSumMag
Sum of component magnitudes.
Definition: surfaceFieldValue.H:491
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:519
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:632
Foam::functionObjects::fieldValues::surfaceFieldValue::movePoints
virtual void movePoints(const polyMesh &mesh)
Update for changes of mesh.
Definition: surfaceFieldValue.C:1308
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:558
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:611
Foam::functionObjects::fieldValues::surfaceFieldValue::operator=
void operator=(const surfaceFieldValue &)=delete
No copy assignment.
Foam::functionObjects::fieldValues::surfaceFieldValue::opAverage
Ensemble average.
Definition: surfaceFieldValue.H:497
Foam::functionObjects::fieldValues::surfaceFieldValue::operationTypeNames_
static const Enum< operationType > operationTypeNames_
Operation type names.
Definition: surfaceFieldValue.H:551
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::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:533
Foam::functionObjects::fieldValues::surfaceFieldValue::needsUpdate_
bool needsUpdate_
Track if the surface needs an update.
Definition: surfaceFieldValue.H:608
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:635
Foam::wordRes
A List of wordRe with additional matching capabilities.
Definition: wordRes.H:51
Foam::functionObjects::fieldValues::surfaceFieldValue::opWeightedAreaAverage
Weighted area average.
Definition: surfaceFieldValue.H:522
Foam::functionObjects::fieldValues::surfaceFieldValue::postOpSqrt
Component-wise sqrt after normal operation.
Definition: surfaceFieldValue.H:559
Foam::functionObjects::fieldValues::surfaceFieldValue
A face regionType variant of the fieldValues function object.
Definition: surfaceFieldValue.H:453
Foam::functionObjects::fieldValues::surfaceFieldValue::sampledPtr_
autoPtr< sampledSurface > sampledPtr_
The sampledSurface (when operating on sampledSurface)
Definition: surfaceFieldValue.H:642
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:476
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:161
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:505
Foam::functionObjects::fieldValues::surfaceFieldValue::stPatch
Calculate with patch(es)
Definition: surfaceFieldValue.H:465
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:474
Foam::functionObjects::fieldValues::surfaceFieldValue::write
virtual bool write()
Calculate and write.
Definition: surfaceFieldValue.C:1154
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:636
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:487
Foam::functionObjects::fieldValues::surfaceFieldValue::opAreaAverage
Area average.
Definition: surfaceFieldValue.H:498
Foam::functionObjects::fieldValues::surfaceFieldValue::postOperationTypeNames_
static const Enum< postOperationType > postOperationTypeNames_
Operation type names.
Definition: surfaceFieldValue.H:563
Foam::functionObjects::fieldValues::surfaceFieldValue::faceId
const labelList & faceId() const
Return the local list of face IDs.
Definition: surfaceFieldValueI.H:54
surfaceFieldValueTemplates.C
Enum.H