Gyselalib++
Quadrature< IdxRangeQuadrature, IdxRangeTotal, MemorySpace > Class Template Reference

A class providing an operator for integrating functions defined on a discrete index range. More...

Public Member Functions

 Quadrature (QuadConstField coeffs)
 Create a Quadrature object. More...
 
template<class ExecutionSpace , class IntegratorFunction >
double operator() (ExecutionSpace exec_space, IntegratorFunction integrated_function) const
 An operator for calculating the integral of a function defined on a discrete index range. More...
 
template<class ExecutionSpace , class BatchIdxRange , class IntegratorFunction >
void operator() (ExecutionSpace exec_space, Field< double, BatchIdxRange, MemorySpace > const result, IntegratorFunction integrated_function) const
 An operator for calculating the integral of a function defined on a discrete index range by cycling over batch dimensions. More...
 

Detailed Description

template<class IdxRangeQuadrature, class IdxRangeTotal = IdxRangeQuadrature, class MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
class Quadrature< IdxRangeQuadrature, IdxRangeTotal, MemorySpace >

A class providing an operator for integrating functions defined on a discrete index range.

Template Parameters
IdxRangeQuadratureThe index range over which the function is integrated.
IdxRangeTotalThe index range of the chunk which can be passed to the operator(). This is the IdxRangeQuadrature combined with any batch dimensions. If there are no batch dimensions then this argument does not need to be provided as by default it is equal to the IdxRangeQuadrature.
MemorySpaceThe memory space (cpu/gpu) where the quadrature coefficients are saved.

Constructor & Destructor Documentation

◆ Quadrature()

template<class IdxRangeQuadrature , class IdxRangeTotal = IdxRangeQuadrature, class MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
Quadrature< IdxRangeQuadrature, IdxRangeTotal, MemorySpace >::Quadrature ( QuadConstField  coeffs)
inlineexplicit

Create a Quadrature object.

Parameters
coeffsThe coefficients of the quadrature.

Member Function Documentation

◆ operator()() [1/2]

template<class IdxRangeQuadrature , class IdxRangeTotal = IdxRangeQuadrature, class MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
template<class ExecutionSpace , class IntegratorFunction >
double Quadrature< IdxRangeQuadrature, IdxRangeTotal, MemorySpace >::operator() ( ExecutionSpace  exec_space,
IntegratorFunction  integrated_function 
) const
inline

An operator for calculating the integral of a function defined on a discrete index range.

Parameters
[in]exec_spaceThe space on which the function is executed (CPU/GPU).
[in]integrated_functionA function taking an index of a position in the index range over which the quadrature is calculated and returning the value of the function to be integrated at that point. It should be noted that a Field fulfils these criteria and can be passed as the function to be integrated. If the exec_space is a GPU the function that is passed must be accessible from GPU.
Returns
The integral of the function over the index range.

◆ operator()() [2/2]

template<class IdxRangeQuadrature , class IdxRangeTotal = IdxRangeQuadrature, class MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
template<class ExecutionSpace , class BatchIdxRange , class IntegratorFunction >
void Quadrature< IdxRangeQuadrature, IdxRangeTotal, MemorySpace >::operator() ( ExecutionSpace  exec_space,
Field< double, BatchIdxRange, MemorySpace > const  result,
IntegratorFunction  integrated_function 
) const
inline

An operator for calculating the integral of a function defined on a discrete index range by cycling over batch dimensions.

Parameters
[in]exec_spaceThe space on which the function is executed (CPU/GPU).
[out]resultThe result of the quadrature calculation.
[in]integrated_functionA function taking an index of a position in the index range over which the quadrature is calculated (including the batch index range) and returning the value of the function to be integrated at that point. Please note that a Field fulfills the described criteria. If the exec_space is a GPU the function that is passed must be accessible from GPU.

The documentation for this class was generated from the following file: