Skip to content

Python script that generates initial conditions for a Plummer Sphere distribution of particles in txt, GADGET-2 binary or HDF5 formats.

License

Notifications You must be signed in to change notification settings

n-ssouza/plummerIC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

The Plummer Model may be useful to represent stellar systems such as globular clusters, dwarf galaxies, or to serve as a toy model in N-body simulations containing these types of simple spherical distribution of particles. This python script generates initial conditions in the usual Gadget system of units (check the parameters file) for a Plummer Sphere. There are three possible output formats: txt, GADGET-2 binary, HDF5.

Required python packages

  • os
  • sys
  • struct
  • numpy
  • ConfigParser

Usage

Simply edit the parameters in the plummer_params.ini file as you desire, then run ic.py

python ic.py

The directory InitialConditions will be create with the output file within it.

Comments

  1. The snapwrite.py module is exactly the same as in Elvis Mello's adaptation for python 3 of Rafael Ruggiero's clustep, necessary in order to write the output in the gadget2 binary format or hdf5.
  2. In the GADGET-2 format, all particles are set to the particle type 'stars'. You can change this by editing this line of code accordingly.
  3. The overall structure of ic.py is basically the same as clustep's. Therefore I plan on creating a more general software which would be able to generate initial conditions for many different profiles (for instance, implementing King's model into the code should be an easy task).

Example

Plummer sphere visualization in glnemo2

About

Python script that generates initial conditions for a Plummer Sphere distribution of particles in txt, GADGET-2 binary or HDF5 formats.

Topics

Resources

License

Stars

Watchers

Forks

Languages