Project returns a Function, which is to say a function in the relevant finite element space (in this case P0). The simplest way to get at the coefficients of the function is to access the underlying dat: Re = project(expr, P0) coeffs = Re.dat.data_ro Note that accessing the data_ro property is an assertion that you are not going to change the coefficients in the numpy array. If you intended to change the values, you would instead use: Re.dat.data Regards, David On 02/08/2018, 09:09, "firedrake-bounces@imperial.ac.uk on behalf of Amireh Mousavi" <firedrake-bounces@imperial.ac.uk on behalf of amireh.mousavi@math.iut.ac.ir> wrote: Yes you are right. Now how can I get the constant value on each cell? Because I need to have an array in order to sort and mark some of them to refine. I'm quite new to python and firedrake. So sorry if my questions are too simple. Many thanks for answering. ----- Original Message ----- From: Lawrence Mitchell ( [lawrence.mitchell@imperial.ac.uk] (mailto:lawrence.mitchell@imperial.ac.uk) ) Date: 11/05/97 07:20 To: [firedrake@imperial.ac.uk] (mailto:firedrake@imperial.ac.uk) Subject: Re: [firedrake] .array() > On 1 Aug 2018, at 18:41, Amireh Mousavi < [amireh.mousavi@math.iut.ac.ir] (mailto:amireh.mousavi@math.iut.ac.ir) > wrote: > > sigma, u = w.split() > Re = assemble((div(sigma)+f)*(div(sigma)+f)*dx).array() Here you assemble a functional. So it is just a number. If you want the cellwise value of this expression write: P0 = FunctionSpace(mesh, "DG", 0) Re = project(expr, P0) Where expr is the integrals of your expression above. Thanks, Lawrence _______________________________________________ firedrake mailing list [firedrake@imperial.ac.uk] (mailto:firedrake@imperial.ac.uk) [https://mailman.ic.ac.uk/mailman/listinfo/firedrake] (https://mailman.ic.ac.uk/mailman/listinfo/firedrake) _______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake