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 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 "volFields.H"
88 #include "surfaceFields.H"
89 #include "pointFields.H"
91 
92 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
93 
94 namespace Foam
95 {
96 namespace expressions
97 {
98 namespace volumeExpr
99 {
100 
101 /*---------------------------------------------------------------------------*\
102  Class parseDriver Declaration
103 \*---------------------------------------------------------------------------*/
104 
105 class parseDriver
106 :
107  public parsing::genericRagelLemonDriver,
108  public expressions::fvExprDriver
109 {
110 protected:
111 
112  // Protected Data
113 
114  //- The referenced mesh
115  const fvMesh& mesh_;
116 
117  //- The results (volume, surface, point)
118  autoPtr<regIOobject> resultField_;
119 
120  //- The result type-name.
121  // Normally volScalarField, surfaceVectorField etc,
122  // but Scalar is modified for logical as volScalarField etc
123  word resultType_;
124 
125  //- A logical (bool-like) field (but actually a scalar)
126  bool isLogical_;
127 
128  //- A volume/surface/point field
130 
131  //- The result dimensions
132  dimensionSet resultDimension_;
133 
134 
135  // Protected Member Functions
136 
137  //- Deep-copy the internalField as a result.
138  // Uses the isLogical() and isPointData() values to handle
139  // additional bookkeeping.
140  // For isLogical(), renames the resultType_ from '*Scalar*'
141  // to '*Logical*' (eg, volLogicalField)
142  template<class Type>
143  void setInternalFieldResult(const Field<Type>& fld);
144 
145  //- Cell selections (as logical)
146  tmp<volScalarField> field_cellSelection
147  (
148  const word& name,
149  enum topoSetSource::sourceType setType
150  ) const;
151 
152  //- Face selections (as logical)
153  tmp<surfaceScalarField> field_faceSelection
154  (
155  const word& name,
156  enum topoSetSource::sourceType setType
157  ) const;
158 
159  //- Point selections (as logical)
160  tmp<pointScalarField> field_pointSelection
161  (
162  const word& name,
163  enum topoSetSource::sourceType setType
164  ) const;
165 
166 
167  // No copy copy construct
168  parseDriver(const parseDriver&) = delete;
169 
170  // No copy assignment
171  void operator=(const parseDriver&) = delete;
172 
173 
174 public:
175 
176  ClassName("volumeExpr::driver");
177 
178  // Constructors
179 
180  //- Construct for specified mesh
181  explicit parseDriver
182  (
183  const fvMesh& mesh,
184  bool cacheReadFields = false
185  );
186 
187  //- Construct for specified mesh with given dictionary
188  parseDriver(const fvMesh& mesh, const dictionary& dict);
189 
190  //- Construct for specified mesh with copy of driver context
191  parseDriver(const fvMesh& mesh, const parseDriver& driver);
192 
193  //- Construct with meshName for the given mesh
194  parseDriver(const word& meshName, const fvMesh& mesh);
195 
196  //- Construct with patchName and region specified in dictionary
197  parseDriver(const dictionary& dict, const fvMesh& mesh);
198 
199  //- Clone
200  virtual autoPtr<expressions::fvExprDriver> clone() const
201  {
202  return autoPtr<expressions::fvExprDriver>
203  (
204  new parseDriver(this->mesh_, *this)
205  );
206  }
207 
208 
209  //- Destructor
210  virtual ~parseDriver() = default;
211 
212 
213  // Public Member Functions
214 
215  //- The mesh we are attached to
216  virtual const fvMesh& mesh() const
217  {
218  return mesh_;
219  }
220 
221  //- The underlying field size for the expression
222  virtual label size() const
223  {
224  return mesh_.nCells();
225  }
226 
227  //- The underlying point field size for the expression
228  virtual label pointSize() const
229  {
230  return mesh_.nPoints();
231  }
232 
233  //- Field size associated with different geometric field types
234  inline label size(const FieldAssociation geoType) const;
235 
236 
237  // Reading
238 
239  //- Read variables, tables etc.
240  // Adds support for "dimensions"
241  virtual bool readDict(const dictionary& dict);
242 
243 
244  // Evaluation
245 
246  //- Perform parsing on (sub) string
247  using genericRagelLemonDriver::content;
248 
249  //- Execute the parser.
250  // The return value currently has no meaning.
251  virtual unsigned parse
252  (
253  const std::string& expr,
254  size_t pos = 0,
255  size_t len = std::string::npos
256  );
257 
258 
259  // Field Information
260 
261  //- The result type-name.
262  // Normally volScalarField, surfaceVectorField etc,
263  // but Scalar is modified for logical as volScalarField etc
264  const word& resultType() const
265  {
266  return resultType_;
267  }
268 
269  //- The geometric field association
271  {
272  return fieldGeoType_;
273  }
274 
275  //- A logical (bool-like) field. Actually stored as a scalar.
276  bool isLogical() const
277  {
278  return isLogical_;
279  }
280 
281  //- A volume field
282  bool isVolumeData() const
283  {
285  }
286 
287  //- A surface field
288  bool isSurfaceData() const
289  {
291  }
292 
293  //- A point field
294  bool isPointData() const
295  {
297  }
298 
299  //- Test if stored result pointer is the specified type
300  template<class GeoField>
301  const GeoField* isResultType() const;
302 
303  //- Test if stored result pointer is the specified type
304  //- and matches the specified logical type
305  template<class GeoField>
306  const GeoField* isResultType(bool logical, bool dieOnNull=false) const;
307 
308 
309  // Set Fields
310 
311  //- Set result (vol field)
312  template<class Type>
313  void setResult
314  (
315  GeometricField<Type, fvPatchField, volMesh>* ptr,
316  bool logical = false
317  );
318 
319  //- Set result (surface field)
320  template<class Type>
321  void setResult
322  (
323  GeometricField<Type, fvsPatchField, surfaceMesh>* ptr,
324  bool logical = false
325  );
326 
327  //- Set result (point field)
328  template<class Type>
329  void setResult
330  (
332  bool logical = false
333  );
334 
335 
336  // New Fields
337 
338  //- Return a new volume field with the mesh size
339  template<class Type>
341  newVolField(const Type& val = pTraits<Type>::zero) const;
342 
343  //- Return a new surface field with the mesh nInternalFaces size
344  template<class Type>
346  newSurfaceField(const Type& val = pTraits<Type>::zero) const;
347 
348  //- Return a new point field with the mesh nPoints size
349  template<class Type>
351  newPointField(const Type& val = pTraits<Type>::zero) const;
352 
353 
354  //- Retrieve field (vol field)
355  template<class Type>
357  getVolField(const word& fldName, bool getOldTime=false);
358 
359  //- Retrieve field (surface field)
360  template<class Type>
362  getSurfaceField(const word& fldName, bool getOldTime=false);
363 
364  //- Retrieve field (surface field)
365  template<class Type>
367  getPointField(const word& fldName, bool getOldTime=false);
368 
369 
370  // Field "shape" conversions
371 
372  //- Interpolate cell to face values
373  template<class Type>
375  cellToFace
376  (
378  ) const;
379 
380  //- Interpolate cell to point values
381  template<class Type>
384  (
386  ) const;
387 
388  //- Interpolate point to cell values
389  template<class Type>
392  (
394  ) const;
395 
396 
397  // Custom Field Functions
398 
399  //- The volume-weighted average of a field
400  template<class Type>
401  Type volAverage
402  (
404  ) const
405  {
406  return weightedAverage(fld.mesh().V(), fld.primitiveField());
407  }
408 
409  //- The volume-weighted sum of a field
410  template<class Type>
411  Type volSum
412  (
414  ) const
415  {
416  return weightedSum(fld.mesh().V(), fld.primitiveField());
417  }
418 
419  //- The area-weighted average of a field
420  template<class Type>
421  Type areaAverage
422  (
424  ) const
425  {
426  return weightedAverage
427  (
428  fld.mesh().magSf().primitiveField(),
429  fld.primitiveField()
430  );
431  }
432 
433  //- The area-weighted sum of a field
434  template<class Type>
435  Type areaSum
436  (
438  ) const
439  {
440  return weightedSum
441  (
442  fld.mesh().magSf().primitiveField(),
443  fld.primitiveField()
444  );
445  }
446 
447 
448  //- The cell volumes - (swak = vol)
450 
451  //- The cell centres - (swak = pos)
453 
454  //- The face area magnitudes [magSf] - (swak = area)
456 
457  //- The face centres - (swak = fpos)
459 
460  //- The face areas with their vector direction [Sf] - (swak = face)
462 
463  //- The mesh point locations - (swak = pts)
465 
466 
467  //- Cell selection (set)
468  inline tmp<volScalarField> field_cellSet(const word& name) const;
469 
470  //- Cell selection (zone)
471  inline tmp<volScalarField> field_cellZone(const word& name) const;
472 
473  //- Face selection (set)
474  inline tmp<surfaceScalarField> field_faceSet(const word& name) const;
475 
476  //- Face selection (zone)
477  inline tmp<surfaceScalarField> field_faceZone(const word& name) const;
478 
479  //- Point selection (set)
480  inline tmp<pointScalarField> field_pointSet(const word& name) const;
481 
482  //- Point selection (zone)
483  inline tmp<pointScalarField> field_pointZone(const word& name) const;
484 
485  //- A uniform random field
486  tmp<volScalarField> field_rand(label seed=0, bool gaussian=false) const;
487 
488  //- A Gaussian random field
489  tmp<volScalarField> field_randGaussian(label seed=0) const
490  {
491  return field_rand(seed, true);
492  }
493 };
494 
495 
496 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
497 
498 } // End namespace volumeExpr
499 } // End namespace expressions
500 } // End namespace Foam
501 
502 
503 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
504 
505 #include "volumeExprDriverI.H"
506 
507 #ifdef NoRepository
508  #include "volumeExprDriverTemplates.C"
509 #endif
510 
511 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
512 
513 #endif
514 
515 // ************************************************************************* //
Foam::expressions::volumeExpr::parseDriver::fieldAssociation
FieldAssociation fieldAssociation() const
The geometric field association.
Definition: volumeExprDriver.H:394
Foam::expressions::volumeExpr::parseDriver::isSurfaceData
bool isSurfaceData() const
A surface field.
Definition: volumeExprDriver.H:412
volFields.H
Foam::expressions::volumeExpr::parseDriver::field_pointZone
tmp< pointScalarField > field_pointZone(const word &name) const
Point selection (zone)
Definition: volumeExprDriverI.H:125
Foam::topoSetSource::sourceType
sourceType
Enumeration defining the types of sources.
Definition: topoSetSource.H:73
Foam::expressions::volumeExpr::parseDriver::pointSize
virtual label pointSize() const
The underlying point field size for the expression.
Definition: volumeExprDriver.H:352
Foam::expressions::volumeExpr::parseDriver::size
virtual label size() const
The underlying field size for the expression.
Definition: volumeExprDriver.H:346
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
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::patchExpr::POINT_DATA
Point data.
Definition: patchExprFwd.H:60
Foam::expressions::volumeExpr::parseDriver
Driver for volume, surface, point field expressions.
Definition: volumeExprDriver.H:229
Foam::expressions::volumeExpr::parseDriver::mesh
virtual const fvMesh & mesh() const
The mesh we are attached to.
Definition: volumeExprDriver.H:340
Foam::expressions::volumeExpr::parseDriver::operator=
void operator=(const parseDriver &)=delete
Foam::expressions::patchExpr::SURFACE_DATA
Surface data.
Definition: patchExprFwd.H:61
Foam::expressions::volumeExpr::parseDriver::parseDriver
parseDriver(const parseDriver &)=delete
Foam::expressions::fvExprDriver
Base driver for parsing value expressions associated with an fvMesh.
Definition: fvExprDriver.H:137
surfaceFields.H
Foam::surfaceFields.
fvExprDriver.H
Foam::dimensionSet
Dimension set for the base types.
Definition: dimensionSet.H:65
Foam::expressions::volumeExpr::parseDriver::field_rand
tmp< volScalarField > field_rand(label seed=0, bool gaussian=false) const
A uniform random field.
Definition: volumeExprDriverFields.C:264
Foam::expressions::volumeExpr::parseDriver::mesh_
const fvMesh & mesh_
The referenced mesh.
Definition: volumeExprDriver.H:239
Foam::expressions::volumeExpr::parseDriver::field_randGaussian
tmp< volScalarField > field_randGaussian(label seed=0) const
A Gaussian random field.
Definition: volumeExprDriver.H:613
Foam::expressions::volumeExpr::parseDriver::clone
virtual autoPtr< expressions::fvExprDriver > clone() const
Clone.
Definition: volumeExprDriver.H:324
genericRagelLemonDriver.H
Foam::expressions::volumeExpr::parseDriver::field_cellVolume
tmp< volScalarField > field_cellVolume() const
The cell volumes - (swak = vol)
Definition: volumeExprDriverFields.C:191
Foam::expressions::volumeExpr::parseDriver::~parseDriver
virtual ~parseDriver()=default
Destructor.
Foam::expressions::volumeExpr::parseDriver::isPointData
bool isPointData() const
A point field.
Definition: volumeExprDriver.H:418
Foam::expressions::volumeExpr::VOLUME_DATA
Volume data.
Definition: volumeExprFwd.H:60
Foam::expressions::volumeExpr::parseDriver::resultType_
word resultType_
The result type-name.
Definition: volumeExprDriver.H:247
Foam::expressions::exprDriver::cacheReadFields
bool cacheReadFields() const
Definition: exprDriver.H:371
Foam::primitiveMesh::nCells
label nCells() const
Number of mesh cells.
Definition: primitiveMeshI.H:96
Foam::expressions::volumeExpr::parseDriver::areaSum
Type areaSum(GeometricField< Type, fvsPatchField, surfaceMesh > &fld) const
The area-weighted sum of a field.
Definition: volumeExprDriver.H:560
Foam::expressions::volumeExpr::parseDriver::volAverage
Type volAverage(GeometricField< Type, fvPatchField, volMesh > &fld) const
The volume-weighted average of a field.
Definition: volumeExprDriver.H:526
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:536
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::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
Foam::expressions::volumeExpr::parseDriver::readDict
virtual bool readDict(const dictionary &dict)
Read variables, tables etc.
Definition: volumeExprDriver.C:165
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:242
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:224
Foam::expressions::volumeExpr::FieldAssociation
FieldAssociation
The field association for volume expressions (mutually exclusive)
Definition: volumeExprFwd.H:55
Foam::expressions::volumeExpr::parseDriver::fieldGeoType_
enum FieldAssociation fieldGeoType_
A volume/surface/point field.
Definition: volumeExprDriver.H:253
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::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:83
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::isLogical
bool isLogical() const
A logical (bool-like) field. Actually stored as a scalar.
Definition: volumeExprDriver.H:400
Foam::expressions::volumeExpr::parseDriver::field_pointField
tmp< pointVectorField > field_pointField() const
The mesh point locations - (swak = pts)
Definition: volumeExprDriverFields.C:250
Foam::expressions::volumeExpr::parseDriver::resultType
const word & resultType() const
The result type-name.
Definition: volumeExprDriver.H:388
Foam::expressions::volumeExpr::parseDriver::isLogical_
bool isLogical_
A logical (bool-like) field (but actually a scalar)
Definition: volumeExprDriver.H:250
Foam::expressions::volumeExpr::parseDriver::areaAverage
Type areaAverage(GeometricField< Type, fvsPatchField, surfaceMesh > &fld) const
The area-weighted average of a field.
Definition: volumeExprDriver.H:546
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:211
Foam::expressions::volumeExpr::parseDriver::field_pointSet
tmp< pointScalarField > field_pointSet(const word &name) const
Point selection (set)
Definition: volumeExprDriverI.H:111
Foam::expressions::exprDriver::dict
const dictionary & dict() const
The dictionary with all input data/specification.
Definition: exprDriver.H:299
Foam::expressions::volumeExpr::parseDriver::field_faceZone
tmp< surfaceScalarField > field_faceZone(const word &name) const
Face selection (zone)
Definition: volumeExprDriverI.H:97
Foam::expressions::volumeExpr::parseDriver::field_cellSet
tmp< volScalarField > field_cellSet(const word &name) const
Cell selection (set)
Foam::expressions::volumeExpr::parseDriver::resultDimension_
dimensionSet resultDimension_
The result dimensions.
Definition: volumeExprDriver.H:256
Foam::expressions::volumeExpr::parseDriver::field_areaNormal
tmp< surfaceVectorField > field_areaNormal() const
The face areas with their vector direction [Sf] - (swak = face)
Definition: volumeExprDriverFields.C:237
Foam::pTraits
Traits class for primitives.
Definition: pTraits.H:54
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:83
Foam::expressions::volumeExpr::parseDriver::pointToCell
tmp< GeometricField< Type, fvPatchField, volMesh > > pointToCell(const GeometricField< Type, pointPatchField, pointMesh > &field) const
Interpolate point to cell values.
Foam::primitiveMesh::nPoints
label nPoints() const
Number of mesh points.
Definition: primitiveMeshI.H:37
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::expressions::volumeExpr::parseDriver::field_cellCentre
tmp< volVectorField > field_cellCentre() const
The cell centres - (swak = pos)
Definition: volumeExprDriverFields.C:204
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:151
volumeExprDriverTemplates.C
volumeExprDriverI.H
Foam::expressions::volumeExpr::parseDriver::field_cellZone
tmp< volScalarField > field_cellZone(const word &name) const
Cell selection (zone)
Definition: volumeExprDriverI.H:69
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::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::isVolumeData
bool isVolumeData() const
A volume field.
Definition: volumeExprDriver.H:406
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:179
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:76
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")
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::pos
dimensionedScalar pos(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:177