Hi Nicolas,

 

The composition is the other way up, you have to make the VectorFunctionSpaces for P2 and P1, and then take the product of these:

 

fs  = VectorFunctionSpace(mesh, “CG”, 2) * VectorFunctionSpace(mesh, “CG”, 1)

 

f  = Function(fs)

for fn in f.split():

                fn.interpolate(mesh.coordinate)

 

 

 

From: Karin&NiKo <niko.karin@gmail.com>
Date: Tuesday, 25 August 2020 at 13:44
To: "Ham, David A" <david.ham@imperial.ac.uk>
Cc: firedrake <firedrake@imperial.ac.uk>
Subject: Re: [firedrake] retrieve dof and entities of assembled matrix entries

 

Hi David,

 

Thank you for your super-fast answer! I then have another question. In fact, I consider a coupled poro-elasticity problem. I have 2 VectorFunctionSpaces, one which is P2 for the displacements, call it U, and one which is P1 for the fluid pressure, call it P. I do not see how to interpolate the mesh coordinates into it. Do I simply define a VectorFunctionSpace of the product space and interpolate the mesh coordinates into it?

 

Best regards,

Nicolas

 

Le mar. 25 août 2020 à 14:06, Ham, David A <david.ham@imperial.ac.uk> a écrit :

Hi Nicolas,

 

If what you want is their physical locations then you can create a P2 VectorFunctionSpace and interpolate the mesh coordinates into it. This will give you the physical locations of the P2 point evaluation nodes in the same order they are used in the assembled matrix.

 

Cheers,

 

David

 

From: <firedrake-bounces@imperial.ac.uk> on behalf of Karin&NiKo <niko.karin@gmail.com>
Date: Tuesday, 25 August 2020 at 13:02
To: firedrake <firedrake@imperial.ac.uk>
Subject: [firedrake] retrieve dof and entities of assembled matrix entries

 

Dear Firedrakers,

 

I wonder how to retrieve the dof and support entities of the entries of an assembled matrix. To make it clearer, let's say I consider a simple elasticity problem that I discretize with P2 elements. I would like to know which nodes and degrees of freedom the values of the assembly matrix refer to.

 

Best regards,

Nicolas