Add method for making directional derivatives to GridClasses
david-zwicker opened this issue · 2 comments
We often need directional derivatives, particularly in Cartesian coordinates. It might be useful to add a make_directional_derivative
method to CartesianGrid
, which would basically serve as a wrapper to pde.grids.operators.cartesian._make_derivative
. Typical arguments would allow specifying the axis, the order of the derivative (currently supporting 1 and 2), and maybe extra arguments to distinguish forward and backward derivatives.
This problem came up multiple times in the Discussions, e.g., in #199 and #364.
Alternatively, we could also extend the existing method make_operator
and make_operator_no_bc
to support d_dx
and similar functions directly. This would probably be more intuitive (and might even simplify the PDE
class).
We might also add a method to grid classes that return what operators are defined.