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

Linear interpolation. More...

#include <stdlib.h>
#include <math.h>
#include "../ascot5.h"
#include "../spline/interp.h"
#include "linint.h"

Go to the source code of this file.

Functions

void linint1D_init (linint1D_data *str, real *c, int n_x, int bc_x, real x_min, real x_max)
 Initialize linear interpolation struct for scalar 1D data.
 
int linint1D_eval_f (real *f, linint1D_data *str, real x)
 Evaluate interpolated value of 1D scalar field.
 

Detailed Description

Linear interpolation.

Definition in file linint1D.c.

Function Documentation

◆ linint1D_init()

void linint1D_init ( linint1D_data * str,
real * c,
int n_x,
int bc_x,
real x_min,
real x_max )

Initialize linear interpolation struct for scalar 1D data.

Parameters
strpointer to struct to be initialized
carray where data is stored
n_xnumber of data points in the x direction
bc_xboundary condition for x axis
x_minminimum value of the x axis
x_maxmaximum value of the x axis

Definition at line 22 of file linint1D.c.

◆ linint1D_eval_f()

int linint1D_eval_f ( real * f,
linint1D_data * str,
real x )

Evaluate interpolated value of 1D scalar field.

This function evaluates the interpolated value of a 1D scalar field using linear interpolation.

Parameters
fvariable in which to place the evaluated value
strdata struct for data interpolation
xx-coordinate
Returns
zero on success and one if x point is outside the grid.

< Normalized x coordinate in current cell

Definition at line 47 of file linint1D.c.