Dear Miklos,
I'm still getting the same error after adding in a domain id.
File "compressible.py", line 30, in <module>
bcv_x = DirichletBC(W.sub(0).sub(0), Constant(0), 1, method="geometric")
File "/home/cserv1_a/apps/install/firedrake/0.11.0-328-gbf9dd55/lib64/python2.7/site-packages/firedrake/functionspace.py", line 812, in __getattr__
return getattr(self._fs, name)
AttributeError: 'VectorFunctionSpace' object has no attribute 'sub'
Will
From: firedrake-bounces@imperial.ac.uk <firedrake-bounces@imperial.ac.uk> on behalf of Homolya, Miklós <m.homolya14@imperial.ac.uk>
Sent: 09 December 2015 13:21
To: firedrake
Subject: Re: [firedrake] boundary conditions on a mixed function space
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