ASCOT5
|
Cubic spline interpolation in explicit form. More...
#include <stdlib.h>
#include <math.h>
#include "../ascot5.h"
#include "interp.h"
#include "spline.h"
Go to the source code of this file.
Functions | |
int | interp1Dexpl_init_coeff (real *c, real *f, int n_x, int bc_x, real x_min, real x_max) |
Calculate cubic spline interpolation coefficients for scalar 1D data. | |
void | interp1Dexpl_init_spline (interp1D_data *str, real *c, int n_x, int bc_x, real x_min, real x_max) |
Initialize a cubic spline. | |
a5err | interp1Dexpl_eval_f (real *f, interp1D_data *str, real x) |
Evaluate interpolated value of 1D scalar field. | |
a5err | interp1Dexpl_eval_df (real *f_df, interp1D_data *str, real x) |
Evaluate interpolated value of 1D and its 1st and 2nd derivatives. | |
Cubic spline interpolation in explicit form.
Definition in file interp1Dexpl.c.
Calculate cubic spline interpolation coefficients for scalar 1D data.
This function calculates the cubic spline interpolation coefficients and stores them in a pre-allocated array. Explicit cofficients are calculated.
c | allocated array of length n_x*4 to store the coefficients |
f | 1D data to be interpolated |
n_x | number of data points in the x axis |
bc_x | boundary condition for the x axis |
x_min | minimum value of the x axis |
x_max | maximum value of the x axis |
Definition at line 25 of file interp1Dexpl.c.
void interp1Dexpl_init_spline | ( | interp1D_data * | str, |
real * | c, | ||
int | n_x, | ||
int | bc_x, | ||
real | x_min, | ||
real | x_max ) |
Initialize a cubic spline.
str | pointer to spline to be initialized |
c | array where coefficients are stored |
n_x | number of data points in the x direction |
bc_x | boundary condition for x axis |
x_min | minimum value of the x axis |
x_max | maximum value of the x axis |
Definition at line 52 of file interp1Dexpl.c.
a5err interp1Dexpl_eval_f | ( | real * | f, |
interp1D_data * | str, | ||
real | x ) |
Evaluate interpolated value of 1D scalar field.
This function evaluates the interpolated value of a 1D scalar field using bicubic spline interpolation coefficients of the explicit form.
f | variable in which to place the evaluated value |
str | data struct for data interpolation |
x | x-coordinate |
Definition at line 81 of file interp1Dexpl.c.
a5err interp1Dexpl_eval_df | ( | real * | f_df, |
interp1D_data * | str, | ||
real | x ) |
Evaluate interpolated value of 1D and its 1st and 2nd derivatives.
This function evaluates the interpolated value of a 1D scalar field and its 1st and 2nd derivatives using bicubic spline interpolation coefficients of the explicit form.
The evaluated values are returned in an array with following elements:
f_df | array in which to place the evaluated values |
str | data struct for data interpolation |
x | x-coordinate |
Definition at line 131 of file interp1Dexpl.c.