Amesos2 - Direct Sparse Solver Interfaces Version of the Day
Amesos2::MultiVecAdapter< Epetra_MultiVector > Class Reference

Amesos2 adapter for the Epetra_MultiVector class. More...

#include <Amesos2_EpetraMultiVecAdapter_decl.hpp>

Inheritance diagram for Amesos2::MultiVecAdapter< Epetra_MultiVector >:
Collaboration diagram for Amesos2::MultiVecAdapter< Epetra_MultiVector >:

Public Types

typedef double scalar_t
typedef int local_ordinal_t
typedef Tpetra::Map ::global_ordinal_type global_ordinal_t
typedef size_t global_size_t
typedef Tpetra::Map ::node_type node_t
typedef Epetra_MultiVector multivec_t

Public Member Functions

bool isLocallyIndexed () const
 Checks whether this multi-vector is local to the calling node.
bool isGloballyIndexed () const
Teuchos::RCP< Epetra_MultiVector > clone () const
Teuchos::RCP< const Tpetra::Map< local_ordinal_t, global_ordinal_t, node_t > > getMap () const
 Get a Tpetra::Map that describes this MultiVector.
const Teuchos::RCP< const Teuchos::Comm< int > > getComm () const
 Returns the Teuchos::Comm object associated with this multi-vector.
size_t getLocalLength () const
 Get the length of vectors local to the calling node.
size_t getLocalNumVectors () const
 Get the number of vectors on this node.
global_size_t getGlobalLength () const
 Get the length of vectors in the global space.
size_t getGlobalNumVectors () const
 Get the number of global vectors.
size_t getStride () const
 Return the stride between vectors on this node.
bool isConstantStride () const
 Return true if this MV has constant stride between vectors on this node.
Teuchos::RCP< const Tpetra::Vector< scalar_t, local_ordinal_t, global_ordinal_t, node_t > > getVector (size_t j) const
 Const vector access.
Teuchos::RCP< Tpetra::Vector< scalar_t, local_ordinal_t, global_ordinal_t, node_t > > getVectorNonConst (size_t j)
 Nonconst vector access.
double * getMVPointer_impl () const
 Return pointer to vector when number of vectors == 1 and num procs == 1.
void get1dCopy (const Teuchos::ArrayView< scalar_t > &A, size_t lda, Teuchos::Ptr< const Tpetra::Map< local_ordinal_t, global_ordinal_t, node_t > > distribution_map, EDistribution distribution) const
 Copies the multi-vector's data into the user-provided vector.
template<typename KV>
bool get1dCopy_kokkos_view (bool bInitialize, KV &A, size_t lda, Teuchos::Ptr< const Tpetra::Map< local_ordinal_t, global_ordinal_t, node_t > > distribution_map, EDistribution distribution) const
void get1dCopy_kokkos_view_host (Kokkos::View< scalar_t **, Kokkos::LayoutLeft, Kokkos::HostSpace > &new_data, size_t lda, Teuchos::Ptr< const Tpetra::Map< local_ordinal_t, global_ordinal_t, node_t > > distribution_map, EDistribution) const
Teuchos::ArrayRCP< scalar_t > get1dViewNonConst (bool local=false)
 Extracts a 1 dimensional view of this multi-vector's data.
void put1dData (const Teuchos::ArrayView< const scalar_t > &new_data, size_t lda, Teuchos::Ptr< const Tpetra::Map< local_ordinal_t, global_ordinal_t, node_t > > source_map, EDistribution distribution)
 Export newVals into the global MultiVector space.
template<typename KV>
void put1dData_kokkos_view (KV &new_data, size_t lda, Teuchos::Ptr< const Tpetra::Map< local_ordinal_t, global_ordinal_t, node_t > > source_map, EDistribution distribution)
void put1dData_kokkos_view_host (Kokkos::View< scalar_t **, Kokkos::LayoutLeft, Kokkos::HostSpace > &new_data, size_t lda, Teuchos::Ptr< const Tpetra::Map< local_ordinal_t, global_ordinal_t, node_t > > source_map, EDistribution distribution)
std::string description () const
 Get a short description of this adapter class.
