include/vecmat/angular.h file

Level-symmetric sphere quadrature and phase functions.

Static tables for $S_2, S_4, S_6, S_8$. Weights sum to $4\pi$. Nodes lie on the unit sphere. The isotropic phase is $1/(4\pi)$; Henyey–Greenstein at $g = 0$ matches it.

Functions

auto vm_angular_count(int n) -> int
Number of directions in the $S_N$ set.
auto vm_angular_sn(int n, vm_float_t* mu, vm_float_t* eta, vm_float_t* xi, vm_float_t* w) -> int
Fill caller-owned arrays with the $S_N$ nodes and weights.
auto vm_angular_isotropic(void) -> vm_float_t
Isotropic phase function $1/(4\pi)$.
auto vm_angular_hg(vm_float_t mu, vm_float_t g) -> vm_float_t
Henyey–Greenstein phase $P(\mu; g)$.
auto vm_angular_scatter(const vm_float_t* mu, const vm_float_t* eta, const vm_float_t* xi, const vm_float_t* w, const vm_float_t* I, int n, vm_float_t ox, vm_float_t oy, vm_float_t oz, vm_float_t g) -> vm_float_t
Scattering source at one direction.

Function documentation

int vm_angular_count(int n)

Number of directions in the $S_N$ set.

Returns Direction count, or 0 if n is not supported.

int vm_angular_sn(int n, vm_float_t* mu, vm_float_t* eta, vm_float_t* xi, vm_float_t* w)

Fill caller-owned arrays with the $S_N$ nodes and weights.

Parameters
n
mu Output direction cosine in x.
eta Output direction cosine in y.
xi Output direction cosine in z.
w Output weight.
Returns Number of directions written, or 0 on invalid input.

Each of mu, eta, xi, w has length at least vm_angular_count(n).

vm_float_t vm_angular_isotropic(void)

Isotropic phase function $1/(4\pi)$.

Returns Phase value.

vm_float_t vm_angular_hg(vm_float_t mu, vm_float_t g)

Henyey–Greenstein phase $P(\mu; g)$.

Parameters
mu Cosine of the scattering angle.
g Asymmetry parameter in $[-1, 1]$.
Returns Phase value. g = 0 matches the isotropic phase.

vm_float_t vm_angular_scatter(const vm_float_t* mu, const vm_float_t* eta, const vm_float_t* xi, const vm_float_t* w, const vm_float_t* I, int n, vm_float_t ox, vm_float_t oy, vm_float_t oz, vm_float_t g)

Scattering source at one direction.

Parameters
mu Ordinate cosines in x; length n.
eta Ordinate cosines in y; length n.
xi Ordinate cosines in z; length n.
w Ordinate weights; length n.
I Intensity at each ordinate; length n.
n
ox Target direction cosine in x.
oy Target direction cosine in y.
oz Target direction cosine in z.
g Asymmetry parameter.
Returns Scattering source.

$\sum_m w_m P(\boldsymbol{\Omega}_m\cdot\boldsymbol{\Omega}) I_m$. g = 0 uses the isotropic phase.