<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><font face="arial, sans-serif">Hello,</font><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">I am using MatZeroRows for imposing a known forcing into my equations in conjunction with rhs and by setting the diagonal of the matrix to 1.</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">I am using Fortran. I have used:</font></div><div><font face="arial, sans-serif"><br></font></div><div><p style="margin:0px;font-stretch:normal;line-height:normal;color:rgb(203,36,24)"><span style="font-variant-ligatures:no-common-ligatures"><font face="arial, sans-serif">! only local processors set their own zeros </font></span></p>
<p style="margin:0px;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><font face="arial, sans-serif"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(194,0,255)">call</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(74,0,255)">MatSetOption</span><span style="font-variant-ligatures:no-common-ligatures">(self%fieldLHSMat_ps, MAT_NO_OFF_PROC_ZERO_ROWS, PETSC_TRUE, ierr)</span></font></p><p style="margin:0px;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><font face="arial, sans-serif"><span style="font-variant-ligatures:no-common-ligatures"><br></span></font></p>
<p style="margin:0px;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><font face="arial, sans-serif"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(194,0,255)">call</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(74,0,255)">MatSetOption</span><span style="font-variant-ligatures:no-common-ligatures">(self%fieldLHSMat_ps, MAT_KEEP_NONZERO_PATTERN, PETSC_TRUE, ierr)</span></font></p>
<p style="margin:0px;font-stretch:normal;line-height:normal;color:rgb(0,0,0);min-height:13px"><font face="arial, sans-serif"><br><span style="font-variant-ligatures:no-common-ligatures"></span></font></p>
<p style="margin:0px;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><font face="arial, sans-serif"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(194,0,255)">call</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(74,0,255)">MatZeroRows</span><span style="font-variant-ligatures:no-common-ligatures">(self%fieldLHSMat_ps, numrows, glob_row_idx, diag, PETSC_NULL_OBJECT, PETSC_NULL_OBJECT, ierr)</span></font></p><p style="margin:0px;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><font face="arial, sans-serif"><br></font></span></p><p style="margin:0px;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><font face="arial, sans-serif"><br></font></span></p><p style="margin:0px;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><font face="arial, sans-serif">Is numrows above the local (on each proc.) number of rows to remove, or is it the global number of rows to remove?</font></span></p><p style="margin:0px;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><font face="arial, sans-serif"><br></font></span></p><p style="margin:0px;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><font face="arial, sans-serif"><span style="font-variant-ligatures:no-common-ligatures">Also on some processors, I have no rows to remove, hence the array </span>glob_row_idx is not allocated. How can I tell Petsc? Should I pass PETSC_NULL_OBJECT instead of glob_row_idx in this case? </font></p><p style="margin:0px;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><font face="arial, sans-serif"><br></font></p><p style="margin:0px;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><font face="arial, sans-serif">Finally, does using the option MAT_KEEP_NONZERO_PATTERN have an influence on the time the MatZeroRows call will take?</font></p><p style="margin:0px;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><font face="arial, sans-serif"><br></font></p><p style="margin:0px;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><font face="arial, sans-serif">Thanks,</font></p><p style="margin:0px;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><font face="arial, sans-serif"><br></font></p><p style="margin:0px;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><font face="arial, sans-serif">Best regards,</font></p><p style="margin:0px;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><font face="arial, sans-serif"><br></font></p><p style="margin:0px;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><font face="arial, sans-serif">Anthony</font></p>
<p style="margin:0px;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><font face="arial, sans-serif"><br></font></p>
<p style="margin:0px;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><font face="arial, sans-serif"><br></font></p></div><div><span style="font-variant-ligatures:no-common-ligatures"><br></span></div></div></div></div></div></div></div></div>