-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathorbit_particles.h
More file actions
226 lines (173 loc) · 3.93 KB
/
orbit_particles.h
File metadata and controls
226 lines (173 loc) · 3.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
/* Copyright 2019, 2020 Garrett Wright, Princeton Plasma Physic Lab
This file is part of CuOrbit.
CuOrbit is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
CuOrbit 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 General Public License
along with CuOrbit. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef SET_ORBIT_PARTICLES_H_
#define SET_ORBIT_PARTICLES_H_
#include <stdlib.h>
#ifdef __NVCC__
#include <cuda.h>
#include <cuda_runtime.h>
#endif
//not sure if this is better way yet
/* typedef struct Particle { */
/* double chrg; /\* 1 for ion, -1 for electron *\/ */
/* double zprt; */
/* double prot; /\* proton mass in proton units *\/ */
/* } Particle_t; */
typedef struct Particles Particles_t;
void initialize_Particles(Particles_t*, Config_t*);
Particles_t* Particles_ctor();
#ifdef __NVCC__
__host__ __device__
#endif
double* get_b(Particles_t*);
#ifdef __NVCC__
__host__ __device__
#endif
double* get_g(Particles_t*);
#ifdef __NVCC__
__host__ __device__
#endif
double* get_q(Particles_t*);
#ifdef __NVCC__
__host__ __device__
#endif
double* get_en(Particles_t*);
#ifdef __NVCC__
__host__ __device__
#endif
double* get_ri(Particles_t* ptcl_ptr);
#ifdef __NVCC__
__host__ __device__
#endif
double* get_pol(Particles_t*);
#ifdef __NVCC__
__host__ __device__
#endif
double* get_rho(Particles_t*);
#ifdef __NVCC__
__host__ __device__
#endif
double* get_rmu(Particles_t*);
#ifdef __NVCC__
__host__ __device__
#endif
int* get_otp(Particles_t*);
#ifdef __NVCC__
__host__ __device__
#endif
double* get_ptch(Particles_t*);
#ifdef __NVCC__
__host__ __device__
#endif
double* get_thet(Particles_t*);
#ifdef __NVCC__
__host__ __device__
#endif
double* get_pot(Particles_t*);
#ifdef __NVCC__
__host__ __device__
#endif
double* get_time(Particles_t*);
#ifdef __NVCC__
__host__ __device__
#endif
double* get_dt(Particles_t*);
#ifdef __NVCC__
__host__ __device__
#endif
double* get_tim1(Particles_t*);
#ifdef __NVCC__
__host__ __device__
#endif
double* get_wt(Particles_t*);
#ifdef __NVCC__
__host__ __device__
#endif
double* get_zet(Particles_t*);
#ifdef __NVCC__
__host__ __device__
#endif
double get_zprt(Particles_t*);
#ifdef __NVCC__
__host__ __device__
#endif
double get_prot(Particles_t*);
#ifdef __NVCC__
__host__ __device__
#endif
double get_prot(Particles_t*);
#ifdef __NVCC__
__host__ __device__
#endif
double get_ekev(Particles_t*);
#ifdef __NVCC__
__host__ __device__
#endif
double* get_dadp(Particles_t*);
#ifdef __NVCC__
__host__ __device__
#endif
double* get_dadt(Particles_t*);
#ifdef __NVCC__
__host__ __device__
#endif
double* get_dadz(Particles_t*);
#ifdef __NVCC__
__host__ __device__
#endif
double* get_padt(Particles_t*);
void field(Config_t*, int);
#ifdef __NVCC__
__host__ __device__
#endif
void kfield(Config_t*, int);
#ifdef __NVCC__
__host__ __device__
#endif
void ptrbak(Config_t*, int);
#ifdef __NVCC__
__host__ __device__
#endif
void ptrb2k(Config_t*, int);
/* generic high level dispatch*/
void do_particles(Config_t*);
/* launches for host/device */
#ifdef __NVCC__
__global__
void do_particles_dev(Config_t*);
#endif
void do_particles_host(Config_t*);
/* per particle kernel */
#ifdef __NVCC__
__host__ __device__
#endif
void do_particle_kernel(Config_t*, int);
#ifdef __NVCC__
__host__ __device__
#endif
void konestep(Config_t*, int);
#ifdef __NVCC__
__host__ __device__
#endif
void kupdate(Config_t* cfg_ptr, int k);
#ifdef __NVCC__
__host__ __device__
#endif
int get_idm(Particles_t*);
#ifdef __NVCC__
__host__ __device__
#endif
void modestep(Config_t*);
void sampledep(Config_t*);
#endif