V3FIT
Data Types | Functions/Subroutines
bivariate Module Reference

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_set_grids
 Interface for the setting of bivariate_type types either using bivariate_set_grids_1d or bivariate_set_grids_2d. More...
 
type  bivariate_type
 An object containing persistent data for the bivariate interpolation. More...
 

Functions/Subroutines

type(bivariate_type) 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 responce function grid. More...
 

Detailed Description

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.

Function/Subroutine Documentation

◆ bivariate_construct()

type (bivariate_type) 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.

Parameters
[in]nsNumber of radial grid points.
[in]nuNumber of poloidal grid points.
Returns
A pointer to a constructed bivariate_type object.

Definition at line 76 of file bivariate.f.

◆ bivariate_destruct()

subroutine bivariate::bivariate_destruct ( type (bivariate_type), pointer  this)

Deconstruct a bivariate_type object.

Deallocates memory and uninitializes a bivariate_type object.

Parameters
[in,out]thisA bivariate_type instance.

Definition at line 118 of file bivariate.f.

◆ bivariate_get_4pt()

subroutine bivariate::bivariate_get_4pt ( type (bivariate_type), 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 responce 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.

Parameters
[in,out]thisA bivariate_type instance.
[in]resp_rzResponse function on the rz grid.
[out]resp_suResponse function on the su grid.

Definition at line 391 of file bivariate.f.

◆ bivariate_set_grids_1d()

subroutine bivariate::bivariate_set_grids_1d ( type (bivariate_type), 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.

Parameters
[in,out]thisA bivariate_type instance.
[in]rsur coordinate at s,u
[in]zsuz coordinate at s,u
[in]rgridR coordinate on a fixed, equally spaced grid
[in]zgridZ coordinate on a fixed, equally spaced grid

Definition at line 290 of file bivariate.f.

◆ bivariate_set_grids_2d()

subroutine bivariate::bivariate_set_grids_2d ( type (bivariate_type), 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.

Parameters
[in,out]thisA bivariate_type instance.
[in]rsur coordinate at s,u
[in]zsuz coordinate at s,u
[in]rgridR coordinate on a fixed, equally spaced grid
[in]zgridZ coordinate on a fixed, equally spaced grid

Definition at line 187 of file bivariate.f.