Name Type Description
constants and global properties
Pi r 3.14159265358979323846264338328
N i N, the total number of bodies
M r M, the total mass
t r t, the time of the snapshot
operators
Sum{expr@cond} i,r,v sum of expr over bodies satisfying cond
Mean{expr@cond} i,r,v mean of expr over bodies satisfying cond
Mmean{expr@cond} i,r,v mass-weighted mean of expr over bodies satisfying cond
Max{expr@cond} i,r,v max of expr over bodies satisfying cond
Min{expr@cond} i,r,v min of expr over bodies satisfying cond
And{expr@cond} b AND of expr over bodies satisfying cond
Or {expr@cond} b OR of expr over bodies satisfying cond
Num{cond} i Number of bodies satisfying cond
Note that Mean{X} is equivalent to (but more efficient than) Sum{X}/N. Similarly, Mmean{X} is equivalent to Sum{m*X}/M.
In addition, the expression may use any standard mathematical expressions, including math functions. For vectors, all operations defined for tupel<3,real>, see tupel(5falcON) , are allowed. The following lists some of these and additional functions supported.
Name Type Description
vector*vector real returns the scalar product
vector^vector vector returns the vector cross product
vector(x) vector converts scalar to vector
real(x) real converts integer to real
norm(x) returns x*x for any type
abs(vector) real returns sqrt(norm(vector))
abs(real) real returns |real|
max(x,y) scalar returns the greater of two scalars
max(vector) real returns the greatest vector element
min(x,y) scalar returns the smaller of two scalars
min(vector) real returns the smallest vector element
ExamplesThe following lists some example bodiesfunc expressions: M and
Sum{m}
both evaluate the total mass of all bodies; Min{eps} and Min{eps@r>#0}
evaluate the mininum softening length of, respectively, all bodies and
of all bodies with radius larger than parameter 0; Sum{m@E<0} and 0.5*Sum{m*norm(vel)@E<0}
evaluate, respectively, the mass and the kinetic energy of all bound bodies;
Num{r<Min{eps}} and Sum{1@r<Min{eps}}
both evaluate the number of bodies with radius less than the minimum softening
length (this demonstrates the usage of another bodiesfunc expression inside
a bodiesfunc operator); Sum{l*m}/M, Mean{l*m}/Mean{m} and Mmean{l}
are three ways to evaluate the mass-weighted mean of specific angular momentum.
See Alsobodiesfunc(1falcON), bodyfunc(1falcON), snapprop(1falcON) AuthorWalter
Dehnen Update History
21-jul-2004 Created WD
20-aug-2004 nested expressions added WD
07-nov-2004 parameters added, changed cond#expr to expr@cond WD
12-jul-2006 Updated WD