Report Typos and Errors    
Semi-Lagrangian Library
Modular library for kinetic and gyrokinetic simulations of plasmas in fusion energy devices.
Derived types and interfaces | Functions/Subroutines
sll_m_sparse_grid_2d Module Reference

Description

Implementation of a 2D sparse grid with interpolation routines.

Author
Katharina Kormann, IPP
Todo:
Implement the optimized interpolation routines for option boundary=1

<DETAILED_DESCRIPTION>

Derived types and interfaces

type  sll_t_sparse_grid_2d
 Sparse grid object for 2d with interpolation routines. More...
 

Functions/Subroutines

subroutine interpolate_array_disp_sgfft (interpolator, dim, displacment_in, data_in, data_out)
 Compute value at displaced grid points using trigonometric interpolation (based on SG FFT) More...
 
subroutine initialize_sg2d (interpolator, levels, order, interpolation, interpolation_type, eta_min, eta_max, boundary, modified)
 Initialize a 2d sparse grid object. More...
 
subroutine set_hierarchy_info (interpolator, counter, cdim, lvecin, kvecin, novecin)
 Helfer function for initialization. Setting all the information needed for node counter of the sparse grid along dimension cdim. More...
 
subroutine set_hierarchy_info_boundary (interpolator, counter, cdim, lvecin, kvecin, novecin)
 Same as set_hierarchy_info but for points on the boundary along dimension cdim. More...
 
real(kind=f64) function interpolate_value_sg (interpolator, data, eta)
 Value at eta interpolated from the hierarchical surplus data using standard sparse grid interpolation. More...
 
real(kind=f64) function interpolate_from_hierarchical_surplus (interpolator, data, eta)
 Implementation of interpolate_value_sg for periodic sparse grid. More...
 
real(kind=f64) function interpolate_from_hierarchical_surplus_boundary (interpolator, data, eta)
 Implementation of interpolate_value_sg for sparse grid with boundary. More...
 
subroutine interpolate_const_disp (interpolator, dorder, displacement, data_in, data_out, hiera)
 Interpolation function for interpolation at (constantly) displaced grid points; displacement only in dimension dim. It is another implementation of the base-class function "interpolate_disp". The advantage is that we can not revisit nodes as we do in the recursive dimension-independently-programmed version. More...
 
subroutine interpolate_disp_nconst_in_1d (interpolator, displacement, dorder, data_in, data_out)
 Functionality: Interpolates the function values for a displacement on in dimension (periodic b.c. i.e. dimension 1 or 2) where the displacement is allowed to be non-constant in one other dimension (Dirichlet b.c. i.e. dimension 3 or 3). More...
 
subroutine interpolate_disp_linnconst_in_1d (interpolator, displacement, dorder, data_in, data_out)
 As interpolate_disp_nconst_in_1d but displacement dependent on displacement*coordinate(dorder(2)) More...
 
subroutine fg_to_sg (interpolator, fg_values, sg_values)
 Set sparse grid values from fg vector. More...
 
integer(kind=i32) function, dimension(2) fg_index (interpolator, sg_index)
 Compute the index of a sparse grid node on level "level" with index "index_on_level" on full grid with of max_level. More...
 
subroutine tohierarchical (interpolator, data_in, data_out)
 Compute Fourier coefficient on sparse grid. More...
 
subroutine todehi (interpolator, data_array)
 
subroutine tohira (interpolator, data_array)
 
subroutine tonodal (interpolator, data_in, data_out)
 
subroutine displace (interpolator, dim, displacement, data)
 Compute the Fourier coefficients of at displaced grid points from Fourier coefficients. More...
 
subroutine spfft (interpolator, data_in, data_out)
 Fourier transform on sparse grid. More...
 
subroutine ispfft (interpolator, data_in, data_out)
 Inverse Fourier transform. More...
 
subroutine filter_highest (interpolator, data)
 
subroutine filter (interpolator, data)
 
subroutine linear_filter (interpolator, data, hs, width)
 

Function/Subroutine Documentation

◆ displace()

subroutine sll_m_sparse_grid_2d::displace ( class(sll_t_sparse_grid_2d), intent(inout)  interpolator,
integer(kind=i32), intent(in)  dim,
real(kind=f64), intent(in)  displacement,
complex(kind=f64), dimension(:), intent(inout)  data 
)
private

Compute the Fourier coefficients of at displaced grid points from Fourier coefficients.

Parameters
[in,out]interpolatorsparse grid object
[in,out]dataFourier coefficients of input and output function, respectively
[in]displacementThe constant displacement along dimension dim
[in]dimDimension along which we displace.

Definition at line 936 of file sll_m_sparse_grid_2d.F90.

