mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: generalize string expression evaluation
- replace stringOps::toScalar with a more generic stringOps::evaluate method that handles scalars, vectors etc. - improve #eval to handle various mathematical operations. Previously only handled scalars. Now produce vectors, tensors etc for the entries. These tokens are streamed directly into the entry.
This commit is contained in:
@ -36,4 +36,13 @@ FoamFile
|
||||
#endif
|
||||
|
||||
|
||||
// Silly example, but can also force cast from scalar to bool
|
||||
|
||||
#if #eval "bool(2 * pi())"
|
||||
condition true;
|
||||
#else
|
||||
condition false;
|
||||
#endif
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
Reference in New Issue
Block a user