Dear Seyed,

Thanks for sharing your print function. For future reference, the 
FullMatrix class has two 
<https://www.dealii.org/8.4.1/doxygen/deal.II/classFullMatrix.html#a6427bd9b23b03c590b9881c7dc551552>
 
print 
<https://www.dealii.org/8.4.1/doxygen/deal.II/classFullMatrix.html#a7ea35d5d8074a56cfae428b4fcf165a1>
 
functions implemented that provide similar functionality.

I've been thinking a little about your previous post that Wolfgang replied 
to. If you're still really desperate to print the SparseMatrix in a 
parallel context, then what you could do it create a new ConditionalOstream 
object on each process, but instead of their "ostream" being "std::cout", 
you could have them output to a file stream.You could then print the parts 
of the SparseMatrix that are owned by each processor to separate files. 
But, in the long run, this is probably not such a good way to debug your 
code.

Regards,
J-P

On Thursday, December 15, 2016 at 10:59:23 AM UTC+1, 
mohsengineer...@gmail.com wrote:
>
> I see. Then I will output the local matrices and check the overall 
> structure accordingly. I wrote a simple function to output the cell matrix.
> Maybe someone as noob as me, may find it useful :)
>
> template<int dim>
> void SolidMechanics<dim>::print_matrix (FullMatrix<double>& matrix, const 
> unsigned int dofs_per_cell , char* name)
> {
> std::cout << std::endl << name << std::endl;
> for (unsigned int i = 0; i < dofs_per_cell; ++i)
> {
> for (unsigned int j = 0; j < dofs_per_cell; ++j)
> std::cout << matrix(i,j) << " ";
> std::cout << std::endl;
> }
> std::cout << std::endl;
> }
>
> Thank you all.
>
> Kind regards,
> Seyed Ali Mohseni
>

-- 
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 dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to