[petsc-users] Values of a column in a parallel matrix
Sanjay Govindjee
s_g at berkeley.edu
Mon Mar 20 23:04:54 CDT 2017
If you zero the row and column as suggested, you can get what you want
by building the
RHS as you construct your matrix (i.e. do in while assembling your
matrix and RHS).
On 3/20/17 8:48 PM, Daralagodu Dattatreya Jois, Sathwik Bharadw wrote:
>
> Hey Barry,
> I am already using MatZeroRows. I was actually stuck precisely while
> applying non zero Dirchlet boundary conditions. But to account for non
> zero value traditionally we subtract the corresponding column with the
> right hand side vector. If we zero the rows and columns we can only
> have value zero for solutions at the boundary.
>
> Get Outlook for Android
>
> ------------------------------------------------------------------------
> *From:* Barry Smith <bsmith at mcs.anl.gov>
> *Sent:* Monday, March 20, 2017 11:33:20 PM
> *To:* Daralagodu Dattatreya Jois, Sathwik Bharadw
> *Cc:* petsc-users at mcs.anl.gov
> *Subject:* Re: [petsc-users] Values of a column in a parallel matrix
>
> > On Mar 20, 2017, at 6:07 PM, Daralagodu Dattatreya Jois, Sathwik
> Bharadw <sdaralagodudatta at wpi.edu> wrote:
> >
> > Hey all,
> >
> > I am using AIJ matrix to solve Laplace problem in finite element
> framework. To apply Neumann boundary conditions I need to obtain
> values of first and last few columns and subtract it with the
> corresponding right hand side vector. I understand that
> MatGetColumnVector andMatGetValues are not collective. Is there any
> other alternative petsc calls to achieve this in parallel?
>
> Hmm, I think you mean non-zero Dirichlet boundary conditions. In
> that case the recommended approach is calling MatZeroRows() or if you
> want to preserve symmetry MatZeroRowsColumns(). There are also
> MatZeroRowsLocal() and MatZeroRowsColumnsLocal() and a few other variants.
>
> Barry
>
>
> >
> > Thanks,
> > Sathwik
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170320/0a79f466/attachment.html>
More information about the petsc-users
mailing list