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

3D neutral data with trilinear interpolation More...

#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include "../ascot5.h"
#include "../error.h"
#include "../print.h"
#include "N0_3D.h"
#include "../linint/linint.h"

Go to the source code of this file.

Functions

int N0_3D_init_offload (N0_3D_offload_data *offload_data, real **offload_array)
 Initialize offload data.
 
void N0_3D_free_offload (N0_3D_offload_data *offload_data, real **offload_array)
 Free offload array and reset parameters.
 
void N0_3D_init (N0_3D_data *ndata, N0_3D_offload_data *offload_data, real *offload_array)
 Initialize neutral data on target.
 
a5err N0_3D_eval_n0 (real *n0, real r, real phi, real z, N0_3D_data *ndata)
 Evaluate neutral density.
 
a5err N0_3D_eval_t0 (real *t0, real r, real phi, real z, N0_3D_data *ndata)
 Evaluate neutral temperature.
 
int N0_3D_get_n_species (N0_3D_data *ndata)
 Return number of neutral species.
 

Detailed Description

3D neutral data with trilinear interpolation

Definition in file N0_3D.c.

Function Documentation

◆ N0_3D_init_offload()

int N0_3D_init_offload ( N0_3D_offload_data * offload_data,
real ** offload_array )

Initialize offload data.

Parameters
offload_datapointer to offload data struct
offload_arraypointer to offload data array
Returns
zero if initialization succeeded

Definition at line 24 of file N0_3D.c.

◆ N0_3D_free_offload()

void N0_3D_free_offload ( N0_3D_offload_data * offload_data,
real ** offload_array )

Free offload array and reset parameters.

This function deallocates the offload_array.

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

Definition at line 66 of file N0_3D.c.

◆ N0_3D_init()

void N0_3D_init ( N0_3D_data * ndata,
N0_3D_offload_data * offload_data,
real * offload_array )

Initialize neutral data on target.

This function copies parameters from the offload struct to the struct on target and sets the data pointers on target struct to correct offsets in the offload array.

Any initialization that requires any computations must have been done already when the offload struct was initialized.

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

Definition at line 86 of file N0_3D.c.

◆ N0_3D_eval_n0()

a5err N0_3D_eval_n0 ( real * n0,
real r,
real phi,
real z,
N0_3D_data * ndata )

Evaluate neutral density.

This function evaluates the neutral density at the given coordinates using trilinear interpolation on the 3D neutral density data.

Parameters
n0n0 value will be stored in n0[0]
rr coordinate
phiphi coordinate
zz coordinate
ndatapointer to neutral data struct
Returns
zero if evaluation succeeded

Definition at line 129 of file N0_3D.c.

◆ N0_3D_eval_t0()

a5err N0_3D_eval_t0 ( real * t0,
real r,
real phi,
real z,
N0_3D_data * ndata )

Evaluate neutral temperature.

This function evaluates the neutral temperature at the given coordinates using trilinear interpolation on the 3D neutral temperature data.

Parameters
t0t0 value will be stored in t0[0]
rr coordinate
phiphi coordinate
zz coordinate
ndatapointer to neutral data struct
Returns
zero if evaluation succeeded

Definition at line 157 of file N0_3D.c.

◆ N0_3D_get_n_species()

int N0_3D_get_n_species ( N0_3D_data * ndata)

Return number of neutral species.

Parameters
ndatapointer to neutral data struct
Returns
number of neutral species

Definition at line 178 of file N0_3D.c.