mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
- the #eval directive is similar to the #calc directive, but for evaluating
string expressions into scalar values. It uses an internal parser for
the evaluation instead of dynamic code compilation. This can make it
more suitable for 'quick' evaluations.
The evaluation supports the following:
- operations: - + * /
- functions: exp, log, log10, pow, sqrt, cbrt, sqr, mag, magSqr
- trigonometric: sin, cos, tan, asin, acos, atan, atan2, hypot
- hyperbolic: sinh, cosh, tanh
- conversions: degToRad, radToDeg
- constants: pi()
- misc: rand(), rand(seed)
12 lines
366 B
Bash
Executable File
12 lines
366 B
Bash
Executable File
#!/bin/sh
|
|
cd ${0%/*} || exit 1 # Run from this directory
|
|
|
|
# Manually create ragel scanner and the lemon parser header
|
|
|
|
"$WM_PROJECT_DIR/wmake/scripts/makeParser" \
|
|
-scanner=evalStringToScalarScanner.rl \
|
|
-parser=evalStringToScalarLemonParser.lyy \
|
|
;
|
|
|
|
#------------------------------------------------------------------------------
|