void describe (Teuchos::FancyOStream &os, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
 Print a description of this adapter to the Fancy Output Stream.

Static Public Attributes

static const char * name

Protected Member Functions

 MultiVecAdapter (const MultiVecAdapter< multivec_t > &adapter)
 Copy constructor.
 MultiVecAdapter (const Teuchos::RCP< multivec_t > &m)
 Initialize an adapter from a multi-vector RCP.

Private Attributes

Teuchos::RCP< multivec_t > mv_
 The multi-vector this adapter wraps.
Teuchos::RCP< Epetra_Import > importer_
Teuchos::RCP< Epetra_Export > exporter_
Teuchos::RCP< const Epetra_BlockMap > mv_map_

Friends

Teuchos::RCP< MultiVecAdapter< multivec_t > > createMultiVecAdapter (Teuchos::RCP< multivec_t >)
Teuchos::RCP< const MultiVecAdapter< multivec_t > > createConstMultiVecAdapter (Teuchos::RCP< const multivec_t >)

(Note that these are not member symbols.)

Teuchos::RCP< MultiVecAdapter< Epetra_MultiVector > > createMultiVecAdapter (Teuchos::RCP< Epetra_MultiVector > mv)
 Factory creation method for MultiVecAdapters.

Detailed Description

Amesos2 adapter for the Epetra_MultiVector class.

Constructor & Destructor Documentation

◆ MultiVecAdapter() [1/2]

◆ MultiVecAdapter() [2/2]

Amesos2::MultiVecAdapter< Epetra_MultiVector >::MultiVecAdapter ( const Teuchos::RCP< multivec_t > & m)
protected

Initialize an adapter from a multi-vector RCP.

Parameters
mAn RCP pointing to the multi-vector which is to be wrapped.

References MultiVecAdapter(), and mv_.

Member Function Documentation

◆ isLocallyIndexed()

bool Amesos2::MultiVecAdapter< Epetra_MultiVector >::isLocallyIndexed ( ) const

Checks whether this multi-vector is local to the calling node.

References MultiVecAdapter(), and mv_.

◆ getMap()

Teuchos::RCP< const Tpetra::Map< MultiVecAdapter< Epetra_MultiVector >::local_ordinal_t, MultiVecAdapter< Epetra_MultiVector >::global_ordinal_t, MultiVecAdapter< Epetra_MultiVector >::node_t > > Amesos2::MultiVecAdapter< Epetra_MultiVector >::getMap ( ) const

Get a Tpetra::Map that describes this MultiVector.

Not part of the MultiVecAdapter interface, but useful for other adaptations.

References Amesos2::Util::epetra_map_to_tpetra_map(), and MultiVecAdapter().

Referenced by getVector(), and getVectorNonConst().

◆ getComm()

const Teuchos::RCP< const Teuchos::Comm< int > > Amesos2::MultiVecAdapter< Epetra_MultiVector >::getComm ( ) const

Returns the Teuchos::Comm object associated with this multi-vector.

References MultiVecAdapter(), mv_, and Amesos2::Util::to_teuchos_comm().

◆ getLocalLength()

size_t Amesos2::MultiVecAdapter< Epetra_MultiVector >::getLocalLength ( ) const

Get the length of vectors local to the calling node.

References MultiVecAdapter(), and mv_.

◆ getLocalNumVectors()

size_t Amesos2::MultiVecAdapter< Epetra_MultiVector >::getLocalNumVectors ( ) const

Get the number of vectors on this node.

References MultiVecAdapter(), and mv_.

◆ getGlobalLength()

MultiVecAdapter< Epetra_MultiVector >::global_size_t Amesos2::MultiVecAdapter< Epetra_MultiVector >::getGlobalLength ( ) const

Get the length of vectors in the global space.

References MultiVecAdapter(), and mv_.

◆ getGlobalNumVectors()

size_t Amesos2::MultiVecAdapter< Epetra_MultiVector >::getGlobalNumVectors ( ) const

Get the number of global vectors.

References MultiVecAdapter(), and mv_.

Referenced by get1dCopy(), getMVPointer_impl(), and put1dData().

◆ getStride()

size_t Amesos2::MultiVecAdapter< Epetra_MultiVector >::getStride ( ) const

Return the stride between vectors on this node.

References MultiVecAdapter(), and mv_.

◆ isConstantStride()

bool Amesos2::MultiVecAdapter< Epetra_MultiVector >::isConstantStride ( ) const

Return true if this MV has constant stride between vectors on this node.

References MultiVecAdapter(), and mv_.

◆ getVector()

Teuchos::RCP< const Tpetra::Vector< MultiVecAdapter< Epetra_MultiVector >::scalar_t, MultiVecAdapter< Epetra_MultiVector >::local_ordinal_t, MultiVecAdapter< Epetra_MultiVector >::global_ordinal_t, MultiVecAdapter< Epetra_MultiVector >::node_t > > Amesos2::MultiVecAdapter< Epetra_MultiVector >::getVector ( size_t j) const

Const vector access.

References getMap(), MultiVecAdapter(), and mv_.

◆ getVectorNonConst()

Teuchos::RCP< Tpetra::Vector< MultiVecAdapter< Epetra_MultiVector >::scalar_t, MultiVecAdapter< Epetra_MultiVector >::local_ordinal_t, MultiVecAdapter< Epetra_MultiVector >::global_ordinal_t, MultiVecAdapter< Epetra_MultiVector >::node_t > > Amesos2::MultiVecAdapter< Epetra_MultiVector >::getVectorNonConst ( size_t j)

Nonconst vector access.

Note
Vectors returned hold a copy of the data in the multi-vector. So any changes to the returned vector will not be represented in the underlying multi-vector.

References getMap(), MultiVecAdapter(), and mv_.

◆ getMVPointer_impl()

double * Amesos2::MultiVecAdapter< Epetra_MultiVector >::getMVPointer_impl ( ) const

Return pointer to vector when number of vectors == 1 and num procs == 1.

References getGlobalNumVectors(), MultiVecAdapter(), and mv_.

◆ get1dCopy()

void Amesos2::MultiVecAdapter< Epetra_MultiVector >::get1dCopy ( const Teuchos::ArrayView< scalar_t > & A,
size_t lda,
Teuchos::Ptr< const Tpetra::Map< local_ordinal_t, global_ordinal_t, node_t > > distribution_map,
EDistribution distribution ) const

Copies the multi-vector's data into the user-provided vector.

Each multi-vector is lda apart in memory.

References getGlobalNumVectors(), MultiVecAdapter(), mv_, and Amesos2::Util::tpetra_map_to_epetra_map().

◆ get1dViewNonConst()

Teuchos::ArrayRCP< MultiVecAdapter< Epetra_MultiVector >::scalar_t > Amesos2::MultiVecAdapter< Epetra_MultiVector >::get1dViewNonConst ( bool local = false)

Extracts a 1 dimensional view of this multi-vector's data.

Guarantees that the view returned will reside in contiguous storage.

Warning
It is recommended to use the get1dCopy function, from a data-hiding perspective. Use if you know what you are doing.
Parameters
localif true , each node will get a view of the vectors it is in possession of. The default, false , will give each calling node a view of the global multi-vector.
Note
This function is not declared const as it normally would be, since it must modify local copies of the vector data before returning the result.

References MultiVecAdapter().

◆ put1dData()

void Amesos2::MultiVecAdapter< Epetra_MultiVector >::put1dData ( const Teuchos::ArrayView< const scalar_t > & new_data,
size_t lda,
Teuchos::Ptr< const Tpetra::Map< local_ordinal_t, global_ordinal_t, node_t > > source_map,
EDistribution distribution )

Export newVals into the global MultiVector space.

Note
we assume the vectors in newVals have the same leading dimension as those in this
Template Parameters
Value_tThe type of the data values that are being put into mv_
Parameters
newValsThe values to be exported into the global space.

References getGlobalNumVectors(), MultiVecAdapter(), mv_, and Amesos2::Util::tpetra_map_to_epetra_map().

◆ description()

std::string Amesos2::MultiVecAdapter< Epetra_MultiVector >::description ( ) const

Get a short description of this adapter class.

References MultiVecAdapter().

◆ describe()

void Amesos2::MultiVecAdapter< Epetra_MultiVector >::describe ( Teuchos::FancyOStream & os,
const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default ) const

Print a description of this adapter to the Fancy Output Stream.

References MultiVecAdapter().

◆ createMultiVecAdapter()

Teuchos::RCP< MultiVecAdapter< Epetra_MultiVector > > createMultiVecAdapter ( Teuchos::RCP< Epetra_MultiVector > mv)
related

Factory creation method for MultiVecAdapters.

Developers should favor this method for creating Amesos2 MultiVector adapters over using the constructors.

References MultiVecAdapter().

Member Data Documentation

◆ mv_


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