This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Define measures on subdomains in c++

0 votes

Hello

I have to handle a problem with two subdomains, something like what is shown in the demo subdomains_poisson. I'm working in c++ and I don't find the function to define the new measures, corresponding to python's functions.

dx = Measure("dx")[domains]
ds = Measure("ds")[boundaries]

In addition I don't understand why this is needed. If I use dx(n) without defining the new measures shouldn't the solver assemble the matrix using just the shape functions defined on the corresponding domain and put to zero the remaining terms of the matrix?

I think that associating subdomains to the linear and bilinear forms should be enough.

A.dx=domain;
L.dx=domain;

The last point is that if I have an equation defined on the whole domain and I integrate over dx(1)+dx(2) I'm not shure I won't integrate twice on the elements on the internal boundary.

Thanks in advance for the clarifications.
Stefano

asked Feb 8, 2015 by Stefano FEniCS Novice (460 points)
edited Feb 9, 2015 by Stefano
...