ASCOT5
|
Tricubic spline interpolation in explicit form. More...
#include <stdlib.h>
#include <math.h>
#include "../ascot5.h"
#include "../consts.h"
#include "interp.h"
#include "spline.h"
Go to the source code of this file.
Functions | |
int | interp3Dexpl_init_coeff (real *c, real *f, int n_x, int n_y, int n_z, int bc_x, int bc_y, int bc_z, real x_min, real x_max, real y_min, real y_max, real z_min, real z_max) |
Calculate tricubic spline interpolation coefficients for 3D data. | |
void | interp3Dexpl_init_spline (interp3D_data *str, real *c, int n_x, int n_y, int n_z, int bc_x, int bc_y, int bc_z, real x_min, real x_max, real y_min, real y_max, real z_min, real z_max) |
Initialize a tricubic spline. | |
a5err | interp3Dexpl_eval_f (real *f, interp3D_data *str, real x, real y, real z) |
Evaluate interpolated value of 3D scalar field. | |
a5err | interp3Dexpl_eval_df (real *f_df, interp3D_data *str, real x, real y, real z) |
Evaluate interpolated value of 3D field and 1st and 2nd derivatives. | |
Tricubic spline interpolation in explicit form.
Definition in file interp3Dexpl.c.
int interp3Dexpl_init_coeff | ( | real * | c, |
real * | f, | ||
int | n_x, | ||
int | n_y, | ||
int | n_z, | ||
int | bc_x, | ||
int | bc_y, | ||
int | bc_z, | ||
real | x_min, | ||
real | x_max, | ||
real | y_min, | ||
real | y_max, | ||
real | z_min, | ||
real | z_max ) |
Calculate tricubic spline interpolation coefficients for 3D data.
This function calculates the tricubic spline interpolation coefficients for the given data and stores them in an array. Explicit cofficients are calculated.
c | allocated array of length n_z*n_y*n_x*64 to store the coefficients |
f | 3D data to be interpolated |
n_x | number of data points in the x direction |
n_y | number of data points in the y direction |
n_z | number of data points in the z direction |
bc_x | boundary condition for x axis |
bc_y | boundary condition for y axis |
bc_z | boundary condition for z axis |
x_min | minimum value of the x axis |
x_max | maximum value of the x axis |
y_min | minimum value of the y axis |
y_max | maximum value of the y axis |
z_min | minimum value of the z axis |
z_max | maximum value of the z axis |
Definition at line 37 of file interp3Dexpl.c.
void interp3Dexpl_init_spline | ( | interp3D_data * | str, |
real * | c, | ||
int | n_x, | ||
int | n_y, | ||
int | n_z, | ||
int | bc_x, | ||
int | bc_y, | ||
int | bc_z, | ||
real | x_min, | ||
real | x_max, | ||
real | y_min, | ||
real | y_max, | ||
real | z_min, | ||
real | z_max ) |
Initialize a tricubic spline.
str | pointer to spline to be initialized |
c | array where coefficients are stored |
n_x | number of data points in the x direction |
n_y | number of data points in the y direction |
n_z | number of data points in the z direction |
bc_x | boundary condition for x axis |
bc_y | boundary condition for y axis |
bc_z | boundary condition for z axis |
x_min | minimum value of the x axis |
x_max | maximum value of the x axis |
y_min | minimum value of the y axis |
y_max | maximum value of the y axis |
z_min | minimum value of the z axis |
z_max | maximum value of the z axis |
Definition at line 153 of file interp3Dexpl.c.
Evaluate interpolated value of 3D scalar field.
This function evaluates the interpolated value of a 3D scalar field using tricubic 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 |
y | y-coordinate |
z | z-coordinate |
< Index jump to cell
Definition at line 200 of file interp3Dexpl.c.
Evaluate interpolated value of 3D field and 1st and 2nd derivatives.
This function evaluates the interpolated value of a 3D 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 |
y | y-coordinate |
z | z-coordinate |
Definition at line 340 of file interp3Dexpl.c.