ASCOT5
Toggle main menu visibility
Loading...
Searching...
No Matches
Efield
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
25
int
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
42
void
E_TC_free
(
E_TC_data
* data) {
43
// No resources were allocated
44
}
45
51
void
E_TC_offload
(
E_TC_data
* data) {
52
GPU_MAP_TO_DEVICE( data->
Exyz
[0:3] )
53
}
54
70
a5err
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
}
B_field.h
Header file for B_field.c.
E_TC_init
int E_TC_init(E_TC_data *data, real exyz[3])
Initialize electric field data and check inputs.
Definition
E_TC.c:25
E_TC_offload
void E_TC_offload(E_TC_data *data)
Offload data to the accelerator.
Definition
E_TC.c:51
E_TC_eval_E
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
E_TC_free
void E_TC_free(E_TC_data *data)
Free allocated resources.
Definition
E_TC.c:42
E_TC.h
Header file for E_TC.c.
ascot5.h
Main header file for ASCOT5.
real
double real
Definition
ascot5.h:85
error.h
Error module for ASCOT5.
a5err
unsigned long int a5err
Simulation error flag.
Definition
error.h:17
math.h
Header file for math.c.
math_vec_xyz2rpz
#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:94
print.h
Macros for printing console output.
print_out
#define print_out(v,...)
Print to standard output.
Definition
print.h:31
VERBOSE_IO
@ VERBOSE_IO
Definition
print.h:20
B_field_data
Magnetic field simulation data.
Definition
B_field.h:41
E_TC_data
Trivial Cartesian electric field simulation data.
Definition
E_TC.h:18
E_TC_data::Exyz
real Exyz[3]
Definition
E_TC.h:19
Generated on
for ASCOT5 by
1.18.0