### Boundary indexing in variational formulation with UFL coupled with dolfin C++

179
views
4
12 months ago by
Hello everyone,

I have got a quick question on the use of UFL with Dolfin C++.

Boundary indexing in the variational formulation is usually written as:
u*v*ds(1)+u*v*ds(2) for  $\int_{\Gamma_1}u\cdot v+\int_{\Gamma_2}u\cdot v$Γ1u·v+Γ2u·v

My question is:
Is there way to write in the ufl something as:
u*v*ds(i)+u*v*ds(k) for   $\int_{\Gamma_i}uv+\int_{\Gamma_k}uv$Γiuv+Γkuv
where k and i are later define in the C++ main code (without modifying by hand the compiled ufl), something similar to defining a coefficient: a.i=1 and a.k=2

The problem in Python is easy as the ufl code is evaluated JIT, but what about C++ to avoid recompiling the code every time?

Thank you very much
Community: FEniCS Project