[petsc-users] a quick question about index out of range in MatSetValues
Panruo Wu
pwu at mymail.mines.edu
Mon Sep 19 10:48:56 CDT 2011
Got it, Thank you.
Robb
On Sun, Sep 18, 2011 at 5:50 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
>
> On Sep 18, 2011, at 11:51 AM, Panruo Wu wrote:
>
> > Dear list,
> >
> > I read in the MatSetValues documentation and found that
> >
> > Negative indices may be passed in idxm and idxn, these rows and columns
> are simply ignored
> >
> > I wonder if it's still the case when passing row or column indices larger
> than matrix dimensions.
> > If it's true it's very handy to assemble matrix of homogeneous dirichlet
> boundary condition.
>
> No, you need to label those nodes with negative indices to get them
> ignored; larger than N will generate an error.
>
> Note if you provide your own local to global mapping to the matrix you can
> map the "extra" large values to negative values and thus have them ignored.
> But I recommend since labeling all nodes you want ignored with negative
> indices.
>
> Barry
>
> >
> > Thanks,
> > Robb
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110919/4ad8b498/attachment.htm>
More information about the petsc-users
mailing list