← Back to team overview

dolfin team mailing list archive

Re: [Bug 453206] Re: Errors with subspaces

 

Johan Hake wrote:
> Yes, this is typical suboptimal behavior.
>
> However, it should also be fixed now :)
>
>
>   


Broke VariationalProblem on the way  :(


    meg@localhost ~/local/src/fenics/dolfin/demo/pde/poisson/python $
    python demo.pyCalling DOLFIN just-in-time (JIT) compiler, this may
    take some time.
    Calling DOLFIN just-in-time (JIT) compiler, this may take some time.
    Calling FFC just-in-time (JIT) compiler, this may take some time.
    V =  <Function space of dimension 1089 (<CG1 on a <triangle of
    degree 1>>)>
    u =  <Function in <Function space of dimension 1089 (<CG1 on a
    <triangle of degree 1>>)>>
    Solving linear variational problem
    Traceback (most recent call last):
      File "demo.py", line 45, in <module>
        u = problem.solve()
      File
    "/home/meg/local/lib64/python2.6/site-packages/dolfin/variationalproblem.py",
    line 61, in solve
        cpp.VariationalProblem.solve(self, u)
    RuntimeError: *** Error: Wrong type of function space for argument
    0, form expects
    FiniteElement('Lagrange', Cell('triangle', 1, Space(2)), 1)
    but we got
    FiniteElement('Lagrange', 'triangle', 1)
    ...


--
Marie

-- 
Errors with subspaces
https://bugs.launchpad.net/bugs/453206
You received this bug notification because you are subscribed to DOLFIN.

Status in DOLFIN: Fix Committed

Bug description:
  mesh = UnitSquare(1, 1)
  V = FunctionSpace(mesh, "CG", 1)
  Q = FunctionSpace(mesh, "CG", 1)
  M = V + Q
  print M.num_sub_spaces()

gives:

  File "form_manipulation.py", line 89, in <module>
    print M.num_sub_spaces()
  File "/home/meg/local/lib64/python2.6/site-packages/dolfin/functionspace.py", line 249, in num_sub_spaces
    return self.__ufc_element.num_sub_elements()
AttributeError: 'MixedFunctionSpace' object has no attribute '_MixedFunctionSpace__ufc_element'


Further
   
  print M.sub(0).ufl_element()
   
Traceback (most recent call last):
  File "form_manipulation.py", line 90, in <module>
    print M.sub(0).ufl_element()
AttributeError: 'SubSpace' object has no attribute 'ufl_element'


Follow ups

References