ASCOT5
|
1D spline electric field evaluation functions More...
#include <stdio.h>
#include <stdlib.h>
#include "../ascot5.h"
#include "../error.h"
#include "../print.h"
#include "../B_field.h"
#include "../spline/interp.h"
#include "E_1DS.h"
Go to the source code of this file.
Functions | |
int | E_1DS_init_offload (E_1DS_offload_data *offload_data, real **offload_array) |
Initialize 1DS electric field data. | |
void | E_1DS_free_offload (E_1DS_offload_data *offload_data, real **offload_array) |
Free offload array and reset parameters. | |
void | E_1DS_init (E_1DS_data *Edata, E_1DS_offload_data *offload_data, real *offload_array) |
Initialize 1D spline electric field data struct on target. | |
a5err | E_1DS_eval_E (real E[3], real r, real phi, real z, E_1DS_data *Edata, B_field_data *Bdata) |
Evaluate 1D spline radial electric field. | |
1D spline electric field evaluation functions
Radial electric field evaluated from 1D profile. Exactly as E_1D but the potential is evaluated with splines.
Definition in file E_1DS.c.
int E_1DS_init_offload | ( | E_1DS_offload_data * | offload_data, |
real ** | offload_array ) |
Initialize 1DS electric field data.
This function takes pre-initialized offload data struct and offload array as inputs. The data is used to fill rest of the offload struct and to construct a cubic spline whose coefficients are stored in re-allocated offload array.
The offload data struct must have the following fields initialized:
E_1DS_offload_data.offload_array_length is set here.
The offload array must contain the following data:
Sanity checks are printed if data was initialized succesfully.
offload_data | pointer to offload data struct |
offload_array | pointer to offload array which is reallocated here |
void E_1DS_free_offload | ( | E_1DS_offload_data * | offload_data, |
real ** | offload_array ) |
void E_1DS_init | ( | E_1DS_data * | Edata, |
E_1DS_offload_data * | offload_data, | ||
real * | offload_array ) |
Initialize 1D spline electric field data struct on target.
This function copies the 1D spline electric field parameters from the offload struct to the struct on target and sets the 1D spline electric field data pointers to correct offsets in the offload array.
Edata | pointer to data struct on target |
offload_data | pointer to offload data struct |
offload_array | pointer to offload array |
a5err E_1DS_eval_E | ( | real | E[3], |
real | r, | ||
real | phi, | ||
real | z, | ||
E_1DS_data * | Edata, | ||
B_field_data * | Bdata ) |
Evaluate 1D spline radial electric field.
This function evaluates the 1D spline potential gradient of the plasma at the given radial coordinate using linear interpolation, and then calculates the radial electric field by multiplying that with the rho-gradient. Gradient of rho is obtained via magnetic field module.
E | array where the electric field will be stored (E_r -> E[1], E_phi -> E[1], E_z -> E[2]) |
r | R-coordiante [m] |
phi | phi-coordinate [rad] |
z | z-coordiante [m] |
Edata | pointer to electric field data |
Bdata | pointer to magnetic field data |