You need to provide a subdomain_id when creating the DirichletBC objects.


For example:

bcv_x = DirichletBC(W.sub(0).sub(0), Constant(0), 1, method="geometric")  # note third argument!


For a UnitSquareMesh, the subdomain_ids are:

    * 1: plane x == 0
    * 2: plane x == 1
    * 3: plane y == 0
    * 4: plane y == 1

Regards,

Miklos



From: firedrake-bounces@imperial.ac.uk <firedrake-bounces@imperial.ac.uk> on behalf of William Booker <scwb@leeds.ac.uk>
Sent: 09 December 2015 12:51
To: firedrake
Subject: [firedrake] boundary conditions on a mixed function space
 

Dear Firedrakers,

I've been trying to implement 0 dirichlet boundaries on a mixed function space that includes a vector space



#Set up boundary conditions
bcv_x = DirichletBC(W.sub(0).sub(0), Constant(0), method="geometric")
bcv_z = DirichletBC(W.sub(0).sub(1), Constant(0), method="geometric")


but I get back 
AttributeError: 'VectorFunctionSpace' object has no attribute 'sub'


I thought we were meant to use sub twice to refer first to the function space component and then to the vector component.

Also, would this be a correct approach for implementing no normal flow boundaries or is there a more appropriate method to use.
Thanks 

Will