writegadget: Write simulation snapshot in Gadget-2 binary format

Description Usage Arguments Value Author(s) See Also

Description

Write astrophysical N-body+SPH snapshot in Gadget-2 binary format, for use as initial conditions with Gadget Version 1/2/3/4 (SnapFormat=1).

Usage

1

Arguments

part

is a list of initial conditions. It contains the items:
x = N-by-3 matrix specifying the initial position in Cartesian coordinates of the N particles
v = optional N-by-3 matrix specifying the initial velocities. If not given, velocities are set to zero.
id = optional N-by-3 matrix specifying unique particle IDs. If not given, the particles will be numbered sequentially from 1 to N.
m = optional vector giving the masses of the particles, whose mass is not already specified in head$Massarr. This is only used for variable particles masses. Fixed masses are best specified with the header argument Massarr.
u = optional vector giving the internal energies of the SPH particles, i.e. the particles of type 0 (in C-indexing).

head

is a list of header arguments. For full details, please refer to the Gadget-2 manual (https://wwwmpa.mpa-garching.mpg.de/gadget/users-guide.pdf, page 33). The most important items are:
Npart = 6-vector giving the number of particles of each type. The first element corresponds to gas particles; the other five are treated as collision-less.
NMassarr = optional 6-vector listing a fixed mass for each particle type. If set to 0 for a type which is present, individual particle masses must be provided in the vector part$m.

file

filename.

Value

Returns a list containing the particle data. The format of the list depends on the input format.

Author(s)

Danail Obreschkow

See Also

readgadget


obreschkow/simstar documentation built on Jan. 29, 2022, 2:16 p.m.