◆ fg_index()

integer(kind=i32) function, dimension(2) sll_m_sparse_grid_2d::fg_index ( class(sll_t_sparse_grid_2d), intent(in)  interpolator,
integer(kind=i32), intent(in)  sg_index 
)
private

Compute the index of a sparse grid node on level "level" with index "index_on_level" on full grid with of max_level.

Parameters
[in]sg_indexindex of point on sparse grid
Returns
vector of full grid indices
Parameters
[in]interpolatorSparse grid object

Definition at line 806 of file sll_m_sparse_grid_2d.F90.

Here is the caller graph for this function:

◆ fg_to_sg()

subroutine sll_m_sparse_grid_2d::fg_to_sg ( class(sll_t_sparse_grid_2d), intent(in)  interpolator,
real(kind=f64), dimension(:, :), intent(in)  fg_values,
real(kind=f64), dimension(:), intent(out)  sg_values 
)
private

Set sparse grid values from fg vector.

Parameters
[in]fg_valuesValues of the full grid
[out]sg_valuesVectro with sparse grid values
[in]interpolatorsparse grid object

Definition at line 774 of file sll_m_sparse_grid_2d.F90.

Here is the call graph for this function:

◆ filter()

subroutine sll_m_sparse_grid_2d::filter ( class(sll_t_sparse_grid_2d), intent(inout)  interpolator,
real(kind=f64), dimension(:), intent(inout)  data 
)
private

Definition at line 1054 of file sll_m_sparse_grid_2d.F90.

◆ filter_highest()

subroutine sll_m_sparse_grid_2d::filter_highest ( class(sll_t_sparse_grid_2d), intent(inout)  interpolator,
real(kind=f64), dimension(:), intent(inout)  data 
)
private

Definition at line 1023 of file sll_m_sparse_grid_2d.F90.

◆ initialize_sg2d()

subroutine sll_m_sparse_grid_2d::initialize_sg2d ( class(sll_t_sparse_grid_2d), intent(inout)  interpolator,
integer(kind=i32), dimension(:), intent(in)  levels,
integer(kind=i32), intent(in)  order,
integer(kind=i32), intent(in)  interpolation,
integer(kind=i32), intent(in)  interpolation_type,
real(kind=f64), dimension(:), intent(in)  eta_min,
real(kind=f64), dimension(:), intent(in)  eta_max,
integer(kind=i32), intent(in)  boundary,
integer(kind=i32), intent(in)  modified 
)
private

Initialize a 2d sparse grid object.

Parameters
[in,out]interpolatorsparse grid object
[in]eta_mineta_min defines the lower bound of the domain
[in]eta_maxeta_max defines the upper bound of the domain
[in]levelslevels defines the maximum level in the sparse grid for each direction
[in]orderorder of the sparse grid functions
[in]interpolationorder of the interpolator
[in]interpolation_typeChoose spline (interpolation_type = 0) or Lagrange (interpolation_type = 1) interpolation for the 1D interpolators if not traditional sparse grid interpolation is used.
[in]modifiedmodified defines if we have a traditional sparse grid for modified = 0 (then the l_1 norm of the levels is bounded by max(levels) ) or if the boundary is sparsified for modified = 1 (then the l_1 norm of the levels is bounded by max(levels)+1 )
[in]boundaryboundary defines the boundary conditions: define 0 for periodic boundary conditions and 1 for zero inflow boundaries

Definition at line 81 of file sll_m_sparse_grid_2d.F90.

◆ interpolate_array_disp_sgfft()

subroutine sll_m_sparse_grid_2d::interpolate_array_disp_sgfft ( class(sll_t_sparse_grid_2d), intent(inout)  interpolator,
integer(kind=i32), intent(in)  dim,
real(kind=f64), intent(in)  displacment_in,
complex(kind=f64), dimension(:), intent(inout)  data_in,
real(kind=f64), dimension(:), intent(out)  data_out 
)
private

Compute value at displaced grid points using trigonometric interpolation (based on SG FFT)

Parameters
[in,out]interpolatorSparse grid object
[in]dimdimension along which the points should be displaced with displacement_in
[in]displacment_indisplacement of the data points along dimension dim
[in,out]data_inFourier transformed values on the sparse grid
[out]data_outFunction values on the sparse grid after displacement

Definition at line 60 of file sll_m_sparse_grid_2d.F90.

◆ interpolate_const_disp()

subroutine sll_m_sparse_grid_2d::interpolate_const_disp ( class(sll_t_sparse_grid_2d), intent(inout)  interpolator,
integer(kind=i32), dimension(:), intent(in)  dorder,
real(kind=f64), intent(in)  displacement,
real(kind=f64), dimension(:), intent(inout)  data_in,
real(kind=f64), dimension(:), intent(out)  data_out,
logical, intent(in)  hiera 
)
private

Interpolation function for interpolation at (constantly) displaced grid points; displacement only in dimension dim. It is another implementation of the base-class function "interpolate_disp". The advantage is that we can not revisit nodes as we do in the recursive dimension-independently-programmed version.

Parameters
[in,out]interpolatorsparse grid object
[in]dorderdorder(1) gives the dimension along which to displace the points, dorder(2) the other dimension
[in,out]data_inhierarchical surplus
[out]data_outValue of the function or the hierarchical surplus (depending on value of hiera) for the displaced data points.
[in]displacementConstant diplacement along dimension dorder(1)
[in]hieraIf the result should be the hierarchical surplus, define hiera = .TRUE.; if the result should be the function values at the data points give hiera = .FALSE.

Definition at line 565 of file sll_m_sparse_grid_2d.F90.

◆ interpolate_disp_linnconst_in_1d()

subroutine sll_m_sparse_grid_2d::interpolate_disp_linnconst_in_1d ( class(sll_t_sparse_grid_2d), intent(inout)  interpolator,
real(kind=f64), intent(in)  displacement,
integer(kind=i32), dimension(:), intent(in)  dorder,
real(kind=f64), dimension(:), intent(inout)  data_in,
real(kind=f64), dimension(:), intent(out)  data_out 
)
private

As interpolate_disp_nconst_in_1d but displacement dependent on displacement*coordinate(dorder(2))

Definition at line 698 of file sll_m_sparse_grid_2d.F90.

◆ interpolate_disp_nconst_in_1d()

subroutine sll_m_sparse_grid_2d::interpolate_disp_nconst_in_1d ( class(sll_t_sparse_grid_2d), intent(inout)  interpolator,
real(kind=f64), dimension(:), intent(in)  displacement,
integer(kind=i32), dimension(:), intent(in)  dorder,
real(kind=f64), dimension(:), intent(inout)  data_in,
real(kind=f64), dimension(:), intent(out)  data_out 
)
private

Functionality: Interpolates the function values for a displacement on in dimension (periodic b.c. i.e. dimension 1 or 2) where the displacement is allowed to be non-constant in one other dimension (Dirichlet b.c. i.e. dimension 3 or 3).

Parameters
[in,out]interpolatorSparse grid object
[in,out]data_inhierarchical surplus of the present function
[out]data_outvalues of the displaced function
[in]dorderOrdering of the dimensions. dorder(1) (=1 or 2) gives the dimension where we want to displace, dorder(2) (=3 or 4) gives the dimension of which the displacement is dependent. dorder(3) = 1 or 2 not dorder(1) and dorder(4) = 3 or 4 not dorder(2).
[in]displacementVector containing the values of the displacement (in hierarchical order, one dimensional)

Definition at line 618 of file sll_m_sparse_grid_2d.F90.

◆ interpolate_from_hierarchical_surplus()

real(kind=f64) function sll_m_sparse_grid_2d::interpolate_from_hierarchical_surplus ( class(sll_t_sparse_grid_2d), intent(inout)  interpolator,
real(kind=f64), dimension(:), intent(in)  data,
real(kind=f64), dimension(:), intent(in)  eta 
)
private

Implementation of interpolate_value_sg for periodic sparse grid.

Definition at line 410 of file sll_m_sparse_grid_2d.F90.

Here is the caller graph for this function:

◆ interpolate_from_hierarchical_surplus_boundary()

real(kind=f64) function sll_m_sparse_grid_2d::interpolate_from_hierarchical_surplus_boundary ( class(sll_t_sparse_grid_2d), intent(inout)  interpolator,
real(kind=f64), dimension(:), intent(in)  data,
real(kind=f64), dimension(:), intent(in)  eta 
)
private

Implementation of interpolate_value_sg for sparse grid with boundary.

Definition at line 466 of file sll_m_sparse_grid_2d.F90.

Here is the caller graph for this function:

◆ interpolate_value_sg()

real(kind=f64) function sll_m_sparse_grid_2d::interpolate_value_sg ( class(sll_t_sparse_grid_2d), intent(inout)  interpolator,
real(kind=f64), dimension(:), intent(in)  data,
real(kind=f64), dimension(:), intent(in)  eta 
)
private

Value at eta interpolated from the hierarchical surplus data using standard sparse grid interpolation.

Parameters
[in,out]interpolatorSparse grid object
[in]datavalues of the hierarchical surplus
Returns
result of the interpolation
Parameters
[in]etacoordinates of the point where to interpolate

