ASCOT5
Loading...
Searching...
No Matches
Functions
E_TC.c File Reference

Trivial Cartesian Electric field. More...

#include <stdlib.h>
#include "../ascot5.h"
#include "../math.h"
#include "../error.h"
#include "../print.h"
#include "../B_field.h"
#include "E_TC.h"

Go to the source code of this file.

Functions

int E_TC_init_offload (E_TC_offload_data *offload_data, real **offload_array)
 Initialize electric field data and check inputs.
 
void E_TC_free_offload (E_TC_offload_data *offload_data, real **offload_array)
 Free offload array and return null pointer.
 
void E_TC_init (E_TC_data *Edata, E_TC_offload_data *offload_data, real *offload_array)
 Initialize electric field simulation data.
 
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.
 

Detailed Description

Trivial Cartesian Electric field.

Electric field that has constant x, y, and z components. Note that this field is defined in Cartesian coordinates and not cylindrical. This field is intended for testing purposes and to act as a dummy input.

Definition in file E_TC.c.

Function Documentation

◆ E_TC_init_offload()

int E_TC_init_offload ( E_TC_offload_data * offload_data,
real ** offload_array )

Initialize electric field data and check inputs.

The offload data struct must have the following fields initialized:

There is nothing left to initialize.

Instead this function only prints values of electric field components as a sanity check.

Parameters
offload_datapointer to offload data struct
offload_arraypointer to pointer to offload array
Returns
Zero to indicate initialization succeeded

Definition at line 33 of file E_TC.c.

◆ E_TC_free_offload()

void E_TC_free_offload ( E_TC_offload_data * offload_data,
real ** offload_array )

Free offload array and return null pointer.

Parameters
offload_datapointer to offload data struct
offload_arraypointer to pointer to offload array

Definition at line 53 of file E_TC.c.

◆ E_TC_init()

void E_TC_init ( E_TC_data * Edata,
E_TC_offload_data * offload_data,
real * offload_array )

Initialize electric field simulation data.

Parameters
Edatapointer to data struct on target
offload_datapointer to offload data struct
offload_arraypointer to offload array

Definition at line 66 of file E_TC.c.

◆ 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.

Even though this module represents a Cartesian electric field, the returned values are given in cylindrical coordinates.

Parameters
Epointer to array where electric field values are stored
rR coordinate [m]
phiphi coordinate [deg]
zz coordinate [m]
Edatapointer to magnetic field data struct
Bdatapointer to magnetic field data struct
Returns
Zero to indicate success

Definition at line 86 of file E_TC.c.