From: Paul T. B. <ptb...@gm...> - 2018-09-07 11:23:35
|
On Fri, Sep 7, 2018 at 3:26 AM Nikhil Vaidya <nik...@gm...> wrote: > I am trying to make some manipulations to sparse matrices. I have a > function that sets some pre-determined entries in a sparse matrix to a > pre-determined value. I have multiple sparse matrices to which I apply this > procedure. None of the said sparse matrices contain non-zero elements at > (0,0) before the modification. Yet during the modification, only one of the > many sparse matrices gives me the following error message: > > [0]PETSC ERROR: Argument out of range > [0]PETSC ERROR: New nonzero at (0,0) caused a malloc > Use MatSetOption(A, MAT_NEW_NONZERO_ALLOCATION_ERR, PETSC_FALSE) to turn > off this check > This error indicates that you've not correctly preallocated the PETSc matrix. You need to make sure that you're correctly allocating the number of nonzeros per row in the sparse matrices you're manipulating. > > I cannot understand the reason for this behaviour. > > Best, > Nikhil > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > Libmesh-users mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/libmesh-users > |