← Back to team overview

dolfin team mailing list archive

[Bug 449494] [NEW] Derivative form crashes upon initialization

 

Public bug reported:

  
When defining forms using derivative() without optional directional argument, the form initialization crashes.

File "derivative.py", line 11, in <module>
    pde = VariationalProblem(a, -F)
  File "/home/meg/local/lib64/python2.6/site-packages/dolfin/variationalproblem.py", line 32, in __init__
    self.a = Form(a)
  File "/home/meg/local/lib64/python2.6/site-packages/dolfin/form.py", line 39, in __init__
    function_spaces)
  File "/home/meg/local/lib64/python2.6/site-packages/dolfin/form.py", line 60, in _extract_function_spaces
    if not isinstance(func.function_space(), cpp.FunctionSpace):
AttributeError: 'BasisFunction' object has no attribute 'function_space'

Reproduce with:

from dolfin import *

V = FunctionSpace(UnitSquare(2, 2), "CG", 1)

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

F = inner(grad(v), (1 + u**2)*grad(u))*dx
a = derivative(F, u)

pde = VariationalProblem(a, -F)

** Affects: dolfin
     Importance: Undecided
         Status: New

-- 
Derivative form crashes upon initialization
https://bugs.launchpad.net/bugs/449494
You received this bug notification because you are subscribed to DOLFIN.

Status in DOLFIN: New

Bug description:
  
When defining forms using derivative() without optional directional argument, the form initialization crashes.

File "derivative.py", line 11, in <module>
    pde = VariationalProblem(a, -F)
  File "/home/meg/local/lib64/python2.6/site-packages/dolfin/variationalproblem.py", line 32, in __init__
    self.a = Form(a)
  File "/home/meg/local/lib64/python2.6/site-packages/dolfin/form.py", line 39, in __init__
    function_spaces)
  File "/home/meg/local/lib64/python2.6/site-packages/dolfin/form.py", line 60, in _extract_function_spaces
    if not isinstance(func.function_space(), cpp.FunctionSpace):
AttributeError: 'BasisFunction' object has no attribute 'function_space'

Reproduce with:

from dolfin import *

V = FunctionSpace(UnitSquare(2, 2), "CG", 1)

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

F = inner(grad(v), (1 + u**2)*grad(u))*dx
a = derivative(F, u)

pde = VariationalProblem(a, -F)


Follow ups

References