Boundary Conditions and MatZeroRows

Manav Bhatia manav at u.washington.edu
Fri Nov 3 17:34:10 CST 2006


Hi,

      I am trying to apply dirichlet boundary conditions in an  
elliptic problem, and I followed the suggestions from section 3.4  
(Other Matrix Operations) in the users manual.
      I use the command MatrixZeroRows() to zero out the rows  
corresponding to the dofs that are constrained, and pass PETSC_NULL  
as the last argument to the function to also remove the diagonal  
entry. However, it seems that I am missing a point somewhere, since  
when I call the KSPSolve routine, I get an error saying that an empty  
row was found.

    My matrix is SeqAIJ, and I am using direct solvers. In my  
understanding, calling this function should remove the rows (and also  
the columns) from all operations, so that these dofs do not play any  
role in the solution. Please correct me if I am wrong.

    I understand that I can place a 1.0 at the diagonal, and that  
would solve the problem. However, as I mentioned before, I want to  
remove the rows and columns corresponding to the constrained dofs. Is  
this the right function to use for such a task? The other method, as  
I understand, is to extract the submatrix from the main matrix and  
use that for the computations.

     I would appreciate any help on this issue.

Regards
Manav





More information about the petsc-users mailing list