Semi-Lagrangian Library
Modular library for kinetic and gyrokinetic simulations of plasmas in fusion energy devices.
|
Implementation of a 2D sparse grid with interpolation routines.
<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) |
|
private |
Compute the Fourier coefficients of at displaced grid points from Fourier coefficients.
[in,out] | interpolator | sparse grid object |
[in,out] | data | Fourier coefficients of input and output function, respectively |
[in] | displacement | The constant displacement along dimension dim |
[in] | dim | Dimension along which we displace. |
Definition at line 936 of file sll_m_sparse_grid_2d.F90.
|
private |
Compute the index of a sparse grid node on level "level" with index "index_on_level" on full grid with of max_level.
[in] | sg_index | index of point on sparse grid |
[in] | interpolator | Sparse grid object |
Definition at line 806 of file sll_m_sparse_grid_2d.F90.
|
private |
Set sparse grid values from fg vector.
[in] | fg_values | Values of the full grid |
[out] | sg_values | Vectro with sparse grid values |
[in] | interpolator | sparse grid object |
Definition at line 774 of file sll_m_sparse_grid_2d.F90.
|
private |
Definition at line 1054 of file sll_m_sparse_grid_2d.F90.
|
private |
Definition at line 1023 of file sll_m_sparse_grid_2d.F90.
|
private |
Initialize a 2d sparse grid object.
[in,out] | interpolator | sparse grid object |
[in] | eta_min | eta_min defines the lower bound of the domain |
[in] | eta_max | eta_max defines the upper bound of the domain |
[in] | levels | levels defines the maximum level in the sparse grid for each direction |
[in] | order | order of the sparse grid functions |
[in] | interpolation | order of the interpolator |
[in] | interpolation_type | Choose spline (interpolation_type = 0) or Lagrange (interpolation_type = 1) interpolation for the 1D interpolators if not traditional sparse grid interpolation is used. |
[in] | modified | modified 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] | boundary | boundary 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.
|
private |
Compute value at displaced grid points using trigonometric interpolation (based on SG FFT)
[in,out] | interpolator | Sparse grid object |
[in] | dim | dimension along which the points should be displaced with displacement_in |
[in] | displacment_in | displacement of the data points along dimension dim |
[in,out] | data_in | Fourier transformed values on the sparse grid |
[out] | data_out | Function values on the sparse grid after displacement |
Definition at line 60 of file sll_m_sparse_grid_2d.F90.
|
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.
[in,out] | interpolator | sparse grid object |
[in] | dorder | dorder(1) gives the dimension along which to displace the points, dorder(2) the other dimension |
[in,out] | data_in | hierarchical surplus |
[out] | data_out | Value of the function or the hierarchical surplus (depending on value of hiera) for the displaced data points. |
[in] | displacement | Constant diplacement along dimension dorder(1) |
[in] | hiera | If 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.
|
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.
|
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).
[in,out] | interpolator | Sparse grid object |
[in,out] | data_in | hierarchical surplus of the present function |
[out] | data_out | values of the displaced function |
[in] | dorder | Ordering 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] | displacement | Vector containing the values of the displacement (in hierarchical order, one dimensional) |
Definition at line 618 of file sll_m_sparse_grid_2d.F90.
|
private |
Implementation of interpolate_value_sg for periodic sparse grid.
Definition at line 410 of file sll_m_sparse_grid_2d.F90.
|
private |
Implementation of interpolate_value_sg for sparse grid with boundary.
Definition at line 466 of file sll_m_sparse_grid_2d.F90.
|
private |
Value at eta interpolated from the hierarchical surplus data using standard sparse grid interpolation.
[in,out] | interpolator | Sparse grid object |
[in] | data | values of the hierarchical surplus |
[in] | eta | coordinates of the point where to interpolate |
Definition at line 393 of file sll_m_sparse_grid_2d.F90.
|
private |
Inverse Fourier transform.
Definition at line 1007 of file sll_m_sparse_grid_2d.F90.
|
private |
Definition at line 1080 of file sll_m_sparse_grid_2d.F90.
|
private |
Helfer function for initialization. Setting all the information needed for node counter of the sparse grid along dimension cdim.
[in] | cdim | current dimension |
[in] | lvecin | vector of current levels |
[in] | kvecin | vector of current index within level |
[in] | novecin | vector with number of points on the current level along each dimension |
Definition at line 208 of file sll_m_sparse_grid_2d.F90.
|
private |
Same as set_hierarchy_info but for points on the boundary along dimension cdim.
[in] | cdim | current dimension |
[in] | counter | counter for node |
Definition at line 285 of file sll_m_sparse_grid_2d.F90.
|
private |
Fourier transform on sparse grid.
Definition at line 996 of file sll_m_sparse_grid_2d.F90.
|
private |
[in,out] | interpolator | Sparse grid object |
[in,out] | data_array | on input: hierarchical surplus; on output: function values |
Definition at line 857 of file sll_m_sparse_grid_2d.F90.
|
private |
Compute Fourier coefficient on sparse grid.
[in,out] | interpolator | Sparse grid object |
[in] | data_in | Values at the sparse grid points |
[out] | data_out | Values of the linear hierarchical surplus |
Definition at line 831 of file sll_m_sparse_grid_2d.F90.
|
private |
Definition at line 883 of file sll_m_sparse_grid_2d.F90.
|
private |
Definition at line 907 of file sll_m_sparse_grid_2d.F90.