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

137

views

4

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$∫

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$∫

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

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$∫

_{Γ1}`u`·`v`+∫_{Γ2}`u`·`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$∫

_{Γi}`u``v`+∫_{Γk}`u``v`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

Please login to add an answer/comment or follow this question.