Error message for misuse of 'point' measure

Issue #348 resolved
Mike Welland created an issue

It would be useful to have an error thrown in the case of using a 'point' measure outside of the PointIntegralSolver.

ref: FEnics QA i.e.: In the following example, perhaps an error should be thrown instead of a normal result:

from dolfin import *

mesh = RectangleMesh(0,0,10,10, 10,10)
V1 = FunctionSpace(mesh, "Lagrange", 1)

u = interpolate(Expression('x[0]+10'),V1)
left = CompiledSubDomain("(std::abs(x[0]) < DOLFIN_EPS) && on_boundary")
corner = CompiledSubDomain("(std::abs(x[0]) < DOLFIN_EPS) && (std::abs(x[1]) < DOLFIN_EPS) && on_boundary")

boundaries = MeshFunction('size_t', mesh, 1) # Gets object of boundaries
boundaries.set_all(0)
left.mark(boundaries,1)
ds = Measure('ds')[boundaries]

points = MeshFunction('size_t', mesh, 0)
points.set_all(0)
corner.mark(points,1)
dp = Measure('point')[points]


print assemble(u*dx)
print assemble(u*ds(1)), assemble(u*ds(0))
print assemble(u*dp(1)), assemble(u*dp(0))

plot(u, interactive=True)

Comments (2)

  1. Log in to comment