[Trilinos-Users] Tpetra CRS matrix repeated fill

Martin Vymazal martin.vymazal at vki.ac.be
Tue Nov 25 15:34:31 MST 2014


Hello Mark and Mike,

 thank you for your replies and for your help.

Martin Vymazal

On Tuesday 25 of November 2014 20:46:24 Hoemmen, Mark wrote:
> On 11/25/14, 12:00 PM, "trilinos-users-request at software.sandia.gov"
> 
> <trilinos-users-request at software.sandia.gov> wrote:
> >Message: 2
> >Date: Mon, 24 Nov 2014 22:46:44 +0100
> >From: Martin Vymazal <martin.vymazal at vki.ac.be>
> >To: trilinos-users at software.sandia.gov
> >Subject: Re: [Trilinos-Users] Tpetra CRS matrix repeated fill - howto
> >Message-ID: <5473A744.9030200 at vki.ac.be>
> >Content-Type: text/plain; charset=windows-1252; format=flowed
> >
> >Hello Mark,
> >
> >  you say that sumIntoGlobalValues is more efficient than
> >
> >insertGlobalValues. However, I still have to do step 1) at least once
> >(say during the setup phase). When I omit 1) completely, I end up with
> >an exception saying that the matrix has zero columns
> >(sumIntoGlobalValues didn't create any entries in the matrix I suppose).
> 
> That's correct.  Only the insert* methods create entries.  The sumInto*
> and replace* methods only modify existing entries.
> 
> Here is a better way to do this:
> 
>   1. Create a Tpetra::CrsGraph from the mesh.
>   2. Create a Tpetra::CrsMatrix using the constructor that takes a
> CrsGraph.
>   3. Repeat nonlinear iterations over the matrix, using
> sumInto{Local,Global}Values.
> 
> mfh
> 
> _______________________________________________
> Trilinos-Users mailing list
> Trilinos-Users at software.sandia.gov
> https://software.sandia.gov/mailman/listinfo/trilinos-users



More information about the Trilinos-Users mailing list