Tpetra Matrix/Vector Services Version of the Day
Public Member Functions
Tpetra::Details::MultiVectorFillerData< MV > Class Template Reference

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

#include <Tpetra_MultiVectorFiller.hpp>

List of all members.

Public Member Functions

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

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 108 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 128 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 149 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 159 of file Tpetra_MultiVectorFiller.hpp.

template<class MV >
void Tpetra::Details::MultiVectorFillerData< MV >::sumIntoGlobalValues ( Teuchos::ArrayView< const global_ordinal_type >  rows,
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 199 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 246 of file Tpetra_MultiVectorFiller.hpp.

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

locallyAssemble() for the usual ADD combine mode.

Definition at line 286 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 293 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 303 of file Tpetra_MultiVectorFiller.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines