Dear Firedrakers, How do the indices work if you take VectorFunctionSpace(mesh, "BDM", 1) ? Is the first index the dim copies and the second index the vector component of the copies of the BDM spaces? all the best --cjc Professor Colin Cotter (he/him) Department of Mathematics 755, Huxley Building Imperial College London South Kensington Campus United Kingdom of Great Britain and Northern Ireland +44 2075943468
On 23 Nov 2019, at 14:02, Cotter, Colin J <colin.cotter@imperial.ac.uk> wrote:
VectorFunctionSpace(mesh, "BDM", 1) ?
Is the first index the dim copies and the second index the vector component of the copies of the BDM spaces?
Yes In [3]: V = VectorFunctionSpace(mesh, "BDM", 2, dim=4) In [4]: f = Function(V) In [5]: f.ufl_shape Out[5]: (4, 2) In [6]: f.sub(0) Out[6]: Coefficient(WithGeometry(ComponentProxyFunctionSpace(<firedrake.mesh.MeshTopology object at 0x1202e31d0>, FiniteElement('Brezzi-Douglas-Marini', triangle, 2), name=None, index=None, component=0), Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 1)), 7) In [7]: f.sub(0).ufl_shape Out[7]: (2,) In [8]: f.sub(1).ufl_shape Out[8]: (2,) In [9]: f.sub(2).ufl_shape Out[9]: (2,)
Thanks Lawrence, Good way to check - picking the dim of the VFS different from the gdim. I had also forgotten about .sub, useful. all the best --cjc ________________________________ From: Lawrence Mitchell <wence@gmx.li> Sent: 23 November 2019 14:15 To: Cotter, Colin J <colin.cotter@imperial.ac.uk> Cc: firedrake <firedrake@imperial.ac.uk> Subject: Re: [firedrake] VFS
On 23 Nov 2019, at 14:02, Cotter, Colin J <colin.cotter@imperial.ac.uk> wrote:
VectorFunctionSpace(mesh, "BDM", 1) ?
Is the first index the dim copies and the second index the vector component of the copies of the BDM spaces?
Yes In [3]: V = VectorFunctionSpace(mesh, "BDM", 2, dim=4) In [4]: f = Function(V) In [5]: f.ufl_shape Out[5]: (4, 2) In [6]: f.sub(0) Out[6]: Coefficient(WithGeometry(ComponentProxyFunctionSpace(<firedrake.mesh.MeshTopology object at 0x1202e31d0>, FiniteElement('Brezzi-Douglas-Marini', triangle, 2), name=None, index=None, component=0), Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 1)), 7) In [7]: f.sub(0).ufl_shape Out[7]: (2,) In [8]: f.sub(1).ufl_shape Out[8]: (2,) In [9]: f.sub(2).ufl_shape Out[9]: (2,)
... although apparently .subs doesn't work for TestFunction or TrialFunction ... Had to use u[0,:] for that. ________________________________ From: Cotter, Colin J <colin.cotter@imperial.ac.uk> Sent: 23 November 2019 14:17 To: firedrake <firedrake@imperial.ac.uk> Subject: Re: [firedrake] VFS Thanks Lawrence, Good way to check - picking the dim of the VFS different from the gdim. I had also forgotten about .sub, useful. all the best --cjc ________________________________ From: Lawrence Mitchell <wence@gmx.li> Sent: 23 November 2019 14:15 To: Cotter, Colin J <colin.cotter@imperial.ac.uk> Cc: firedrake <firedrake@imperial.ac.uk> Subject: Re: [firedrake] VFS
On 23 Nov 2019, at 14:02, Cotter, Colin J <colin.cotter@imperial.ac.uk> wrote:
VectorFunctionSpace(mesh, "BDM", 1) ?
Is the first index the dim copies and the second index the vector component of the copies of the BDM spaces?
Yes In [3]: V = VectorFunctionSpace(mesh, "BDM", 2, dim=4) In [4]: f = Function(V) In [5]: f.ufl_shape Out[5]: (4, 2) In [6]: f.sub(0) Out[6]: Coefficient(WithGeometry(ComponentProxyFunctionSpace(<firedrake.mesh.MeshTopology object at 0x1202e31d0>, FiniteElement('Brezzi-Douglas-Marini', triangle, 2), name=None, index=None, component=0), Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 1)), 7) In [7]: f.sub(0).ufl_shape Out[7]: (2,) In [8]: f.sub(1).ufl_shape Out[8]: (2,) In [9]: f.sub(2).ufl_shape Out[9]: (2,)
participants (2)
- 
                
                Cotter, Colin J
- 
                
                Lawrence Mitchell