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

Second implementation of fill and local assembly for MultiVectorFiller. More...

#include <Tpetra_MultiVectorFiller.hpp>

Inheritance diagram for Tpetra::Details::MultiVectorFillerData2< MV >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 MultiVectorFillerData2 (const Teuchos::RCP< const map_type > &map, const Teuchos::EVerbosityLevel verbLevel=Teuchos::VERB_DEFAULT, const Teuchos::RCP< Teuchos::FancyOStream > &out=Teuchos::null)
 Default constructor (sets number of columns to zero).
 MultiVectorFillerData2 (const Teuchos::RCP< const map_type > &map, const size_t numColumns, const Teuchos::EVerbosityLevel verbLevel=Teuchos::VERB_DEFAULT, const Teuchos::RCP< Teuchos::FancyOStream > &out=Teuchos::null)
 Constructor.
Teuchos::Array
< global_ordinal_type > 
getSourceIndices () const
 All source indices (local and nonlocal) of the source Map, sorted and unique.
void setNumColumns (const size_t newNumColumns)
 Set the number of columns in the output multivector.
void sumIntoGlobalValues (Teuchos::ArrayView< const global_ordinal_type > rows, size_t columnIndex, Teuchos::ArrayView< const scalar_type > values)
 Set entry (rows[i],columnIndex) to values[i], for all i.
void sumIntoGlobalValues (Teuchos::ArrayView< const global_ordinal_type > rows, Teuchos::ArrayView< const scalar_type > values)
 Set entry (rows[i],j) to values[i], for all i and j.
template<class BinaryFunction >
void locallyAssemble (MV &X, BinaryFunction &f)
 Locally assemble into X, with user-specified combine mode.
void locallyAssemble (MV &X)
 locallyAssemble() for the usual Tpetra::ADD combine mode.
void clear ()
 Clear the contents of the multivector.

Detailed Description

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

Second implementation of fill and local assembly for MultiVectorFiller.

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

Definition at line 366 of file Tpetra_MultiVectorFiller.hpp.


Constructor & Destructor Documentation

template<class MV >
Tpetra::Details::MultiVectorFillerData2< MV >::MultiVectorFillerData2 ( const Teuchos::RCP< const map_type > &  map,
const Teuchos::EVerbosityLevel  verbLevel = Teuchos::VERB_DEFAULT,
const Teuchos::RCP< Teuchos::FancyOStream > &  out = Teuchos::null 
) [inline]

Default constructor (sets number of columns to zero).

Parameters:
map[in] Map over which to distribute the initial fill. 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 385 of file Tpetra_MultiVectorFiller.hpp.

template<class MV >
Tpetra::Details::MultiVectorFillerData2< MV >::MultiVectorFillerData2 ( const Teuchos::RCP< const map_type > &  map,
const size_t  numColumns,
const Teuchos::EVerbosityLevel  verbLevel = Teuchos::VERB_DEFAULT,
const Teuchos::RCP< Teuchos::FancyOStream > &  out = Teuchos::null 
) [inline]

Constructor.

Parameters:
map[in] Map over which to distribute the initial fill. This need not be the same Map as that of the multivector output of globalAssemble(), but the Map must have the same communicator as 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 411 of file Tpetra_MultiVectorFiller.hpp.


Member Function Documentation

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

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

Definition at line 518 of file Tpetra_MultiVectorFiller.hpp.

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

Set the number of columns in the output multivector.

Parameters:
newNumColumns[in] The new number of columns in the multivector. Zero is allowed; it means "clear local storage."

Setting the number of columns to zero effectively clears out all local storage, but may not necessarily deallocate nonlocal storage. Call clear() to clear out all nonlocal storage.

Definition at line 572 of file Tpetra_MultiVectorFiller.hpp.

template<class MV >
void Tpetra::Details::MultiVectorFillerData2< MV >::sumIntoGlobalValues ( Teuchos::ArrayView< const global_ordinal_type >  rows,
size_t  columnIndex,
Teuchos::ArrayView< const scalar_type >  values 
) [inline]

Set entry (rows[i],columnIndex) to values[i], for all i.

Definition at line 614 of file Tpetra_MultiVectorFiller.hpp.

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

Set entry (rows[i],j) to values[i], for all i and j.

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 669 of file Tpetra_MultiVectorFiller.hpp.

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

Locally assemble into X, with user-specified combine mode.

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 union of the global indices in map_ and (the union of the entries of nonlocalIndices_[j] for all valid columns j).

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

Definition at line 709 of file Tpetra_MultiVectorFiller.hpp.

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

locallyAssemble() for the usual Tpetra::ADD combine mode.

Definition at line 769 of file Tpetra_MultiVectorFiller.hpp.

template<class MV >
void Tpetra::Details::MultiVectorFillerData2< MV >::clear ( ) [inline]

Clear the contents of the multivector.

This fills the vector with zeros, and also removes nonlocal data. It does not deallocate all storage. For that, you need to set the number of columns to zero.

Definition at line 780 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