pub enum GaussOrder {
G2,
G3,
G4,
G5,
G8,
}Expand description
Node count of a fixed-order Gauss-Legendre rule.
A closed set rather than an open usize, so the choice is exhaustive at
every match site and rust-analyzer lists the options on hover — and so the
nodes can be validated once per order rather than for whatever number a
caller happens to pass.
An n-point Gauss-Legendre rule integrates any polynomial of degree
2n - 1 or less exactly (to rounding), which is both the reason to
prefer it over Simpson at equal cost and the property the tests use as their
oracle.
§Units
Dimensionless — a mode selector.
Variants§
G2
Two-point rule, exact to cubics.
G3
Three-point rule, exact to quintics.
G4
Four-point rule, exact to degree 7.
G5
Five-point rule, exact to degree 9.
G8
Eight-point rule, exact to degree 15.
Implementations§
Source§impl GaussOrder
impl GaussOrder
Sourcepub const fn exact_degree(self) -> usize
pub const fn exact_degree(self) -> usize
The highest polynomial degree this rule integrates exactly, 2n - 1.
§Example
use outram_foam_basic_lib::ode::parallel::GaussOrder;
assert_eq!(GaussOrder::G5.points(), 5);
assert_eq!(GaussOrder::G5.exact_degree(), 9);