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
34 real** offload_array) {
35 // Do no initialization
36 offload_data->offload_array_length = 0;
37 *offload_array = NULL;
38
39 print_out(VERBOSE_IO, "\nTrivial Cartesian electric field (E_TC)\n");
40 print_out(VERBOSE_IO, "E_x = %le, E_y = %le, E_z = %le\n",
41 offload_data->Exyz[0], offload_data->Exyz[1],
42 offload_data->Exyz[2]);
43
44 return 0;
45}
46
54 real** offload_array) {
55 free(*offload_array);
56 *offload_array = NULL;
57}
58
66void E_TC_init(E_TC_data* Edata, E_TC_offload_data* offload_data,
67 real* offload_array) {
68 Edata->Exyz = offload_data->Exyz;
69}
70
86a5err E_TC_eval_E(real E[3], real r, real phi, real z, E_TC_data* Edata,
87 B_field_data* Bdata) {
88 math_vec_xyz2rpz(Edata->Exyz, E, phi);
89
90 return 0;
91}
Header file for B_field.c.
void E_TC_free_offload(E_TC_offload_data *offload_data, real **offload_array)
Free offload array and return null pointer.
Definition E_TC.c:53
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:86
void E_TC_init(E_TC_data *Edata, E_TC_offload_data *offload_data, real *offload_array)
Initialize electric field simulation data.
Definition E_TC.c:66
int E_TC_init_offload(E_TC_offload_data *offload_data, real **offload_array)
Initialize electric field data and check inputs.
Definition E_TC.c:33
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:63
Trivial Cartesian electric field simulation data.
Definition E_TC.h:27
real * Exyz
Definition E_TC.h:28
Trivial Cartesian electric field offload data.
Definition E_TC.h:18
real Exyz[3]
Definition E_TC.h:19
int offload_array_length
Definition E_TC.h:21