fronts.D.constant
- fronts.D.constant(D0)
Return a constant D function.
Given \(D_0\), returns the function D:
\[D(\theta) = D_0\]- Parameters:
D0 (float) – \(D_0\), a positive constant
- Returns:
D –
Function to evaluate \(D\) and its derivatives:
D(theta)
evaluates and returns \(D\) attheta
D(theta, 1)
returns both the value of \(D\) and its first derivative attheta
D(theta, 2)
returns the value of \(D\), its first derivative, and its second derivative attheta
In all cases, the argument
theta
may be a single float or a NumPy array.- 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.