Dear S.A. Mohseni,

There is no need to duplicate code. ;-) 
FullMatrix<number> also has a print function[1] and its implementation[2] 
is more or less identical to what you are doing.

Best,
Daniel

[1] 
https://www.dealii.org/8.4.1/doxygen/deal.II/classFullMatrix.html#a6427bd9b23b03c590b9881c7dc551552
[2] 
https://www.dealii.org/8.4.1/doxygen/deal.II/full__matrix_8h_source.html#l01534

Am Donnerstag, 15. Dezember 2016 10:59:23 UTC+1 schrieb 
mohseng...@gmail.com:
>
> 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