Re: [petsc-users] Matrix is missing diagonal entry

2016-10-18 Thread Barry Smith

   You could also fork off of master and find all the places where the code 
depends on diagonal entries existing and modify the code in each of these 
places to handle the missing diagonal. Then run all the test suite and add some 
new tests that explicitly test this functionality and then make a pull request.

Barry

> On Oct 18, 2016, at 11:24 AM, Kong, Fande  wrote:
> 
> Thanks, Hong and Jed.
> 
> I am going to explicitly add a few zeros into the matrix.
> 
> 
> Regards,
> 
> Fande, 
> 
> On Tue, Oct 18, 2016 at 9:46 AM, Hong  wrote:
> You need set 0.0 to the diagonals.
> Diagonal storage is used in PETSc library.
> 
> Hong
> 
> 
> On Tue, Oct 18, 2016 at 10:11 AM, Kong, Fande  wrote:
> Hi Developers,
> 
> Any reason to force users provide a matrix which does not miss any diagonal 
> entries when using a LU-type solver? 
> 
> Sometime, it is impossible to have all diagonal entries in a matrix, that is, 
> the matrix has to miss some diagonal entries. For example, there is a 
> saddle-point matrix from the discretization of incomprehensible equations, 
> and the lower part of the matrix is a zero block. The matrix usually looks 
> like:
> 
> | A   B^T  |
> | B0 |
> 
> 
> 
> 
> 
> [56]PETSC ERROR: Object is in wrong state
> [56]PETSC ERROR: Matrix is missing diagonal entry 33
> [56]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for 
> trouble shooting.
> [56]PETSC ERROR: Petsc Release Version 3.6.2, unknown 
> [56]PETSC ERROR: ./fluid on a arch-linux2-cxx-opt named ys0755 by fandek Mon 
> Oct 17 17:06:08 2016
> [56]PETSC ERROR: Configure options --with-clanguage=cxx 
> --with-shared-libraries=1 --download-fblaslapack=1 --with-mpi=1 
> --download-parmetis=1 --download-metis=1 --with-netcdf=1 
> --download-exodusii=1 --with-hdf5=1 --with-debugging=no --with-c2html=0 
> --with-64-bit-indices=1 --download-hypre=1 --download-superlu_dist=1
> [56]PETSC ERROR: #1 MatILUFactorSymbolic_SeqAIJ() line 1729 in 
> /petsc_installed/petsc/src/mat/impls/aij/seq/aijfact.c
> [56]PETSC ERROR: #2 MatILUFactorSymbolic() line 6457 in 
> /petsc_installed/petsc/src/mat/interface/matrix.c
> [56]PETSC ERROR: #3 PCSetUp_ILU() line 204 in 
> /petsc_installed/petsc/src/ksp/pc/impls/factor/ilu/ilu.c
> [56]PETSC ERROR: #4 PCSetUp() line 983 in 
> /petsc_installed/petsc/src/ksp/pc/interface/precon.c
> [56]PETSC ERROR: #5 KSPSetUp() line 332 in 
> /petsc_installed/petsc/src/ksp/ksp/interface/itfunc.c
> [56]PETSC ERROR: #6 PCSetUpOnBlocks_ASM() line 405 in 
> /petsc_installed/petsc/src/ksp/pc/impls/asm/asm.c
> [56]PETSC ERROR: #7 PCSetUpOnBlocks() line 1016 in 
> /petsc_installed/petsc/src/ksp/pc/interface/precon.c
> [56]PETSC ERROR: #8 KSPSetUpOnBlocks() line 167 in 
> /petsc_installed/petsc/src/ksp/ksp/interface/itfunc.c
> [56]PETSC ERROR: #9 KSPSolve() line 552 in 
> /petsc_installed/petsc/src/ksp/ksp/interface/itfunc.c
> [56]PETSC ERROR: #10 PCApply_LSC() line 83 in 
> /petsc_installed/petsc/src/ksp/pc/impls/lsc/lsc.c
> [56]PETSC ERROR: #11 PCApply() line 483 in 
> /petsc_installed/petsc/src/ksp/pc/interface/precon.c
> [56]PETSC ERROR: #12 KSP_PCApply() line 242 in 
> /petsc_installed/petsc/include/petsc/private/kspimpl.h
> [56]PETSC ERROR: #13 KSPSolve_PREONLY() line 26 in 
> /petsc_installed/petsc/src/ksp/ksp/impls/preonly/preonly.c
> [56]PETSC ERROR: #14 KSPSolve() line 604 in 
> /petsc_installed/petsc/src/ksp/ksp/interface/itfunc.c
> [56]PETSC ERROR: #15 PCApply_FieldSplit_Schur() line 904 in 
> /petsc_installed/petsc/src/ksp/pc/impls/fieldsplit/fieldsplit.c
> [56]PETSC ERROR: #16 PCApply() line 483 in 
> /petsc_installed/petsc/src/ksp/pc/interface/precon.c
> [56]PETSC ERROR: #17 KSP_PCApply() line 242 in 
> /petsc_installed/petsc/include/petsc/private/kspimpl.h
> [56]PETSC ERROR: #18 KSPInitialResidual() line 63 in 
> /petsc_installed/petsc/src/ksp/ksp/interface/itres.c
> [56]PETSC ERROR: #19 KSPSolve_GMRES() line 235 in 
> /petsc_installed/petsc/src/ksp/ksp/impls/gmres/gmres.c
> [56]PETSC ERROR: #20 KSPSolve() line 604 in 
> /petsc_installed/petsc/src/ksp/ksp/interface/itfunc.c
> [56]PETSC ERROR: #21 SNESSolve_NEWTONLS() line 233 in 
> /petsc_installed/petsc/src/snes/impls/ls/ls.c
> [56]PETSC ERROR: #22 SNESSolve() line 3906 in 
> /petsc_installed/petsc/src/snes/interface/snes.c
> 
> 
> Thanks,
> 
> Fande Kong,
> 
> 



