{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaDiffEq/FEniCS.jl/issues/55","repository_url":"https://api.github.com/repos/JuliaDiffEq/FEniCS.jl","labels_url":"https://api.github.com/repos/JuliaDiffEq/FEniCS.jl/issues/55/labels{/name}","comments_url":"https://api.github.com/repos/JuliaDiffEq/FEniCS.jl/issues/55/comments","events_url":"https://api.github.com/repos/JuliaDiffEq/FEniCS.jl/issues/55/events","html_url":"https://github.com/JuliaDiffEq/FEniCS.jl/issues/55","id":352138596,"node_id":"MDU6SXNzdWUzNTIxMzg1OTY=","number":55,"title":"get_array should return sparse matrix","user":{"login":"clason","id":2361214,"node_id":"MDQ6VXNlcjIzNjEyMTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/2361214?v=4","gravatar_id":"","url":"https://api.github.com/users/clason","html_url":"https://github.com/clason","followers_url":"https://api.github.com/users/clason/followers","following_url":"https://api.github.com/users/clason/following{/other_user}","gists_url":"https://api.github.com/users/clason/gists{/gist_id}","starred_url":"https://api.github.com/users/clason/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clason/subscriptions","organizations_url":"https://api.github.com/users/clason/orgs","repos_url":"https://api.github.com/users/clason/repos","events_url":"https://api.github.com/users/clason/events{/privacy}","received_events_url":"https://api.github.com/users/clason/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-08-20T13:36:22Z","updated_at":"2018-08-20T14:12:40Z","closed_at":null,"author_association":"NONE","body":"At the moment, the `get_array` function returns a full `Array{Float64,2}`, which is not really a reasonable option for any practical use beyond toy problems. Can the get_array function be modified to return a `SparseMatrixCSC{Float64,Int64}` instead?\r\n\r\nFor reference, here's how I do the same on the FEniCS/SciPy interface:\r\n```python\r\nimport scipy.sparse as sp\r\nparameters['linear_algebra_backend'] = 'Eigen'                                    \r\ndef assemble_csr(a,bc=None):                                                           \r\n    A = assemble(a)                                                               \r\n    bc.apply(A)                                                                   \r\n    row,col,val = as_backend_type(A).data()                                       \r\n    return sp.csr_matrix((val,col,row))                                           \r\n```\r\nI believe the same should work for FEniCS-to-Julia."},"comment":{"url":"https://api.github.com/repos/JuliaDiffEq/FEniCS.jl/issues/comments/414330309","html_url":"https://github.com/JuliaDiffEq/FEniCS.jl/issues/55#issuecomment-414330309","issue_url":"https://api.github.com/repos/JuliaDiffEq/FEniCS.jl/issues/55","id":414330309,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNDMzMDMwOQ==","user":{"login":"clason","id":2361214,"node_id":"MDQ6VXNlcjIzNjEyMTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/2361214?v=4","gravatar_id":"","url":"https://api.github.com/users/clason","html_url":"https://github.com/clason","followers_url":"https://api.github.com/users/clason/followers","following_url":"https://api.github.com/users/clason/following{/other_user}","gists_url":"https://api.github.com/users/clason/gists{/gist_id}","starred_url":"https://api.github.com/users/clason/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clason/subscriptions","organizations_url":"https://api.github.com/users/clason/orgs","repos_url":"https://api.github.com/users/clason/repos","events_url":"https://api.github.com/users/clason/events{/privacy}","received_events_url":"https://api.github.com/users/clason/received_events","type":"User","site_admin":false},"created_at":"2018-08-20T14:12:40Z","updated_at":"2018-08-20T14:12:40Z","author_association":"NONE","body":"@MiroK I was not aware of the `mat()` function! Yes, \r\n```python\r\nrow,col,val = as_backend_type(A).mat().getValuesCSR()\r\nA_csr = sp.csr_matrix((val,col,row))\r\n```\r\nworks nicely. This should be the easiest way. Thanks!"}}
{"actor":{"display_login":"clason"}}