volumeExprDriver.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) 2019-2021 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::expressions::volumeExpr::parseDriver
28 
29 Description
30  Driver for volume, surface, point field expressions
31 
32  Additional Properties
33  \table
34  Property | Description | Required | Default
35  dimensions | Dimensions for the expression result | no |
36  \endtable
37 
38  In addition to the standard mathematical functions, operations and
39  logical and relational operations, the volume expressions support the
40  following driver-specific functions:
41 
42  Functions
43  \table
44  Function | Description | Number of arguments |
45  vol | The cell volumes | 0 |
46  pos | The cell centres | 0 |
47  pts | The cell points | 0 |
48  area | The face area magnitudes | 0 |
49  fpos | The face centres | 0 |
50  weightAverage| Volume or area weighted average | 1 |
51  weightSum | Volume or area weighted sum | 1 |
52  face | The face areaNormal vectors | 0 |
53  face | A surface-field face value | 1 |
54  point | A point-field point value | 1 |
55  cellToFace | Interpolate cell values onto faces | 1 |
56  cellToPoint | Interpolate cell values onto points | 1 |
57  pointToCell | Interpolate point values onto cells | 1 |
58  reconstruct | Reconstruct cell vector from surface scalar | 1 |
59  rand | Random field | 0/1 |
60  \endtable
61 
62  Selections
63  \table
64  Function| Description | Number of arguments |
65  cset | Logical vol field corresponding to cellSet | 1 |
66  fset | Logical surf field corresponding to faceSet | 1 |
67  pset | Logical point field corresponding to pointSet | 1 |
68  czone | Logical vol field corresponding to cellZone | 1 |
69  fzone | Logical surf field corresponding to faceZone | 1 |
70  pzone | Logical point field corresponding to pointZone| 1 |
71  \endtable
72 
73 Note
74  Use namespace debug switch \c volumeExpr for scanner (2), parser (4)
75  or dictionary controls as per Foam::expressions::exprDriver.
76 
77 SourceFiles
78  volumeExprDriver.C
79 
80 \*---------------------------------------------------------------------------*/
81 
82 #ifndef expressions_volumeExprDriver_H
83 #define expressions_volumeExprDriver_H
84 
85 #include "volumeExprFwd.H"
86 #include "fvExprDriver.H"
87 #include "exprFieldAssociation.H"
88 #include "volFields.H"
89 #include "surfaceFields.H"
90 #include "pointFields.H"
92 
93 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
94 
95 namespace Foam
96 {
97 namespace expressions
98 {
99 namespace volumeExpr
100 {
101 
102 /*---------------------------------------------------------------------------*\
103  Class parseDriver Declaration
104 \*---------------------------------------------------------------------------*/
105 
106 class parseDriver
107 :
108  public parsing::genericRagelLemonDriver,
109  public expressions::fvExprDriver
110 {
111 protected:
112 
113  // Protected Data
114 
115  //- The referenced mesh
116  const fvMesh& mesh_;
117 
118  //- The results (volume, surface, point)
119  autoPtr<regIOobject> resultField_;
120 
121  //- The result type-name.
122  // Normally volScalarField, surfaceVectorField etc,
123  // but Scalar is modified for logical as volScalarField etc
124  word resultType_;
125 
126  //- A logical (bool-like) field (but actually a scalar)
127  bool isLogical_;
128 
129  //- Requested use of dimensions
130  bool hasDimensions_;
131 
132  //- A volume/surface/point field
134 
135  //- The result dimensions
136  dimensionSet resultDimensions_;
137 
138 
139  // Protected Member Functions
140 
141  //- Deep-copy the internalField as a result.
142  // Uses the isLogical() and isPointData() values to handle
143  // additional bookkeeping.
144  // For isLogical(), renames the resultType_ from '*Scalar*'
145  // to '*Logical*' (eg, volLogicalField)
146  template<class Type>
147  void setInternalFieldResult(const Field<Type>& fld);
148 
149  //- Cell selections (as logical)
150  tmp<volScalarField> field_cellSelection
151  (
152  const word& name,
153  enum topoSetSource::sourceType setType
154  ) const;
155 
156  //- Face selections (as logical)
157  tmp<surfaceScalarField> field_faceSelection
158  (
159  const word& name,
160  enum topoSetSource::sourceType setType
161  ) const;
162 
163  //- Point selections (as logical)
164  tmp<pointScalarField> field_pointSelection
165  (
166  const word& name,
167  enum topoSetSource::sourceType setType
168  ) const;
169 
170 
171 public:
172 
173  ClassName("volumeExpr::driver");
174 
175  // Generated Methods
176 
177  // No copy copy construct
178  parseDriver(const parseDriver&) = delete;
179 
180  // No copy assignment
181  void operator=(const parseDriver&) = delete;
182 
183 
184  // Constructors
185 
186  //- Construct for specified mesh, with dictionary information
187  explicit parseDriver
188  (
189  const fvMesh& mesh,
190  const dictionary& dict = dictionary::null
191  );
192 
193  //- Construct for specified mesh with copy of driver context
195  (
196  const fvMesh& mesh,
197  const parseDriver& driver,
198  const dictionary& dict
199  );
200 
201  //- Construct with meshName for the given mesh
202  parseDriver(const word& meshName, const fvMesh& mesh);
203 
204  //- Construct with patchName and region specified in dictionary
205  parseDriver(const dictionary& dict, const fvMesh& mesh);
206 
207 
208  // Not generally clonable
209 
210 
211  //- Destructor
212  virtual ~parseDriver() = default;
213 
214 
215  // Public Member Functions
216 
217  //- The mesh we are attached to
218  virtual const fvMesh& mesh() const
219  {
220  return mesh_;
221  }
222 
223  //- The natural field size for the expression
224  virtual label size() const
225  {
226  return mesh_.nCells();
227  }
228 
229  //- The point field size for the expression
230  virtual label pointSize() const
231  {
232  return mesh_.nPoints();
233  }
234 
235  //- Field size associated with different geometric field types
236  inline label size(const FieldAssociation geoType) const;
237 
238  //- Apply dimensions() to geometric fields
239  inline bool hasDimensions() const noexcept;
240 
241  //- The preferred result dimensions (if any)
242  inline const dimensionSet& dimensions() const noexcept;
243 
244 
245  //- Clear out local copies of the field
246  void clearField();
247 
248 
249  // Reading
250 
251  //- Read variables, tables etc.
252  // Adds support for "dimensions"
253  virtual bool readDict(const dictionary& dict);
254 
255 
256  // Evaluation
257 
258  //- Perform parsing on (sub) string
260 
261  //- Execute the parser.
262  // The return value currently has no meaning.
263  virtual unsigned parse
264  (
265  const std::string& expr,
266  size_t pos = 0,
267  size_t len = std::string::npos
268  );
269 
270 
271  // Field Information
272 
273  //- The result type-name.
274  // Normally volScalarField, surfaceVectorField etc,
275  // but Scalar is modified for logical as volScalarField etc
276  const word& resultType() const noexcept
277  {
278  return resultType_;
279  }
280 
281  //- The geometric field association
282  FieldAssociation fieldAssociation() const noexcept
283  {
284  return fieldGeoType_;
285  }
286 
287  //- A logical (bool-like) field. Actually stored as a scalar.
288  bool isLogical() const noexcept
289  {
290  return isLogical_;
291  }
292 
293  //- A volume field
294  bool isVolumeData() const noexcept
295  {
297  }
298 
299  //- A surface field
300  bool isFaceData() const noexcept
301  {
303  }
304 
305  //- A point field
306  bool isPointData() const noexcept
307  {
309  }
310 
311  //- Test if stored result pointer is the specified type
312  template<class GeoField>
313  const GeoField* isResultType() const;
314 
315  //- Test if stored result pointer is the specified type
316  //- and matches the specified logical type
317  template<class GeoField>
318  const GeoField* isResultType(bool logical, bool dieOnNull=false) const;
319 
320  //- A zero-initialized field with the same type as the result field.
321  autoPtr<regIOobject> dupZeroField() const;
322 
323 
324  // Set Fields
325 
326  //- Set result (vol field)
327  template<class Type>
328  void setResult
329  (
330  GeometricField<Type, fvPatchField, volMesh>* ptr,
331  bool logical = false
332  );
333 
334  //- Set result (surface field)
335  template<class Type>
336  void setResult
337  (
338  GeometricField<Type, fvsPatchField, surfaceMesh>* ptr,
339  bool logical = false
340  );
341 
342  //- Set result (point field)
343  template<class Type>
344  void setResult
345  (
347  bool logical = false
348  );
349 
350 
351  // New Fields
352 
353  //- Return a new volume field with the mesh size
354  template<class Type>
356  newVolField(const Type& val = pTraits<Type>::zero) const;
357 
358  //- Return a new surface field with the mesh nInternalFaces size
359  template<class Type>
361  newSurfaceField(const Type& val = pTraits<Type>::zero) const;
362 
363  //- Return a new point field with the mesh nPoints size
364  template<class Type>
366  newPointField(const Type& val = pTraits<Type>::zero) const;
367 
368 
369  //- Retrieve field (vol field)
370  template<class Type>
372  getVolField(const word& fldName, bool getOldTime=false);
373 
374  //- Retrieve field (surface field)
375  template<class Type>
377  getSurfaceField(const word& fldName, bool getOldTime=false);
378 
379  //- Retrieve field (surface field)
380  template<class Type>
382  getPointField(const word& fldName, bool getOldTime=false);
383 
384 
385  // Field "shape" conversions
386 
387  //- Interpolate cell to face values
388  template<class Type>
390  cellToFace
391  (
393  ) const;
394 
395  //- Interpolate cell to point values
396  template<class Type>
399  (
401  ) const;
402 
403  //- Interpolate point to cell values
404  template<class Type>
407  (
409  ) const;
410 
411 
412  // Custom Field Functions
413 
414  //- The volume-weighted average of a field
415  template<class Type>
416  Type volAverage
417  (
419  ) const
420  {
421  return weightedAverage(fld.mesh().V(), fld.primitiveField());
422  }
423 
424  //- The volume-weighted sum of a field
425  template<class Type>
426  Type volSum
427  (
429  ) const
430  {
431  return weightedSum(fld.mesh().V(), fld.primitiveField());
432  }
433 
434  //- The area-weighted average of a field
435  template<class Type>
436  Type areaAverage
437  (
439  ) const
440  {
441  return weightedAverage
442  (
443  fld.mesh().magSf().primitiveField(),
444  fld.primitiveField()
445  );
446  }
447 
448  //- The area-weighted sum of a field
449  template<class Type>
450  Type areaSum
451  (
453  ) const
454  {
455  return weightedSum
456  (
457  fld.mesh().magSf().primitiveField(),
458  fld.primitiveField()
459  );
460  }
461 
462 
463  //- The cell volumes - (swak = vol)
465 
466  //- The cell centres - (swak = pos)
468 
469  //- The face area magnitudes [magSf] - (swak = area)
471 
472  //- The face centres - (swak = fpos)
474 
475  //- The face areas with their vector direction [Sf] - (swak = face)
477 
478  //- The mesh point locations - (swak = pts)
480 
481 
482  //- Cell selection (set)
483  inline tmp<volScalarField> field_cellSet(const word& name) const;
484 
485  //- Cell selection (zone)
486  inline tmp<volScalarField> field_cellZone(const word& name) const;
487 
488  //- Face selection (set)
489  inline tmp<surfaceScalarField> field_faceSet(const word& name) const;
490 
491  //- Face selection (zone)
492  inline tmp<surfaceScalarField> field_faceZone(const word& name) const;
493 
494  //- Point selection (set)
495  inline tmp<pointScalarField> field_pointSet(const word& name) const;
496 
497  //- Point selection (zone)
498  inline tmp<pointScalarField> field_pointZone(const word& name) const;
499 
500  //- A uniform random field
501  tmp<volScalarField> field_rand(label seed=0, bool gaussian=false) const;
502 
503  //- A Gaussian random field
504  tmp<volScalarField> field_randGaussian(label seed=0) const
505  {
506  return field_rand(seed, true);
507  }
508 };
509 
510 
511 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
512 
513 } // End namespace volumeExpr
514 } // End namespace expressions
515 } // End namespace Foam
516 
517 
518 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
519 
520 #include "volumeExprDriverI.H"
521 
522 #ifdef NoRepository
523  #include "volumeExprDriverTemplates.C"
524 #endif
525 
526 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
527 
528 #endif
529 
530 // ************************************************************************* //
Foam::expressions::volumeExpr::parseDriver::resultDimensions_
dimensionSet resultDimensions_
The result dimensions.
Definition: volumeExprDriver.H:260
volFields.H
Foam::expressions::volumeExpr::parseDriver::field_pointZone
tmp< pointScalarField > field_pointZone(const word &name) const
Point selection (zone)
Definition: volumeExprDriverI.H:139
Foam::topoSetSource::sourceType
sourceType
Enumeration defining the types of sources.
Definition: topoSetSource.H:74
Foam::expressions::volumeExpr::parseDriver::resultType
const word & resultType() const noexcept
The result type-name.
Definition: volumeExprDriver.H:400
Foam::expressions::volumeExpr::parseDriver::pointSize
virtual label pointSize() const
The point field size for the expression.
Definition: volumeExprDriver.H:354
Foam::parsing::genericRagelLemonDriver::genericRagelLemonDriver
genericRagelLemonDriver()
Construct null.
Definition: genericRagelLemonDriver.C:34
Foam::expressions::volumeExpr::parseDriver::dupZeroField
autoPtr< regIOobject > dupZeroField() const
A zero-initialized field with the same type as the result field.
Definition: volumeExprDriver.C:209
Foam::expressions::volumeExpr::parseDriver::dimensions
const dimensionSet & dimensions() const noexcept
The preferred result dimensions (if any)
Definition: volumeExprDriverI.H:61
Foam::expressions::volumeExpr::parseDriver::size
virtual label size() const
The natural field size for the expression.
Definition: volumeExprDriver.H:348
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::expressions::volumeExpr::parseDriver::cellToPoint
tmp< GeometricField< Type, pointPatchField, pointMesh > > cellToPoint(const GeometricField< Type, fvPatchField, volMesh > &field) const
Interpolate cell to point values.
Foam::expressions::volumeExpr::parseDriver::isResultType
const GeoField * isResultType() const
Test if stored result pointer is the specified type.
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
volumeExprFwd.H
Foam::expressions::volumeExpr::parseDriver
Driver for volume, surface, point field expressions.
Definition: volumeExprDriver.H:230
Foam::expressions::volumeExpr::parseDriver::mesh
virtual const fvMesh & mesh() const
The mesh we are attached to.
Definition: volumeExprDriver.H:342
Foam::expressions::volumeExpr::parseDriver::operator=
void operator=(const parseDriver &)=delete
Foam::expressions::volumeExpr::parseDriver::clearField
void clearField()
Clear out local copies of the field.
Definition: volumeExprDriver.C:197
Foam::expressions::volumeExpr::parseDriver::parseDriver
parseDriver(const parseDriver &)=delete
Foam::parsing::genericRagelLemonDriver::content
const std::string & content() const
Get reference to the input buffer content.
Definition: genericRagelLemonDriver.H:109
Foam::expressions::fvExprDriver
Base driver for parsing value expressions associated with an fvMesh.
Definition: fvExprDriver.H:136
surfaceFields.H
Foam::surfaceFields.
fvExprDriver.H
Foam::dimensionSet
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
Definition: dimensionSet.H:108
Foam::expressions::volumeExpr::parseDriver::field_rand
tmp< volScalarField > field_rand(label seed=0, bool gaussian=false) const
A uniform random field.
Definition: volumeExprDriverFields.C:267
Foam::expressions::volumeExpr::parseDriver::mesh_
const fvMesh & mesh_
The referenced mesh.
Definition: volumeExprDriver.H:240
Foam::expressions::volumeExpr::parseDriver::field_randGaussian
tmp< volScalarField > field_randGaussian(label seed=0) const
A Gaussian random field.
Definition: volumeExprDriver.H:628
Foam::expressions::VOLUME_DATA
Volume data.
Definition: exprFieldAssociation.H:48
exprFieldAssociation.H
Foam::primitiveMesh::nPoints
label nPoints() const noexcept
Number of mesh points.
Definition: primitiveMeshI.H:37
genericRagelLemonDriver.H
Foam::expressions::volumeExpr::parseDriver::field_cellVolume
tmp< volScalarField > field_cellVolume() const
The cell volumes - (swak = vol)
Definition: volumeExprDriverFields.C:194
Foam::expressions::FieldAssociation
FieldAssociation
Definition: exprFieldAssociation.H:43
Foam::dictionary::null
static const dictionary null
An empty dictionary, which is also the parent for all dictionaries.
Definition: dictionary.H:392
Foam::expressions::volumeExpr::parseDriver::~parseDriver
virtual ~parseDriver()=default
Destructor.
Foam::expressions::volumeExpr::parseDriver::resultType_
word resultType_
The result type-name.
Definition: volumeExprDriver.H:248
Foam::primitiveMesh::nCells
label nCells() const noexcept
Number of mesh cells.
Definition: primitiveMeshI.H:96
Foam::expressions::FACE_DATA
Face data.
Definition: exprFieldAssociation.H:47
Foam::expressions::volumeExpr::parseDriver::areaSum
Type areaSum(GeometricField< Type, fvsPatchField, surfaceMesh > &fld) const
The area-weighted sum of a field.
Definition: volumeExprDriver.H:575
Foam::expressions::volumeExpr::parseDriver::volAverage
Type volAverage(GeometricField< Type, fvPatchField, volMesh > &fld) const
The volume-weighted average of a field.
Definition: volumeExprDriver.H:541
Foam::Field
Generic templated field type.
Definition: Field.H:63
Foam::expressions::volumeExpr::parseDriver::volSum
Type volSum(GeometricField< Type, fvPatchField, volMesh > &fld) const
The volume-weighted sum of a field.
Definition: volumeExprDriver.H:551
Foam::expressions::volumeExpr::parseDriver::getPointField
tmp< GeometricField< Type, pointPatchField, pointMesh > > getPointField(const word &fldName, bool getOldTime=false)
Retrieve field (surface field)
Foam::expressions::exprDriver::weightedAverage
static Type weightedAverage(const scalarField &weights, const Field< Type > &fld)
The (global) weighted average of a field, with stabilisation.
Foam::expressions::volumeExpr::parseDriver::readDict
virtual bool readDict(const dictionary &dict)
Read variables, tables etc.
Definition: volumeExprDriver.C:161
Foam::parsing::genericRagelLemonDriver
Generic interface code for Ragel/Lemon combination Subclasses should implement one or more process() ...
Definition: genericRagelLemonDriver.H:59
Foam::expressions::volumeExpr::parseDriver::resultField_
autoPtr< regIOobject > resultField_
The results (volume, surface, point)
Definition: volumeExprDriver.H:243
Foam::expressions::volumeExpr::parseDriver::getSurfaceField
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > getSurfaceField(const word &fldName, bool getOldTime=false)
Retrieve field (surface field)
Foam::expressions::volumeExpr::parseDriver::field_faceCentre
tmp< surfaceVectorField > field_faceCentre() const
The face centres - (swak = fpos)
Definition: volumeExprDriverFields.C:227
field
rDeltaTY field()
fld
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))
Definition: gmvOutputLagrangian.H:23
Foam::expressions::volumeExpr::parseDriver::hasDimensions_
bool hasDimensions_
Requested use of dimensions.
Definition: volumeExprDriver.H:254
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::expressions::volumeExpr::parseDriver::fieldGeoType_
expressions::FieldAssociation fieldGeoType_
A volume/surface/point field.
Definition: volumeExprDriver.H:257
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam::expressions::volumeExpr::parseDriver::setInternalFieldResult
void setInternalFieldResult(const Field< Type > &fld)
Deep-copy the internalField as a result.
Definition: volumeExprDriverTemplates.C:38
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::expressions::volumeExpr::parseDriver::field_pointField
tmp< pointVectorField > field_pointField() const
The mesh point locations - (swak = pts)
Definition: volumeExprDriverFields.C:253
Foam::expressions::volumeExpr::parseDriver::isLogical_
bool isLogical_
A logical (bool-like) field (but actually a scalar)
Definition: volumeExprDriver.H:251
Foam::expressions::volumeExpr::parseDriver::areaAverage
Type areaAverage(GeometricField< Type, fvsPatchField, surfaceMesh > &fld) const
The area-weighted average of a field.
Definition: volumeExprDriver.H:561
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::expressions::volumeExpr::parseDriver::field_faceArea
tmp< surfaceScalarField > field_faceArea() const
The face area magnitudes [magSf] - (swak = area)
Definition: volumeExprDriverFields.C:214
Foam::expressions::volumeExpr::parseDriver::field_pointSet
tmp< pointScalarField > field_pointSet(const word &name) const
Point selection (set)
Definition: volumeExprDriverI.H:125
Foam::expressions::volumeExpr::parseDriver::field_faceZone
tmp< surfaceScalarField > field_faceZone(const word &name) const
Face selection (zone)
Definition: volumeExprDriverI.H:111
Foam::expressions::volumeExpr::parseDriver::field_cellSet
tmp< volScalarField > field_cellSet(const word &name) const
Cell selection (set)
Foam::expressions::exprDriver::dict
const dictionary & dict() const noexcept
The dictionary with all input data/specification.
Definition: exprDriver.H:384
Foam::expressions::volumeExpr::parseDriver::field_areaNormal
tmp< surfaceVectorField > field_areaNormal() const
The face areas with their vector direction [Sf] - (swak = face)
Definition: volumeExprDriverFields.C:240
Foam::pTraits
A traits class, which is primarily used for primitives.
Definition: pTraits.H:56
Foam::expressions::volumeExpr::parseDriver::getVolField
tmp< GeometricField< Type, fvPatchField, volMesh > > getVolField(const word &fldName, bool getOldTime=false)
Retrieve field (vol field)
Foam::expressions::volumeExpr::parseDriver::field_faceSet
tmp< surfaceScalarField > field_faceSet(const word &name) const
Face selection (set)
Definition: volumeExprDriverI.H:97
Foam::expressions::volumeExpr::parseDriver::pointToCell
tmp< GeometricField< Type, fvPatchField, volMesh > > pointToCell(const GeometricField< Type, pointPatchField, pointMesh > &field) const
Interpolate point to cell values.
Foam::expressions::volumeExpr::parseDriver::hasDimensions
bool hasDimensions() const noexcept
Apply dimensions() to geometric fields.
Definition: volumeExprDriverI.H:53
Foam::expressions::POINT_DATA
Point data.
Definition: exprFieldAssociation.H:46
Foam::expressions::volumeExpr::parseDriver::field_cellSelection
tmp< volScalarField > field_cellSelection(const word &name, enum topoSetSource::sourceType setType) const
Cell selections (as logical)
Definition: volumeExprDriverFields.C:36
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
Foam::expressions::volumeExpr::parseDriver::field_cellCentre
tmp< volVectorField > field_cellCentre() const
The cell centres - (swak = pos)
Definition: volumeExprDriverFields.C:207
Foam::expressions::volumeExpr::parseDriver::newVolField
tmp< GeometricField< Type, fvPatchField, volMesh > > newVolField(const Type &val=pTraits< Type >::zero) const
Return a new volume field with the mesh size.
Foam::expressions::volumeExpr::parseDriver::setResult
void setResult(GeometricField< Type, fvPatchField, volMesh > *ptr, bool logical=false)
Set result (vol field)
Definition: volumeExprDriverTemplates.C:64
Foam::expressions::volumeExpr::parseDriver::field_pointSelection
tmp< pointScalarField > field_pointSelection(const word &name, enum topoSetSource::sourceType setType) const
Point selections (as logical)
Definition: volumeExprDriverFields.C:153
volumeExprDriverTemplates.C
volumeExprDriverI.H
Foam::expressions::volumeExpr::parseDriver::field_cellZone
tmp< volScalarField > field_cellZone(const word &name) const
Cell selection (zone)
Definition: volumeExprDriverI.H:83
Foam::expressions::volumeExpr::parseDriver::newSurfaceField
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > newSurfaceField(const Type &val=pTraits< Type >::zero) const
Return a new surface field with the mesh nInternalFaces size.
Foam::expressions::volumeExpr::parseDriver::isLogical
bool isLogical() const noexcept
A logical (bool-like) field. Actually stored as a scalar.
Definition: volumeExprDriver.H:412
Foam::expressions::volumeExpr::parseDriver::isPointData
bool isPointData() const noexcept
A point field.
Definition: volumeExprDriver.H:430
Foam::GeometricField< Type, fvPatchField, volMesh >
Foam::expressions::exprDriver::weightedSum
static Type weightedSum(const scalarField &weights, const Field< Type > &fld)
The (global) weighted sum (integral) of a field.
Foam::expressions::volumeExpr::parseDriver::parse
virtual unsigned parse(const std::string &expr, size_t pos=0, size_t len=std::string::npos)
Execute the parser.
Definition: volumeExprDriver.C:183
Foam::expressions::volumeExpr::parseDriver::field_faceSelection
tmp< surfaceScalarField > field_faceSelection(const word &name, enum topoSetSource::sourceType setType) const
Face selections (as logical)
Definition: volumeExprDriverFields.C:77
Foam::expressions::volumeExpr::parseDriver::cellToFace
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > cellToFace(const GeometricField< Type, fvPatchField, volMesh > &field) const
Interpolate cell to face values.
Foam::expressions::volumeExpr::parseDriver::ClassName
ClassName("volumeExpr::driver")
Foam::expressions::volumeExpr::parseDriver::isVolumeData
bool isVolumeData() const noexcept
A volume field.
Definition: volumeExprDriver.H:418
pointFields.H
Foam::expressions::volumeExpr::parseDriver::newPointField
tmp< GeometricField< Type, pointPatchField, pointMesh > > newPointField(const Type &val=pTraits< Type >::zero) const
Return a new point field with the mesh nPoints size.
Foam::expressions::volumeExpr::parseDriver::fieldAssociation
FieldAssociation fieldAssociation() const noexcept
The geometric field association.
Definition: volumeExprDriver.H:406
Foam::expressions::volumeExpr::parseDriver::isFaceData
bool isFaceData() const noexcept
A surface field.
Definition: volumeExprDriver.H:424
Foam::pos
dimensionedScalar pos(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:177