[petsc-users] PETSC Matrix debugging

Shatanawi, Sawsan Muhammad sawsan.shatanawi at wsu.edu
Mon Apr 1 15:40:01 CDT 2024


Hello Barry and Matthew,

Yes MatView is what I was looking for. Thank you for your help.

Bests,
Sawsan
________________________________
From: Barry Smith <bsmith at petsc.dev>
Sent: Monday, April 1, 2024 1:14 PM
To: Matthew Knepley <knepley at gmail.com>
Cc: Shatanawi, Sawsan Muhammad <sawsan.shatanawi at wsu.edu>; petsc-users at mcs.anl.gov <petsc-users at mcs.anl.gov>
Subject: Re: [petsc-users] PETSC Matrix debugging


[EXTERNAL EMAIL]

  Note, you can also run with the option -mat_view and it will print each matrix that gets assembled.

  Also in the debugger you can do call MatView(mat,0)



On Apr 1, 2024, at 2:18 PM, Matthew Knepley <knepley at gmail.com> wrote:

This Message Is From an External Sender
This message came from outside your organization.
On Mon, Apr 1, 2024 at 1:57 PM Shatanawi, Sawsan Muhammad via petsc-users <petsc-users at mcs.anl.gov<mailto:petsc-users at mcs.anl.gov>> wrote:
This Message Is From an External Sender
This message came from outside your organization.

Hello everyone,

I hope this email finds you well.

Is there a way we can check how the matrix looks like after setting it.
I have tried debugging it with gdb- break points- and print statements, but it only gave me one value instead of a matrix.

Thank you in advance for your time and assistance.

I usually use MatView(), which can print to the screen. Is that what you want?

  Thanks,

     Matt

Best regards,

 Sawsan



--
What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
-- Norbert Wiener

https://urldefense.us/v3/__https://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!dzUer79uIA6hcNT7qaG9AYDGyzDSYNgriB1CbMtHqSvf4Yo-IpKL7NBCWNtAUNcE4xbHLqQPsngdWk6kYcVImGviELhswASejA$ <https://urldefense.com/v3/__https://urldefense.us/v3/__http:/*www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!cFl9o86vmX7ZWINcjhpIy1gzc938wF-1bgwtrPGwm8zQQ71WUgVstEpSos7o1OWqfmTup5bgaekGgXgHtARk$__;Lyo!!JmPEgBY0HMszNaDT!qlwOMP0cMvy1t2oClXMYnNWjgy5a9anhp7DsQsT2cv6Tj_6FhcRZRQq8tmenmEGYmUudiYBlOLLUFaJI9o9YasI$>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20240401/3006bb8a/attachment-0001.html>


More information about the petsc-users mailing list