Re: [petsc-users] Matrix is missing diagonal entry

2016-10-18 Thread Kong, Fande
Thanks, Hong and Jed.

I am going to explicitly add a few zeros into the matrix.


Regards,

Fande,

On Tue, Oct 18, 2016 at 9:46 AM, Hong  wrote:

> You need set 0.0 to the diagonals.
> Diagonal storage is used in PETSc library.
>
> Hong
>
>
> On Tue, Oct 18, 2016 at 10:11 AM, Kong, Fande  wrote:
>
>> Hi Developers,
>>
>> Any reason to force users provide a matrix which does not miss any
>> diagonal entries when using a LU-type solver?
>>
>> Sometime, it is impossible to have all diagonal entries in a matrix, that
>> is, the matrix has to miss some diagonal entries. For example, there is a
>> saddle-point matrix from the discretization of incomprehensible equations,
>> and the lower part of the matrix is a zero block. The matrix usually looks
>> like:
>>
>> | A   B^T  |
>> | B0 |
>>
>>
>>
>>
>>
>> [56]PETSC ERROR: Object is in wrong state
>> [56]PETSC ERROR: Matrix is missing diagonal entry 33
>> [56]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html
>> 
>> for trouble shooting.
>> [56]PETSC ERROR: Petsc Release Version 3.6.2, unknown
>> [56]PETSC ERROR: ./fluid on a arch-linux2-cxx-opt named ys0755 by fandek
>> Mon Oct 17 17:06:08 2016
>> [56]PETSC ERROR: Configure options --with-clanguage=cxx
>> --with-shared-libraries=1 --download-fblaslapack=1 --with-mpi=1
>> --download-parmetis=1 --download-metis=1 --with-netcdf=1
>> --download-exodusii=1 --with-hdf5=1 --with-debugging=no --with-c2html=0
>> --with-64-bit-indices=1 --download-hypre=1 --download-superlu_dist=1
>> [56]PETSC ERROR: #1 MatILUFactorSymbolic_SeqAIJ() line 1729 in
>> /petsc_installed/petsc/src/mat/impls/aij/seq/aijfact.c
>> [56]PETSC ERROR: #2 MatILUFactorSymbolic() line 6457 in
>> /petsc_installed/petsc/src/mat/interface/matrix.c
>> [56]PETSC ERROR: #3 PCSetUp_ILU() line 204 in
>> /petsc_installed/petsc/src/ksp/pc/impls/factor/ilu/ilu.c
>> [56]PETSC ERROR: #4 PCSetUp() line 983 in /petsc_installed/petsc/src/ksp
>> /pc/interface/precon.c
>> [56]PETSC ERROR: #5 KSPSetUp() line 332 in /petsc_installed/petsc/src/ksp
>> /ksp/interface/itfunc.c
>> [56]PETSC ERROR: #6 PCSetUpOnBlocks_ASM() line 405 in
>> /petsc_installed/petsc/src/ksp/pc/impls/asm/asm.c
>> [56]PETSC ERROR: #7 PCSetUpOnBlocks() line 1016 in
>> /petsc_installed/petsc/src/ksp/pc/interface/precon.c
>> [56]PETSC ERROR: #8 KSPSetUpOnBlocks() line 167 in
>> /petsc_installed/petsc/src/ksp/ksp/interface/itfunc.c
>> [56]PETSC ERROR: #9 KSPSolve() line 552 in /petsc_installed/petsc/src/ksp
>> /ksp/interface/itfunc.c
>> [56]PETSC ERROR: #10 PCApply_LSC() line 83 in
>> /petsc_installed/petsc/src/ksp/pc/impls/lsc/lsc.c
>> [56]PETSC ERROR: #11 PCApply() line 483 in /petsc_installed/petsc/src/ksp
>> /pc/interface/precon.c
>> [56]PETSC ERROR: #12 KSP_PCApply() line 242 in
>> /petsc_installed/petsc/include/petsc/private/kspimpl.h
>> [56]PETSC ERROR: #13 KSPSolve_PREONLY() line 26 in
>> /petsc_installed/petsc/src/ksp/ksp/impls/preonly/preonly.c
>> [56]PETSC ERROR: #14 KSPSolve() line 604 in /petsc_installed/petsc/src/ksp
>> /ksp/interface/itfunc.c
>> [56]PETSC ERROR: #15 PCApply_FieldSplit_Schur() line 904 in
>> /petsc_installed/petsc/src/ksp/pc/impls/fieldsplit/fieldsplit.c
>> [56]PETSC ERROR: #16 PCApply() line 483 in /petsc_installed/petsc/src/ksp
>> /pc/interface/precon.c
>> [56]PETSC ERROR: #17 KSP_PCApply() line 242 in
>> /petsc_installed/petsc/include/petsc/private/kspimpl.h
>> [56]PETSC ERROR: #18 KSPInitialResidual() line 63 in
>> /petsc_installed/petsc/src/ksp/ksp/interface/itres.c
>> [56]PETSC ERROR: #19 KSPSolve_GMRES() line 235 in
>> /petsc_installed/petsc/src/ksp/ksp/impls/gmres/gmres.c
>> [56]PETSC ERROR: #20 KSPSolve() line 604 in /petsc_installed/petsc/src/ksp
>> /ksp/interface/itfunc.c
>> [56]PETSC ERROR: #21 SNESSolve_NEWTONLS() line 233 in
>> /petsc_installed/petsc/src/snes/impls/ls/ls.c
>> [56]PETSC ERROR: #22 SNESSolve() line 3906 in
>> /petsc_installed/petsc/src/snes/interface/snes.c
>>
>>
>> Thanks,
>>
>> Fande Kong,
>>
>
>