Definition at line 393 of file sll_m_sparse_grid_2d.F90.

Here is the call graph for this function:

◆ ispfft()

subroutine sll_m_sparse_grid_2d::ispfft ( class(sll_t_sparse_grid_2d), intent(inout)  interpolator,
complex(kind=f64), dimension(:), intent(inout)  data_in,
real(kind=f64), dimension(:), intent(out)  data_out 
)
private

Inverse Fourier transform.

Definition at line 1007 of file sll_m_sparse_grid_2d.F90.

◆ linear_filter()

subroutine sll_m_sparse_grid_2d::linear_filter ( class(sll_t_sparse_grid_2d), intent(inout)  interpolator,
real(kind=f64), dimension(:), intent(inout)  data,
real(kind=f64), dimension(:), intent(inout)  hs,
real(kind=f64), dimension(2), intent(in)  width 
)
private

Definition at line 1080 of file sll_m_sparse_grid_2d.F90.

◆ set_hierarchy_info()

subroutine sll_m_sparse_grid_2d::set_hierarchy_info ( class(sll_t_sparse_grid_2d), intent(inout)  interpolator,
integer(kind=i32), intent(in)  counter,
integer(kind=i32), intent(in)  cdim,
integer(kind=i32), dimension(:), intent(in)  lvecin,
integer(kind=i32), dimension(:), intent(in)  kvecin,
integer(kind=i32), dimension(:), intent(in)  novecin 
)
private

Helfer function for initialization. Setting all the information needed for node counter of the sparse grid along dimension cdim.

Parameters
[in]cdimcurrent dimension
[in]lvecinvector of current levels
[in]kvecinvector of current index within level
[in]novecinvector with number of points on the current level along each dimension

Definition at line 208 of file sll_m_sparse_grid_2d.F90.

◆ set_hierarchy_info_boundary()

subroutine sll_m_sparse_grid_2d::set_hierarchy_info_boundary ( class(sll_t_sparse_grid_2d), intent(inout)  interpolator,
integer(kind=i32), intent(in)  counter,
integer(kind=i32), intent(in)  cdim,
integer(kind=i32), dimension(:), intent(in)  lvecin,
integer(kind=i32), dimension(:), intent(in)  kvecin,
integer(kind=i32), dimension(:), intent(in)  novecin 
)
private

Same as set_hierarchy_info but for points on the boundary along dimension cdim.

Parameters
[in]cdimcurrent dimension
[in]countercounter for node

Definition at line 285 of file sll_m_sparse_grid_2d.F90.

◆ spfft()

subroutine sll_m_sparse_grid_2d::spfft ( class(sll_t_sparse_grid_2d), intent(inout)  interpolator,
real(kind=f64), dimension(:), intent(in)  data_in,
complex(kind=f64), dimension(:), intent(out)  data_out 
)
private

Fourier transform on sparse grid.

Definition at line 996 of file sll_m_sparse_grid_2d.F90.

◆ todehi()

subroutine sll_m_sparse_grid_2d::todehi ( class(sll_t_sparse_grid_2d), intent(inout)  interpolator,
complex(kind=f64), dimension(:), intent(inout)  data_array 
)
private
Parameters
[in,out]interpolatorSparse grid object
[in,out]data_arrayon input: hierarchical surplus; on output: function values

Definition at line 857 of file sll_m_sparse_grid_2d.F90.

◆ tohierarchical()

subroutine sll_m_sparse_grid_2d::tohierarchical ( class(sll_t_sparse_grid_2d), intent(inout)  interpolator,
real(kind=f64), dimension(:), intent(in)  data_in,
complex(kind=f64), dimension(:), intent(out)  data_out 
)
private

Compute Fourier coefficient on sparse grid.

Parameters
[in,out]interpolatorSparse grid object
[in]data_inValues at the sparse grid points
[out]data_outValues of the linear hierarchical surplus

Definition at line 831 of file sll_m_sparse_grid_2d.F90.

◆ tohira()

subroutine sll_m_sparse_grid_2d::tohira ( class(sll_t_sparse_grid_2d), intent(inout)  interpolator,
complex(kind=f64), dimension(:), intent(inout)  data_array 
)
private

Definition at line 883 of file sll_m_sparse_grid_2d.F90.

◆ tonodal()

subroutine sll_m_sparse_grid_2d::tonodal ( class(sll_t_sparse_grid_2d), intent(inout)  interpolator,
complex(kind=f64), dimension(:), intent(inout)  data_in,
real(kind=f64), dimension(:), intent(out)  data_out 
)
private

Definition at line 907 of file sll_m_sparse_grid_2d.F90.

    Report Typos and Errors