ASCOT5
Loading...
Searching...
No Matches
afsi.c
Go to the documentation of this file.
1
5#include <string.h>
6#include <math.h>
7#include <hdf5_hl.h>
8#include "ascot5.h"
9#include "print.h"
10#include "gitver.h"
11#include "consts.h"
12#include "random.h"
13#include "simulate.h"
14#include "boschhale.h"
15#include "diag/dist_5D.h"
16#include "hdf5_interface.h"
17#include "hdf5io/hdf5_helpers.h"
18#include "hdf5io/hdf5_dist.h"
19#include "afsi.h"
20
23
25 afsi_data* react1, afsi_data* react2, real m1, real m2, int n, int iR,
26 int iphi, int iz, real* ppara1, real* pperp1, real* ppara2, real* pperp2);
28 int i, real m1, real m2, real mprod1, real mprod2, real Q,
29 real* ppara1, real* pperp1, real* ppara2, real* pperp2, real* vcom2,
30 real* pparaprod1, real* pperpprod1, real* pparaprod2, real* pperpprod2);
31void afsi_sample_5D(dist_5D_data* dist, int n, int iR, int iphi, int iz,
32 real* ppara, real* pperp);
33void afsi_sample_thermal(afsi_thermal_data* data, real mass, int n, int iR,
34 int iphi, int iz, real* ppara, real* pperp);
35real afsi_get_density(afsi_data* dist, int iR, int iphi, int iz);
36real afsi_get_volume(afsi_data* dist, int iR);
37
53void afsi_run(sim_data* sim, Reaction reaction, int n,
54 afsi_data* react1, afsi_data* react2, real mult,
55 dist_5D_data* prod1, dist_5D_data* prod2) {
56 /* QID for this run */
57 char qid[11];
59 strcpy(sim->qid, qid);
60
61 int mpi_rank = 0, mpi_root = 0; /* AFSI does not support MPI */
62 print_out0(VERBOSE_MINIMAL, mpi_rank, mpi_root, "AFSI5\n");
63 print_out0(VERBOSE_MINIMAL, mpi_rank, mpi_root,
64 "Tag %s\nBranch %s\n\n", GIT_VERSION, GIT_BRANCH);
65 dist_5D_init(prod1);
66 dist_5D_init(prod2);
67
68 random_init(&rdata, time((NULL)));
69 strcpy(sim->hdf5_out, sim->hdf5_in);
70 simulate_init(sim);
71
72 if( hdf5_interface_init_results(sim, qid, "afsi") ) {
73 print_out0(VERBOSE_MINIMAL, mpi_rank, mpi_root,
74 "\nInitializing output failed.\n"
75 "See stderr for details.\n");
76 /* Free data and terminate */
77 abort();
78 }
79
80 real m1, q1, m2, q2, mprod1, qprod1, mprod2, qprod2, Q;
82 reaction, &m1, &q1, &m2, &q2, &mprod1, &qprod1, &mprod2, &qprod2, &Q);
83
84 int n_r=0, n_phi=0, n_z=0;
85 if(react1->type == 1) {
86 n_r = react1->dist_5D->n_r;
87 n_phi = react1->dist_5D->n_phi;
88 n_z = react1->dist_5D->n_z;
89 }
90 else if(react1->type == 2) {
91 n_r = react1->dist_thermal->n_r;
92 n_phi = react1->dist_thermal->n_phi;
93 n_z = react1->dist_thermal->n_z;
94 }
95
96 #pragma omp parallel for
97 for(int iR = 0; iR < n_r; iR++) {
98 real* ppara1 = (real*) malloc(n*sizeof(real));
99 real* pperp1 = (real*) malloc(n*sizeof(real));
100 real* ppara2 = (real*) malloc(n*sizeof(real));
101 real* pperp2 = (real*) malloc(n*sizeof(real));
102 real* pparaprod1 = (real*) malloc(n*sizeof(real));
103 real* pperpprod1 = (real*) malloc(n*sizeof(real));
104 real* pparaprod2 = (real*) malloc(n*sizeof(real));
105 real* pperpprod2 = (real*) malloc(n*sizeof(real));
106
107 real vol = afsi_get_volume(react1, iR);
108 for(int iphi = 0; iphi < n_phi; iphi++) {
109 for(int iz = 0; iz < n_z; iz++) {
110 real density1 = afsi_get_density(react1, iR, iphi, iz);
111 real density2 = afsi_get_density(react2, iR, iphi, iz);
112 if(density1 > 0 && density2 > 0) {
114 react1, react2, m1, m2, n, iR, iphi, iz,
115 ppara1, pperp1, ppara2, pperp2);
116 for(int i = 0; i < n; i++) {
117 real vcom2;
119 i, m1, m2, mprod1, mprod2, Q,
120 ppara1, pperp1, ppara2, pperp2, &vcom2,
121 pparaprod1, pperpprod1, pparaprod2, pperpprod2);
122 real E = 0.5 * ( m1 * m2 ) / ( m1 + m2 ) * vcom2;
123
124 real weight = density1 * density2 * sqrt(vcom2)
125 * boschhale_sigma(reaction, E)/n*vol;
126
127 int ippara = floor(
128 (pparaprod1[i] - prod1->min_ppara) * prod1->n_ppara
129 / ( prod1->max_ppara - prod1->min_ppara ) );
130 int ipperp = floor(
131 (pperpprod1[i] - prod1->min_pperp) * prod1->n_pperp
132 / ( prod1->max_pperp - prod1->min_pperp ) );
133 if( 0 <= ippara && ippara < prod1->n_ppara &&
134 0 <= ipperp && ipperp < prod1->n_pperp) {
136 iR, iphi, iz, ippara, ipperp, 0, 0,
137 prod1->step_6, prod1->step_5, prod1->step_4,
138 prod1->step_3, prod1->step_2, prod1->step_1)]
139 += weight * mult;
140 }
141
142 ippara = floor(
143 (pparaprod2[i] - prod2->min_ppara) * prod2->n_ppara
144 / ( prod2->max_ppara - prod2->min_ppara ) );
145 ipperp = floor(
146 (pperpprod2[i] - prod2->min_pperp) * prod2->n_pperp
147 / ( prod2->max_pperp - prod2->min_pperp ) );
148 if( 0 <= ippara && ippara < prod2->n_ppara &&
149 0 <= ipperp && ipperp < prod2->n_pperp) {
151 iR, iphi, iz, ippara, ipperp, 0, 0,
152 prod2->step_6, prod2->step_5, prod2->step_4,
153 prod2->step_3, prod2->step_2, prod2->step_1)]
154 += weight * mult;
155 }
156 }
157 }
158 else {
159 /* Do nothing */
160 }
161 }
162 }
163 free(ppara1);
164 free(ppara2);
165 free(pperp1);
166 free(pperp2);
167 free(pparaprod1);
168 free(pparaprod2);
169 free(pperpprod1);
170 free(pperpprod2);
171 }
172
173 m1 = m1 / CONST_U;
174 m2 = m2 / CONST_U;
175 mprod1 = mprod1 / CONST_U;
176 mprod2 = mprod2 / CONST_U;
177 int c1 = (int)rint(q1 / CONST_E);
178 int c2 = (int)rint(q2 / CONST_E);
179 int cprod1 = (int)rint(qprod1 / CONST_E);
180 int cprod2 = (int)rint(qprod2 / CONST_E);
181
182 hid_t f = hdf5_open(sim->hdf5_out);
183 if(f < 0) {
184 print_err("Error: File not found.\n");
185 abort();
186 }
187 char path[300];
188 sprintf(path, "/results/afsi_%s/reaction", sim->qid);
189 hid_t reactiondata = H5Gcreate2(f, path, H5P_DEFAULT, H5P_DEFAULT,
190 H5P_DEFAULT);
191 if(reactiondata < 0) {
192 print_err("Failed to write reaction data.\n");
193 abort();
194 }
195 hsize_t size = 1;
196 real q = Q / CONST_E;
197 if(H5LTmake_dataset_double(reactiondata, "m1", 1, &size, &m1)) {
198 print_err("Failed to write reaction data.\n");
199 abort();
200 }
201 if(H5LTmake_dataset_double(reactiondata, "m2", 1, &size, &m2)) {
202 print_err("Failed to write reaction data.\n");
203 abort();
204 }
205 if(H5LTmake_dataset_double(reactiondata, "mprod1", 1, &size, &mprod1)) {
206 print_err("Failed to write reaction data.\n");
207 abort();
208 }
209 if(H5LTmake_dataset_double(reactiondata, "mprod2", 1, &size, &mprod2)) {
210 print_err("Failed to write reaction data.\n");
211 abort();
212 }
213 if(H5LTmake_dataset_double(reactiondata, "q", 1, &size, &q)) {
214 print_err("Failed to write reaction data.\n");
215 abort();
216 }
217 if(H5LTmake_dataset_int(reactiondata, "q1", 1, &size, &c1)) {
218 print_err("Failed to write reaction data.\n");
219 abort();
220 }
221 if(H5LTmake_dataset_int(reactiondata, "q2", 1, &size, &c2)) {
222 print_err("Failed to write reaction data.\n");
223 abort();
224 }
225 if(H5LTmake_dataset_int(reactiondata, "qprod1", 1, &size, &cprod1)) {
226 print_err("Failed to write reaction data.\n");
227 abort();
228 }
229 if(H5LTmake_dataset_int(reactiondata, "qprod2", 1, &size, &cprod2)) {
230 print_err("Failed to write reaction data.\n");
231 abort();
232 }
233 if(H5Gclose(reactiondata)) {
234 print_err("Failed to write reaction data.\n");
235 abort();
236 }
237
238 sprintf(path, "/results/afsi_%s/prod1dist5d", sim->qid);
239 if( hdf5_dist_write_5D(f, path, prod1) ) {
240 print_err("Warning: 5D distribution could not be written.\n");
241 }
242 sprintf(path, "/results/afsi_%s/prod2dist5d", sim->qid);
243 if( hdf5_dist_write_5D(f, path, prod2) ) {
244 print_err("Warning: 5D distribution could not be written.\n");
245 }
246 if(hdf5_close(f)) {
247 print_err("Failed to close the file.\n");
248 abort();
249 }
250
251 print_out0(VERBOSE_MINIMAL, mpi_rank, mpi_root, "\nDone\n");
252}
253
271 afsi_data* react1, afsi_data* react2, real m1, real m2, int n, int iR,
272 int iphi, int iz, real* ppara1, real* pperp1, real* ppara2, real* pperp2) {
273
274 if(react1->type == 1) {
275 afsi_sample_5D(react1->dist_5D, n, iR, iphi, iz, ppara1, pperp1);
276 }
277 else if(react1->type == 2) {
279 react1->dist_thermal, m1, n, iR, iphi, iz, ppara1, pperp1);
280 }
281
282 if(react2->type == 1) {
283 afsi_sample_5D(react2->dist_5D, n, iR, iphi, iz, ppara2, pperp2);
284 }
285 else if(react2->type == 2) {
287 react2->dist_thermal, m2, n, iR, iphi, iz, ppara2, pperp2);
288 }
289}
290
311 int i, real m1, real m2, real mprod1, real mprod2, real Q,
312 real* ppara1, real* pperp1, real* ppara2, real* pperp2, real* vcom2,
313 real* pparaprod1, real* pperpprod1, real* pparaprod2, real* pperpprod2) {
314
317
318 real v1x = cos(rn1) * pperp1[i] / m1;
319 real v1y = sin(rn1) * pperp1[i] / m1;
320 real v1z = ppara1[i] / m1;
321
322 real v2x = cos(rn2) * pperp2[i] / m2;
323 real v2y = sin(rn2) * pperp2[i] / m2;
324 real v2z = ppara2[i] / m2;
325
326 *vcom2 = (v1x - v2x) * (v1x - v2x)
327 + (v1y - v2y) * (v1y - v2y)
328 + (v1z - v2z) * (v1z - v2z);
329
330 // Velocity of the system's center of mass
331 real v_cm[3];
332 v_cm[0] = ( m1 * v1x + m2 * v2x ) / ( m1 + m2 );
333 v_cm[1] = ( m1 * v1y + m2 * v2y ) / ( m1 + m2 );
334 v_cm[2] = ( m1 * v1z + m2 * v2z ) / ( m1 + m2 );
335
336 // Total kinetic energy after the reaction in CM frame
337 real ekin = Q
338 + 0.5 * m1 * ( (v1x - v_cm[0])*(v1x - v_cm[0])
339 + (v1y - v_cm[1])*(v1y - v_cm[1])
340 + (v1z - v_cm[2])*(v1z - v_cm[2]) )
341 + 0.5 * m2 * ( (v2x - v_cm[0])*(v2x - v_cm[0])
342 + (v2y - v_cm[1])*(v2y - v_cm[1])
343 + (v2z - v_cm[2])*(v2z - v_cm[2]) );
344
345 // Speed and velocity of product 2 in CM frame
346 rn1 = random_uniform(rdata);
347 rn2 = random_uniform(rdata);
348 real phi = CONST_2PI * rn1;
349 real theta = acos( 2 * ( rn2 - 0.5 ) );
350 real vnorm = sqrt( 2.0 * ekin / ( mprod2 * ( 1.0 + mprod2 / mprod1 ) ) );
351
352 real v2_cm[3];
353 v2_cm[0] = vnorm * sin(theta) * cos(phi);
354 v2_cm[1] = vnorm * sin(theta) * sin(phi);
355 v2_cm[2] = vnorm * cos(theta);
356
357 // Products' velocities in lab frame
358 real vprod1[3], vprod2[3];
359 vprod1[0] = -(mprod2/mprod1) * v2_cm[0] + v_cm[0];
360 vprod1[1] = -(mprod2/mprod1) * v2_cm[1] + v_cm[1];
361 vprod1[2] = -(mprod2/mprod1) * v2_cm[2] + v_cm[2];
362 vprod2[0] = v2_cm[0] + v_cm[0];
363 vprod2[1] = v2_cm[1] + v_cm[1];
364 vprod2[2] = v2_cm[2] + v_cm[2];
365
366 // ppara and pperp
367 pparaprod1[i] = vprod1[2] * mprod1;
368 pperpprod1[i] = sqrt( vprod1[0]*vprod1[0] + vprod1[1]*vprod1[1] ) * mprod1;
369 pparaprod2[i] = vprod2[2] * mprod2;
370 pperpprod2[i] = sqrt( vprod2[0]*vprod2[0] + vprod2[1]*vprod2[1] ) * mprod2;
371}
372
384void afsi_sample_5D(dist_5D_data* dist, int n, int iR, int iphi, int iz,
385 real* ppara, real* pperp) {
386 real* cumdist = (real*) malloc(dist->n_ppara*dist->n_pperp*sizeof(real));
387
388 for(int ippara = 0; ippara < dist->n_ppara; ippara++) {
389 for(int ipperp = 0; ipperp < dist->n_pperp; ipperp++) {
390 if(ippara == 0 && ipperp == 0) {
391 cumdist[0] = dist->histogram[dist_5D_index(
392 iR, iphi, iz, 0, 0, 0, 0, dist->step_6, dist->step_5,
393 dist->step_4, dist->step_3, dist->step_2,
394 dist->step_1)];
395 } else {
396 cumdist[ippara*dist->n_pperp+ipperp] =
397 cumdist[ippara*dist->n_pperp+ipperp-1]
398 + dist->histogram[dist_5D_index(
399 iR, iphi, iz, ippara, ipperp, 0, 0, dist->step_6,
400 dist->step_5, dist->step_4, dist->step_3, dist->step_2,
401 dist->step_1)];
402 }
403 }
404 }
405 for(int ippara = 0; ippara < dist->n_ppara; ippara++) {
406 for(int ipperp = 0; ipperp < dist->n_pperp; ipperp++) {
407 cumdist[ippara*dist->n_pperp+ipperp] /=
408 cumdist[dist->n_ppara*dist->n_pperp-1];
409 }
410 }
411
412 for(int i = 0; i < n; i++) {
414 for(int j = 0; j < dist->n_ppara*dist->n_pperp; j++) {
415 if(cumdist[j] > r) {
416 pperp[i] = dist->min_pperp + (j % dist->n_pperp + 0.5)
417 * (dist->max_pperp - dist->min_pperp) / dist->n_pperp;
418 ppara[i] = dist->min_ppara + (j / dist->n_pperp + 0.5)
419 * (dist->max_ppara - dist->min_ppara) / dist->n_ppara;
420 break;
421 }
422 }
423 }
424 free(cumdist);
425}
426
443void afsi_sample_thermal(afsi_thermal_data* data, real mass, int n, int iR,
444 int iphi, int iz, real* ppara, real* pperp) {
445 int ind = iR * (data->n_phi * data->n_z) + iphi * data->n_z + iz;
446 real temp = data->temperature[ind];
447
448 for(int i = 0; i < n; i++) {
449 real r1, r2, r3, r4, E;
450
451 r1 = random_uniform(rdata);
452 r2 = random_uniform(rdata);
453 r3 = cos( 0.5 * random_uniform(rdata) * CONST_PI );
454 E = -temp * ( log(r1) + log(r2) * r3 * r3 );
455
456 r4 = 1.0 - 2 * random_uniform(rdata);
457 pperp[i] = sqrt( ( 1 - r4*r4 ) * 2 * E * mass);
458 ppara[i] = r4 * sqrt(2 * E * mass);
459 }
460}
461
471real afsi_get_density(afsi_data* dist, int iR, int iphi, int iz) {
472 if(dist->type == 1) {
473 real vol = afsi_get_volume(dist, iR);
474
475 real density = 0.0;
476 for(int ippara = 0; ippara < dist->dist_5D->n_ppara; ippara++) {
477 for(int ipperp = 0; ipperp < dist->dist_5D->n_pperp; ipperp++) {
478 density += dist->dist_5D->histogram[dist_5D_index(
479 iR, iphi, iz, ippara, ipperp, 0, 0,
480 dist->dist_5D->step_6, dist->dist_5D->step_5,
481 dist->dist_5D->step_4, dist->dist_5D->step_3,
482 dist->dist_5D->step_2, dist->dist_5D->step_1)] / vol;
483 }
484 }
485 return density;
486 }
487
488 else if(dist->type == 2) {
489 return dist->dist_thermal->density[
490 iR * dist->dist_thermal->n_phi * dist->dist_thermal->n_z
491 + iphi * dist->dist_thermal->n_z + iz];
492 }
493
494 else {
495 return 0;
496 }
497}
498
507 real dR, dz;
508
509 if(dist->type == 1) {
510 dR = (dist->dist_5D->max_r - dist->dist_5D->min_r) / dist->dist_5D->n_r;
511 dz = (dist->dist_5D->max_z - dist->dist_5D->min_z) / dist->dist_5D->n_z;
512 return CONST_2PI*(dist->dist_5D->min_r + iR * dR + 0.5*dR)*dR*dz;
513 }
514
515 else if(dist->type == 2) {
516 dR = (dist->dist_thermal->max_r - dist->dist_thermal->min_r)
517 / dist->dist_thermal->n_r;
518 dz = (dist->dist_thermal->max_z - dist->dist_thermal->min_z)
519 / dist->dist_thermal->n_z;
520 return CONST_2PI*(dist->dist_thermal->min_r + iR * dR + 0.5*dR)*dR*dz;
521 }
522 return 0;
523}
524
531 printf("%d %le %le\n", dist1->n_r, dist1->min_r, dist1->max_r);
532 printf("%d %le %le\n", dist1->n_phi, dist1->min_phi, dist1->max_phi);
533 printf("%d %le %le\n", dist1->n_z, dist1->min_z, dist1->max_z);
534 printf("%d %le %le\n", dist1->n_ppara, dist1->min_ppara, dist1->max_ppara);
535 printf("%d %le %le\n", dist1->n_pperp, dist1->min_pperp, dist1->max_pperp);
536 printf("%d %le %le\n", dist1->n_time, dist1->min_time, dist1->max_time);
537 printf("%d %le %le\n", dist1->n_q, dist1->min_q, dist1->max_q);
538
539 real sum = 0.0;
540
541 int ncell = dist1->n_r * dist1->n_phi * dist1->n_z * dist1->n_ppara
542 * dist1->n_pperp * dist1->n_time * dist1->n_q;
543 for(int i = 0; i < ncell; i++) {
544 sum += dist1->histogram[i];
545 }
546
547 printf("%le\n", sum);
548}
549
555
556 data.n_r = 1;
557 data.min_r = 0.1;
558 data.max_r = 1;
559 data.n_phi = 1;
560 data.min_phi = 0;
561 data.max_phi = 360;
562 data.n_z = 1;
563 data.min_z = -1;
564 data.max_z = 1;
565
566 real temperature = 1e3;
567 real density = 1e19;
568
569 data.temperature = &temperature;
570 data.density = &density;
571
572 int n = 100000;
573 real* ppara = (real*) malloc(n*sizeof(real));
574 real* pperp = (real*) malloc(n*sizeof(real));
575
576 afsi_sample_thermal(&data, 3.343e-27, n, 0, 0, 0, ppara, pperp);
577
578 for(int i = 0; i < n; i++) {
579 printf("%le %le\n", ppara[i], pperp[i]);
580 }
581}
random_data rdata
Definition afsi.c:22
void afsi_run(sim_data *sim, Reaction reaction, int n, afsi_data *react1, afsi_data *react2, real mult, dist_5D_data *prod1, dist_5D_data *prod2)
Calculate fusion source from two arbitrary ion distributions.
Definition afsi.c:53
void afsi_sample_thermal(afsi_thermal_data *data, real mass, int n, int iR, int iphi, int iz, real *ppara, real *pperp)
Sample ppara and pperp from a thermal (Maxwellian) population.
Definition afsi.c:443
void afsi_test_thermal()
Test thermal source.
Definition afsi.c:553
real afsi_get_volume(afsi_data *dist, int iR)
Get physical volume of a distribution cell.
Definition afsi.c:506
void afsi_sample_5D(dist_5D_data *dist, int n, int iR, int iphi, int iz, real *ppara, real *pperp)
Sample ppara and pperp from a 5D distribution.
Definition afsi.c:384
void afsi_compute_product_momenta(int i, real m1, real m2, real mprod1, real mprod2, real Q, real *ppara1, real *pperp1, real *ppara2, real *pperp2, real *vcom2, real *pparaprod1, real *pperpprod1, real *pparaprod2, real *pperpprod2)
Compute momenta of reaction products.
Definition afsi.c:310
real afsi_get_density(afsi_data *dist, int iR, int iphi, int iz)
Get particle density.
Definition afsi.c:471
void afsi_sample_reactant_momenta(afsi_data *react1, afsi_data *react2, real m1, real m2, int n, int iR, int iphi, int iz, real *ppara1, real *pperp1, real *ppara2, real *pperp2)
Sample velocities from reactant distributions.
Definition afsi.c:270
void afsi_test_dist(dist_5D_data *dist1)
Test distribution.
Definition afsi.c:530
Main header file for ASCOT5.
double real
Definition ascot5.h:85
void boschhale_reaction(Reaction reaction, real *m1, real *q1, real *m2, real *q2, real *mprod1, real *qprod1, real *mprod2, real *qprod2, real *Q)
Get masses and charges of particles participating in the reaction and the released energy.
Definition boschhale.c:28
real boschhale_sigma(Reaction reaction, real E)
Estimate cross-section for a given fusion reaction.
Definition boschhale.c:87
Header file for boschdale.c.
Reaction
Available reactions.
Definition boschhale.h:13
Header file containing physical and mathematical constants.
#define CONST_U
Atomic mass unit in kilograms [kg]
Definition consts.h:29
#define CONST_PI
pi
Definition consts.h:11
#define CONST_2PI
2*pi
Definition consts.h:14
#define CONST_E
Elementary charge [C]
Definition consts.h:32
size_t dist_5D_index(int i_r, int i_phi, int i_z, int i_ppara, int i_pperp, int i_time, int i_q, size_t step_6, size_t step_5, size_t step_4, size_t step_3, size_t step_2, size_t step_1)
Function for calculating the index in the histogram array.
Definition dist_5D.c:17
int dist_5D_init(dist_5D_data *data)
Initializes distribution from offload data.
Definition dist_5D.c:35
Header file for dist_5D.c.
int hdf5_dist_write_5D(hid_t f, char *path, dist_5D_data *dist)
Write 5D distribution to an existing result group.
Definition hdf5_dist.c:26
herr_t hdf5_close(hid_t file_id)
Close access to given hdf5 file identifier. A negative value is returned on failure.
hid_t hdf5_open(const char *filename)
Open a hdf5 file for reading and writing. A negative value is returned on failure.
Header file for hdf5_helpers.h.
int hdf5_interface_init_results(sim_data *sim, char *qid, char *run)
Initialize run group.
void hdf5_generate_qid(char *qid)
Generate an identification number for a run.
Header file for hdf5_interface.c.
Header file for math.c.
Macros for printing console output.
@ VERBOSE_MINIMAL
Definition print.h:19
#define print_out0(v, rank, root,...)
Print to standard output only for root process.
Definition print.h:36
#define print_err(...)
Print to standard error.
Definition print.h:42
Header file for random.c.
void * random_data
Definition random.h:87
#define random_uniform(data)
Definition random.h:96
#define random_init(data, seed)
Definition random.h:94
void simulate_init(sim_data *sim)
Initialize simulation data struct.
Definition simulate.c:306
Header file for simulate.c.
Wrapper around input data structures.
Definition afsi.h:39
dist_5D_data * dist_5D
Definition afsi.h:41
afsi_thermal_data * dist_thermal
Definition afsi.h:42
int type
Definition afsi.h:40
Structure for passing in 2D thermal temperature and density.
Definition afsi.h:19
real * density
Definition afsi.h:33
real * temperature
Definition afsi.h:32
Histogram parameters.
Definition dist_5D.h:15
real min_time
Definition dist_5D.h:37
real max_r
Definition dist_5D.h:18
real max_pperp
Definition dist_5D.h:34
size_t step_5
Definition dist_5D.h:48
real min_phi
Definition dist_5D.h:21
size_t step_3
Definition dist_5D.h:46
real max_phi
Definition dist_5D.h:22
real min_ppara
Definition dist_5D.h:29
size_t step_1
Definition dist_5D.h:44
real max_z
Definition dist_5D.h:26
real max_time
Definition dist_5D.h:38
size_t step_2
Definition dist_5D.h:45
int n_ppara
Definition dist_5D.h:28
size_t step_6
Definition dist_5D.h:49
int n_pperp
Definition dist_5D.h:32
real min_z
Definition dist_5D.h:25
real max_ppara
Definition dist_5D.h:30
real min_r
Definition dist_5D.h:17
real max_q
Definition dist_5D.h:42
real * histogram
Definition dist_5D.h:51
real min_pperp
Definition dist_5D.h:33
size_t step_4
Definition dist_5D.h:47
real min_q
Definition dist_5D.h:41
Simulation data struct.
Definition simulate.h:57
char qid[256]
Definition simulate.h:128
char hdf5_in[256]
Definition simulate.h:126
char hdf5_out[256]
Definition simulate.h:127