Fastflo supports expressions with a wide range of unary and binary operators. Expressions can be used in e or b statements defining PDEs, in various global commands, and in post-processing of results. Vector and coordinate variables can be used in expressions. Expressions may have multiple components, in which case care is need for consistency of length.
The binary operators available in Fastflo, in order of precedence, are:
| highest precedence | ^ . @ M p P t c |
| * / m r | |
| + - | |
| & | |
| | | |
| lowest precedence | ? : |
Operators of equal precedence are evaluated in left-to-right order. Unary operators have highest precedence. (Note that operators in early versions of Fastflo were evaluated in strict left-to-right sequence. The precedence described in the table above was introduced in mid 1997.)
Many of the binary operators have their familiar meaning, and those that do not have a familiar meaning generally involve vector operations. For example, there are two dot products: one (.) is the true scalar product over all components yielding a single number result, whilst the operator @ is a dot product over vector components yielding a vector with one scalar value per node.
The p, P, t and c products are respectively a matrix-vector product, a
matrix-matrix product, a dyadic product of vectors, and a vector cross
product. M is a binary maximum, m is a modulo and r a remainder
operator. The logical operators
,
, & and | can be applied to
scalars or vectors. In the case of vectors, these operators return a
floating point vector with 1 and 0 entries. Fastflo has only
floating point type, which is why there is no test involving equality.
For more details, see the on-line Reference Manual.