Table of Contents

Name

acceleration - format for accelerations description (functors)

Synopsis


#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?   
   */

Description

acceleration(5NEMO) are implemented as an improvement to the nearly-compatible potential(5NEMO) format.

Parameters

The 4th argument to get_acceleration() is boolean and returns whether masses are required as input for acceleration(). If they are not required a NULL pointer may be given.

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.

Examples

The following table lists the non-pattern speed parameters for a few example potentials found in $NEMOOBJ/potential. Note: the pattern speed is not listed here


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,1
A 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.

Bugs

Since the later introduction of a third character valued parameter in inipotential() a Fortran-to-C interface cannot be used in as portable a way as before. A small Fortran-to-C interface is however available, but is not guaranteed to work on all machines. Also keep in mind if you write your potentials in fortran: common blocks and other used routines get loaded into the executable, with the potential for duplicate symbol names.

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.

Environment

The environment variable ACCPATH can be used to search for accelerations in other than the local directory.

See Also

acceleration(3NEMO) , potential(5NEMO) , manipulator(5NEMO) ,gyrfalcON(1NEMO)

Author

Peter Teuben

Files


~/src/orbit/potential   potential.c, potential.h potentialf.c
~/text/manuals          potential.inc (latex description)

Update History


28-oct-05    man page finally written    PJT


Table of Contents