Hello everybody,
I am trying to solve a diffusion problem where the (constant) diffusivity is the result of the integration of another function over the domain.
That is, something like:
$$\int_{\Omega} k \nabla u \nabla v = \int_{\Omega} f v$$
where
$$k=\int_{\Omega} g$$
for a given $g$.
I know I can do this by writing a ufl file to compute the integral of $g$ and then passing this value along to the ufl file that solves the problem, but I would like to do it in just one shot. For example:
element = FiniteElement("Lagrange", triangle, 1)
u = TrialFunction(element)
v = TestFunction(element)
f = Coefficient(element)
g = Coefficient(element)
gg = g*dx
a = inner(gg * grad(u), grad(v))*dx
L = f*v*dx
This of course does not work.
How would I go about integrating a coefficient in a ufl code?
Thanks a lot!
Mattia