← Back to team overview

dolfin team mailing list archive

[Question #104471]: BCs in mixed space vector+scalar+scalar

 

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

I want to solve for a vector and two scalars, and I have specified the FunctionSpace W intuitively correctly, 
but the BC complains that my dimension is incorrect (for the vector). What am I doing wrong?

mesh=UnitSquare(10,10)

V=VectorFunctionSpace(mesh,"CG",2)
Q=FunctionSpace(mesh,"CG",1)
R=FunctionSpace(mesh,"CG",1)
W=V+Q+R

def bound0(x):
    x[0]<DOLFIN_EPS

v0=Constant((0.0,0.0))

bc=DirichletBC(W.sub(0),v0,bound0)


    bc=DirichletBC(W.sub(0),v0,bound0)
  File "/usr/lib/python2.6/dist-packages/dolfin/mesh/bcs.py", line 56, in __init__
    cpp.DirichletBC.__init__(self, *args)
  File "/usr/lib/python2.6/dist-packages/dolfin/cpp.py", line 9390, in __init__
    _cpp.DirichletBC_swiginit(self,_cpp.new_DirichletBC(*args))
RuntimeError: *** Error: Unable to create boundary condition. Reason: Illegal value 2 for value dimension, should be 3.



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



Follow ups