← Back to team overview

dolfin team mailing list archive

Re: [Bug 453206] Re: Errors with subspaces

 

Johan Hake wrote:
> Ok, did not see the second one. But this should be fixed now too.
>
>   

Still not working optimally:
   
    mesh = UnitSquare(1, 1)
    V = FunctionSpace(mesh, "CG", 1)
    Q = FunctionSpace(mesh, "CG", 1)
    M = V + Q
    print "V.num_sub_spaces() = ", V.num_sub_spaces()
    print "M.sub(0).num_sub_spaces() = ", M.sub(0).num_sub_spaces()

   
gives:

    V.num_sub_spaces() =  1
    M(0).num_sub_spaces() =
    Traceback (most recent call last):
      File "form_manipulation.py", line 108, in <module>
        print "M.sub(0).num_sub_spaces() = ", M.sub(0).num_sub_spaces()
      File
    "/home/meg/local/lib64/python2.6/site-packages/dolfin/functionspace.py",
    line 78, in num_sub_spaces
        return self._dolfin_element.num_sub_elements()
    AttributeError: 'FunctionSpaceFromCpp' object has no attribute
    '_dolfin_element'

-- 
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'


References