In the following, I put more clear code with more detail, mesh = UnitSquareMesh(16, 16) BDM = FunctionSpace(mesh, "BDM", 1) DG = FunctionSpace(mesh, "DG", 0) W = BDM * DG sigma, u = TrialFunctions(W) tau, v = TestFunctions(W) x, y = SpatialCoordinate(mesh) f = Function(DG).interpolate( 10*exp(-(pow(x - 0.5, 2) + pow(y - 0.5, 2)) / 0.02)) a = (dot(sigma, tau) + div(tau)*u + div(sigma)*v)*dx L = - f*v*dx bc0 = DirichletBC(W.sub(0), as_vector([0.0, -sin(5*x)]), 1) bc1 = DirichletBC(W.sub(0), as_vector([0.0, sin(5*y)]), 2) w = Function(W) solve(a == L, w, bcs=[bc0, bc1]) sigma, u = w.split() Re = assemble((div(sigma)+f)*(div(sigma)+f)*dx).array() and I got the error: AttributeError: 'numpy.float64' object has no attribute 'array' How can I compute "Re" on each element? ----- Original Message ----- From: Colin Cotter (colin.cotter@imperial.ac.uk) Date: 10/05/97 16:03 To: firedrake@imperial.ac.uk Subject: Re: [firedrake] .array() Dear Amireh, What are the types of u and v? I suspect you have Function for both when you need TestFunction and TrialFunction? All the best Cjc On Wednesday, 1 August 2018, Amireh Mousavi <amireh.mousavi@math.iut.ac.ir> wrote: Dear Firedrake team, i'm trying to get u*v*dx as a array which each component is amount of the integral on each element. I want to do that in order to compute error indicator. In dolfin implementation it be done like: assemble(u*v*dx).array() Is there a way to do this in Firedrake? Runing the above code in Firedrake gives: AttributeError: 'numpy.float64' object has no attribute 'array' Thank you in advance. Best, Amireh -- Colin Cotter Department of Mathematics Imperial College London I don't expect a reply to this email from you outside of your normal working hours. http://www.imperial.ac.uk/people/colin.cotter www.cambridge.org/9781107663916 _______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake