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

File providing functions to adapt quadrature coefficients so they can integrate over a N-D volume. More...

#include <ddc/ddc.hpp>
#include <sll/mapping/mapping_tools.hpp>
#include "ddc_alias_inline_functions.hpp"
#include "ddc_aliases.hpp"
#include "quadrature.hpp"

Go to the source code of this file.

Functions

template<class Mapping , class IdxRangeCoeffs , class ExecSpace >
DFieldMem< IdxRangeCoeffs, typename ExecSpace::memory_space > compute_coeffs_on_mapping (ExecSpace exec_space, Mapping &mapping, DFieldMem< IdxRangeCoeffs, typename ExecSpace::memory_space > &&coefficients_alloc)
 Add the Jacobian determinant to the coefficients.
 

Detailed Description

File providing functions to adapt quadrature coefficients so they can integrate over a N-D volume.

A N-D volume is a surface in 2D and a volume in 3D.

Function Documentation

◆ compute_coeffs_on_mapping()

template<class Mapping , class IdxRangeCoeffs , class ExecSpace >
DFieldMem< IdxRangeCoeffs, typename ExecSpace::memory_space > compute_coeffs_on_mapping ( ExecSpace  exec_space,
Mapping &  mapping,
DFieldMem< IdxRangeCoeffs, typename ExecSpace::memory_space > &&  coefficients_alloc 
)

Add the Jacobian determinant to the coefficients.

For polar integration, we can add the Jacobian determinant to the quadrature coefficients.

  • 2D example: (but it is implemented for ND)

\( \int_{\Omega_{\text{cart}}} f(x,y) dxdy = \int_{\Omega} f(r,\theta) |det(J(r,\theta))| drd\theta \simeq \sum_{i,j} [q_{i,j}| det(J(r_i,\theta_j))|] f_{ij}\)

This function uses rvalues. It means that coefficients is a temporary input parameter and it returns a temporary coefficient object. The Quadrature object can only be instantiate with rvalues.

Parameters
[in]exec_spaceThe space on which the function is executed (CPU/GPU).
[in]mappingThe mapping function from the logical index range \( (r,\theta) \) to the physical index range \( (x, y) \).
[in]coefficients_allocThe quadrature coefficients \(\{q_{ij}\}_{ij} \).
Returns
A rvalue FieldMem to the modified coefficients \(\{q_{ij}| det(J(r_i,\theta_j))|\}_{ij} \).