#include <acceleration.h>typedef void(*acc_pter) /* return: void */(int, /* input: number of dimensions */double, /* input: simulation time */int, /* input: number bodies = size of arrays */const void*, /* input: masses: m[i] */const void*, /* input: positions (x,y,z)[i] */const void*, /* input: velocities (u,v,w)[i] */const int *, /* input: flags f[i] */void*, /* output: potentials p[i] */void*, /* output: accelerations (ax,ay,az)[i] */int, /* input: indicator */char); /* input: type: ’f’ or ’d’ */ acc_pter get_acceleration(const char*, /* input: acc_name */const char*, /* input: acc_pars */const char*, /* input: acc_file */bool *, /* output: need masses? */bool *); /* output: need velocities? */
The 5th argument to get_acceleration() is boolean and returns whether velocities are required as input for acceleration(). If they are not required a NULL pointer may be given. Velocities may be used to compute friction forces, such as the drag a gaseous disk is generating on stars crossing it.
arrays are passed as pointer to void. They must be either all of type float or all of type double as indicated by the last argument being ’f’ or ’d’, respectively.
arrays of vector quantities are in the order x0,y0,z0, x1,y1,z1, ...
if the pointer to flags is NULL, all bodies are supposed to be active, otherwise only those for which (f[i] & 1) is true.
the argument "indicator" of acceleration() indicates whether the accelerations and potential shall be assigned or added. If bit 0 is set, the potential is added, otherwise assigned, If bit 1 is set, the acceleration is added, otherwise assigned. So, 0 means both are assigned.
harmonic wx,wy,wz 1,1,1 plummer m,a 1,1 log mc,rc,q 1,1,1 bar83 fm,fx,ca 1.334697416,8.485281374,0.2 hackforce tol,eps,rsize,fcells 1,0.025,4,0.75 ccd Iscale,Xcen,Ycen,Dx,Dy 1,0,0,1,1A full listing, including their mathematical expression can be found in the NEMO manual, see also $NEMO/text/manuals/potential.inc,, and of course in $NEMO/src/orbit/potential/data.
Most likely loadobj(3NEMO) will break under such circumstances.
Second: no I/O should be done. In practise this also means that this third parameter, potfile, of inipotential cannot be used, as is mostly serves as a filename. The reason is that we didn’t want the programs to have to link in huge fortran I/O libraries, including various portability problems.
There is one exception: potlist(1NEMO) is allowed to load potential(5NEMO) files with FORTRAN WRITE statements. After you have made sure the function works as you think, these statements must be Commented out and can then be reloaded by most other potential/orbit programs.
~/src/orbit/potential potential.c, potential.h potentialf.c ~/text/manuals potential.inc (latex description)
28-oct-05 man page finally written PJT