hydro_part.h 2.77 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*******************************************************************************
 * This file is part of SWIFT.
 * Copyright (c) 2012 Pedro Gonnet (pedro.gonnet@durham.ac.uk)
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 ******************************************************************************/
19
20
#ifndef SWIFT_GADGET2_HYDRO_PART_H
#define SWIFT_GADGET2_HYDRO_PART_H
21

22
23
#include "cooling_struct.h"

24
/* Extra particle data not needed during the SPH loops over neighbours. */
25
26
struct xpart {

27
28
  /* Offset between current position and position at last tree rebuild. */
  float x_diff[3];
29
30
31

  /* Velocity at the last full step. */
  float v_full[3];
Matthieu Schaller's avatar
Matthieu Schaller committed
32

33
34
35
  /* Additional data used to record cooling information */
  struct cooling_xpart_data cooling_data;

36
} SWIFT_STRUCT_ALIGN;
37
38
39
40
41
42
43
44
45
46
47

/* Data of a single particle. */
struct part {

  /* Particle position. */
  double x[3];

  /* Particle predicted velocity. */
  float v[3];

  /* Particle acceleration. */
Matthieu Schaller's avatar
Matthieu Schaller committed
48
  float a_hydro[3];
49
50
51
52

  /* Particle cutoff radius. */
  float h;

53
54
  /* Particle mass. */
  float mass;
55

56
  /* Particle time of beginning of time-step. */
57
  int ti_begin;
58
59

  /* Particle time of end of time-step. */
60
  int ti_end;
61
62
63
64

  /* Particle density. */
  float rho;

65
66
  /* Particle entropy. */
  float entropy;
67

68
69
70
71
  /* Entropy time derivative */
  float entropy_dt;

  /* Derivative of the density with respect to smoothing length. */
72
  float rho_dh;
Matthieu Schaller's avatar
Matthieu Schaller committed
73
74
75

  union {

76
77
    struct {

78
      /* Number of neighbours. */
79
      float wcount;
Matthieu Schaller's avatar
Matthieu Schaller committed
80

81
      /* Number of neighbours spatial derivative. */
82
      float wcount_dh;
Matthieu Schaller's avatar
Matthieu Schaller committed
83

84
      /* Particle velocity curl. */
85
      float rot_v[3];
Matthieu Schaller's avatar
Matthieu Schaller committed
86

87
88
89
      /* Particle velocity divergence. */
      float div_v;

90
91
92
    } density;

    struct {
Matthieu Schaller's avatar
Matthieu Schaller committed
93

94
95
      /* Balsara switch */
      float balsara;
96

97
      /* Pressure over density squared (including drho/dh term) */
Matthieu Schaller's avatar
Matthieu Schaller committed
98
      float P_over_rho2;
99

100
      /* Particle sound speed. */
101
      float soundspeed;
Matthieu Schaller's avatar
Matthieu Schaller committed
102

Matthieu Schaller's avatar
Matthieu Schaller committed
103
104
      /* Signal velocity. */
      float v_sig;
105

106
107
108
      /* Time derivative of the smoothing length */
      float h_dt;

109
110
    } force;
  };
Matthieu Schaller's avatar
Matthieu Schaller committed
111

112
  /* Particle ID. */
113
  long long id;
114
115
116
117

  /* Pointer to corresponding gravity part. */
  struct gpart* gpart;

118
} SWIFT_STRUCT_ALIGN;
119
120

#endif /* SWIFT_GADGET2_HYDRO_PART_H */