I want to use scipy and petsc4py in program, but the second code is wrong because I include the dolfin library. Does anybody know where is wrong!? Thanks!
The first code :
import numpy as np
from petsc4py import PETSc
import scipy.sparse
csr_mat = scipy.sparse.rand(1000, 1000, density=0.1, format='csr')
csr = (csr_mat.indptr,csr_mat.indices,csr_mat.data)
A = PETSc.Mat()
A.createAIJ(size=csr_mat.shape ,csr = csr)
The second code :
from dolfin import *
import numpy as np
from petsc4py import PETSc
import scipy.sparse
csr_mat = scipy.sparse.rand(1000, 1000, density=0.1, format='csr')
csr = (csr_mat.indptr,csr_mat.indices,csr_mat.data)
A = PETSc.Mat()
A.createAIJ(size=csr_mat.shape ,csr = csr)