Table of Contents
directcode - simple direct N-body code
directcode is a simple leapfrog equal-timestepping direct N-body
The infra-structure of the code is derived from hackcode1(1NEMO)
most of the save and restore state code has been removed to keep the code
It is possible with this code to change the softening to mean a
pseudo-Newtonian interaction, using 1/r -> 1/(r-eps), where eps=3GM/c^2.
following parameters are recognized; they may be given in any order if
supplied with their keyword.
Using eps<0 to activate the pseudo-Newtonian option does not change
the units, all units need to be absorbed into eps. For example, for given
eps<0, the precession rate of a planet around a star should then be 2.pi.eps/(a*(1-e^2)).
- If given, initial conditions will
be read from in-file in snapshot format. At most one of in, restart, or continue
may be specified.
- If given, results are written to out-file in
- Number of bodies for test data, generated
only if none of in, restart, or continue are specified. Default is 128.
- Random number seed used in generating initial conditions. Default is 123.
- If true, generate centrally concentrated test system.
Default is false.
- Inverse time-step, to be used with a leap-frog
integrator. Default is 32.0 (32 steps per unit time).
softening parameter. If a negative value is given, the potential is turned
into a pseudo-Newtonian one with the meaning of -eps = 3GM/c^2. Default is
- Miscellaneous control options, specified as a
comma-separated list of keywords. Currently recognized keywords are: reset_time:
when reading initial data, set tnow to zero; new_tout: when restarting,
set new output times; mass, phi, acc: output mass, potential, acceleration
data with major data outputs. The phase space coordinates are always output.
It also seems that the reset_time and new_tout options have not been implemented
yet. Default: mass,phase.
- Time to stop integration in N-body
model units. Default is 2.0.
- Frequency of major N-body data
outputs. Default is 4.0 (4 frames per unit time).
of minor diagnostic outputs. If this frequency is not a simple fraction
of freq (see above), the program can waiste significant amounts of time.
Default is 32.0 (32 diagnostic measurements per unit time).
for the gravitational constant. Although normally 1 in N-body units (see
), this allows you to work in more natural units. [Default:
src/nbody/evolve/directcode/ source code
17-feb-04 V1.0 code written, cloned off hackcode1 PJT
29-jul-09 V1.2 allow eps<0 for pseudo-Newtonian hack PJT
30-jul-09 V1.3 added gravc= PJT
Table of Contents