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

How dolfin iterates through elements during the assembly process

0 votes

If I have a linear form defined only in a subdomain

F = inner(grad(u), grad(u))*dx(1)

When this form is assembled, does dolfin iterate through all the elements, then checks whether that element belongs to the subdomain that defines the measure dx(1) or not and assemble the form? Or it iterates only through the elements in subdomain?

asked Jul 13, 2016 by miguelito FEniCS Novice (760 points)

1 Answer

0 votes

Have a look at dolfin/fem/Assembler.cpp around line 156. Dolfin will iterate over all cells in the domain, and then skip the ones which are not in subdomain 1.

answered Jul 17, 2016 by francesco.ballarin FEniCS User (4,070 points)

Thanks. Really appreciate your answer.

...