[petsc-users] MatNest error with null matrix blocks

Randall Mackie rlmackie862 at gmail.com
Fri Jul 4 09:32:41 CDT 2025


In the process of upgrading our code to version 3.23, we have run into another issue, this time with nest matrices.

In previous versions (well to at least 3.21) it was perfectly fine to pass in null matrix blocks to create a nest matrix. There are situations where we have, for example, only diagonal blocks. That should be allowed and was and worked fine.

In petsc 3.23, that no longer is true, or perhaps we do not know what is the proper way to pass in a null matrix.

The attached example reproduces this with the following error:

[0]PETSC ERROR: Configure options: --force --with-clean=1 --with-scalar-type=complex --with-debugging=1 --with-fortran=1 --download-mpich=1 --with-cxx=0
[0]PETSC ERROR: #1 PetscObjectReference() at /home/rmackie/PETSc/petsc/src/sys/objects/inherit.c:620
[0]PETSC ERROR: #2 MatNestSetSubMats_Nest() at /home/rmackie/PETSc/petsc/src/mat/impls/nest/matnest.c:1407
[0]PETSC ERROR: #3 MatNestSetSubMats() at /home/rmackie/PETSc/petsc/src/mat/impls/nest/matnest.c:1518
[0]PETSC ERROR: #4 MatCreateNest() at /home/rmackie/PETSc/petsc/src/mat/impls/nest/matnest.c:1800
[0]PETSC ERROR: #5 matnest_bug_reproducer.F90:48


Thanks for helping with this, and thanks for all the work on the Fortran interfaces - I’ve been playing around with your new branch and am excited by all the work!

Randy

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20250704/79234178/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: matnest_bug_reproducer.F90
Type: application/octet-stream
Size: 2062 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20250704/79234178/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20250704/79234178/attachment-0001.html>


More information about the petsc-users mailing list