ENH: Expressions: basic expression template support
Summary
Adding basic expression template support through .expr() function on primitives.
Resolved bugs (If applicable)
none
Details of new models (If applicable)
-
.expr()to create the wrapper - assignment to evaluate the wrapper
c = a.expr() + sqrt(b.expr()); - wrapper generators
| Class | Expression | Assignment |
|---|---|---|
| List | .expr() | yes |
| Field | .expr() | yes |
| GeometricField (e.g. volScalarField) | .expr() | yes |
| tmp<Field> | .expr() | no |
| tmp<GeometricField> | .expr() | no |
| DimensionedType (for constant Field) | .expr(<size>) | no |
| DimensonedType (for constant GeometricField) | .expr(<GeoField>) | no |
| fvMatrix | .expr() | yes |
Risks
- requires new C++
- no boundary conditions on surfaceFields
- different truncation behaviour if offloaded