ASCOT5
Loading...
Searching...
No Matches
E_1DS.c File Reference

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 (E_1DS_data *data, int nrho, real rhomin, real rhomax, real reff, real *dvdrho)
 Initialize 1DS electric field data.
 
void E_1DS_free (E_1DS_data *data)
 Free allocated resources.
 
void E_1DS_offload (E_1DS_data *data)
 Offload data to the accelerator.
 
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.
 

Detailed Description

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.

Function Documentation

◆ E_1DS_init()

int E_1DS_init ( E_1DS_data * data,
int nrho,
real rhomin,
real rhomax,
real reff,
real * dvdrho )

Initialize 1DS electric field data.

Parameters
datapointer to the data struct
nrhonumber of points in the rho grid
rhominminimum rho value in the grid
rhomaxmaximum rho value in the grid
reffeffective minor radius
dvdrhogradient of the potential
Returns
zero if initialization succeeded

Definition at line 29 of file E_1DS.c.

◆ E_1DS_free()

void E_1DS_free ( E_1DS_data * data)

Free allocated resources.

Parameters
datapointer to the data struct

Definition at line 58 of file E_1DS.c.

◆ E_1DS_offload()

void E_1DS_offload ( E_1DS_data * data)

Offload data to the accelerator.

Parameters
datapointer to the data struct

Definition at line 67 of file E_1DS.c.

◆ E_1DS_eval_E()

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.

Parameters
Earray where the electric field will be stored (E_r -> E[1], E_phi -> E[1], E_z -> E[2])
rR-coordiante [m]
phiphi-coordinate [rad]
zz-coordiante [m]
Edatapointer to electric field data
Bdatapointer to magnetic field data
Returns
zero if evaluation succeeded

Definition at line 89 of file E_1DS.c.