[petsc-users] Scale the diagonal entries of a Mat

Matthew Knepley knepley at gmail.com
Sat Feb 23 06:37:37 CST 2013


On Sat, Feb 23, 2013 at 7:35 AM, Hui Zhang <mike.hui.zhang at hotmail.com>wrote:

>
> On Feb 23, 2013, at 1:32 PM, Matthew Knepley wrote:
>
> > On Sat, Feb 23, 2013 at 7:29 AM, Hui Zhang <mike.hui.zhang at hotmail.com>
> wrote:
> > I want to implement diagonal penalty method for enforcing the Dirichlet
> boundary conditions.  That is, the diagonal entries corresponding to
> Dirichlet boundary are going to be scaled by a large number.
> >
> > What is the easiest way to do this?  Thanks!
> >
> >
> http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/Mat/MatDiagonalScale.html
>
> But it seems not what I want.  That routine scales all the entries of a
> mat.  I want to scale only the diagonal entries.


Then use
http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/Mat/MatDiagonalSet.html

As Jed says, you really really do not want to do this.

  Matt


> >
> >   Matt
> >
> > --
> > What most experimenters take for granted before they begin their
> experiments is infinitely more interesting than any results to which their
> experiments lead.
> > -- Norbert Wiener
>
>


-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130223/4f089fe8/attachment.html>


More information about the petsc-users mailing list