ASCOT5
Loading...
Searching...
No Matches
hdf5_bfield.c
Go to the documentation of this file.
1
17#include <stdlib.h>
18#include <stdio.h>
19#include <math.h>
20#include <hdf5.h>
21#include <hdf5_hl.h>
22#include "../ascot5.h"
23#include "../math.h"
24#include "../print.h"
25#include "../consts.h"
26#include "../B_field.h"
27#include "../Bfield/B_2DS.h"
28#include "../Bfield/B_3DS.h"
29#include "../Bfield/B_STS.h"
30#include "../Bfield/B_TC.h"
31#include "../Bfield/B_GS.h"
32#include "hdf5_helpers.h"
33#include "hdf5_bfield.h"
34
35#define BPATH
37int hdf5_bfield_read_2DS(hid_t f, B_2DS_offload_data* offload_data,
38 real** offload_array, char* qid);
39int hdf5_bfield_read_3DS(hid_t f, B_3DS_offload_data* offload_data,
40 real** offload_array, char* qid);
41int hdf5_bfield_read_STS(hid_t f, B_STS_offload_data* offload_data,
42 real** offload_array, char* qid);
43int hdf5_bfield_read_TC(hid_t f, B_TC_offload_data* offload_data,
44 real** offload_array, char* qid);
45int hdf5_bfield_read_GS(hid_t f, B_GS_offload_data* offload_data,
46 real** offload_array, char* qid);
47
70 real** offload_array, char* qid) {
71
72 char path[256]; // Storage array required for hdf5_gen_path() calls
73 int err = 1; // Error flag which is nullified if data is read succesfully
74
75 /* Read data the QID corresponds to */
76
77 hdf5_gen_path("/bfield/B_TC_XXXXXXXXXX", qid, path);
78 if( !hdf5_find_group(f, path) ) {
79 offload_data->type = B_field_type_TC;
80 err = hdf5_bfield_read_TC(f, &(offload_data->BTC),
81 offload_array, qid);
82 }
83
84 hdf5_gen_path("/bfield/B_GS_XXXXXXXXXX", qid, path);
85 if( !hdf5_find_group(f, path) ) {
86 offload_data->type = B_field_type_GS;
87 err = hdf5_bfield_read_GS(f, &(offload_data->BGS),
88 offload_array, qid);
89 }
90
91 hdf5_gen_path("/bfield/B_2DS_XXXXXXXXXX", qid, path);
92 if( !hdf5_find_group(f, path) ) {
93 offload_data->type = B_field_type_2DS;
94 err = hdf5_bfield_read_2DS(f, &(offload_data->B2DS),
95 offload_array, qid);
96 }
97
98 hdf5_gen_path("/bfield/B_3DS_XXXXXXXXXX", qid, path);
99 if( !hdf5_find_group(f, path) ) {
100 offload_data->type = B_field_type_3DS;
101 err = hdf5_bfield_read_3DS(f, &(offload_data->B3DS),
102 offload_array, qid);
103 }
104
105 hdf5_gen_path("/bfield/B_STS_XXXXXXXXXX", qid, path);
106 if( !hdf5_find_group(f, path) ) {
107 offload_data->type = B_field_type_STS;
108 err = hdf5_bfield_read_STS(f, &(offload_data->BSTS),
109 offload_array, qid);
110 }
111
112 /* Initialize if data was read succesfully */
113 if(!err) {
114 err = B_field_init_offload(offload_data, offload_array);
115 }
116
117 return err;
118}
119
157int hdf5_bfield_read_2DS(hid_t f, B_2DS_offload_data* offload_data,
158 real** offload_array, char* qid) {
159 #undef BPATH
160 #define BPATH "/bfield/B_2DS_XXXXXXXXXX/"
161
162 /* Read and initialize psi and magnetic field Rz-grid */
163 if( hdf5_read_int(BPATH "nr", &(offload_data->n_r),
164 f, qid, __FILE__, __LINE__) ) {return 1;}
165 if( hdf5_read_int(BPATH "nz", &(offload_data->n_z),
166 f, qid, __FILE__, __LINE__) ) {return 1;}
167 if( hdf5_read_double(BPATH "rmin", &(offload_data->r_min),
168 f, qid, __FILE__, __LINE__) ) {return 1;}
169 if( hdf5_read_double(BPATH "rmax", &(offload_data->r_max),
170 f, qid, __FILE__, __LINE__) ) {return 1;}
171 if( hdf5_read_double(BPATH "zmin", &(offload_data->z_min),
172 f, qid, __FILE__, __LINE__) ) {return 1;}
173 if( hdf5_read_double(BPATH "zmax", &(offload_data->z_max),
174 f, qid, __FILE__, __LINE__) ) {return 1;}
175
176 /* Allocate offload_array; psi and each component (B_R, B_phi, B_z) has
177 * size = n_r*n_z */
178 int B_size = offload_data->n_r * offload_data->n_z;
179 *offload_array = (real*) malloc(4 * B_size * sizeof(real));
180
181 /* Read psi and B values */
182 if( hdf5_read_double(BPATH "psi", &(*offload_array)[0*B_size],
183 f, qid, __FILE__, __LINE__) ) {return 1;}
184 if( hdf5_read_double(BPATH "br", &(*offload_array)[1*B_size],
185 f, qid, __FILE__, __LINE__) ) {return 1;}
186 if( hdf5_read_double(BPATH "bphi", &(*offload_array)[2*B_size],
187 f, qid, __FILE__, __LINE__) ) {return 1;}
188 if( hdf5_read_double(BPATH "bz", &(*offload_array)[3*B_size],
189 f, qid, __FILE__, __LINE__) ) {return 1;}
190
191 /* Read the poloidal flux (psi) values at magnetic axis and separatrix. */
192 if( hdf5_read_double(BPATH "psi0", &(offload_data->psi0),
193 f, qid, __FILE__, __LINE__) ) {return 1;}
194 if( hdf5_read_double(BPATH "psi1", &(offload_data->psi1),
195 f, qid, __FILE__, __LINE__) ) {return 1;}
196
197 /* Read magnetic axis R and z coordinates */
198 if( hdf5_read_double(BPATH "axisr", &(offload_data->axis_r),
199 f, qid, __FILE__, __LINE__) ) {return 1;}
200 if( hdf5_read_double(BPATH "axisz", &(offload_data->axis_z),
201 f, qid, __FILE__, __LINE__) ) {return 1;}
202
203 return 0;
204}
205
256int hdf5_bfield_read_3DS(hid_t f, B_3DS_offload_data* offload_data,
257 real** offload_array, char* qid) {
258 #undef BPATH
259 #define BPATH "/bfield/B_3DS_XXXXXXXXXX/"
260
261 /* Read and initialize magnetic field Rpz-grid */
262 if( hdf5_read_int(BPATH "b_nr", &(offload_data->Bgrid_n_r),
263 f, qid, __FILE__, __LINE__) ) {return 1;}
264 if( hdf5_read_int(BPATH "b_nz", &(offload_data->Bgrid_n_z),
265 f, qid, __FILE__, __LINE__) ) {return 1;}
266 if( hdf5_read_double(BPATH "b_rmin", &(offload_data->Bgrid_r_min),
267 f, qid, __FILE__, __LINE__) ) {return 1;}
268 if( hdf5_read_double(BPATH "b_rmax", &(offload_data->Bgrid_r_max),
269 f, qid, __FILE__, __LINE__) ) {return 1;}
270 if( hdf5_read_double(BPATH "b_zmin", &(offload_data->Bgrid_z_min),
271 f, qid, __FILE__, __LINE__) ) {return 1;}
272 if( hdf5_read_double(BPATH "b_zmax", &(offload_data->Bgrid_z_max),
273 f, qid, __FILE__, __LINE__) ) {return 1;}
274
275 if( hdf5_read_int(BPATH "b_nphi", &(offload_data->Bgrid_n_phi),
276 f, qid, __FILE__, __LINE__) ) {return 1;}
277 if( hdf5_read_double(BPATH "b_phimin", &(offload_data->Bgrid_phi_min),
278 f, qid, __FILE__, __LINE__) ) {return 1;}
279 if( hdf5_read_double(BPATH "b_phimax", &(offload_data->Bgrid_phi_max),
280 f, qid, __FILE__, __LINE__) ) {return 1;}
281
282 // Convert to radians
283 offload_data->Bgrid_phi_min = math_deg2rad(offload_data->Bgrid_phi_min);
284 offload_data->Bgrid_phi_max = math_deg2rad(offload_data->Bgrid_phi_max);
285
286 /* Read and initialize psi field Rz-grid */
287 if( hdf5_read_int(BPATH "psi_nr", &(offload_data->psigrid_n_r),
288 f, qid, __FILE__, __LINE__) ) {return 1;}
289 if( hdf5_read_int(BPATH "psi_nz", &(offload_data->psigrid_n_z),
290 f, qid, __FILE__, __LINE__) ) {return 1;}
291 if( hdf5_read_double(BPATH "psi_rmin", &(offload_data->psigrid_r_min),
292 f, qid, __FILE__, __LINE__) ) {return 1;}
293 if( hdf5_read_double(BPATH "psi_rmax", &(offload_data->psigrid_r_max),
294 f, qid, __FILE__, __LINE__) ) {return 1;}
295 if( hdf5_read_double(BPATH "psi_zmin", &(offload_data->psigrid_z_min),
296 f, qid, __FILE__, __LINE__) ) {return 1;}
297 if( hdf5_read_double(BPATH "psi_zmax", &(offload_data->psigrid_z_max),
298 f, qid, __FILE__, __LINE__) ) {return 1;}
299
300 /* Allocate offload_array storing psi and the three components of B */
301 int psi_size = offload_data->psigrid_n_r*offload_data->psigrid_n_z;
302 int B_size = offload_data->Bgrid_n_r * offload_data->Bgrid_n_z
303 * offload_data->Bgrid_n_phi;
304
305 *offload_array = (real*) malloc((psi_size + 3 * B_size) * sizeof(real));
306 offload_data->offload_array_length = psi_size + 3 * B_size;
307
308 /* Read psi */
309 if( hdf5_read_double(BPATH "psi", &(*offload_array)[3*B_size],
310 f, qid, __FILE__, __LINE__) ) {return 1;}
311
312 /* Read the magnetic field */
313 if( hdf5_read_double(BPATH "br", &(*offload_array)[0*B_size],
314 f, qid, __FILE__, __LINE__) ) {return 1;}
315 if( hdf5_read_double(BPATH "bphi", &(*offload_array)[1*B_size],
316 f, qid, __FILE__, __LINE__) ) {return 1;}
317 if( hdf5_read_double(BPATH "bz", &(*offload_array)[2*B_size],
318 f, qid, __FILE__, __LINE__) ) {return 1;}
319
320 /* Read the poloidal flux (psi) values at magnetic axis and separatrix. */
321 if( hdf5_read_double(BPATH "psi0", &(offload_data->psi0),
322 f, qid, __FILE__, __LINE__) ) {return 1;}
323 if( hdf5_read_double(BPATH "psi1", &(offload_data->psi1),
324 f, qid, __FILE__, __LINE__) ) {return 1;}
325
326 /* Read magnetic axis R and z coordinates */
327 if( hdf5_read_double(BPATH "axisr", &(offload_data->axis_r),
328 f, qid, __FILE__, __LINE__) ) {return 1;}
329 if( hdf5_read_double(BPATH "axisz", &(offload_data->axis_z),
330 f, qid, __FILE__, __LINE__) ) {return 1;}
331
332 return 0;
333}
334
395int hdf5_bfield_read_STS(hid_t f, B_STS_offload_data* offload_data,
396 real** offload_array, char* qid) {
397 #undef BPATH
398 #define BPATH "/bfield/B_STS_XXXXXXXXXX/"
399
400 /* Read and initialize magnetic field Rpz-grid */
401 if( hdf5_read_int(BPATH "b_nr", &(offload_data->Bgrid_n_r),
402 f, qid, __FILE__, __LINE__) ) {return 1;}
403 if( hdf5_read_int(BPATH "b_nz", &(offload_data->Bgrid_n_z),
404 f, qid, __FILE__, __LINE__) ) {return 1;}
405 if( hdf5_read_double(BPATH "b_rmin", &(offload_data->Bgrid_r_min),
406 f, qid, __FILE__, __LINE__) ) {return 1;}
407 if( hdf5_read_double(BPATH "b_rmax", &(offload_data->Bgrid_r_max),
408 f, qid, __FILE__, __LINE__) ) {return 1;}
409 if( hdf5_read_double(BPATH "b_zmin", &(offload_data->Bgrid_z_min),
410 f, qid, __FILE__, __LINE__) ) {return 1;}
411 if( hdf5_read_double(BPATH "b_zmax", &(offload_data->Bgrid_z_max),
412 f, qid, __FILE__, __LINE__) ) {return 1;}
413
414 if( hdf5_read_int(BPATH "b_nphi", &(offload_data->Bgrid_n_phi),
415 f, qid, __FILE__, __LINE__) ) {return 1;}
416 if( hdf5_read_double(BPATH "b_phimin", &(offload_data->Bgrid_phi_min),
417 f, qid, __FILE__, __LINE__) ) {return 1;}
418 if( hdf5_read_double(BPATH "b_phimax", &(offload_data->Bgrid_phi_max),
419 f, qid, __FILE__, __LINE__) ) {return 1;}
420
421 // Convert to radians
422 offload_data->Bgrid_phi_min = math_deg2rad(offload_data->Bgrid_phi_min);
423 offload_data->Bgrid_phi_max = math_deg2rad(offload_data->Bgrid_phi_max);
424
425 /* Read and initialize psi field Rpz-grid */
426 if( hdf5_read_int(BPATH "psi_nr", &(offload_data->psigrid_n_r),
427 f, qid, __FILE__, __LINE__) ) {return 1;}
428 if( hdf5_read_int(BPATH "psi_nz", &(offload_data->psigrid_n_z),
429 f, qid, __FILE__, __LINE__) ) {return 1;}
430 if( hdf5_read_double(BPATH "psi_rmin", &(offload_data->psigrid_r_min),
431 f, qid, __FILE__, __LINE__) ) {return 1;}
432 if( hdf5_read_double(BPATH "psi_rmax", &(offload_data->psigrid_r_max),
433 f, qid, __FILE__, __LINE__) ) {return 1;}
434 if( hdf5_read_double(BPATH "psi_zmin", &(offload_data->psigrid_z_min),
435 f, qid, __FILE__, __LINE__) ) {return 1;}
436 if( hdf5_read_double(BPATH "psi_zmax", &(offload_data->psigrid_z_max),
437 f, qid, __FILE__, __LINE__) ) {return 1;}
438
439 if( hdf5_read_int(BPATH "psi_nphi", &(offload_data->psigrid_n_phi),
440 f, qid, __FILE__, __LINE__) ) {return 1;}
441 if( hdf5_read_double(BPATH "psi_phimin",
442 &(offload_data->psigrid_phi_min),
443 f, qid, __FILE__, __LINE__) ) {return 1;}
444 if( hdf5_read_double(BPATH "psi_phimax",
445 &(offload_data->psigrid_phi_max),
446 f, qid, __FILE__, __LINE__) ) {return 1;}
447
448 // Convert to radians
449 offload_data->psigrid_phi_min = math_deg2rad(offload_data->psigrid_phi_min);
450 offload_data->psigrid_phi_max = math_deg2rad(offload_data->psigrid_phi_max);
451
452 /* Read and initialize magnetic axis phi-grid */
453 if( hdf5_read_int(BPATH "axis_nphi", &(offload_data->n_axis),
454 f, qid, __FILE__, __LINE__) ) {return 1;}
455 if( hdf5_read_double(BPATH "axis_phimin", &(offload_data->axis_min),
456 f, qid, __FILE__, __LINE__) ) {return 1;}
457 if( hdf5_read_double(BPATH "axis_phimax", &(offload_data->axis_max),
458 f, qid, __FILE__, __LINE__) ) {return 1;}
459
460 // Convert to radians
461 offload_data->axis_min = math_deg2rad(offload_data->axis_min);
462 offload_data->axis_max = math_deg2rad(offload_data->axis_max);
463
464 /* Allocate offload_array storing psi and the three components of B */
465 int psi_size = offload_data->psigrid_n_r*offload_data->psigrid_n_z
466 * offload_data->psigrid_n_phi;
467 int B_size = offload_data->Bgrid_n_r * offload_data->Bgrid_n_z
468 * offload_data->Bgrid_n_phi;
469 int axis_size = offload_data->n_axis;
470
471 *offload_array = (real*) malloc((psi_size + 3 * B_size + 2 * axis_size)
472 * sizeof(real));
473 offload_data->offload_array_length = psi_size + 3 * B_size + 2 * axis_size;
474
475 /* Read the magnetic field */
476 if( hdf5_read_double(BPATH "br", &(*offload_array)[0*B_size],
477 f, qid, __FILE__, __LINE__) ) {return 1;}
478 if( hdf5_read_double(BPATH "bphi", &(*offload_array)[1*B_size],
479 f, qid, __FILE__, __LINE__) ) {return 1;}
480 if( hdf5_read_double(BPATH "bz", &(*offload_array)[2*B_size],
481 f, qid, __FILE__, __LINE__) ) {return 1;}
482
483 /* Read psi */
484 if( hdf5_read_double(BPATH "psi", &(*offload_array)[3*B_size],
485 f, qid, __FILE__, __LINE__) ) {return 1;}
486
487 /* Read the magnetic axis */
488 if( hdf5_read_double(BPATH "axisr",
489 &(*offload_array)[3*B_size + psi_size],
490 f, qid, __FILE__, __LINE__) ) {return 1;}
491 if( hdf5_read_double(BPATH "axisz",
492 &(*offload_array)[3*B_size + psi_size + axis_size],
493 f, qid, __FILE__, __LINE__) ) {return 1;}
494
495 /* Read the poloidal flux (psi) values at magnetic axis and separatrix. */
496 if( hdf5_read_double(BPATH "psi0", &(offload_data->psi0),
497 f, qid, __FILE__, __LINE__) ) {return 1;}
498 if( hdf5_read_double(BPATH "psi1", &(offload_data->psi1),
499 f, qid, __FILE__, __LINE__) ) {return 1;}
500
501 return 0;
502}
503
533int hdf5_bfield_read_TC(hid_t f, B_TC_offload_data* offload_data,
534 real** offload_array, char* qid) {
535 #undef BPATH
536 #define BPATH "/bfield/B_TC_XXXXXXXXXX/"
537
538 if( hdf5_read_double(BPATH "axisr", &(offload_data->axisr),
539 f, qid, __FILE__, __LINE__) ) {return 1;}
540 if( hdf5_read_double(BPATH "axisz", &(offload_data->axisz),
541 f, qid, __FILE__, __LINE__) ) {return 1;}
542 if( hdf5_read_double(BPATH "psival", &(offload_data->psival),
543 f, qid, __FILE__, __LINE__) ) {return 1;}
544 if( hdf5_read_double(BPATH "rhoval", &(offload_data->rhoval),
545 f, qid, __FILE__, __LINE__) ) {return 1;}
546 if( hdf5_read_double(BPATH "bxyz", offload_data->B,
547 f, qid, __FILE__, __LINE__) ) {return 1;}
548 if( hdf5_read_double(BPATH "jacobian", offload_data->dB,
549 f, qid, __FILE__, __LINE__) ) {return 1;}
550
551 *offload_array = NULL;
552 return 0;
553}
554
584int hdf5_bfield_read_GS(hid_t f, B_GS_offload_data* offload_data,
585 real** offload_array, char* qid) {
586 #undef BPATH
587 #define BPATH "/bfield/B_GS_XXXXXXXXXX/"
588
589 /* Equilibrium */
590 if( hdf5_read_double(BPATH "r0", &(offload_data->R0),
591 f, qid, __FILE__, __LINE__) ) {return 1;}
592 if( hdf5_read_double(BPATH "z0", &(offload_data->z0),
593 f, qid, __FILE__, __LINE__) ) {return 1;}
594 if( hdf5_read_double(BPATH "raxis", &(offload_data->raxis),
595 f, qid, __FILE__, __LINE__) ) {return 1;}
596 if( hdf5_read_double(BPATH "zaxis", &(offload_data->zaxis),
597 f, qid, __FILE__, __LINE__) ) {return 1;}
598 if( hdf5_read_double(BPATH "bphi0", &(offload_data->B_phi0),
599 f, qid, __FILE__, __LINE__) ) {return 1;}
600 if( hdf5_read_double(BPATH "psi0", &(offload_data->psi0),
601 f, qid, __FILE__, __LINE__) ) {return 1;}
602 if( hdf5_read_double(BPATH "psi1", &(offload_data->psi1),
603 f, qid, __FILE__, __LINE__) ) {return 1;}
604 if( hdf5_read_double(BPATH "psimult", &(offload_data->psi_mult),
605 f, qid, __FILE__, __LINE__) ) {return 1;}
606 if( hdf5_read_double(BPATH "coefficients", offload_data->psi_coeff,
607 f, qid, __FILE__, __LINE__) ) {return 1;}
608
609 /* Ripple */
610 if( hdf5_read_double(BPATH "delta0", &(offload_data->delta0),
611 f, qid, __FILE__, __LINE__) ) {return 1;}
612 if( hdf5_read_double(BPATH "alpha0", &(offload_data->alpha0),
613 f, qid, __FILE__, __LINE__) ) {return 1;}
614 if( hdf5_read_double(BPATH "a0", &(offload_data->a0),
615 f, qid, __FILE__, __LINE__) ) {return 1;}
616 if( hdf5_read_int(BPATH "nripple", &(offload_data->Nripple),
617 f, qid, __FILE__, __LINE__) ) {return 1;}
618
619 *offload_array = NULL;
620
621 return 0;
622}
Header file for B_2DS.c.
Header file for B_3DS.c.
Header file for B_GS.c.
Header file for B_STS.c.
Header file for B_TC.c.
int B_field_init_offload(B_field_offload_data *offload_data, real **offload_array)
Load magnetic field data and prepare parameters.
Definition B_field.c:44
Header file for B_field.c.
@ B_field_type_2DS
Definition B_field.h:29
@ B_field_type_TC
Definition B_field.h:32
@ B_field_type_3DS
Definition B_field.h:30
@ B_field_type_STS
Definition B_field.h:31
@ B_field_type_GS
Definition B_field.h:28
Main header file for ASCOT5.
double real
Definition ascot5.h:85
Header file containing physical and mathematical constants.
int hdf5_bfield_read_STS(hid_t f, B_STS_offload_data *offload_data, real **offload_array, char *qid)
Read magnetic field data of type B_STS.
#define BPATH
Definition hdf5_bfield.c:35
int hdf5_bfield_init_offload(hid_t f, B_field_offload_data *offload_data, real **offload_array, char *qid)
Initialize magnetic field offload data from HDF5 file.
Definition hdf5_bfield.c:69
int hdf5_bfield_read_2DS(hid_t f, B_2DS_offload_data *offload_data, real **offload_array, char *qid)
Read magnetic field data of type B_2DS.
int hdf5_bfield_read_3DS(hid_t f, B_3DS_offload_data *offload_data, real **offload_array, char *qid)
Read magnetic field data of type B_3DS.
int hdf5_bfield_read_GS(hid_t f, B_GS_offload_data *offload_data, real **offload_array, char *qid)
Read magnetic field data of type B_GS.
int hdf5_bfield_read_TC(hid_t f, B_TC_offload_data *offload_data, real **offload_array, char *qid)
Read magnetic field data of type B_TC.
Header file for hdf5_bfield.c.
herr_t hdf5_find_group(hid_t loc, const char *path)
Checks if given group exists within given hdf5 file. Negative value is returned if the group doesn't ...
int hdf5_read_double(const char *var, real *ptr, hid_t file, char *qid, const char *errfile, int errline)
Read double-valued data from ASCOT5 HDF5 file.
char * hdf5_gen_path(const char *original, char *qid, char *path)
Generate a valid path from a given template and qid.
int hdf5_read_int(const char *var, int *ptr, hid_t file, char *qid, const char *errfile, int errline)
Read int-valued data from ASCOT5 HDF5 file.
Header file for hdf5_helpers.h.
Header file for math.c.
#define math_deg2rad(a)
Convert degrees to radians.
Definition math.h:107
Macros for printing console output.
2D magnetic field parameters that will be offloaded to target
Definition B_2DS.h:17
3D magnetic field parameters on the host
Definition B_3DS.h:15
real psigrid_z_max
Definition B_3DS.h:21
real Bgrid_phi_max
Definition B_3DS.h:31
real psigrid_r_min
Definition B_3DS.h:18
real psigrid_z_min
Definition B_3DS.h:20
int offload_array_length
Definition B_3DS.h:37
real psigrid_r_max
Definition B_3DS.h:19
real Bgrid_phi_min
Definition B_3DS.h:30
Analytic magnetic field parameters that will be offloaded to target.
Definition B_GS.h:14
real psi_coeff[13]
Definition B_GS.h:23
real psi_mult
Definition B_GS.h:22
stellarator magnetic field parameters on the host
Definition B_STS.h:15
real psigrid_r_max
Definition B_STS.h:20
int offload_array_length
Definition B_STS.h:38
real Bgrid_phi_max
Definition B_STS.h:34
real Bgrid_phi_min
Definition B_STS.h:33
real psigrid_phi_min
Definition B_STS.h:23
real psigrid_z_min
Definition B_STS.h:21
real psigrid_r_min
Definition B_STS.h:19
real psigrid_phi_max
Definition B_STS.h:24
real psigrid_z_max
Definition B_STS.h:22
TC magnetic field parameters that will be offloaded to target.
Definition B_TC.h:16
real dB[9]
Definition B_TC.h:26
real B[3]
Definition B_TC.h:25
Magnetic field offload data.
Definition B_field.h:44
B_2DS_offload_data B2DS
Definition B_field.h:47
B_field_type type
Definition B_field.h:45
B_TC_offload_data BTC
Definition B_field.h:50
B_GS_offload_data BGS
Definition B_field.h:46
B_STS_offload_data BSTS
Definition B_field.h:49
B_3DS_offload_data B3DS
Definition B_field.h:48