Re: [petsc-users] Matrix is missing diagonal entry

2016-10-18 Thread Hong
You need set 0.0 to the diagonals.
Diagonal storage is used in PETSc library.

Hong

On Tue, Oct 18, 2016 at 10:11 AM, Kong, Fande  wrote:

> Hi Developers,
>
> Any reason to force users provide a matrix which does not miss any
> diagonal entries when using a LU-type solver?
>
> Sometime, it is impossible to have all diagonal entries in a matrix, that
> is, the matrix has to miss some diagonal entries. For example, there is a
> saddle-point matrix from the discretization of incomprehensible equations,
> and the lower part of the matrix is a zero block. The matrix usually looks
> like:
>
> | A   B^T  |
> | B0 |
>
>
>
>
>
> [56]PETSC ERROR: Object is in wrong state
> [56]PETSC ERROR: Matrix is missing diagonal entry 33
> [56]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html
> for trouble shooting.
> [56]PETSC ERROR: Petsc Release Version 3.6.2, unknown
> [56]PETSC ERROR: ./fluid on a arch-linux2-cxx-opt named ys0755 by fandek
> Mon Oct 17 17:06:08 2016
> [56]PETSC ERROR: Configure options --with-clanguage=cxx
> --with-shared-libraries=1 --download-fblaslapack=1 --with-mpi=1
> --download-parmetis=1 --download-metis=1 --with-netcdf=1
> --download-exodusii=1 --with-hdf5=1 --with-debugging=no --with-c2html=0
> --with-64-bit-indices=1 --download-hypre=1 --download-superlu_dist=1
> [56]PETSC ERROR: #1 MatILUFactorSymbolic_SeqAIJ() line 1729 in
> /petsc_installed/petsc/src/mat/impls/aij/seq/aijfact.c
> [56]PETSC ERROR: #2 MatILUFactorSymbolic() line 6457 in
> /petsc_installed/petsc/src/mat/interface/matrix.c
> [56]PETSC ERROR: #3 PCSetUp_ILU() line 204 in /petsc_installed/petsc/src/
> ksp/pc/impls/factor/ilu/ilu.c
> [56]PETSC ERROR: #4 PCSetUp() line 983 in /petsc_installed/petsc/src/
> ksp/pc/interface/precon.c
> [56]PETSC ERROR: #5 KSPSetUp() line 332 in /petsc_installed/petsc/src/
> ksp/ksp/interface/itfunc.c
> [56]PETSC ERROR: #6 PCSetUpOnBlocks_ASM() line 405 in
> /petsc_installed/petsc/src/ksp/pc/impls/asm/asm.c
> [56]PETSC ERROR: #7 PCSetUpOnBlocks() line 1016 in
> /petsc_installed/petsc/src/ksp/pc/interface/precon.c
> [56]PETSC ERROR: #8 KSPSetUpOnBlocks() line 167 in
> /petsc_installed/petsc/src/ksp/ksp/interface/itfunc.c
> [56]PETSC ERROR: #9 KSPSolve() line 552 in /petsc_installed/petsc/src/
> ksp/ksp/interface/itfunc.c
> [56]PETSC ERROR: #10 PCApply_LSC() line 83 in /petsc_installed/petsc/src/
> ksp/pc/impls/lsc/lsc.c
> [56]PETSC ERROR: #11 PCApply() line 483 in /petsc_installed/petsc/src/
> ksp/pc/interface/precon.c
> [56]PETSC ERROR: #12 KSP_PCApply() line 242 in /petsc_installed/petsc/
> include/petsc/private/kspimpl.h
> [56]PETSC ERROR: #13 KSPSolve_PREONLY() line 26 in
> /petsc_installed/petsc/src/ksp/ksp/impls/preonly/preonly.c
> [56]PETSC ERROR: #14 KSPSolve() line 604 in /petsc_installed/petsc/src/
> ksp/ksp/interface/itfunc.c
> [56]PETSC ERROR: #15 PCApply_FieldSplit_Schur() line 904 in
> /petsc_installed/petsc/src/ksp/pc/impls/fieldsplit/fieldsplit.c
> [56]PETSC ERROR: #16 PCApply() line 483 in /petsc_installed/petsc/src/
> ksp/pc/interface/precon.c
> [56]PETSC ERROR: #17 KSP_PCApply() line 242 in /petsc_installed/petsc/
> include/petsc/private/kspimpl.h
> [56]PETSC ERROR: #18 KSPInitialResidual() line 63 in
> /petsc_installed/petsc/src/ksp/ksp/interface/itres.c
> [56]PETSC ERROR: #19 KSPSolve_GMRES() line 235 in
> /petsc_installed/petsc/src/ksp/ksp/impls/gmres/gmres.c
> [56]PETSC ERROR: #20 KSPSolve() line 604 in /petsc_installed/petsc/src/
> ksp/ksp/interface/itfunc.c
> [56]PETSC ERROR: #21 SNESSolve_NEWTONLS() line 233 in
> /petsc_installed/petsc/src/snes/impls/ls/ls.c
> [56]PETSC ERROR: #22 SNESSolve() line 3906 in /petsc_installed/petsc/src/
> snes/interface/snes.c
>
>
> Thanks,
>
> Fande Kong,
>


Re: [petsc-users] Matrix is missing diagonal entry

2016-10-18 Thread Jed Brown
"Kong, Fande"  writes:

> Hi Developers,
>
> Any reason to force users provide a matrix which does not miss any diagonal
> entries when using a LU-type solver?

Automatically adding the entries for incomplete factorization is a
slight increase in complexity and means that "ILU(0)" actually has some
fill.  Note that a literal ILU(0) cannot work if there are missing
diagonal entries.

It's probably not a significant code complexity difference for LU.

> Sometime, it is impossible to have all diagonal entries in a matrix, that
> is, the matrix has to miss some diagonal entries. For example, there is a
> saddle-point matrix from the discretization of incomprehensible equations,
> and the lower part of the matrix is a zero block. The matrix usually looks
> like:
>
> | A   B^T  |
> | B0 |

Just insert explicit zeros on the diagonal.


signature.asc
Description: PGP signature