Running `dreampyface` with analytical geometry raises error about the magnetic field
leferi99 opened this issue · 2 comments
Running the same script with the "traditional" method runiface()
does not give an error, and runs properly. Digging deeper the psi
array is incorrect in fvm/Grid/AnalyticBRadialGridGenerator::constructSplines()
. All the other four arrays, namely GOverB0
, kappa
, Delta
, and delta
are being passed correctly. For the testing I modified the fvm/Grid/AnalyticBRadialGridGenerator::constructSplines()
to contain the following:
if (pp->npsi > 1) {
this->spline_psi = construct_spline(pp->npsi, pp->psi_r, pp->psi);
// Print the array for testing
char shaping2[] = "psi";
printf("%s \n", shaping2);
for(int i = pp->npsi - 1; i>=0; i--) {
printf("%e \n", pp->psi[i]);
}
this->gsl_acc_psi = gsl_interp_accel_alloc();
}
If it is of any importance: I pass an externally sourced psi
array, and all the other shaping parameters are linearly interpolated onto the grid in Python before passing them to the C++. All passed data already has the dimensions that I set for their respective grids in ds.radialgrid.setShaping()
so they should not be interpolated (?).
My psi
array should go from around -51 to around -31, but instead, I get these types of values which seem to indicate some repetition every 5 values. I have a grid of 200 points, so I only attach the first 10 values for illustration.
2.013080e-01
-9.555920e+05
3.952780e+04
1.863300e+20
-4.719510e+01
1.963000e-01
-9.577710e+05
3.981160e+04
1.867640e+20
-4.729090e+01
Turns out that the problem originates in using numpy.genfromtxt()
for importing the data. Typecasting the psi
numpy array with list()
solves this abovementioned issue.
But then the simulation throws the following errors instead, which seems to be unrelated to the magnetic geometry at first glance:
INTEL MKL ERROR: /cineca/prod/opt/compilers/intel/pe-xe-2020/binary/mkl/lib/intel64/libmkl_avx512.so: undefined symbol: mkl_sparse_optimize_bsr_trsm_i8.
Intel MKL FATAL ERROR: Cannot load libmkl_avx512.so or libmkl_def.so.
Since this is a different issue, I think we can close this.