Mario Alberto Rodríguez-Meza

NAME

nbody_n2 - (Direct force calculation) simulation of a selfgravitating N-body system

DOWNLOAD

To download click on the following link nbody_n2.

SYNOPSIS

nbody_n2 [parameter_file_name] [options]

DESCRIPTION

nbody_n2 - Simulates the evolution of a N-body system interacting with a potential proportional to 1/r. The force is computed directly. Code complexity is N*N.

OPTIONS

The options have the structure

option_name = <option_value>

except option -help.

Options and their possible values are:

-help By writting

nbody_n2 -help

you will get the list of all parameters and their default values. An option may have an alias which is a short name of the option. If an option has an alias in the list above it comes after its description surrounded by brackets tagged with 'a:'. For example,

option_name=<option_value> ... Description ... [a: opt]

here 'opt' is the short name of the option. In the description of the options below, when an option has an alias it will be noted in the same way but before its description.

paramfile - is the name file with the values of the input parameters. Overwrite parameters values below. You may also input this filename by only writing:

nbody_n2 parameters_input_file_name

Parameter input file may be created by hand with the editor of your choice. Comment lines start with an "%". Follow each name option with a blank space and the option value. The order of the option lines does not matter. Also you may create an example input file by executing

nbody_n2

This will run the nbody_n2 code with default values generating a test data set internally, and when it finish you will have in your running directory the file "parameters_null-usedvalues". Now you may edit this file to adapt it to your own simulation parameters. It may be helpful to change this file name to whatever apropriate.

eps - It is the smoothing force length.

nbody - It is the number of bodies to simulate

Note: it is recommended that this number is given as power of 2.

dtime [a: dt] - is the time step integration. It can be given as an integration frequency just type in <dt1/dt2>.

tstop - is the time to stop the simulation.

seed - It is the Random number seed for the test run.

icfile [a: ic] - you give here the name of the file with the N-body initial data.

icfilefmt [a: icfmt] - is the format of the initial condition file. Values are: <snap-bin> (Binary) or <snap-ascii> (ASCII).

snapout [out] - you give here the name structure for the output of N-body snaps. The format follows as the ones used in C-language for integers ("%0#d").

snapoutfmt [a: outfmt] - you tell the code the format of the snaps output. There are two options <snap-ascii>, <snap-bin>, or <snap-pv>. Brakets are not written. The n-body standard format binary or ASCII is a file with n-body data written as follows:

nbody
NDIM
time
mass (of all the particles)
x y z (position for all the particles)
vx vy vz (velocity for all the particles)

And in the colummns format the particle data is written in column form as

# nbody NDIM time
# nbody value NDIM value time value
Id mass x y z vx vy vz (for all the particles)

dtout - This is the time step for a snap output. It can be given as an output frequency, just type in <dt1/dt2>.

dtoutinfo - This is the time step output for other info such energy statistics. It can be given as an output frequency, just
type in <dt1/dt2>.

statefile [a: state] - you give here the name of a file where the run state will be saved. If it is null no run state will be saved.

stepState - you give here the number of time step integrations to jump to save a state of the run.

restorefile [a: restore] - if it is not null a run will be restarted from the data stored in this file.

options [a: opt] - you may give here various code behavior options. They are, <reset-time> (inputdata); <out-phi> (outputdata); <out-acc> (outputdata). If you save a state file, this parameter is saved.

STOPPING THE CODE

Once the nbody_n2 is running you may allways stop it by executing the command

echo > stop

You must be in the same directory were the process were lunched. A file named 'stop-state' is saved containing the state of the simulation run. This option permits us to stop the simulation and change some numerical parameters such as eps or options.

EXAMPLES

By executing the command,

nbody_n2 nbody=4096 dtime=1/32 out=snap%03d

will run the code, generating internally a Plummer sphere sampled with 4096 particles and then evolving it up to t=2 with a time step of 1/32. Snaps of the evolution will be saved as snap000, snap004, ..., snap064, with format <snap-ascii>.

SEE ALSO

gbsph(1)

COPYRIGHT

Copyright (C) 1999-2007

M.A. Rodriguez-Meza