Tpetra parallel linear algebra  Version of the Day
Public Member Functions | List of all members
Tpetra::Details::MultiVectorFillerData< MV > Class Template Reference

Implementation of fill and local assembly for MultiVectorFiller. More...

#include <Tpetra_MultiVectorFiller.hpp>

Public Member Functions

 MultiVectorFillerData (const Teuchos::RCP< const map_type > &map)
 Default constructor (sets number of columns to zero). More...
 
 MultiVectorFillerData (const Teuchos::RCP< const map_type > &map, const size_t numColumns)
 Constructor. More...
 
void setNumColumns (const size_t newNumColumns)
 Set the number of columns in the output multivector. More...
 
void sumIntoGlobalValues (const Teuchos::ArrayView< const global_ordinal_type > &rows, const Teuchos::ArrayView< const scalar_type > &values)
 
template<class BinaryFunction >
void locallyAssemble (MV &X, BinaryFunction &f)
 Locally assemble into X. More...
 
void locallyAssemble (MV &X)
 Overload of locallyAssemble() for the usual ADD combine mode. More...
 
void clear ()
 Clear the contents of the vector, making it implicitly a vector of zeros. More...
 
Teuchos::Array< global_ordinal_type > getSourceIndices () const
 All source indices (local and nonlocal) of the source Map, sorted and unique. More...
 

Detailed Description

template<class MV>
class Tpetra::Details::MultiVectorFillerData< MV >

Implementation of fill and local assembly for MultiVectorFiller.

Author
Mark Hoemmen
Template Parameters
MVSpecialization of Tpetra::MultiVector.

Definition at line 110 of file Tpetra_MultiVectorFiller.hpp.

Constructor & Destructor Documentation

template<class MV >
Tpetra::Details::MultiVectorFillerData< MV >::MultiVectorFillerData ( const Teuchos::RCP< const map_type > &  map)
inline

Default constructor (sets number of columns to zero).

Parameters
map[in] Map, which this object may or may not use as a hint to separate local from nonlocal data. This need not be the same Map as that of the multivector output of globalAssemble().

Before using this object, you should call setNumColumns() to set the number of columns in the output multivector. Otherwise, the two-argument version of sumIntoGlobalValues() won't actually do anything.

Definition at line 130 of file Tpetra_MultiVectorFiller.hpp.

template<class MV >
Tpetra::Details::MultiVectorFillerData< MV >::MultiVectorFillerData ( const Teuchos::RCP< const map_type > &  map,
const size_t  numColumns 
)
inline

Constructor.

Parameters
map[in] Map, which this object may or may not use as a hint to separate local from nonlocal data. This need not be the same Map as that of the multivector output of globalAssemble().
numColumns[in] The (expected) number of columns in the output multivector. You can always change this later by calling setNumColumns().
Note
If the number of columns given here is not the same as the number of columns in the output multivector, you should call setNumColumns() first before inserting any data. Otherwise, the two-argument version of sumIntoGlobalValues() won't do the right thing.

Definition at line 151 of file Tpetra_MultiVectorFiller.hpp.

Member Function Documentation

template<class MV >
void Tpetra::Details::MultiVectorFillerData< MV >::setNumColumns ( const size_t  newNumColumns)
inline

Set the number of columns in the output multivector.

Definition at line 161 of file Tpetra_MultiVectorFiller.hpp.

template<class MV >
void Tpetra::Details::MultiVectorFillerData< MV >::sumIntoGlobalValues ( const Teuchos::ArrayView< const global_ordinal_type > &  rows,
const Teuchos::ArrayView< const scalar_type > &  values 
)
inline

Data for each column are stored contiguously in rows and in values. Thus, rows and values are in rowwise order, even though they may be stored in columnwise order in the multivector.

Be sure that the number of columns is set correctly before calling this.

Definition at line 201 of file Tpetra_MultiVectorFiller.hpp.

template<class MV >
template<class BinaryFunction >
void Tpetra::Details::MultiVectorFillerData< MV >::locallyAssemble ( MV &  X,
BinaryFunction &  f 
)
inline

Locally assemble into X.

Parameters
X[in/out] Multivector (overlapping source distribution).
f[in/out] Binary function that defines the combine mode. It must define scalar_type operator (const scalar_type&, const scalar_type&). It need not necessarily be commutative or even associative, but it should be thread-safe in case we decide to parallelize local assembly. We call it via X(i,j) = f(X(i,j), Y(i,j)), so write your possibly nonassociative or noncommutative operation accordingly.

X is distributed by the source Map (with possible overlap) of the Export operation. The source Map of the Export includes both the elements owned by this object's constructor's input Map, and the indices inserted by sumIntoGlobalValues().

Precondition: The set of global indices in X's Map equals the the union of the entries of nonlocalIndices_[j] for all valid columns j.

Note
You can get the usual ADD combine mode by supplying f = std::plus<scalar_type>.

Definition at line 248 of file Tpetra_MultiVectorFiller.hpp.

template<class MV >
void Tpetra::Details::MultiVectorFillerData< MV >::locallyAssemble ( MV &  X)
inline

Overload of locallyAssemble() for the usual ADD combine mode.

Definition at line 288 of file Tpetra_MultiVectorFiller.hpp.

template<class MV >
void Tpetra::Details::MultiVectorFillerData< MV >::clear ( )
inline

Clear the contents of the vector, making it implicitly a vector of zeros.

Definition at line 295 of file Tpetra_MultiVectorFiller.hpp.

template<class MV >
Teuchos::Array<global_ordinal_type> Tpetra::Details::MultiVectorFillerData< MV >::getSourceIndices ( ) const
inline

All source indices (local and nonlocal) of the source Map, sorted and unique.

Definition at line 305 of file Tpetra_MultiVectorFiller.hpp.


The documentation for this class was generated from the following file: