Skip to content

HMBond/Sym4

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fixed-timestep parallel softened N-body code with 4th order symplectic integrator
To build, simply 'make' in this directory

#################### INPUT PARAMETERS ####################

input:

./Main.exe t_begin t_end dt_snap eta N config param

t_begin         = begin time of simulation
t_end           = end time
dt_snap         = snapshot output interval
eta             = internal timestep
N               = number of bodies
numThreads      = number of software threads
config          = initial condition mode
param           = parameters

if config = "file", param is the initial condition filename
filename        = file with initial condition as such:
                  mass1 x1 y1 z1 vx1 vy1 vz1
                  mass2 x2 y2 z2 vx2 vy2 vz2
                  etc...
                  It is assumed that the initial condition is placed in the 'inputs' folder
                  
if config = "cold_plummer", a cold plummer sphere with N bodies is generated.
if config = "plummer", a warm plummer sphere with N bodies and randomized velocities is generated.

Optimal softening parameter epsilon is calculated internally
                  
Example:
./Main.exe 0 6300 6.3 0.001 10 2 file Solar_Syst.in

Simulates approximately 1000 years of our solar system (including Pluto) with 2 threads
and a snapshot output interval of 1 year

Example:
./Main.exe 0 10 0.01 0.00001 1000 100 plummer

Simulates a realization of a warm plummer distribution with N=1000 for 10 time units with 100 threads

After a simulation, CPU time is printed to the screen

Writes output and energies to file

#################### data.out structure ####################

A row represents one body at one snapshot in time. Format is as such:

    mass x y z vx vy vz (just like manual initial condition)
    
This means that, for each snapshot, there are N rows corresponding to N bodies. Column 0 is mass, columns 1, 2 and 3 represent x, y and z coordinate
and columns 5, 6 and 7 represent velocity in x, y and z respectively. Concisely, the data.out file contains an array with 

  (t_end - t_begin) / dt_snap * N       rows
  
              7                         columns

################## energies.out structure ##################

This file contains the total energy for the cluster per snapshot interval. Format is a s such:

    timestamp energy
    
This means that for each snapshot there is a timestamp and an energy.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 79.5%
  • Python 14.4%
  • Makefile 6.1%