> On 23 Apr 2018, at 11:32, Loic Gouarin <[email protected]> wrote: > > Hi, > > I try to use MATIS from petsc4py but I am not able to use setValuesLocal (I > have a segmentation fault). And I don't understand why. > > Could you tell me if I did a mistake or if it's a bug ?
This code works for me with: PETSc: 7bfdb6492ce petsc4py: 9137bf78e Perhaps you have a mismatching petsc4py/PETSc combo? Lawrence > My example > ======= > from petsc4py import PETSc > import numpy as np > > n = 10 > da = PETSc.DMDA().create([n, n], dof=1, stencil_width=1) > da.setMatType(PETSc.Mat.Type.IS) > > A = da.createMatrix() > #ltog = da.getLGMap() > #A.setLGMap(ltog, ltog) > > elem = da.getElements() > melem = np.ones((4, 4)) > > for e in elem: > A.setValuesLocal(e, e, melem, PETSc.InsertMode.ADD_VALUES) > > Thanks, > Loic > > -- > Tel: 01 69 15 60 14 > http://www.math.u-psud.fr/~gouarin > https://github.com/gouarin >
