Skip to content

How do I make a jit compiled backward differenced operator? #321

Answered by david-zwicker
HannoSpreeuw asked this question in Q&A
Discussion options

You must be logged in to vote

The operator returned by _make_derivative is already numba-compiled, so this should not be an issue.
If you want to register a new operator and later use it with a grid class, you can typically do that during the initialization of your module or script since it only needs to be done once.

Here is an example that registers an operator and then uses it to apply it to a field (after setting BCs) and also to create a numba-compiled function that does the same and can be used in other numba-compiled code:

import pde
from pde.grids.operators.cartesian import _make_derivative

# register the backward gradient operator with the Cartesian grid
pde.CartesianGrid.register_operator("grad_backward", l…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@HannoSpreeuw
Comment options

@HannoSpreeuw
Comment options

@david-zwicker
Comment options

Answer selected by HannoSpreeuw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants