MathUtils Namespace

MOOSE includes a number of C++ utility classes and functions that may be useful for developing applications with mathematical expressions.

Polynomial evaluations

MathUtils::poly evaluates a polynomial for any integer order using the Horner's method of evaluation, (1) (2)

Clamp

MathUtils::clamp returns a clamped value between an upper and lower bound, and respectively, (3)

SmootherStep

MathUtils::smootherStep returns a smoothed step transition between a starting and ending bounds, and respectively, for a given value , (4) (5) This method ensures a smooth transition from 0 to 1 between the two bounds, while also ensuring the first and second derivatives are zero at the two bounds. Use of this method is especially useful when transitioning between two non-smooth regimes. The derivative with respect to the passed value is returned using the optional derivative bool.