Gyselalib++
 
Loading...
Searching...
No Matches
spline_quadrature.hpp File Reference

File providing quadrature coefficients via a spline quadrature. More...

#include <cassert>
#include <ddc/ddc.hpp>
#include <sll/matrix.hpp>
#include "ddc_aliases.hpp"

Go to the source code of this file.

Functions

template<class Grid1D , class SplineBuilder >
host_t< DFieldMem< IdxRange< Grid1D > > > spline_quadrature_coefficients_1d (IdxRange< Grid1D > const &idx_range, SplineBuilder const &builder)
 Get the spline quadrature coefficients.
 
template<class ExecSpace , class... DDims, class... SplineBuilders>
DFieldMem< IdxRange< DDims... >, typename ExecSpace::memory_space > spline_quadrature_coefficients (IdxRange< DDims... > const &idx_range, SplineBuilders const &... builders)
 Get the spline quadrature coefficients in ND from N 1D quadrature coefficient.
 

Detailed Description

File providing quadrature coefficients via a spline quadrature.

Function Documentation

◆ spline_quadrature_coefficients_1d()

template<class Grid1D , class SplineBuilder >
host_t< DFieldMem< IdxRange< Grid1D > > > spline_quadrature_coefficients_1d ( IdxRange< Grid1D > const &  idx_range,
SplineBuilder const &  builder 
)

Get the spline quadrature coefficients.

To integrate a function with a spline quadrature, we use:

\( \int_a^b f(x)dx \simeq \sum_{i = 0}^{N_{\text{basis}} -1 } c_i \int_a^b b_{i,d}()x dx \),

which rewritten gives

\( \int_a^b f(x)dx \simeq \sum_{i = 0}^{N_{\text{basis}} - 1} q_i f_i \),

with

  • \(\{ f_i\}_i \) the values of the function at the interpolation points;
  • \( q = \{ q_i\}_i \) the quadrature coefficients we compute thanks to \( q B^T = I_b \),
    • with \( B \) the matrix of B-splines \( B_{ij} = b_{j,d}(x_i)\),
    • and \( I_b = \int_a^b b_{i,d}(x)dx \) the integrated B-splines.

More details are given in Emily Bourne's thesis "Non-Uniform Numerical Schemes for the Modelling of Turbulence in the 5D GYSELA Code". December 2022.

Parameters
[in]idx_rangeThe index range where the functions we want to integrate are defined.
[in]builderThe spline builder describing the way in which splines would be constructed.
Returns
A chunk with the quadrature coefficients \( q \).

◆ spline_quadrature_coefficients()

template<class ExecSpace , class... DDims, class... SplineBuilders>
DFieldMem< IdxRange< DDims... >, typename ExecSpace::memory_space > spline_quadrature_coefficients ( IdxRange< DDims... > const &  idx_range,
SplineBuilders const &...  builders 
)

Get the spline quadrature coefficients in ND from N 1D quadrature coefficient.

Calculate the quadrature coefficients for the spline quadrature method defined on the provided index range.

Parameters
[in]idx_rangeThe index range on which the coefficients will be defined.
[in]buildersThe spline builder used for the quadrature coefficients in the different dimensions.
Returns
The coefficients which define the spline quadrature method in ND.