segfault with AMR

Issue #77 invalid
Nico Schlömer created an issue

Using AMR for a simple 1D problem segfaults.

Code to reproduce:

eps = 1.0e-5
n = 10

mesh = UnitIntervalMesh(n)
b = Constant(0.0)

V = FunctionSpace(mesh, 'CG', 1)

c = Constant(1.0)
f = Constant(0.0)

bc0 = DirichletBC(V, 1.0, 'on_boundary')

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

F = eps*inner(grad(u), grad(v))*dx \
  + c*u*v*dx \
  - f*v*dx

a = lhs(F)
L = rhs(F)

M = u * dx

# Solve the system.
solve(a == L,
          sol,
          bcs = bc0,
          tol=1.0e-2,
          M=M)

plot(sol)
interactive()

Terminal output:

Solving variational problem adaptively
Adaptive iteration 0
  Solving linear variational problem.
Segmentation fault (core dumped)

Comments (3)

  1. Jan Blechta

    This code works with goal functional

    M = sol * dx
    

    instead your linear form M. Segfault on DOLFIN 1.2.0 has been replaced by error message on master already

    *** Error:   Unable to complete call to function evaluate_goal().
    *** Reason:  Assertion M.num_coefficients() > 0 failed.
    *** Where:   This error was encountered inside /usr/users/blechta/fenics/fenics-work/src/dolfin/dolfin/adaptivity/AdaptiveLinearVariationalSolver.cpp (line 114).
    

    Please, close this issue as invalid.

  2. Log in to comment