Segfault happens if linear form is supplied instead of goal functional for adaptive solve

Issue #152 resolved
Jan Blechta created an issue

This code demonstrates the issue:

from dolfin import *

mesh = UnitSquareMesh(4, 4)
V = FunctionSpace(mesh , "CG", 1)

u = TrialFunction(V)
v = TestFunction(V)
u_h = Function(V)

a = dot(grad (u), grad (v))*dx
L = v*dx

def boundary (x):
    return x[0] < 1E-14

bc = DirichletBC(V, Constant (0.0), boundary)

M = u*dx

solve(a == L, u_h, bcs=bc, tol=1e-3, M=M)

Taking M = u_h*dx makes it working. An error message should be raised instead of segfaulting.

Comments (4)

  1. Log in to comment