fronts.D.constant¶
-
fronts.D.
constant
(D=1.0)¶ Return a constant D function.
Given a positive constant D, returns the function D:
\[D(S) = D\]- Parameters
D (float) – A positive constant.
- Returns
D – Function that maps any value of S to the given constant. It can be called as
D(S)
to obtain the value. It can also be called asD(S, n)
with n equal to 1 or 2, in which case the first n derivatives of the function, which are always zero, are included (in order) as additional return values. While mathematically a scalar function, D operates in a vectorized fashion with the same semantics when S is a numpy.ndarray.- Return type
callable
Notes
This function is not particularly useful: a constant D will turn a diffusion problem into a linear one, which has an exact solution and no numerical solvers are necessary. However, it is provided here given that it is the simplest supported function.