Skip to content

Solving coupled PDE with numba acceleration #482

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

You must be logged in to vote

Thanks for the code – here is an untested suggestion for the method using numba:

def _make_pde_rhs_numba(self, state):
        """ the numba-accelerated evolution equation """
        zp, zm = state
        # create operators
        laplace_u_p = zp.grid.make_operator("laplace", bc="auto_periodic_neumann")
        gradient_u_p = zp.grid.make_operator("gradient", bc="auto_periodic_neumann")
        laplace_u_m = zm.grid.make_operator("laplace", bc="auto_periodic_neumann")
        gradient_u_m = zm.grid.make_operator("gradient", bc="auto_periodic_neumann")

        @jit
        def pde_rhs(state_data, t=0):
            """ compiled helper function evaluating right hand side """
            z…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@ScottDemarest
Comment options

@david-zwicker
Comment options

Answer selected by ScottDemarest
@ScottDemarest
Comment options

@david-zwicker
Comment options

@ScottDemarest
Comment options

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