[petsc-users] Changing a few entries in a matrix

Ganesh Vijayakumar ganesh.iitm at gmail.com
Fri May 8 16:14:27 CDT 2015


Hello,

  Thanks. Looks like I could set all the possible entries I'll use to zero
and selectively overwrite them.

  Can I overwrite any entries without incurring additional cost in memory?
I currently use MatSetValue with the option INSERT_VALUES? Does Petsc have
an option to OVERWRITE the existing value?

ganesh

On Fri, May 8, 2015 at 5:10 PM, Jed Brown <jed at jedbrown.org> wrote:

> Ganesh Vijayakumar <ganesh.iitm at gmail.com> writes:
>
> > Hello,
> >
> >   I have a CFD application where some entries of the matrix change every
> > time step.
>
> The entries change value or the set of nonzero entries changes?  If the
> former, just MatSetValues and carry on.  If the latter, either allocate
> for the union of all possible nonzeros (storing some explicit zeros) or
> reallocate the matrix each time.
>
> > However, the total number of non-zero elements never changes. Is there
> > anyway I can efficiently do this. My current attempts at doing this
> > results in running over the total initial memory allocation very soon.
> >
> > ganesh
>



-- 
ganesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150508/5a87315c/attachment.html>


More information about the petsc-users mailing list