17 #define _CELL_SIZE_ 2.5
29 char fname[FILENAME_MAX];
31 snprintf(fname, FILENAME_MAX-1,
"DipoleMap%d.dat",
_MAP_ID_);
34 FILE *fout = fopen(fname,
"w");
38 printf(
"Failed to open '%s' for writing!\n", fname);
48 t_3d_vector xx = {-37.5, 107.5, -10.0}, B;
50 int ret = get_cartesian_field_value(mgrid, xx, B);
57 unsigned iq, nodes[3] = {101, 101, 201};
58 float xmin[3] = { -125.0, -125.0, -250.0};
59 float xmax[3] = { 125.0, 125.0, 250.0};
62 fprintf(fout,
"Dipole\n");
65 fprintf(fout,
"%6.1f %6.1f %3d\n", xmin[iq], xmax[iq], nodes[iq]);
72 for(ix=0; ix<nodes[
_X_]; ix++)
73 for(iy=0; iy<nodes[
_Y_]; iy++)
74 for(iz=0; iz<nodes[
_Z_]; iz++)
78 xmin[
_Z_] + iz*_CELL_SIZE_}, B;
80 ret = get_cartesian_field_value(mgrid, xx, B);
82 fprintf(fout,
"%10.3f %10.3f %10.3f\n", B[0], B[1], B[2]);