mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Example,
($radius > 10) ? sin(degToRad(45)) : cos(degToRad(30))
- protect division and modulo against zero-divide.
- add scanner/parser debugging switches in the namespace,
selectable as "stringToScalar". For example,
debug parser: foamDictionary -debug-switch stringToScalar=2
debug scanner: foamDictionary -debug-switch stringToScalar=4
debug both: foamDictionary -debug-switch stringToScalar=6
40 lines
1.1 KiB
C++
40 lines
1.1 KiB
C++
/*--------------------------------*- C++ -*----------------------------------*\
|
|
| ========= | |
|
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
|
| \\ / O peration | Version: v1912 |
|
|
| \\ / A nd | Website: www.openfoam.com |
|
|
| \\/ M anipulation | |
|
|
\*---------------------------------------------------------------------------*/
|
|
FoamFile
|
|
{
|
|
version 2.0;
|
|
format ascii;
|
|
class dictionary;
|
|
object dictionary;
|
|
}
|
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
|
|
// Do comparison
|
|
|
|
#if #eval "${FOAM_API:-0}"
|
|
foamApi nonZero;
|
|
#else
|
|
foamApi zeroValue;
|
|
#endif
|
|
|
|
#if #eval "${XX_XXX_FOAM_API:-1000}"
|
|
other "some entry";
|
|
#else
|
|
other "unexpected";
|
|
#endif
|
|
|
|
|
|
#if #eval "${FOAM_API:-0} >= 1910"
|
|
evalType hasEvalWithConditionals;
|
|
#else
|
|
evalType none;
|
|
#endif
|
|
|
|
|
|
// ************************************************************************* //
|