[petsc-users] Eliminating rows and columns which are zeros

Karthikeyan Chockalingam - STFC UKRI karthikeyan.chockalingam at stfc.ac.uk
Tue Jan 10 09:30:56 CST 2023


Hello,

I am assembling a MATIJ of size N, where a very large number of rows (and corresponding columns), are zeros. I would like to potentially eliminate them before the solve.

For instance say N=7


0 0  0  0 0 0 0

0 1 -1  0 0 0 0

0 -1 2  0 0 0 -1

0 0  0  0 0 0 0

0 0  0  0 0 0 0

0 0  0  0 0 0 0

0 0  -1 0 0 0 1

I would like to reduce it to a 3x3

1 -1 0
-1 2 -1
0 -1 1

I do know the size N.

Q1) How do I do it?
Q2) Is it better to eliminate them as it would save a lot of memory?
Q3) At the moment, I don’t know which rows (and columns) have the zero entries but with some effort I probably can find them. Should I know which rows (and columns) I am eliminating?

Thank you.

Karthik.

This email and any attachments are intended solely for the use of the named recipients. If you are not the intended recipient you must not use, disclose, copy or distribute this email or any of its attachments and should notify the sender immediately and delete this email from your system. UK Research and Innovation (UKRI) has taken every reasonable precaution to minimise risk of this email or any attachments containing viruses or malware but the recipient should carry out its own virus and malware checks before opening the attachments. UKRI does not accept any liability for any losses or damages which the recipient may sustain due to presence of any viruses.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230110/49f08858/attachment.html>


More information about the petsc-users mailing list