GLAMERDOC++
Gravitational Lensing Code Library
Loading...
Searching...
No Matches
gadgetio.hpp
1//
2// gadgetio.hpp
3//
4// Created by bmetcalf on 07.11.18.
5//
6
7#ifndef gadgetio_hpp
8#define gadgetio_hpp
9
10#include <vector>
11
12struct gadget_header
13{
14 int npart[6];
15 double mass[6];
16 double time;
17 double redshift;
18 int flag_sfr;
19 int flag_feedback;
20 int npartTotal[6];
21 int flag_cooling;
22 int num_files;
23 double BoxSize;
24 double Omega0;
25 double OmegaLambda;
26 double HubbleParam;
27 char fill[256 - 6 * 4 - 6 * 8 - 2 * 8 - 2 * 4 - 6 * 4 - 2 * 4 - 4 * 8]; /* fills to 256 Bytes */
28};
29
30struct gadget_particle_data
31{
32 float Pos[3];
33 float Vel[3];
34 float Mass;
35 int Type;
36
37 float Rho, U, Temp, Ne;
38};
39
40void load_snapshot_gadget2(char *fname
41 ,int nfiles
42 ,std::vector<gadget_particle_data> &p
43 ,std::vector<int> IDs
44 ,gadget_header &header1
45 ,int &NumPart
46 ,int &Ngas
47 );
48
49void load_snapshot_gadget2(char *fname
50 ,int nfiles
51 ,std::vector<ParticleData<float> > &xp
52 ,std::vector<int> &ntypes
53 );
54#endif /* gadgetio_hpp */