Problem with integration of exterior_facet
Hi,
I expect the following code to be equivalent to a line integral over the edge of the square domain. However it seems as if integration is actually happening in the cells that touch the edge of the domain. (This can be seen by the values for x and y printed out during the assembly)
Do I understand this correctly or is my implementation wrong?
import dolfin as D
mesh = D.UnitSquare(2,2)
V = D.FunctionSpace
bd = D.DomainBoundary()
# mf = D.FacetFunction
mf = D.MeshFunction(
mf.set_all(0)
bd.mark(mf, 2)
dss = D.ds[mf]
print mf.array()
code = """
class MyFunc : public Expression
{
public:
boost:
MyFunc() : Expression(2), mesh(static_
void eval(Array<double>& values, const Array<double>& x, const ufc::cell& ufc_cell) const
{
Cell cell(*mesh, ufc_cell.index);
Point n = cell.normal(
printf ("x: %f, y: %f, n.x: %f, n.y: %f\\n", x[0], x[1], n.x(), n.y());
values[0] = x[0];
values[1] = x[1];
}
};
"""
ex = D.Expression(code, element=
ex.mesh = mesh
v = D.TestFunction(V)
L = D.dot(v, ex)*dss(2)
b = D.assemble(L)
print b.array() # expect this to only have values for edge basis functions defined of the edges
Regards,
Renier Marchand
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Renier Marchand
- Solved:
- Last query:
- Last reply: