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_data* data, char* qid);
38int hdf5_bfield_read_3DS(hid_t f, B_3DS_data* data, char* qid);
39int hdf5_bfield_read_STS(hid_t f, B_STS_data* data, char* qid);
40int hdf5_bfield_read_TC(hid_t f, B_TC_data* data, char* qid);
41int hdf5_bfield_read_GS(hid_t f, B_GS_data* data, char* qid);
42
62int hdf5_bfield_init(hid_t f, B_field_data* data, char* qid) {
63
64 char path[256]; // Storage array required for hdf5_gen_path() calls
65 int err = 1; // Error flag which is nullified if data is read succesfully
66
67 /* Read data the QID corresponds to */
68
69 hdf5_gen_path("/bfield/B_TC_XXXXXXXXXX", qid, path);
70 if( !hdf5_find_group(f, path) ) {
71 data->type = B_field_type_TC;
72 err = hdf5_bfield_read_TC(f, &(data->BTC), qid);
73 }
74
75 hdf5_gen_path("/bfield/B_GS_XXXXXXXXXX", qid, path);
76 if( !hdf5_find_group(f, path) ) {
77 data->type = B_field_type_GS;
78 err = hdf5_bfield_read_GS(f, &(data->BGS), qid);
79 }
80
81 hdf5_gen_path("/bfield/B_2DS_XXXXXXXXXX", qid, path);
82 if( !hdf5_find_group(f, path) ) {
83 data->type = B_field_type_2DS;
84 err = hdf5_bfield_read_2DS(f, &(data->B2DS), qid);
85 }
86
87 hdf5_gen_path("/bfield/B_3DS_XXXXXXXXXX", qid, path);
88 if( !hdf5_find_group(f, path) ) {
89 data->type = B_field_type_3DS;
90 err = hdf5_bfield_read_3DS(f, &(data->B3DS), qid);
91 }
92
93 hdf5_gen_path("/bfield/B_STS_XXXXXXXXXX", qid, path);
94 if( !hdf5_find_group(f, path) ) {
95 data->type = B_field_type_STS;
96 err = hdf5_bfield_read_STS(f, &(data->BSTS), qid);
97 }
98
99 return err;
100}
101
136int hdf5_bfield_read_2DS(hid_t f, B_2DS_data* data, char* qid) {
137 #undef BPATH
138 #define BPATH "/bfield/B_2DS_XXXXXXXXXX/"
139
140 /* Read and initialize psi and magnetic field Rz-grid */
141 int n_r, n_z;
142 real r_min, r_max, z_min, z_max;
143 if( hdf5_read_int(BPATH "nr", &n_r,
144 f, qid, __FILE__, __LINE__) ) {return 1;}
145 if( hdf5_read_int(BPATH "nz", &n_z,
146 f, qid, __FILE__, __LINE__) ) {return 1;}
147 if( hdf5_read_double(BPATH "rmin", &r_min,
148 f, qid, __FILE__, __LINE__) ) {return 1;}
149 if( hdf5_read_double(BPATH "rmax", &r_max,
150 f, qid, __FILE__, __LINE__) ) {return 1;}
151 if( hdf5_read_double(BPATH "zmin", &z_min,
152 f, qid, __FILE__, __LINE__) ) {return 1;}
153 if( hdf5_read_double(BPATH "zmax", &z_max,
154 f, qid, __FILE__, __LINE__) ) {return 1;}
155
156 /* Read psi and B values */
157 real* psi = (real*)malloc(n_r*n_z*sizeof(real));
158 real* br = (real*)malloc(n_r*n_z*sizeof(real));
159 real* bphi = (real*)malloc(n_r*n_z*sizeof(real));
160 real* bz = (real*)malloc(n_r*n_z*sizeof(real));
161 if( hdf5_read_double(BPATH "psi", psi,
162 f, qid, __FILE__, __LINE__) ) {return 1;}
163 if( hdf5_read_double(BPATH "br", br,
164 f, qid, __FILE__, __LINE__) ) {return 1;}
165 if( hdf5_read_double(BPATH "bphi", bphi,
166 f, qid, __FILE__, __LINE__) ) {return 1;}
167 if( hdf5_read_double(BPATH "bz", bz,
168 f, qid, __FILE__, __LINE__) ) {return 1;}
169
170 real psi0, psi1, axisr, axisz;
171 if( hdf5_read_double(BPATH "psi0", &psi0,
172 f, qid, __FILE__, __LINE__) ) {return 1;}
173 if( hdf5_read_double(BPATH "psi1", &psi1,
174 f, qid, __FILE__, __LINE__) ) {return 1;}
175 if( hdf5_read_double(BPATH "axisr", &axisr,
176 f, qid, __FILE__, __LINE__) ) {return 1;}
177 if( hdf5_read_double(BPATH "axisz", &axisz,
178 f, qid, __FILE__, __LINE__) ) {return 1;}
179
180 int err = B_2DS_init(data, n_r, r_min, r_max, n_z, z_min, z_max,
181 axisr, axisz, psi0, psi1, psi, br, bphi, bz);
182 free(psi);
183 free(br);
184 free(bphi);
185 free(bz);
186 return err;
187}
188
236int hdf5_bfield_read_3DS(hid_t f, B_3DS_data* data, char* qid) {
237 #undef BPATH
238 #define BPATH "/bfield/B_3DS_XXXXXXXXXX/"
239
240 /* Read and initialize magnetic field Rpz-grid */
241 int b_n_r, b_n_phi, b_n_z;
242 real b_r_min, b_r_max, b_phi_min, b_phi_max, b_z_min, b_z_max;
243 if( hdf5_read_int(BPATH "b_nr", &b_n_r,
244 f, qid, __FILE__, __LINE__) ) {return 1;}
245 if( hdf5_read_int(BPATH "b_nz", &b_n_z,
246 f, qid, __FILE__, __LINE__) ) {return 1;}
247 if( hdf5_read_double(BPATH "b_rmin", &b_r_min,
248 f, qid, __FILE__, __LINE__) ) {return 1;}
249 if( hdf5_read_double(BPATH "b_rmax", &b_r_max,
250 f, qid, __FILE__, __LINE__) ) {return 1;}
251 if( hdf5_read_double(BPATH "b_zmin", &b_z_min,
252 f, qid, __FILE__, __LINE__) ) {return 1;}
253 if( hdf5_read_double(BPATH "b_zmax", &b_z_max,
254 f, qid, __FILE__, __LINE__) ) {return 1;}
255
256 if( hdf5_read_int(BPATH "b_nphi", &b_n_phi,
257 f, qid, __FILE__, __LINE__) ) {return 1;}
258 if( hdf5_read_double(BPATH "b_phimin", &b_phi_min,
259 f, qid, __FILE__, __LINE__) ) {return 1;}
260 if( hdf5_read_double(BPATH "b_phimax", &b_phi_max,
261 f, qid, __FILE__, __LINE__) ) {return 1;}
262
263 // Convert to radians
264 b_phi_min = math_deg2rad(b_phi_min);
265 b_phi_max = math_deg2rad(b_phi_max);
266
267 /* Read and initialize psi field Rz-grid */
268 int p_n_r, p_n_z;
269 real p_r_min, p_r_max, p_z_min, p_z_max;
270 if( hdf5_read_int(BPATH "psi_nr", &p_n_r,
271 f, qid, __FILE__, __LINE__) ) {return 1;}
272 if( hdf5_read_int(BPATH "psi_nz", &p_n_z,
273 f, qid, __FILE__, __LINE__) ) {return 1;}
274 if( hdf5_read_double(BPATH "psi_rmin", &p_r_min,
275 f, qid, __FILE__, __LINE__) ) {return 1;}
276 if( hdf5_read_double(BPATH "psi_rmax", &p_r_max,
277 f, qid, __FILE__, __LINE__) ) {return 1;}
278 if( hdf5_read_double(BPATH "psi_zmin", &p_z_min,
279 f, qid, __FILE__, __LINE__) ) {return 1;}
280 if( hdf5_read_double(BPATH "psi_zmax", &p_z_max,
281 f, qid, __FILE__, __LINE__) ) {return 1;}
282
283 /* Read psi and B values */
284 real* psi = (real*)malloc(p_n_r*p_n_z*sizeof(real));
285 real* br = (real*)malloc(b_n_r*b_n_phi*b_n_z*sizeof(real));
286 real* bphi = (real*)malloc(b_n_r*b_n_phi*b_n_z*sizeof(real));
287 real* bz = (real*)malloc(b_n_r*b_n_phi*b_n_z*sizeof(real));
288 if( hdf5_read_double(BPATH "psi", psi,
289 f, qid, __FILE__, __LINE__) ) {return 1;}
290 if( hdf5_read_double(BPATH "br", br,
291 f, qid, __FILE__, __LINE__) ) {return 1;}
292 if( hdf5_read_double(BPATH "bphi", bphi,
293 f, qid, __FILE__, __LINE__) ) {return 1;}
294 if( hdf5_read_double(BPATH "bz", bz,
295 f, qid, __FILE__, __LINE__) ) {return 1;}
296
297 /* Read the poloidal flux (psi) values at magnetic axis and separatrix. */
298 real psi0, psi1, axisr, axisz;
299 if( hdf5_read_double(BPATH "psi0", &psi0,
300 f, qid, __FILE__, __LINE__) ) {return 1;}
301 if( hdf5_read_double(BPATH "psi1", &psi1,
302 f, qid, __FILE__, __LINE__) ) {return 1;}
303
304 /* Read magnetic axis R and z coordinates */
305 if( hdf5_read_double(BPATH "axisr", &axisr,
306 f, qid, __FILE__, __LINE__) ) {return 1;}
307 if( hdf5_read_double(BPATH "axisz", &axisz,
308 f, qid, __FILE__, __LINE__) ) {return 1;}
309
310 int err = B_3DS_init(data, p_n_r, p_r_min, p_r_max, p_n_z, p_z_min, p_z_max,
311 b_n_r, b_r_min, b_r_max, b_n_phi, b_phi_min, b_phi_max,
312 b_n_z, b_z_min, b_z_max, axisr, axisz, psi0, psi1,
313 psi, br, bphi, bz);
314 free(psi);
315 free(br);
316 free(bphi);
317 free(bz);
318 return err;
319}
320
378int hdf5_bfield_read_STS(hid_t f, B_STS_data* data, char* qid) {
379 #undef BPATH
380 #define BPATH "/bfield/B_STS_XXXXXXXXXX/"
381
382 /* Read and initialize magnetic field Rpz-grid */
383 int b_n_r, b_n_phi, b_n_z;
384 real b_r_min, b_r_max, b_z_min, b_z_max, b_phi_min, b_phi_max;
385 if( hdf5_read_int(BPATH "b_nr", &b_n_r,
386 f, qid, __FILE__, __LINE__) ) {return 1;}
387 if( hdf5_read_int(BPATH "b_nz", &b_n_z,
388 f, qid, __FILE__, __LINE__) ) {return 1;}
389 if( hdf5_read_double(BPATH "b_rmin", &b_r_min,
390 f, qid, __FILE__, __LINE__) ) {return 1;}
391 if( hdf5_read_double(BPATH "b_rmax", &b_r_max,
392 f, qid, __FILE__, __LINE__) ) {return 1;}
393 if( hdf5_read_double(BPATH "b_zmin", &b_z_min,
394 f, qid, __FILE__, __LINE__) ) {return 1;}
395 if( hdf5_read_double(BPATH "b_zmax", &b_z_max,
396 f, qid, __FILE__, __LINE__) ) {return 1;}
397
398 if( hdf5_read_int(BPATH "b_nphi", &b_n_phi,
399 f, qid, __FILE__, __LINE__) ) {return 1;}
400 if( hdf5_read_double(BPATH "b_phimin", &b_phi_min,
401 f, qid, __FILE__, __LINE__) ) {return 1;}
402 if( hdf5_read_double(BPATH "b_phimax", &b_phi_max,
403 f, qid, __FILE__, __LINE__) ) {return 1;}
404
405 // Convert to radians
406 b_phi_min = math_deg2rad(b_phi_min);
407 b_phi_max = math_deg2rad(b_phi_max);
408
409 /* Read and initialize psi field Rpz-grid */
410 int p_n_r, p_n_phi, p_n_z;
411 real p_r_min, p_r_max, p_z_min, p_z_max, p_phi_min, p_phi_max;
412 if( hdf5_read_int(BPATH "psi_nr", &p_n_r,
413 f, qid, __FILE__, __LINE__) ) {return 1;}
414 if( hdf5_read_int(BPATH "psi_nz", &p_n_z,
415 f, qid, __FILE__, __LINE__) ) {return 1;}
416 if( hdf5_read_double(BPATH "psi_rmin", &p_r_min,
417 f, qid, __FILE__, __LINE__) ) {return 1;}
418 if( hdf5_read_double(BPATH "psi_rmax", &p_r_max,
419 f, qid, __FILE__, __LINE__) ) {return 1;}
420 if( hdf5_read_double(BPATH "psi_zmin", &p_z_min,
421 f, qid, __FILE__, __LINE__) ) {return 1;}
422 if( hdf5_read_double(BPATH "psi_zmax", &p_z_max,
423 f, qid, __FILE__, __LINE__) ) {return 1;}
424
425 if( hdf5_read_int(BPATH "psi_nphi", &p_n_phi,
426 f, qid, __FILE__, __LINE__) ) {return 1;}
427 if( hdf5_read_double(BPATH "psi_phimin", &p_phi_min,
428 f, qid, __FILE__, __LINE__) ) {return 1;}
429 if( hdf5_read_double(BPATH "psi_phimax", &p_phi_max,
430 f, qid, __FILE__, __LINE__) ) {return 1;}
431
432 // Convert to radians
433 p_phi_min = math_deg2rad(p_phi_min);
434 p_phi_max = math_deg2rad(p_phi_max);
435
436 /* Read and initialize magnetic axis phi-grid */
437 int naxis;
438 real axis_min, axis_max;
439 if( hdf5_read_int(BPATH "axis_nphi", &naxis,
440 f, qid, __FILE__, __LINE__) ) {return 1;}
441 if( hdf5_read_double(BPATH "axis_phimin", &axis_min,
442 f, qid, __FILE__, __LINE__) ) {return 1;}
443 if( hdf5_read_double(BPATH "axis_phimax", &axis_max,
444 f, qid, __FILE__, __LINE__) ) {return 1;}
445
446 // Convert to radians
447 axis_min = math_deg2rad(axis_min);
448 axis_max = math_deg2rad(axis_max);
449
450 /* Read the poloidal flux (psi) values at magnetic axis and separatrix. */
451 real psi0, psi1;
452 if( hdf5_read_double(BPATH "psi0", &psi0,
453 f, qid, __FILE__, __LINE__) ) {return 1;}
454 if( hdf5_read_double(BPATH "psi1", &psi1,
455 f, qid, __FILE__, __LINE__) ) {return 1;}
456
457 /* Read the magnetic field and psi */
458 real* psi = (real*)malloc(p_n_r*p_n_phi*p_n_z*sizeof(real));
459 real* br = (real*)malloc(b_n_r*b_n_phi*b_n_z*sizeof(real));
460 real* bphi = (real*)malloc(b_n_r*b_n_phi*b_n_z*sizeof(real));
461 real* bz = (real*)malloc(b_n_r*b_n_phi*b_n_z*sizeof(real));
462 if( hdf5_read_double(BPATH "br", br,
463 f, qid, __FILE__, __LINE__) ) {return 1;}
464 if( hdf5_read_double(BPATH "bphi", bphi,
465 f, qid, __FILE__, __LINE__) ) {return 1;}
466 if( hdf5_read_double(BPATH "bz", bz,
467 f, qid, __FILE__, __LINE__) ) {return 1;}
468 if( hdf5_read_double(BPATH "psi", psi,
469 f, qid, __FILE__, __LINE__) ) {return 1;}
470
471 /* Read the magnetic axis */
472 real* axisr = (real*)malloc(naxis*sizeof(real));
473 real* axisz = (real*)malloc(naxis*sizeof(real));
474 if( hdf5_read_double(BPATH "axisr", axisr,
475 f, qid, __FILE__, __LINE__) ) {return 1;}
476 if( hdf5_read_double(BPATH "axisz", axisz,
477 f, qid, __FILE__, __LINE__) ) {return 1;}
478 int err = B_STS_init(data, p_n_r, p_r_min, p_r_max,
479 p_n_phi, p_phi_min, p_phi_max, p_n_z, p_z_min, p_z_max,
480 b_n_r, b_r_min, b_r_max, b_n_phi, b_phi_min, b_phi_max,
481 b_n_z, b_z_min, b_z_max, naxis, axis_min, axis_max,
482 axisr, axisz, psi0, psi1, psi, br, bphi, bz);
483 free(psi);
484 free(br);
485 free(bphi);
486 free(bz);
487 free(axisr);
488 free(axisz);
489
490 return err;
491}
492
520int hdf5_bfield_read_TC(hid_t f, B_TC_data* data, char* qid) {
521 #undef BPATH
522 #define BPATH "/bfield/B_TC_XXXXXXXXXX/"
523
524 real axisr, axisz, psival, rhoval, B[3], dB[9];
525 if( hdf5_read_double(BPATH "axisr", &axisr,
526 f, qid, __FILE__, __LINE__) ) {return 1;}
527 if( hdf5_read_double(BPATH "axisz", &axisz,
528 f, qid, __FILE__, __LINE__) ) {return 1;}
529 if( hdf5_read_double(BPATH "psival", &psival,
530 f, qid, __FILE__, __LINE__) ) {return 1;}
531 if( hdf5_read_double(BPATH "rhoval", &rhoval,
532 f, qid, __FILE__, __LINE__) ) {return 1;}
533 if( hdf5_read_double(BPATH "bxyz", B,
534 f, qid, __FILE__, __LINE__) ) {return 1;}
535 if( hdf5_read_double(BPATH "jacobian", dB,
536 f, qid, __FILE__, __LINE__) ) {return 1;}
537 int err = B_TC_init(data, axisr, axisz, psival, rhoval, B, dB);
538 return err;
539}
540
568int hdf5_bfield_read_GS(hid_t f, B_GS_data* data, char* qid) {
569 #undef BPATH
570 #define BPATH "/bfield/B_GS_XXXXXXXXXX/"
571
572 /* Equilibrium */
573 real R0, z0, raxis, zaxis, B_phi0, psi0, psi1, psi_mult, psi_coeff[14];
574 if( hdf5_read_double(BPATH "r0", &R0,
575 f, qid, __FILE__, __LINE__) ) {return 1;}
576 if( hdf5_read_double(BPATH "z0", &z0,
577 f, qid, __FILE__, __LINE__) ) {return 1;}
578 if( hdf5_read_double(BPATH "raxis", &raxis,
579 f, qid, __FILE__, __LINE__) ) {return 1;}
580 if( hdf5_read_double(BPATH "zaxis", &zaxis,
581 f, qid, __FILE__, __LINE__) ) {return 1;}
582 if( hdf5_read_double(BPATH "bphi0", &B_phi0,
583 f, qid, __FILE__, __LINE__) ) {return 1;}
584 if( hdf5_read_double(BPATH "psi0", &psi0,
585 f, qid, __FILE__, __LINE__) ) {return 1;}
586 if( hdf5_read_double(BPATH "psi1", &psi1,
587 f, qid, __FILE__, __LINE__) ) {return 1;}
588 if( hdf5_read_double(BPATH "psimult", &psi_mult,
589 f, qid, __FILE__, __LINE__) ) {return 1;}
590 if( hdf5_read_double(BPATH "coefficients", psi_coeff,
591 f, qid, __FILE__, __LINE__) ) {return 1;}
592
593 /* Ripple */
594 int Nripple;
595 real delta0, alpha0, a0;
596 if( hdf5_read_double(BPATH "delta0", &delta0,
597 f, qid, __FILE__, __LINE__) ) {return 1;}
598 if( hdf5_read_double(BPATH "alpha0", &alpha0,
599 f, qid, __FILE__, __LINE__) ) {return 1;}
600 if( hdf5_read_double(BPATH "a0", &a0,
601 f, qid, __FILE__, __LINE__) ) {return 1;}
602 if( hdf5_read_int(BPATH "nripple", &Nripple,
603 f, qid, __FILE__, __LINE__) ) {return 1;}
604 int err = B_GS_init(data, R0, z0, raxis, zaxis, B_phi0, psi0, psi1,
605 psi_mult, psi_coeff, Nripple, a0, alpha0, delta0);
606 return err;
607}
int B_2DS_init(B_2DS_data *data, int n_r, real r_min, real r_max, int n_z, real z_min, real z_max, real axis_r, real axis_z, real psi0, real psi1, real *psi, real *B_r, real *B_phi, real *B_z)
Initialize magnetic field data.
Definition B_2DS.c:55
Header file for B_2DS.c.
real psi0
Definition B_3DS.c:59
real psi1
Definition B_3DS.c:60
int B_3DS_init(B_3DS_data *data, int p_n_r, real p_r_min, real p_r_max, int p_n_z, real p_z_min, real p_z_max, int b_n_r, real b_r_min, real b_r_max, int b_n_phi, real b_phi_min, real b_phi_max, int b_n_z, real b_z_min, real b_z_max, real axis_r, real axis_z, real psi0, real psi1, real *psi, real *B_r, real *B_phi, real *B_z)
Initialize magnetic field data.
Definition B_3DS.c:106
Header file for B_3DS.c.
int B_GS_init(B_GS_data *data, real R0, real z0, real raxis, real zaxis, real B_phi0, real psi0, real psi1, real psi_mult, real c[14], int Nripple, real a0, real alpha0, real delta0)
Initialize magnetic field data.
Definition B_GS.c:96
Header file for B_GS.c.
int B_STS_init(B_STS_data *data, int p_n_r, real p_r_min, real p_r_max, int p_n_phi, real p_phi_min, real p_phi_max, int p_n_z, real p_z_min, real p_z_max, int b_n_r, real b_r_min, real b_r_max, int b_n_phi, real b_phi_min, real b_phi_max, int b_n_z, real b_z_min, real b_z_max, int naxis, real axis_min, real axis_max, real *axis_r, real *axis_z, real psi0, real psi1, real *psi, real *B_r, real *B_phi, real *B_z)
Initialize magnetic field data.
Definition B_STS.c:81
Header file for B_STS.c.
int B_TC_init(B_TC_data *data, real axisr, real axisz, real psival, real rhoval, real B[3], real dB[9])
Initialize magnetic field data.
Definition B_TC.c:46
Header file for B_TC.c.
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_GS(hid_t f, B_GS_data *data, char *qid)
Read magnetic field data of type B_GS.
int hdf5_bfield_read_TC(hid_t f, B_TC_data *data, char *qid)
Read magnetic field data of type B_TC.
#define BPATH
Definition hdf5_bfield.c:35
int hdf5_bfield_read_3DS(hid_t f, B_3DS_data *data, char *qid)
Read magnetic field data of type B_3DS.
int hdf5_bfield_read_STS(hid_t f, B_STS_data *data, char *qid)
Read magnetic field data of type B_STS.
int hdf5_bfield_init(hid_t f, B_field_data *data, char *qid)
Initialize magnetic field data from HDF5 file.
Definition hdf5_bfield.c:62
int hdf5_bfield_read_2DS(hid_t f, B_2DS_data *data, char *qid)
Read magnetic field data of type B_2DS.
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
Definition B_2DS.h:17
3D magnetic field parameters
Definition B_3DS.h:15
Analytic magnetic field parameters on the target.
Definition B_GS.h:14
stellarator magnetic field parameters on the target
Definition B_STS.h:15
TC magnetic field parameters on the target.
Definition B_TC.h:16
Magnetic field simulation data.
Definition B_field.h:41
B_STS_data BSTS
Definition B_field.h:46
B_TC_data BTC
Definition B_field.h:47
B_2DS_data B2DS
Definition B_field.h:44
B_field_type type
Definition B_field.h:42
B_GS_data BGS
Definition B_field.h:43
B_3DS_data B3DS
Definition B_field.h:45