← Back to team overview

dolfin team mailing list archive

[Question #114828]: Specifying DirichletBC on function sub-spaces of MixedFunctionSpace

 

New question #114828 on DOLFIN:
https://answers.launchpad.net/dolfin/+question/114828

Hi,

I am using MixedFunctionSpace:
# Create FunctionSpaces
Q = FunctionSpace(mesh, "CG", 1)
V = VectorFunctionSpace(mesh, "CG", 1)
U = MixedFunctionSpace([Q, V])

and am trying to specify a Dirichlet BC on the 0 subspace of V with something like:
right= compile_subdomains("(x[0] >  9.0) && on_boundary")
disp = Constant(0.0)
bcr = DirichletBC(V.sub(0), disp, right) 

This seems to work (no ffc errors), but evidently the desired BC is not imposed strongly in  the plotted solution.

I tried:
bcr = DirichletBC(U[1][0], disp, right) 

as suggested in SubSpace.h, but it gives
Traceback (most recent call last):
  File "tumor51.py", line 76, in <module>
    bcr = DirichletBC(U[1][0], disp, right) 
TypeError: 'MixedFunctionSpace' object does not support indexing


Is there another way to address subspaces of subspaces in DirichletBC?

 ---Krishna

-- 
You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.



Follow ups