GADGET-4
lightcone_particle_data.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * \copyright This file is part of the GADGET4 N-body/SPH code developed
3  * \copyright by Volker Springel. Copyright (C) 2014-2020 by Volker Springel
4  * \copyright (vspringel@mpa-garching.mpg.de) and all contributing authors.
5  *******************************************************************************/
6 
12 #ifndef LCPARTDATA_H
13 #define LCPARTDATA_H
14 
15 #include "gadgetconfig.h"
16 
17 #if defined(LIGHTCONE) && defined(LIGHTCONE_PARTICLES)
18 
19 #include "../data/constants.h"
20 #include "../data/dtypes.h"
21 #include "../data/idstorage.h"
22 #include "../data/macros.h"
23 #include "../data/symtensors.h"
24 
25 struct lightcone_particle_data
26 {
27  MyIntPosType IntPos[3];
28  MyFloat Vel[3];
29 #ifdef LIGHTCONE_OUTPUT_ACCELERATIONS
30  vector<MyFloat> GravAccel;
31 #endif
32  MyFloat Ascale;
33  MyIDStorage ID;
34 
35  long ipnest;
36 
37 #ifdef REARRANGE_OPTION
38  unsigned long long TreeID;
39 #endif
40 
41 #ifndef LEAN
42  private:
43  MyDouble Mass;
44  public:
45 #endif
46 
47 #ifndef LEAN
48  private:
49  unsigned char Type;
50  public:
51 #endif
52 
53 #if NSOFTCLASSES > 1
54  private:
55  unsigned char
56  SofteningClass : 7; /* we use only 7 bits here so that we can stuff 1 bit for ActiveFlag into it in the Tree_Points structure */
57  public:
58 #endif
59 
60 #if defined(MERGERTREE) && defined(SUBFIND)
61  // compactrank_t PrevRankInSubhalo; // 1-byte
62  MyHaloNrType PrevSubhaloNr; // 6-byte
63  approxlen PrevSizeOfSubhalo; // 2-byte
64 #endif
65 
66 #ifdef LIGHTCONE_IMAGE_COMP_HSML_VELDISP
67  int NumNgb;
68  MyFloat Hsml;
69  MyFloat VelDisp;
70  MyFloat Density;
71  MyFloat Vx;
72  MyFloat Vy;
73  MyFloat Vz;
74 #endif
75 
76 #if defined(LIGHTCONE_PARTICLES_GROUPS) && defined(FOF)
77  private:
78  bool FlagSaveDistance;
79 
80  public:
81  inline void setFlagSaveDistance(void) { FlagSaveDistance = true; }
82  inline void clearFlagSaveDistance(void) { FlagSaveDistance = false; }
83  inline bool getFlagSaveDistance(void) { return FlagSaveDistance; }
84 
85  inline unsigned char getSofteningClass(void)
86  {
87 #if NSOFTCLASSES > 1
88  return SofteningClass;
89 #else
90  return 0;
91 #endif
92  }
93  inline void setSofteningClass(unsigned char softclass)
94  {
95 #if NSOFTCLASSES > 1
96  SofteningClass = softclass;
97 #endif
98  }
99 
100 #endif
101 
102  inline unsigned char getType(void)
103  {
104 #ifdef LEAN
105  return 1;
106 #else
107  return Type;
108 #endif
109  }
110 
111  inline double getAscale(void) { return Ascale; }
112 
113  inline void setType(unsigned char type)
114  {
115 #ifndef LEAN
116  Type = type;
117 #endif
118  }
119 
120  inline MyDouble getMass(void)
121  {
122 #ifdef LEAN
123  return All.PartMass;
124 #else
125  return Mass;
126 #endif
127  }
128 
129  inline integertime get_Ti_Current(void) { return 0; }
130 
131  inline void setMass(MyDouble mass)
132  {
133 #ifndef LEAN
134  Mass = mass;
135 #endif
136  }
137 
138  inline float getOldAcc(void) { return 0; }
139 
140  inline signed char getTimeBinGrav(void) { return 0; }
141  inline signed char getTimeBinHydro(void) { return 0; }
142  inline int getGravCost(void) { return 0; }
143 
144 #if defined(MERGERTREE) && defined(SUBFIND)
145  inline void setPrevSubhaloNr(int nr) {}
146  inline void setPrevRankInSubhalo(int nr) {}
147  inline long long getPrevSubhaloNr(void) { return 0; }
148  inline int getPrevRankInSubhalo(void) { return 0; }
149 #endif
150 };
151 
152 #endif
153 #endif
global_data_all_processes All
Definition: main.cc:40
int integertime
Definition: constants.h:331
float MyDouble
Definition: dtypes.h:87
float MyFloat
Definition: dtypes.h:86
uint32_t MyIntPosType
Definition: dtypes.h:35