2d-mini element-can't use sub(0),but bubble element is ok.

Asked by Guo Jiang

my program(python):

mesh=UnitSquareMesh(16,16)
U_h = VectorFunctionSpace(mesh, "Lagrange", 1)
B = VectorFunctionSpace(mesh, "Bubble", degree=3,dim=2)
Mini_h = U_h + B

# boundary definition:for example u0_boundary and u1_boundary are part of square,respectively
w0 = Constant("0.0")
bc0 = DirichletBC(Mini_h.sub(0), w0, u0_boundary) #error
bc1 = DirichletBC(Mini_h.sub(1), w0, u1_boundary)

ValueError: Can only extract SubSpaces with i = 0 ... -1
Who can tell me why? Mini_h.sub(0) is the first component of Mini_h,

Actually, only for vector bubble element, everything is ok,for example:
   B = VectorFunctionSpace(mesh, "Bubble", degree=3,dim=2)
   bc0 = DirichletBC(B.sub(0), w0, u0_boundary)
   bc1 = DirichletBC(B.sub(1), w0, u1_boundary)
all right!
In addition, I want to know why can not directly added to a mini finite element, rather than CG + Bubble.

Question information

Language:
English Edit question
Status:
Answered
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Johannes Ring (johannr) said :
#1

FEniCS no longer uses Launchpad for Questions & Answers. Please consult the documentation on the FEniCS web page for where and how to (re)post your question: http://fenicsproject.org/support/

Can you help with this problem?

Provide an answer of your own, or ask Guo Jiang for more information if necessary.

To post a message you must log in.