zwicker-group / py-pde

Python package for solving partial differential equations using finite differences.

Home Page:https://py-pde.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow setting boundary values using functions

david-zwicker opened this issue · comments

The idea would be to use a special boundary condition to allow setting the value, derivative, or directly the value of the virtual point using a python function (which must be jitable for numbs-compiled cases). This could build on ExpressionBC and the interface would probably look something like this:

def bc_value(value, dx, x, y, z, t):
    return [some expression of the variables]

bc={'value_function': bc_value}

A use case is demonstrated in #365.