Stellarator-Tools
|
This modules contains routines for interpolating points inside a grid. This was originally written by S. P. Hirshman. It has been modified for thread safety converting it to be object oriented by M. Cianciosa. More...
Data Types | |
interface | bivariate_class |
An object containing persistent data for the bivariate interpolation. More... | |
Functions/Subroutines | |
class(bivariate_class) function, pointer | bivariate_construct (ns, nu) |
Construct a bivariate_type object. More... | |
subroutine | bivariate_destruct (this) |
Deconstruct a bivariate_type object. More... | |
subroutine | bivariate_set_grids_2d (this, rsu, zsu, rgrid, zgrid) |
Set up the interpolation grid for a phi plane. More... | |
subroutine | bivariate_set_grids_1d (this, rsu, zsu, rgrid, zgrid) |
Set up the interpolation grid for a phi plane. More... | |
subroutine | bivariate_get_4pt (this, resp_rz, resp_su) |
Interpolate points on to response function grid. More... | |
This modules contains routines for interpolating points inside a grid. This was originally written by S. P. Hirshman. It has been modified for thread safety converting it to be object oriented by M. Cianciosa.
class (bivariate_class) function, pointer bivariate::bivariate_construct | ( | integer, intent(in) | ns, |
integer, intent(in) | nu | ||
) |
Construct a bivariate_type object.
Allocates memory and initializes a bivariate_type object.
[in] | ns | Number of radial grid points. |
[in] | nu | Number of poloidal grid points. |
subroutine bivariate::bivariate_destruct | ( | type (bivariate_class), intent(inout) | this | ) |
Deconstruct a bivariate_type object.
Deallocates memory and uninitializes a bivariate_type object.
[in,out] | this | A bivariate_type instance. |
subroutine bivariate::bivariate_get_4pt | ( | class (bivariate_class), intent(inout) | this, |
real (rprec), dimension(this%nrz), intent(in) | resp_rz, | ||
real (rprec), dimension(this%nsu), intent(out) | resp_su | ||
) |
Interpolate points on to response function grid.
Determin response function on the s,u grid by 4 point bivariate interpolation of response function on the r,z mesh at a fixed toroidal plane. This uses a 2-D interpolation based on the four point formula in Abramowitz and Stegun, Eq. 25.2.66. Note that the arrays need an explicit size in dimension to allow the 2D arrays to be passed to the 1D arguments.
[in,out] | this | A bivariate_type instance. |
[in] | resp_rz | Response function on the rz grid. |
[out] | resp_su | Response function on the su grid. |
subroutine bivariate::bivariate_set_grids_1d | ( | class (bivariate_class), intent(inout) | this, |
real (rprec), dimension(:), intent(in) | rsu, | ||
real (rprec), dimension(:), intent(in) | zsu, | ||
real (rprec), dimension(:), intent(in) | rgrid, | ||
real (rprec), dimension(:), intent(in) | zgrid | ||
) |
Set up the interpolation grid for a phi plane.
Compute the indices (ir_bi, jz_bi) and weight factors (wij_bi) for performing bivariate (4 pt) interpolation FROM a rectangular (R X Z) grid TO a general (non-orthogonal) grid (s, u). R and Z grids may have different mesh sizes.
[in,out] | this | A bivariate_type instance. |
[in] | rsu | r coordinate at s,u |
[in] | zsu | z coordinate at s,u |
[in] | rgrid | R coordinate on a fixed, equally spaced grid |
[in] | zgrid | Z coordinate on a fixed, equally spaced grid |
subroutine bivariate::bivariate_set_grids_2d | ( | class (bivariate_class), intent(inout) | this, |
real (rprec), dimension(:,:), intent(in) | rsu, | ||
real (rprec), dimension(:,:), intent(in) | zsu, | ||
real (rprec), dimension(:), intent(in) | rgrid, | ||
real (rprec), dimension(:), intent(in) | zgrid | ||
) |
Set up the interpolation grid for a phi plane.
Compute the indices (ir_bi, jz_bi) and weight factors (wij_bi) for performing bivariate (4 pt) interpolation FROM a rectangular (R X Z) grid TO a general (non-orthogonal) grid (s, u). R and Z grids may have different mesh sizes.
[in,out] | this | A bivariate_type instance. |
[in] | rsu | r coordinate at s,u |
[in] | zsu | z coordinate at s,u |
[in] | rgrid | R coordinate on a fixed, equally spaced grid |
[in] | zgrid | Z coordinate on a fixed, equally spaced grid |