[petsc-dev] Is MatZeroRows too severe?

Stefano Zampini stefano.zampini at gmail.com
Wed Jan 18 10:26:53 CST 2017


> On Jan 18, 2017, at 7:23 PM, Eric Chamberland <Eric.Chamberland at giref.ulaval.ca> wrote:
> 
> Hi Stefano,
> On 18/01/17 11:07 AM, Stefano Zampini wrote:
>> Perhaps this is a valid fix
>> 
>> -      if (missing)
>> SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_ARG_WRONGSTATE,"Matrix is missing
>> diagonal entry in row %D",d);
>> +      if (missing) {
>> +        for (i=0; i<N; i++) {
>> +          if (rows[i] == d)
>> SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_ARG_WRONGSTATE,"Cannot insert
>> diagonal value! Matrix is missing diagonal entry in row %D",d);
>> +        }
>> +      }
>> 
> 
> I think that d only contains the first row with missing diagonal..?
> 
> I think missing diagonals should be checked one by one...
> 
> Is that what you wanted ti write?
> 

You’re right. Maybe we should use MatFindZeroDiagonals if missing is true.

> Thanks!
> 
> Eric




More information about the petsc-dev mailing list