Mundy: Multibody Nonlocal Dynamics Version of the Day
Loading...
Searching...
No Matches
mundy::GaussLegendreSphere< Scalar, N > Class Template Reference

The Gauss-Legendre product rule on the unit sphere with N rings, exact through degree 2N - 1. More...

#include <GaussLegendreSphere.hpp>

Public Types

using value_type = Scalar

Static Public Member Functions

static constexpr Kokkos::Array< Scalar, 3 *num_points > points ()
 The points as (x, y, z) triples: ring by ring from the north pole, by increasing longitude within a ring.
static constexpr Kokkos::Array< Scalar, num_points > weights ()
 The num_points weights, in the order of points().
template<class Function>
static constexpr auto integrate (const Function &f)
 sum_i w_i f(x_i, y_i, z_i), approximating the integral of f over the unit sphere.

Static Public Attributes

static constexpr unsigned num_rings = N
static constexpr unsigned num_points = 2 * N * N

Detailed Description

template<class Scalar, unsigned N>
class mundy::GaussLegendreSphere< Scalar, N >

The points and weights are correctly rounded to Scalar and computed by the compiler, so every member is a constant expression. Like GaussLegendre's rule, it integrates on the unit sphere; scale for other radii.

Member Typedef Documentation

◆ value_type

template<class Scalar, unsigned N>
using mundy::GaussLegendreSphere< Scalar, N >::value_type = Scalar

Member Function Documentation

◆ points()

template<class Scalar, unsigned N>
constexpr Kokkos::Array< Scalar, 3 *num_points > mundy::GaussLegendreSphere< Scalar, N >::points ( )
inlinestaticconstexpr

◆ weights()

template<class Scalar, unsigned N>
constexpr Kokkos::Array< Scalar, num_points > mundy::GaussLegendreSphere< Scalar, N >::weights ( )
inlinestaticconstexpr

◆ integrate()

template<class Scalar, unsigned N>
template<class Function>
constexpr auto mundy::GaussLegendreSphere< Scalar, N >::integrate ( const Function & f)
inlinestaticconstexpr

Member Data Documentation

◆ num_rings

template<class Scalar, unsigned N>
unsigned mundy::GaussLegendreSphere< Scalar, N >::num_rings = N
staticconstexpr

◆ num_points

template<class Scalar, unsigned N>
unsigned mundy::GaussLegendreSphere< Scalar, N >::num_points = 2 * N * N
staticconstexpr