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

Neutral interface. More...

#include <stdio.h>
#include "ascot5.h"
#include "error.h"
#include "print.h"
#include "neutral.h"
#include "neutral/N0_1D.h"
#include "neutral/N0_3D.h"

Go to the source code of this file.

Functions

void neutral_free (neutral_data *data)
 Free allocated resources.
 
void neutral_offload (neutral_data *data)
 Offload data to the accelerator.
 
a5err neutral_eval_n0 (real *n0, real rho, real r, real phi, real z, real t, neutral_data *ndata)
 Evaluate neutral density.
 
a5err neutral_eval_t0 (real *t0, real rho, real r, real phi, real z, real t, neutral_data *ndata)
 Evaluate neutral temperature.
 
int neutral_get_n_species (neutral_data *ndata)
 Get the number of neutral species.
 

Detailed Description

Neutral interface.

This is an interface through which neutral data is initialized and accessed. Reading e.g. from disk is done elsewhere.

To add a new neutral data instance, make sure these functions are implemented and called from this interface, and that neutral.h contains enum type for the new instance.

The interface checks which instance given data corresponds to from the "type"-field in neutral_offload_data or neutral_data that is given as an argument, and calls the relevant function for that instance.

Definition in file neutral.c.

Function Documentation

◆ neutral_free()

void neutral_free ( neutral_data * data)

Free allocated resources.

Parameters
datapointer to data struct

Definition at line 29 of file neutral.c.

◆ neutral_offload()

void neutral_offload ( neutral_data * data)

Offload data to the accelerator.

Parameters
datapointer to the data struct

Definition at line 45 of file neutral.c.

◆ neutral_eval_n0()

a5err neutral_eval_n0 ( real * n0,
real rho,
real r,
real phi,
real z,
real t,
neutral_data * ndata )

Evaluate neutral density.

This function evaluates the neutral density n0 at the given coordinates.

This is a SIMD function.

Parameters
n0pointer where neutral density is stored [m^-3]
rhonormalized poloidal flux coordinate
rR coordinate [m]
phiphi coordinate [deg]
zz coordinate [m]
ttime coordinate [s]
ndatapointer to neutral density data struct
Returns
Non-zero a5err value if evaluation failed, zero otherwise

Definition at line 73 of file neutral.c.

◆ neutral_eval_t0()

a5err neutral_eval_t0 ( real * t0,
real rho,
real r,
real phi,
real z,
real t,
neutral_data * ndata )

Evaluate neutral temperature.

This function evaluates the neutral temperature t0 at the given coordinates.

This is a SIMD function.

Parameters
t0pointer where neutral temperature is stored [J]
rhonormalized poloidal flux coordinate
rR coordinate [m]
phiphi coordinate [deg]
zz coordinate [m]
ttime coordinate [s]
ndatapointer to neutral temperature data struct
Returns
Non-zero a5err value if evaluation failed, zero otherwise

Definition at line 115 of file neutral.c.

◆ neutral_get_n_species()

int neutral_get_n_species ( neutral_data * ndata)

Get the number of neutral species.

Retrieve the number of how many neutral species the data contains.

This is a SIMD function.

Parameters
ndatapointer to neutral data struct
Returns
The number of neutral species

Definition at line 151 of file neutral.c.