Hello,
I consider an elliptic PDE with Robin boundary conditions:
$$ -\Delta u + u = f \quad on \; \Omega $$
$$ \frac{\partial u}{\partial n} + u = j \quad on \; \partial \Omega $$
My .ufl file looks as follows:
P1 = FiniteElement("Lagrange",triangle,1)
u = TrialFunction(P1)
v = TestFunction(P1)
f = Coefficient(P1)
j = Coefficient(P1)
a = inner(grad(u),grad(v))*dx + inner(u,v)*dx + u*v*ds
L = f*v*dx + j*v*ds
forms = [a,L]
My domain is $$ \Omega = [-1,1]x[-1,1].$$
I have defined $$ f $$ as a derived class from dolfin::Expression, i.e.
class MySource : public dolfin::Expression{
void eval(dolfin::Array<double>& value, const dolfin::Array<double>& x) const{
value[0] = 1.0;
}
};
Now I want to define $$j$$ such that j is constant =1 on the left side of the boundary, 2 in the bottom of the boundary, 3 on the right side of the boundary and 4 on the top of the boundary. Do you have any idea how I could implement this? (I am coding in C++)
I am very thankful for any suggestions!
frieder