[petsc-users] Zero entries of a sparse matrix in a block-wise style

Mingchang Ding dmcvamos at udel.edu
Fri Jul 26 14:55:08 CDT 2019


Hi, all

I am trying to apply LDG to discretizing 1D diffusion term u_{xx} with Dirichlet boundary condition. The difficulty I have is that I want to zero all entries (except the diagonal one needs to be set as 1.0) of the beginning and ending DOF rows of the sparse matrix.

I have tried the MatZeroRows and MatZeroRowsStencil. However, I can only change the very first and last row of the matrix with them. This isn’t right when DOF > 1 because I need to zero the first DOF rows (the diagonal should be set as identity).

I was wondering if there is anyway I can take to zero the first and last DOF rows (with identity matrix diagonal) in a block-wise style.

Let me know if any further explanation is needed.

Thank you in advance!

Mingchang Ding
Graduate Student
EWG 111
Department of Mathematical Sciences
University of Delaware




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


More information about the petsc-users mailing list