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

Am Donnerstag, 19. Mai 2016 15:29:46 UTC+2 schrieb David:
>
> 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.
>
> 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.
>
> Best regards,
> David.
>
>
>
> On Tuesday, May 17, 2016 at 3:30:22 AM UTC+8, Daniel Arndt wrote:
>>
>> >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?
>>
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to