[Trilinos-Users] Tpetra CRS matrix repeated fill

Hoemmen, Mark mhoemme at sandia.gov
Tue Nov 25 13:46:24 MST 2014


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



More information about the Trilinos-Users mailing list