part.h 2.41 KB
Newer Older
1
/*******************************************************************************
2
 * This file is part of SWIFT.
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 * Coypright (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/>.
 * 
 ******************************************************************************/


/* Some constants. */
#define part_maxwait                    3
#define part_maxunlock                  39
24
#define part_dtmax                      10
25
26


27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/* Condensed data of a single particle. */
struct cpart {

    /* Particle position. */
    double x[3];
    
    /* Particle cutoff radius. */
    float h;
    
    /* Particle time-step. */
    float dt;
    
    } __attribute__((aligned (32)));
    

42
43
44
/* Data of a single particle. */
struct part {

45
46
47
    /* Particle velocity. */
    float v[3] __attribute__((aligned (16)));
    
48
49
    /* Particle mass. */
    float mass;
50
    
Pedro Gonnet's avatar
Pedro Gonnet committed
51
52
53
    /* Particle density. */
    float rho;
    
54
    /* Particle pressure. */
Pedro Gonnet's avatar
Pedro Gonnet committed
55
    // float P;
56
    
57
58
    /* Aggregate quantities. */
    float POrho2;
59
60
61
62
    
    /* Change in particle energy over time. */
    float u_dt;
    
63
64
65
    /* Change in smoothing length over time. */
    float h_dt;
    
66
67
68
    /* Particle acceleration. */
    float a[3] __attribute__((aligned (16)));
    
69
70
71
72
    /* Derivative of the density with respect to this particle's smoothing length. */
    float rho_dh;
    
    /* Particle number density. */
73
    // int icount;
74
    float wcount;
75
    float wcount_dh;
76
    
Pedro Gonnet's avatar
Pedro Gonnet committed
77
78
79
80
81
82
    /* Particle internal energy. */
    float u;
    
    /* Particle ID. */
    unsigned long long id;
    
83
84
85
    /* Old position, at last tree rebuild. */
    double x_old[3];
    
Pedro Gonnet's avatar
Pedro Gonnet committed
86
87
88
89
90
91
92
93
94
    /* Particle position. */
    double x[3];
    
    /* Particle cutoff radius. */
    float h;
    
    /* Particle time-step. */
    float dt;
    
95
96
97
    } __attribute__((aligned (32)));