It would be nice for users to be able to define custom derived quantities like this:
def my_func(**kwargs):
D = kwargs["D"]
c_h1 = kwargs["H_1"]
c_h2 = kwargs["H_2"]
n = kwargs["n"]
return -D * ufl.dot(ufl.grad(c_h1 + c_h2), n)
def retention(**kwargs):
D = kwargs["D"]["H_1"]
D_0 = kwargs["D_0"]
c_h1 = kwargs["H_1"]
c_h2 = kwargs["H_2"]
n = kwargs["n"]
return c_h1 + c_h2
my_custom_quantity = F.CustomQuantity(expr=retention, subdomain=vol1, title="Retention", filename="retention.txt")
It would be nice for users to be able to define custom derived quantities like this: