ENH: improve expression string expansions
- reuse more of stringOps expansions to reduce code and improve the syntax flexiblity. We can now embed "pre-calculated" values into an expression. For example, angle 35; valueExpr "vector(${{cos(degToRad($angle))}}, 2, 3)"; and the ${{..}} will be evaluated with the regular string evaluation and used to build the entire expression for boundary condition evaluation. Could also use for fairly wild indirect referencing: axis1 (1 0 0); axis2 (0 1 0); axis3 (0 0 1); index 100; expr "$[(vector) axis${{ ($index % 3) +1 }}] / ${{max(1,$index)}}";
Showing
- applications/test/exprEntry/Make/files 3 additions, 0 deletionsapplications/test/exprEntry/Make/files
- applications/test/exprEntry/Make/options 1 addition, 0 deletionsapplications/test/exprEntry/Make/options
- applications/test/exprEntry/Test-exprEntry.C 145 additions, 0 deletionsapplications/test/exprEntry/Test-exprEntry.C
- applications/test/exprEntry/testDict1 69 additions, 0 deletionsapplications/test/exprEntry/testDict1
- src/OpenFOAM/expressions/exprEntry/expressionEntry.C 50 additions, 146 deletionssrc/OpenFOAM/expressions/exprEntry/expressionEntry.C
- src/OpenFOAM/expressions/exprEntry/expressionEntry.H 7 additions, 9 deletionssrc/OpenFOAM/expressions/exprEntry/expressionEntry.H
- src/OpenFOAM/expressions/exprString/exprString.C 40 additions, 13 deletionssrc/OpenFOAM/expressions/exprString/exprString.C
- src/OpenFOAM/expressions/exprString/exprString.H 22 additions, 1 deletionsrc/OpenFOAM/expressions/exprString/exprString.H
Please register or sign in to comment