Hey All, I was wondering if anyone had used MatNest with petsc4py. I am having issues trying to create a MatNest where some of the submatrices are empty. In PETSc, I can just pass NULL in the array that I give to MatCreateNest and it works fine. However, the following code
nest_list = [[None,None],[None,None]] nest_list[0][0] = some matrix nest_list[0][1] = some matrix nest_list[1][0] = some matrix A = PETSc.Mat().createNest(nest_list,comm=PETSc.COMM_WORLD) fails with: File "Mat.pyx", line 445, in petsc4py.PETSc.Mat.createNest (src/petsc4py.PETSc.c:103202) TypeError: Cannot convert NoneType to petsc4py.PETSc.Mat Is there an equivalent to NULL in petsc4py (there doesn't appear to be one)? If all of the entries in nest_list are filled, everything works fine. Any help would be appreciated! Thanks, Chris -- Chris Eldred Postdoctoral Fellow, LAGA, University of Paris 13 PhD, Atmospheric Science, Colorado State University, 2015 DOE Computational Science Graduate Fellow (Alumni) B.S. Applied Computational Physics, Carnegie Mellon University, 2009 [email protected]
