[petsc-users] MatGetSubMatrix for a Nested matrix

Khai Hong Pham khaipham at utexas.edu
Mon Aug 11 15:53:36 CDT 2014


Matt,

I've the following error as I tried to get the sub block matrix. I check
the isrow and iscol that are passed to MatGetSubMatrix and they look ok to
me. The line 110 of  ISStrideGetInfo() calls to PetscValidHeaderSpecific.


[0]PETSC ERROR: Null argument, when expecting valid pointer
[0]PETSC ERROR: Null Object: Parameter # 1
[0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for
trouble shooting.
[0]PETSC ERROR: Petsc Release Version 3.5.1, Jul, 24, 2014
[0]PETSC ERROR: [1]PETSC ERROR: ./PFFEM2DSolver on a arch-linux2-c-debug
named khp by khp Mon Aug 11 15:26:47 2014
Null argument, when expecting valid pointer
[0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++
--with-fc=gfortran --download-fblaslapack --download-mpich --download-hdf5
--download-metis --download-parmetis
[1]PETSC ERROR: Null Object: Parameter # 1
[1]PETSC ERROR: [0]PETSC ERROR: #1 ISStrideGetInfo() line 110 in
/home/khp/bin/petsc-3.5.1/src/vec/is/is/impls/stride/stride.c
See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble
shooting.
[1]PETSC ERROR: Petsc Release Version 3.5.1, Jul, 24, 2014
[1]PETSC ERROR: ./PFFEM2DSolver on a arch-linux2-c-debug named khp by khp
Mon Aug 11 15:26:47 2014
[1]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++
--with-fc=gfortran --download-fblaslapack --download-mpich --download-hdf5
--download-metis --download-parmetis
[1]PETSC ERROR: #1 ISStrideGetInfo() line 110 in
/home/khp/bin/petsc-3.5.1/src/vec/is/is/impls/stride/stride.c
[0]PETSC ERROR: #2 MatNestFindSubMat() line 357 in
/home/khp/bin/petsc-3.5.1/src/mat/impls/nest/matnest.c
[0]PETSC ERROR: #3 MatGetLocalSubMatrix_Nest() line 411 in
/home/khp/bin/petsc-3.5.1/src/mat/impls/nest/matnest.c
[0]PETSC ERROR: #4 MatGetLocalSubMatrix() line 9224 in
/home/khp/bin/petsc-3.5.1/src/mat/interface/matrix.c
[1]PETSC ERROR: #2 MatNestFindSubMat() line 357 in
/home/khp/bin/petsc-3.5.1/src/mat/impls/nest/matnest.c
[0]PETSC ERROR: #5 jacobian_comp() line 49 in src/assembly.cpp
[1]PETSC ERROR: #3 MatGetLocalSubMatrix_Nest() line 411 in
/home/khp/bin/petsc-3.5.1/src/mat/impls/nest/matnest.c
[0]PETSC ERROR: [1]PETSC ERROR: #6 TaoComputeJacobian() line 153 in
/home/khp/bin/petsc-3.5.1/src/tao/interface/taosolver_hj.c
#4 MatGetLocalSubMatrix() line 9224 in
/home/khp/bin/petsc-3.5.1/src/mat/interface/matrix.c
[0]PETSC ERROR: [1]PETSC ERROR: #7 Tao_SSLS_FunctionGradient() line 63 in
/home/khp/bin/petsc-3.5.1/src/tao/complementarity/impls/ssls/ssls.c
#5 jacobian_comp() line 49 in src/assembly.cpp
[0]PETSC ERROR: #8 TaoLineSearchComputeObjectiveAndGradient() line 941 in
/home/khp/bin/petsc-3.5.1/src/tao/linesearch/interface/taolinesearch.c
[1]PETSC ERROR: #6 TaoComputeJacobian() line 153 in
/home/khp/bin/petsc-3.5.1/src/tao/interface/taosolver_hj.c
[0]PETSC ERROR: #9 TaoSolve_SSILS() line 65 in
/home/khp/bin/petsc-3.5.1/src/tao/complementarity/impls/ssls/ssils.c
[1]PETSC ERROR: #7 Tao_SSLS_FunctionGradient() line 63 in
/home/khp/bin/petsc-3.5.1/src/tao/complementarity/impls/ssls/ssls.c
[0]PETSC ERROR: #10 TaoSolve() line 188 in
/home/khp/bin/petsc-3.5.1/src/tao/interface/taosolver.c
[1]PETSC ERROR: #8 TaoLineSearchComputeObjectiveAndGradient() line 941 in
/home/khp/bin/petsc-3.5.1/src/tao/linesearch/interface/taolinesearch.c
[0]PETSC ERROR: #11 main() line 286 in src/main.cpp
[1]PETSC ERROR: #9 TaoSolve_SSILS() line 65 in
/home/khp/bin/petsc-3.5.1/src/tao/complementarity/impls/ssls/ssils.c
[0]PETSC ERROR: ----------------End of Error Message -------send entire
error message to petsc-maint at mcs.anl.gov----------
[1]PETSC ERROR: #10 TaoSolve() line 188 in
/home/khp/bin/petsc-3.5.1/src/tao/interface/taosolver.c
[1]PETSC ERROR: #11 main() line 286 in src/main.cpp
[1]PETSC ERROR: ----------------End of Error Message -------send entire
error message to petsc-maint at mcs.anl.gov----------



On Mon, Aug 11, 2014 at 12:34 PM, Matthew Knepley <knepley at gmail.com> wrote:

> On Mon, Aug 11, 2014 at 12:05 PM, Khai Hong Pham <khaipham at utexas.edu>
> wrote:
>
>> Hello Petsc-Users,
>>
>> In the MatGetSubMatrix, if the matrix mat is a nested matrix, for example
>> [ A00 A01 | A10 A11], and I'd like to get submat  A10. Then the isrow and
>> iscol will be the index of the subblock matrix which is (1,0) or it must be
>> the index of all rows, columns of the submat in the mat (like in
>> MatGetSubMatrix). Please help me to clarify this.
>>
>
> It is the later (the list of rows/cols)
>
>   Thsnks,
>
>     Matt
>
>
>> Thanks
>>
>> Khai
>>
>
>
>
> --
> What most experimenters take for granted before they begin their
> experiments is infinitely more interesting than any results to which their
> experiments lead.
> -- Norbert Wiener
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140811/2031546b/attachment.html>


More information about the petsc-users mailing list