ASCOT5
Loading...
Searching...
No Matches
E_TC.c
Go to the documentation of this file.
1
9#include <stdlib.h>
10#include "../ascot5.h"
11#include "../math.h"
12#include "../error.h"
13#include "../print.h"
14#include "../B_field.h"
15#include "E_TC.h"
16
25int E_TC_init(E_TC_data* data, real exyz[3]) {
26
27 data->Exyz[0] = exyz[0];
28 data->Exyz[1] = exyz[1];
29 data->Exyz[2] = exyz[2];
30
31 print_out(VERBOSE_IO, "\nTrivial Cartesian electric field (E_TC)\n");
32 print_out(VERBOSE_IO, "E_x = %le, E_y = %le, E_z = %le\n",
33 data->Exyz[0], data->Exyz[1], data->Exyz[2]);
34 return 0;
35}
36
42void E_TC_free(E_TC_data* data) {
43 // No resources were allocated
44}
45
52 GPU_MAP_TO_DEVICE( data->Exyz[0:3] )
53}
54
70a5err E_TC_eval_E(real E[3], real r, real phi, real z, E_TC_data* Edata,
71 B_field_data* Bdata) {
72 math_vec_xyz2rpz(Edata->Exyz, E, phi);
73
74 return 0;
75}
Header file for B_field.c.
int E_TC_init(E_TC_data *data, real exyz[3])
Initialize electric field data and check inputs.
Definition E_TC.c:25
void E_TC_offload(E_TC_data *data)
Offload data to the accelerator.
Definition E_TC.c:51
a5err E_TC_eval_E(real E[3], real r, real phi, real z, E_TC_data *Edata, B_field_data *Bdata)
Evaluate electric field.
Definition E_TC.c:70
void E_TC_free(E_TC_data *data)
Free allocated resources.
Definition E_TC.c:42
Header file for E_TC.c.
Main header file for ASCOT5.
double real
Definition ascot5.h:85
Error module for ASCOT5.
unsigned long int a5err
Simulation error flag.
Definition error.h:17
Header file for math.c.
#define math_vec_xyz2rpz(vxyz, vrpz, phi)
Transform vector from cartesian to cylindrical basis: vxyz -> vrpz, phi is the toroidal angle in radi...
Definition math.h:90
Macros for printing console output.
#define print_out(v,...)
Print to standard output.
Definition print.h:31
@ VERBOSE_IO
Definition print.h:20
Magnetic field simulation data.
Definition B_field.h:41
Trivial Cartesian electric field simulation data.
Definition E_TC.h:18
real Exyz[3]
Definition E_TC.h:19