Help with interpretation of PETSc and SLEPc error message.

135 views
Skip to first unread message

David

unread,
May 15, 2016, 9:58:04 AM5/15/16
to deal.II User Group
Hi all:

I am learning step-36 and doing a similar eigenproblem computation, but met an error. I tried to understand it by referring to the source file but still have no idea.
Could anyone please take a look, it says:

[0]PETSC ERROR: Object is in wrong state
[0]PETSC ERROR: Matrix is missing diagonal entry 8

and the additional information says:

----------------------------------------------------
Exception on processing:

--------------------------------------------------------
An error occurred in line <172> of file </home/ubuntu/deal.II/dealii/source/lac/slepc_solver.cc> in function
   
void dealii::SLEPcWrappers::SolverBase::solve(unsigned int, unsigned int*)
The violated condition was:
    ierr
== 0
The name and call sequence of the exception was:
   
ExcSLEPcError(ierr)
Additional Information:
   
An error with error number 73 occurred while calling a SLEPc function
--------------------------------------------------------


Dose anyone have ideas about the main cause of this error? On what direction should I try to fix it? Greatly appreciate your help!

Best regards,
David.

Tobi Young

unread,
May 15, 2016, 1:03:30 PM5/15/16
to dealii
> Could anyone please take a look, it says:
>
> [0]PETSC ERROR: Object is in wrong state
> [0]PETSC ERROR: Matrix is missing diagonal entry 8
>

The above tells us that the matrix is singular (missing a diagonal entry).

I can recommend you check first, if your matrix should be singular -
ie. if you are assembling him correctly; and second, check that the
SLEPc solver you are using is capable of solving a singular matrix
(not all are). You can get some information from the solver pages of
the SLEPc manual.

Hope that helps a little.

Best,
Toby
Message has been deleted

Daniel Arndt

unread,
May 16, 2016, 3:30:22 PM5/16/16
to deal.II User Group
Dear David,

for debugging your code you should start with simplifying your code as much as possible to see what is going wrong.
In particular, you should try with not refining your mesh and confirm that the assembled matrices look as they should.
Can you modify the parameters in such a way that you would expect to reproduce the results of step-36?

Best,
Daniel


Am Montag, 16. Mai 2016 11:28:39 UTC+2 schrieb David:
Hi, Tobi:

Thank you so much for your suggestions. I have followed your direction and checked my code again and again for all day long, but still
could not resolve this problem. If you (or someone else) wouldn't mind, could you please take a look at my code attached below?

It is a really short code, of which most parts are exactly the same with step-36, except some details I changed for learning purposes (I changed
this problem to a simple dynamical elasticity problem on a rectangular domain). I know this might cause some unconveniences, but I really
need somesone's help. Since nobody around me uses dealii, this is the only place I can turn to.

Thanks in advance for any help!

Best regards,
David.

David

unread,
May 19, 2016, 9:29:46 AM5/19/16
to deal.II User Group
Hi, Daniel:

Thank you for your suggestions and sorry about late reply. I decided to simplify the starting mesh and display the resulting matrix using
MatrixOut, so that I can check whether I went wrong in assembling the matrix. But after using the following code to get the output matrix
data file, I don't know how to display the the matrix in gnuplot with their values showing in the corresponding positions.


...                // fill matrix M with some values
                  // now write out M:

MatrixOut matrix_out;

std::ofstream out ("M.gnuplot");
matrix_out.build_patches (M, "M");
matrix_out.write_gnuplot (out);


I tried to use

plot 'M.gnuplot' matrix

but all I get is some point without values showing up. Opening this file with Emacs, the values can be found, but their orderings are not convenient.
Do you know how to display this data file so that they can show the values in correct order just like in MATLAB.

Best regards,
David.

Daniel Arndt

unread,
May 19, 2016, 9:53:40 AM5/19/16
to deal.II User Group
Hey David,

you can always use the 'print' method of your matrix[1] to write its content to a file.
Doing so both for the reference code and your code, you can simply compare the two files.

Best,
Daniel

[1] https://www.dealii.org/8.4.1/doxygen/deal.II/classSparseMatrix.html#a57ee42a70d603759e17b8a204af3c4d5

David

unread,
May 19, 2016, 12:33:25 PM5/19/16
to deal.II User Group
Hi, Daniel:

Thank you so much for your help! Your suggestions really helped a lot, and finally I find where I got wrong!
Great thanks!

Best,
David.

Wolfgang Bangerth

unread,
May 19, 2016, 10:34:33 PM5/19/16
to dea...@googlegroups.com

> Thank you for your suggestions and sorry about late reply. I decided to
> simplify the starting mesh and display the resulting matrix using
> *MatrixOut*, so that I can check whether I went wrong in assembling the
> matrix. But after using the following code to get the output matrix
> data file, I don't know how to display the the matrix in gnuplot with their
> values showing in the corresponding positions.
>
> |
> FullMatrix<double>
> <http://dealii.org/8.4.1/doxygen/deal.II/classFullMatrix.html>M;
>
> ...// fill matrix M with some values
> // now write out M:
>
> MatrixOut <http://dealii.org/8.4.1/doxygen/deal.II/classMatrixOut.html>matrix_out;
>
> std::ofstream out("M.gnuplot");
> matrix_out.build_patches
> <http://dealii.org/8.4.1/doxygen/deal.II/classMatrixOut.html#a0d01113fd37dfa352dc237f3d05c2182>(M,"M");
> matrix_out.write_gnuplot
> <http://dealii.org/8.4.1/doxygen/deal.II/classDataOutInterface.html#a471d836d307c6e888ab3b5ad81fe0416>(out);
>
> |
>
> I tried to use
>
> |
> plot 'M.gnuplot'matrix
> |
>
> but all I get is some point without values showing up. Opening this file with
> Emacs, the values can be found, but their orderings are not convenient.
> Do you know how to display this data file so that they can show the values in
> correct order just like in MATLAB.

You can do this in gnuplot:
set style data lines
set hidden3d
splot "M.gnuplot" using 1:2:3

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@math.tamu.edu
www: http://www.math.tamu.edu/~bangerth/

Reply all
Reply to author
Forward
0 new messages