2009/2/16 N <[email protected]>:
>
> Take a simple example like
>
> from dolfin import *
> mesh = UnitSquare(4, 4)
> V = FunctionSpace(mesh, "CG", 1)
> v = TestFunction(V)
> u = TrialFunction(V)
> a = dot(grad(v), grad(u))*dx
> A = assemble(a)
>
> The matrix A (with boost as the linear algebra base) gives the following for 
> attribute data:
>    data(self) -> 
> std::tr1::tuple<(p.q(const).std::size_t,p.q(const).std::size_t,p.q(const).double,int)>
>
>    Return pointers to underlying compressed storage data. See
>    GenericMatrix for documentation.
>
>
> How can this be used to gain access to the column data, row pointer, and data 
> elements in the matrix?  I would like to have access to this data in Numpy 
> arrays without copying the data.  Is this possible?

A.array()  returns numpy.ndarray.


-Ali

>
> Thanks.
>
> Nate
>
>
>
> _______________________________________________
> DOLFIN-dev mailing list
> [email protected]
> http://www.fenics.org/mailman/listinfo/dolfin-dev
>
_______________________________________________
DOLFIN-dev mailing list
[email protected]
http://www.fenics.org/mailman/listinfo/dolfin-dev

Reply via email to