Hi Tomasz,


On Mon, 14 Dec 2015 at 04:46 Tomasz Salwa [RPG] <mmtjs@leeds.ac.uk> wrote:






Dear Firedrakers,




I use utility meshes, including the extruded ones. I need to access the entries of system matrices, but I am not sure about the node/entries numbering. Say, I have the code:


m = UnitIntervalMesh(3)
mesh = ExtrudedMesh(m, 3)
V = FunctionSpace(mesh, "CG", 1)



f = Function(V)
trial = TrialFunction(V)
test = TestFunction(V)
A = assemble( trial * test * dx ).M.values





Does the element A[i,j] correspond to nodes mesh.coordinates.dat.data[i] & [j], same


as f.dat.data[i] & j?

 
Yes. This is exactly what happens. Note, however that coordinates is vector-valued so mesh.coordinates.dat.data[i] is itself a vector.

What is the case for VectorFunctionSpace?


For a matrix assembled over a VectorFunctionSpace, the entries are interleaved. For example, if the mesh were 2D then the row corresponding to f.dat.data[i,0] would be row 2*i and that corresponding to f.dat.data[i,1] would be 2*i + 1.

Regards,

David
 





Thanks,

Tomasz