Tpetra Matrix/Vector Services Version of the Day

Adds nonlocal suminto functionality to Tpetra::MultiVector. More...
#include <Tpetra_MultiVectorFiller.hpp>
Public Member Functions  
MultiVectorFiller (const Teuchos::RCP< const map_type > &map, const size_t numCols)  
Constructor.  
void  globalAssemble (MV &X_out, const bool forceReuseMap=false) 
Assemble all the data (local and nonlocal) into X_out.  
void  sumIntoGlobalValues (Teuchos::ArrayView< const global_ordinal_type > rows, size_t column, Teuchos::ArrayView< const scalar_type > values) 
Sum data into the multivector.  
void  sumIntoGlobalValues (Teuchos::ArrayView< const global_ordinal_type > rows, Teuchos::ArrayView< const scalar_type > values) 
Sum data into the multivector. 
Adds nonlocal suminto functionality to Tpetra::MultiVector.
MultiVector does not allow modifications to rows not owned by the calling process. This makes the implementation of MultiVector simple, fast, and local, but it complicates operations like assembly of the righthand side in the finite element method. CrsMatrix already supports insertion into nonowned rows, so that makes assembly not consistent for sparse matrices and vectors. MultiVectorFiller remedies this by specializing for the case of filling a (multi)vector. It provides a constructor and sumIntoGlobalValues() methods that look just like those of MultiVector, so you can swap it in at the assembly stage. Then, you can call globalAssemble() to turn the MultiVectorFiller into a standard MultiVector.
The globalAssemble() method will redistribute data if necessary. You can force it to use the Map provided to the constructor (or the Map provided to the last call to globalAssemble(), which is a common use case for doing nonlinear solves where the sparse matrix structure doesn't change).
MV  Specialization of Tpetra::MultiVector. 
Definition at line 912 of file Tpetra_MultiVectorFiller.hpp.
Tpetra::MultiVectorFiller< MV >::MultiVectorFiller  (  const Teuchos::RCP< const map_type > &  map, 
const size_t  numCols  
) 
Constructor.
The constructor takes the same arguments as MV's constructor. We did this on purpose, so that you can construct MultiVectorFiller as you would a standard MV.
map  [in] A Map with the same communicator and Kokkos Node as the output multivector of globalAssemble() . This need not be the same Map as that output multivector's Map. 
numCols  [in] Expected number of columns in the output multivector of globalAssemble() . 
sumIntoGlobalValues()
won't do the right thing. Use the threeargument version of that method if you don't know how many columns there will be in advance.globalAssemble()
more flexibility. For example, its output multivector may have any distribution with the same global number of rows. Furthermore, decoupling insertion from the output multivector lets this object store preassembled data in whatever format it likes. It doesn't have to insert directly into the output multivector until assembly time. (This may improve performance by amortizing the cost of global>local index conversions, for example.) Definition at line 1089 of file Tpetra_MultiVectorFiller.hpp.
void Tpetra::MultiVectorFiller< MV >::globalAssemble  (  MV &  X_out, 
const bool  forceReuseMap = false 

) 
Assemble all the data (local and nonlocal) into X_out.
You can call this method multiple times with different multivector output arguments. If those arguments have the same Map, this method will attempt to reuse the Export object each time. It will only reuse if the new target Map is the same as (in the sense of isSameAs()
) the previous target Map, unless you force reuse with the second argument (that saves a few global reductions for the check).
X_out  [in/out] MultiVector with a nonoverlapping Map. That Map need not be the same as the one with which this object was created. 
forceReuseMap  [in] If true, assume that X_out has the same Map (in the sense of isSameAs() ) as the target Map in the previous call to this method. If this method was not called before, then assume that X_out has the same Map as the argument to the constructor of this object. 
Definition at line 1121 of file Tpetra_MultiVectorFiller.hpp.
void Tpetra::MultiVectorFiller< MV >::sumIntoGlobalValues  (  Teuchos::ArrayView< const global_ordinal_type >  rows, 
size_t  column,  
Teuchos::ArrayView< const scalar_type >  values  
)  [inline] 
Sum data into the multivector.
rows  [in] Array of global rows for which to insert values. Must have the same length as values. 
column  [in] Index of the column in which to insert. 
values  [in] Array of values to insert. Must have the same length as rows. rows[i] is the row in which values[i] is to be inserted. 
Definition at line 991 of file Tpetra_MultiVectorFiller.hpp.
void Tpetra::MultiVectorFiller< MV >::sumIntoGlobalValues  (  Teuchos::ArrayView< const global_ordinal_type >  rows, 
Teuchos::ArrayView< const scalar_type >  values  
)  [inline] 
Sum data into the multivector.
In rows and values, the data for each column are stored contiguously. Thus, each array is really a matrix in rowwise order. (The multivector may use columnwise order internally.)
Be sure that the number of columns is set correctly before calling this.
rows  [in] Array of global rows for which to insert values. Must have the same length as values. 
values  [in] Array of values to insert. Must have the same length as rows. rows[i] is the row in which values[i] is to be inserted. 
Definition at line 1014 of file Tpetra_MultiVectorFiller.hpp.