exprDriver.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) 2010-2018 Bernhard Gschaider
9 Copyright (C) 2019-2022 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::expressions::exprDriver
29
30Description
31 Base driver for parsing (field) values.
32
33 Largely based on code and ideas from swak4foam
34
35 Properties
36 \table
37 Property | Description | Required | Default
38 variables | List of variables for expressions | no | ()
39 functions<scalar> | Dictionary of scalar Function1 | no | {}
40 functions<vector> | Dictionary of vector Function1 | no | {}
41 allowShadowing | Allow variables to shadow field names | no | false
42 \endtable
43
44 Debug Properties
45 \table
46 Property | Description | Required | Default
47 debug.driver | Debug level (int) for base driver | no |
48 debug.scanner | Add debug for scanner | no | false
49 debug.parser | Add debug for parser | no | false
50 \endtable
51
52 The \c functions<scalar> and \c functions<vector> entries are
53 dictionaries of Foam::Function1 definitions that can either be used
54 to establish a time-varying quantity, to remap a field of scalar
55 values, or both.
56
57SourceFiles
58 exprDriverI.H
59 exprDriverContextI.H
60 exprDriver.C
61 exprDriverFields.C
62 exprDriverFunctions.C
63 exprDriverIO.C
64 exprDriverTemplates.C
65
66\*---------------------------------------------------------------------------*/
67
68#ifndef Foam_expressions_exprDriver_H
69#define Foam_expressions_exprDriver_H
70
71#include "exprResult.H"
72#include "exprString.H"
73#include "exprTraits.H"
74#include "pointField.H"
75#include "primitiveFields.H"
76#include "objectRegistry.H"
77#include "HashTable.H"
78#include "HashSet.H"
79#include "Function1.H"
80
81// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
82
83namespace Foam
84{
85
86// Forward Declarations
87class TimeState;
88
89namespace expressions
90{
91
92/*---------------------------------------------------------------------------*\
93 Class exprDriver Declaration
94\*---------------------------------------------------------------------------*/
95
96class exprDriver
97{
98public:
99
100 // Data Types
101
102 //- Search/caching controls
103 enum searchControls
104 {
105 NO_SEARCH = 0,
106 SEARCH_REGISTRY = 1,
107 SEARCH_FILES = 2,
110 };
111
112
113 //- Externally defined context fields
114 typedef HashTable<const regIOobject*> contextObjectTableType;
115
116
117private:
118
119 // Private Member Functions
120
121 //- Get search/caching controls from dictionary entries
122 static int getSearchControls(const dictionary& dict);
123
124 //- Read/reset Function1 entries
125 void resetFunctions(const dictionary& dict);
126
127 //- Helper for lookup of Function1 in table
128 template<class Type>
129 static const Function1<Type>* getFunction1Ptr
130 (
131 const word& name,
132 const HashTable<refPtr<Function1<Type>>>& tbl,
133 wordList* listFailure = nullptr
134 );
135
136
137protected:
138
139 // Protected Data
141 // Stored Data
142
143 //- The dictionary with all input data/specification
144 const dictionary& dict_;
145
146 //- The result
148
149 //- Variable definitions, as read from a dictionary
152 //- The variables table
155 //- Function1 mappings/timelines (scalar),
156 //- evaluated at the simulation time or with arbitrary scalars
159 //- Function1 mappings/timelines (vector),
160 //- evaluated at the simulation time or with arbitrary scalars
162
163 //- Externally defined context fields
165
166 //- Special-purpose scalar reference argument
167 scalar arg1Value_;
168
169 //- Reference to the time-state
170 mutable const TimeState* timeStatePtr_;
171
172 //- Pointer to an object registry (for functions etc).
173 const objectRegistry* obrPtr_;
174
175
176 // Controls, tracing etc.
177
178 //- Internal bookkeeping as "look-behind" parsing context
179 mutable int stashedTokenId_;
180
181 //- Request debugging for scanner
182 bool debugScanner_;
183
184 //- Request debugging for parser
185 bool debugParser_;
186
187 //- Allow variable names to mask field names
189
190 //- Use value of previous iteration when oldTime is requested
192
193 //- Registry/disk/caching control
195
196
197 // Protected Member Functions
198
199 inline bool searchRegistry() const noexcept;
200 inline bool searchFiles() const noexcept;
201 inline bool cacheReadFields() const noexcept;
202
203 //- Reset the time-state reference
204 void resetTimeReference(const TimeState* ts);
206 //- Reset the time-state reference
207 void resetTimeReference(const TimeState& ts);
209 //- Write scalar/vector Function1 entries in dictionary format
210 void writeFunctions(Ostream& os) const;
212
213 // Variables
215 //- Non-const access to the named variable (sub-classes only)
216 inline virtual exprResult& variable(const word& name);
218
219 // Fields
220
221 //- Fill a random field
222 //
223 // \param field the field to populate
224 // \param seed the seed value. If zero or negative, use as an offset
225 // to the current timeIndex (if a time-state is available)
226 // \param gaussian generate a Gaussian distribution
227 void fill_random
228 (
230 label seed = 0,
231 const bool gaussian = false
232 ) const;
233
234 //- The (global) weighted average of a field, with stabilisation
235 template<class Type>
236 static Type weightedAverage
237 (
238 const scalarField& weights,
239 const Field<Type>& fld
240 );
241
242 //- The (global) weighted sum (integral) of a field
243 template<class Type>
244 static Type weightedSum
245 (
246 const scalarField& weights,
247 const Field<Type>& fld
248 );
249
250 //- Return the location of the min value
252 (
253 const scalarField& vals,
254 const pointField& locs
255 );
256
257 //- Return the location of the max value
259 (
260 const scalarField& vals,
261 const pointField& locs
262 );
263
264
265 // Updating
266
267 //- Update things
268 virtual bool update();
269
270 //- Examine current variable values and update stored variables
271 virtual void updateSpecialVariables(bool force=false);
272
273
274 // Results
275
276 //- Get the result from another driver.
277 // Override to allow mapping
278 virtual exprResult getRemoteResult(const exprDriver& other) const;
279
280
281public:
282
283 //- Runtime type information
285
286
287 // Generated Methods
288
289 //- No copy construct
290 exprDriver(const exprDriver&) = delete;
291
292 //- No copy assignment
293 void operator=(const exprDriver&) = delete;
294
295
296 // Constructors
297
298 //- Default construct, and default construct with search preferences
299 explicit exprDriver
300 (
302 const dictionary& dict = dictionary::null
303 );
304
305 //- Copy construct with new dictionary reference
306 exprDriver(const exprDriver& rhs, const dictionary& dict);
307
308 //- Construct from a dictionary
309 explicit exprDriver(const dictionary& dict);
310
311
312 //- Destructor
313 virtual ~exprDriver() = default;
314
315
316 // Public Member Functions
317
318 //- The natural field size for the expression
319 virtual label size() const
320 {
321 return 1;
322 }
323
324 //- The point field size for the expression
325 virtual label pointSize() const
326 {
327 return 1;
329
330 //- Reference to the current time-state (can be nullptr)
331 const TimeState* timeState() const noexcept;
332
333 //- The current time value
334 virtual scalar timeValue() const;
335
336 //- The current deltaT value
337 virtual scalar deltaT() const;
338
339
340 //- The dictionary with all input data/specification
341 const dictionary& dict() const noexcept
342 {
343 return dict_;
344 }
345
346 //- Const access to expression result
347 const exprResult& result() const noexcept
348 {
349 return result_;
350 }
351
352 //- Non-const access to expression result
353 exprResult& result() noexcept
354 {
355 return result_;
356 }
358 //- Clear the result
359 void clearResult();
360
361 //- Return the expression result as a tmp field
362 // This also clears the result and associated memory.
363 template<class Type>
364 tmp<Field<Type>> getResult(bool wantPointData=false);
365
366 //- The result type as word - same as result().valueType()
367 const word& getResultType() const noexcept
368 {
370 }
371
372
373 // External References
374
375 //- Reset the objectRegistry (for functions)
376 void resetDb(const objectRegistry* obrPtr = nullptr);
377
378 //- Reset the objectRegistry (for functions)
379 void resetDb(const objectRegistry& db);
380
381
382 // Specials
383
384 //- Get special-purpose scalar reference argument.
385 // Typically available as \c arg() in an expression and
386 // may correspond to table index, time value etc.
387 inline scalar argValue() const noexcept;
388
389
390 // General Controls
392 //- Get "look-behind" parsing context (internal bookkeeping)
393 inline int stashedTokenId() const noexcept;
394
395 //- Reset "look-behind" parsing context (mutable operation)
396 // \return the previous value
397 inline int resetStashedTokenId(int tokenId=0) const noexcept;
398
399
400 //- Set the scanner/parser debug
401 void setDebugging(bool scannerDebug, bool parserDebug);
402
403 //- Set the scanner/parser debug to match the input
404 void setDebugging(const exprDriver& rhs);
405
406 //- Toggle CACHE_READ_FIELDS control
407 bool setCaching(bool on) noexcept;
409 //- Set search behaviour,
410 //- with additional CACHE_READ_FIELDS toggle on
412 (
414 const bool caching = false
415 );
416
417 //- Set search behaviour to be identical to rhs
418 void setSearchBehaviour(const exprDriver& rhs);
419
420 //- Read access to scanner debug
421 inline bool debugScanner() const noexcept;
422
423 //- Read access to parser debug
424 inline bool debugParser() const noexcept;
425
426 bool prevIterIsOldTime() const { return prevIterIsOldTime_; }
427
428
429 // Variables
430
431 //- Clear temporary variables, reset from expression strings
432 virtual void clearVariables();
433
434 //- Set special-purpose scalar reference argument.
435 // Typically available as \c arg() in an expression and
436 // may corrspond to table index, time value etc.
437 inline void setArgument(const scalar val) noexcept;
438
439 //- True if named variable exists
440 inline virtual bool hasVariable(const word& name) const;
441
442 //- Return const-access to the named variable
443 inline virtual const exprResult& variable(const word& name) const;
444
445 //- Add/set string expressions for variables
446 // Can include multiple definitions inline
447 void addVariables
448 (
449 const expressions::exprString& expr,
450 bool clear = true
451 );
452
453 //- Add/set string expressions for variables
454 // Can include multiple definitions inline
455 void addVariables
456 (
458 bool clear = true
459 );
460
461 //- Add a uniform variable from an outside caller
462 template<class T>
463 inline void addUniformVariable
464 (
465 const word& name,
466 const T& val
467 );
468
469
470 // Context fields (similar to objectRegistry)
471
472 //- True if any context fields are defined
473 inline bool hasContextObjects() const;
474
475 //- Find named context field, if it exists
476 inline const regIOobject* cfindContextIOobject(const word& name) const;
477
478 //- Find context field object of specified type
479 // \return nullptr if not found
480 template<class ObjType>
481 const ObjType* cfindContextObject(const word& name) const;
482
483 //- Add the object to the context
484 inline void addContextObject(const word& name, const regIOobject*);
485
486 //- Add the object to the context
487 inline void addContextObject(const regIOobject*);
488
489 //- Remove the object from the context
490 inline void removeContextObject(const word& name);
491
492 //- Remove the object from the context
493 inline void removeContextObject(const regIOobject*);
494
495 //- Read access to the object context
496 inline const contextObjectTableType& contextObjects() const noexcept;
497
498 //- Write access to the object context
500
501
502 // Scalar mappings (timelines / lookups)
503
504 //- Named mapping with given type exists
505 template<class Type>
506 bool isFunction(const word& name) const;
508 //- Evaluate named mapping for the given time/value.
509 //- Zero for undefined/unknown
510 template<class Type>
511 Type getFunctionValue(const word& name, const scalar x) const;
512
513 //- Fill result with values remapped according to the named Function1
514 template<class Type>
516 (
517 Field<Type>& result,
518 const word& name,
519 const scalarField& input
520 ) const;
521
522
523 // Fields
524
525 //- Test existence of a local variable
526 template<class T>
527 bool isLocalVariable
528 (
529 const word& name,
530 bool wantPointData = false,
531 label expectedSize = -1
532 ) const;
533
534 //- Retrieve local/global variable as a tmp field
535 //
536 // \param name The name of the local/global field
537 // \param expectSize The size check on the variable, -1 to ignore
538 // \param mandatory A missing variable is Fatal, or return
539 // an invalid tmp
540 template<class Type>
542 (
543 const word& name,
544 label expectSize,
545 const bool mandatory = true
546 ) const;
547
548
549 // Evaluation
550
551 //- Execute the parser.
552 // The return value currently has no meaning.
553 virtual unsigned parse
554 (
555 const std::string& expr,
556 size_t pos = 0,
557 size_t len = std::string::npos
558 ) = 0;
559
560 //- Evaluate the expression and return the field.
561 // This also clears the result and associated memory.
562 template<class Type>
563 inline tmp<Field<Type>>
565 (
566 const expressions::exprString& expr,
567 bool wantPointData = false
568 );
569
570 //- Evaluate the expression and return a single value.
571 // Does not clear the result.
572 template<class Type>
573 inline Type evaluateUniform
574 (
575 const expressions::exprString& expr,
576 bool wantPointData = false
577 );
578
579
580 //- Evaluate the expression
581 //- and save as the specified named variable
583 (
584 const word& varName,
585 const expressions::exprString& expr
586 );
587
588 //- Evaluate an expression on a remote
589 //- and save as the specified named variable
590 virtual void evaluateVariableRemote
591 (
592 string remote,
593 const word& varName,
594 const expressions::exprString& expr
595 );
596
598 // Fields
599
600 //- Return a new field with the size()
601 template<class Type>
602 tmp<Field<Type>>
603 newField(const Type& val = pTraits<Type>::zero) const;
604
605 //- Return a new field with the pointSize()
606 template<class Type>
607 tmp<Field<Type>>
608 newPointField(const Type& val = pTraits<Type>::zero) const;
609
610
611 // Reading
612
613 //- Read an expression string and do substitutions
614 static expressions::exprString readExpression
615 (
616 const word& name,
617 const dictionary& dict
618 );
619
620 //- Read the list of variable strings
621 // (or initialize with a single string)
622 static List<expressions::exprString> readVariableStrings
623 (
624 const dictionary& dict,
625 const word& name = "variables",
626 bool mandatory = false
627 );
628
629 //- Read an expression string (with the current dictionary)
630 //- and do substitutions
631 expressions::exprString readExpression(const word& name);
632
633
634 //- Read variables, tables etc.
635 // Also usable for objects not constructed from a dictionary.
636 virtual bool readDict(const dictionary& dict);
637
638 //- Read "variables" and assigns to the list of expression strings
639 // \return the number variable strings read.
641 (
642 const dictionary& dict,
643 bool mandatory = false
644 );
645
646
647 // Writing
648
649 //- Write "variables"
651 (
653 const word& keyword = ""
654 ) const;
655};
656
657
658// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
659
660} // End namespace expressions
661} // End namespace Foam
662
663// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
664
665#include "exprDriverI.H"
666#include "exprDriverContextI.H"
667
668#ifdef NoRepository
669 #include "exprDriverTemplates.C"
670#endif
671
672// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
673
674#endif
675
676// ************************************************************************* //
Info<< nl<< "Wrote faMesh in vtk format: "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.mesh().time().globalPath()/"finiteArea-edges"));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
Definition: Function1.H:96
A HashTable similar to std::unordered_map.
Definition: HashTable.H:123
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
The time value with time-stepping information, user-defined remapping, etc.
Definition: TimeState.H:54
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: UList.H:94
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Base driver for parsing (field) values.
Definition: exprDriver.H:141
bool isLocalVariable(const word &name, bool wantPointData=false, label expectedSize=-1) const
Test existence of a local variable.
virtual label size() const
The natural field size for the expression.
Definition: exprDriver.H:363
bool searchFiles() const noexcept
Definition: exprDriverI.H:150
void fill_random(scalarField &field, label seed=0, const bool gaussian=false) const
Fill a random field.
bool cacheReadFields() const noexcept
Definition: exprDriverI.H:156
bool debugParser() const noexcept
Read access to parser debug.
Definition: exprDriverI.H:138
static point getPositionOfMaximum(const scalarField &vals, const pointField &locs)
Return the location of the max value.
Ostream & writeVariableStrings(Ostream &os, const word &keyword="") const
Write "variables".
Definition: exprDriverIO.C:119
exprResult result_
The result.
Definition: exprDriver.H:191
void removeContextObject(const word &name)
Remove the object from the context.
virtual exprResult & variable(const word &name)
Non-const access to the named variable (sub-classes only)
Definition: exprDriverI.H:64
virtual void updateSpecialVariables(bool force=false)
Examine current variable values and update stored variables.
Definition: exprDriver.C:327
void clearResult()
Clear the result.
Definition: exprDriver.C:315
void addVariables(const expressions::exprString &expr, bool clear=true)
Add/set string expressions for variables.
Definition: exprDriver.C:379
bool hasContextObjects() const
True if any context fields are defined.
static expressions::exprString readExpression(const word &name, const dictionary &dict)
Read an expression string and do substitutions.
Definition: exprDriverIO.C:75
void writeFunctions(Ostream &os) const
Write scalar/vector Function1 entries in dictionary format.
exprResult & result() noexcept
Non-const access to expression result.
Definition: exprDriver.H:397
const TimeState * timeState() const noexcept
Reference to the current time-state (can be nullptr)
Definition: exprDriver.C:254
void addContextObject(const word &name, const regIOobject *)
Add the object to the context.
virtual label pointSize() const
The point field size for the expression.
Definition: exprDriver.H:369
void resetDb(const objectRegistry *obrPtr=nullptr)
Reset the objectRegistry (for functions)
Definition: exprDriver.C:142
tmp< Field< Type > > newField(const Type &val=pTraits< Type >::zero) const
Return a new field with the size()
bool searchRegistry() const noexcept
Definition: exprDriverI.H:144
HashTable< refPtr< Function1< scalar > > > scalarFuncs_
Definition: exprDriver.H:201
label setVariableStrings(const dictionary &dict, bool mandatory=false)
Read "variables" and assigns to the list of expression strings.
Definition: exprDriverIO.C:107
tmp< Field< Type > > getLocalVariable(const word &name, label expectSize, const bool mandatory=true) const
Retrieve local/global variable as a tmp field.
bool debugParser_
Request debugging for parser.
Definition: exprDriver.H:229
HashTable< refPtr< Function1< vector > > > vectorFuncs_
Definition: exprDriver.H:205
Type getFunctionValue(const word &name, const scalar x) const
bool allowShadowing_
Allow variable names to mask field names.
Definition: exprDriver.H:232
searchControls
Search/caching controls.
Definition: exprDriver.H:148
@ SEARCH_REGISTRY
Search registry before disk.
Definition: exprDriver.H:150
@ SEARCH_FILES
Search disk (eg, standalone app)
Definition: exprDriver.H:151
@ CACHE_READ_FIELDS
Cache fields read from disk.
Definition: exprDriver.H:152
virtual void evaluateVariableRemote(string remote, const word &varName, const expressions::exprString &expr)
Definition: exprDriver.C:357
tmp< Field< Type > > evaluate(const expressions::exprString &expr, bool wantPointData=false)
Evaluate the expression and return the field.
bool prevIterIsOldTime_
Use value of previous iteration when oldTime is requested.
Definition: exprDriver.H:235
bool debugScanner_
Request debugging for scanner.
Definition: exprDriver.H:226
bool debugScanner() const noexcept
Read access to scanner debug.
Definition: exprDriverI.H:132
const ObjType * cfindContextObject(const word &name) const
Find context field object of specified type.
virtual bool readDict(const dictionary &dict)
Read variables, tables etc.
Definition: exprDriver.C:297
static point getPositionOfMinimum(const scalarField &vals, const pointField &locs)
Return the location of the min value.
Type evaluateUniform(const expressions::exprString &expr, bool wantPointData=false)
Evaluate the expression and return a single value.
Definition: exprDriverI.H:101
List< expressions::exprString > variableStrings_
Variable definitions, as read from a dictionary.
Definition: exprDriver.H:194
virtual scalar deltaT() const
The current deltaT value.
Definition: exprDriver.C:282
const objectRegistry * obrPtr_
Pointer to an object registry (for functions etc).
Definition: exprDriver.H:217
const TimeState * timeStatePtr_
Reference to the time-state.
Definition: exprDriver.H:214
const dictionary & dict_
The dictionary with all input data/specification.
Definition: exprDriver.H:188
static Type weightedAverage(const scalarField &weights, const Field< Type > &fld)
The (global) weighted average of a field, with stabilisation.
HashTable< exprResult > variables_
The variables table.
Definition: exprDriver.H:197
searchControls searchCtrl_
Registry/disk/caching control.
Definition: exprDriver.H:238
scalar argValue() const noexcept
Get special-purpose scalar reference argument.
Definition: exprDriverI.H:37
void setDebugging(bool scannerDebug, bool parserDebug)
Set the scanner/parser debug.
Definition: exprDriver.C:493
int resetStashedTokenId(int tokenId=0) const noexcept
Reset "look-behind" parsing context (mutable operation)
Definition: exprDriverI.H:122
static Type weightedSum(const scalarField &weights, const Field< Type > &fld)
The (global) weighted sum (integral) of a field.
void setSearchBehaviour(enum searchControls search, const bool caching=false)
Definition: exprDriver.C:542
virtual exprResult getRemoteResult(const exprDriver &other) const
Get the result from another driver.
Definition: exprDriver.C:369
virtual bool update()
Update things.
Definition: exprDriver.C:321
void setArgument(const scalar val) noexcept
Set special-purpose scalar reference argument.
Definition: exprDriverI.H:31
const contextObjectTableType & contextObjects() const noexcept
Read access to the object context.
const exprResult & result() const noexcept
Const access to expression result.
Definition: exprDriver.H:391
int stashedTokenId() const noexcept
Get "look-behind" parsing context (internal bookkeeping)
Definition: exprDriverI.H:115
void evaluateVariable(const word &varName, const expressions::exprString &expr)
Definition: exprDriver.C:339
void resetTimeReference(const TimeState *ts)
Reset the time-state reference.
Definition: exprDriver.C:130
virtual void clearVariables()
Clear temporary variables, reset from expression strings.
Definition: exprDriver.C:331
contextObjectTableType contextObjects_
Externally defined context fields.
Definition: exprDriver.H:208
bool isFunction(const word &name) const
Named mapping with given type exists.
const regIOobject * cfindContextIOobject(const word &name) const
Find named context field, if it exists.
virtual bool hasVariable(const word &name) const
True if named variable exists.
Definition: exprDriverI.H:44
virtual unsigned parse(const std::string &expr, size_t pos=0, size_t len=std::string::npos)=0
Execute the parser.
static List< expressions::exprString > readVariableStrings(const dictionary &dict, const word &name="variables", bool mandatory=false)
Read the list of variable strings.
Definition: exprDriverIO.C:96
const dictionary & dict() const noexcept
The dictionary with all input data/specification.
Definition: exprDriver.H:385
void fillFunctionValues(Field< Type > &result, const word &name, const scalarField &input) const
Fill result with values remapped according to the named Function1.
virtual scalar timeValue() const
The current time value.
Definition: exprDriver.C:268
const word & getResultType() const noexcept
The result type as word - same as result().valueType()
Definition: exprDriver.H:411
HashTable< const regIOobject * > contextObjectTableType
Externally defined context fields.
Definition: exprDriver.H:158
bool setCaching(bool on) noexcept
Toggle CACHE_READ_FIELDS control.
Definition: exprDriver.C:513
tmp< Field< Type > > getResult(bool wantPointData=false)
Return the expression result as a tmp field.
int stashedTokenId_
Internal bookkeeping as "look-behind" parsing context.
Definition: exprDriver.H:223
void addUniformVariable(const word &name, const T &val)
Add a uniform variable from an outside caller.
tmp< Field< Type > > newPointField(const Type &val=pTraits< Type >::zero) const
Return a new field with the pointSize()
scalar arg1Value_
Special-purpose scalar reference argument.
Definition: exprDriver.H:211
A polymorphic field/result from evaluating an expression.
Definition: exprResult.H:127
const word & valueType() const noexcept
Basic type for the field or single value.
Definition: exprResultI.H:235
Registry of regIOobjects.
A traits class, which is primarily used for primitives.
Definition: pTraits.H:59
A class for managing references or pointers (no reference counting)
Definition: refPtr.H:58
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:76
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition: zero.H:63
const volScalarField & T
rDeltaTY field()
patchWriters clear()
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
dimensionedScalar pos(const dimensionedScalar &ds)
List< word > wordList
A List of words.
Definition: fileName.H:63
static Istream & input(Istream &is, IntRange< T > &range)
Definition: IntRanges.C:55
const direction noexcept
Definition: Scalar.H:223
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
fileName search(const word &file, const fileName &directory)
Recursively search the given directory for the file.
Definition: fileName.C:624
Specialisations of Field<T> for scalar, vector and tensor.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73