A class providing an operator for integrating functions defined on a discrete index range.
More...
|
| 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...
|
|
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
-
IdxRangeQuadrature | The index range over which the function is integrated. |
IdxRangeTotal | The 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. |
MemorySpace | The memory space (cpu/gpu) where the quadrature coefficients are saved. |
◆ Quadrature()
template<class IdxRangeQuadrature , class IdxRangeTotal = IdxRangeQuadrature, class MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
Create a Quadrature object.
- Parameters
-
coeffs | The coefficients of the quadrature. |
◆ 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_space | The space on which the function is executed (CPU/GPU). |
[in] | integrated_function | A 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_space | The space on which the function is executed (CPU/GPU). |
[out] | result | The result of the quadrature calculation. |
[in] | integrated_function | A 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:
- /home/runner/work/gyselalibxx/gyselalibxx/code_branch/src/quadrature/quadrature.hpp