FullMatrix::print_formatted() issue

19 views
Skip to first unread message

Vinayak Vijay

unread,
May 17, 2023, 10:58:16 AM5/17/23
to deal.II User Group
Hello,

I am trying to print out a matrix to a file using the following commands:

std::ofstream file("mat.txt");
cell_matrix.print_formatted(file);

However, the matrix that is printed out to the file has some missing
entries, which are actually 0.

Can someone tell me how can i print the 0 entries as well?

Thanks
Vinayak

Praveen C

unread,
May 17, 2023, 11:35:52 PM5/17/23
to Deal. II Googlegroup
The manual page (assuming cell_matrix is a FullMatrix)

https://dealii.org/developer/doxygen/deal.II/classFullMatrix.html#abdd86a102fefa37a3916a612d8e329bd

says there is an option “zero_string”, may be set it to “0” and try it.

best
praveen
> --
> 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+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/49b4be8d-1f9a-41ce-8b20-d0cb81a32dean%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages