This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Setting boundary condition of vector component using DirichletBC

+2 votes

I completely misrepresented my question earlier. I hope this is clear.

V = VectorFunctionSpace(mesh, "CG", 2)
Q = FunctionSpace(mesh, "CG", 1)
W = MixedFunctionSpace([V, Q])

v0 = Expression(('0.0', '0.0'))

# Set  both components of V to zero
bc = DirichletBC(W.sub(0), v0, boundary)

My question:
Is it possible to set only first or second component to zero using DirichletBC ?

This is related to the question here: http://fenicsproject.org/qa/3412/constraint-component-vector-field-using-boundary-conditions

related to an answer for: Assign values to component of W.sub(0)
closed with the note: The issue is solved
asked Aug 31, 2014 by shriram FEniCS User (1,540 points)
closed Sep 1, 2014 by shriram

1 Answer

+3 votes
 
Best answer

Yes, e.g.,

bc = DirichletBC(W.sub(0).sub(1), 0, boundary)
answered Aug 31, 2014 by mikael-mortensen FEniCS Expert (29,340 points)
selected Aug 31, 2014 by shriram
...