Hello,

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.

I am using Fortran. I have used:

! only local processors set their own zeros



call MatSetOption(self%fieldLHSMat_ps, MAT_NO_OFF_PROC_ZERO_ROWS,
PETSC_TRUE, ierr)


call MatSetOption(self%fieldLHSMat_ps, MAT_KEEP_NONZERO_PATTERN,
PETSC_TRUE, ierr)


call MatZeroRows(self%fieldLHSMat_ps, numrows, glob_row_idx, diag,
PETSC_NULL_OBJECT, PETSC_NULL_OBJECT, ierr)



Is numrows above the local (on each proc.) number of rows to remove, or is
it the global number of rows to remove?


Also on some processors, I have no rows to remove, hence the array 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?


Finally, does using the option MAT_KEEP_NONZERO_PATTERN have an influence
on the time the MatZeroRows call will take?


Thanks,


Best regards,


Anthony

Reply via email to