53 #ifndef AMESOS2_TPETRA_MULTIVEC_ADAPTER_DECL_HPP 54 #define AMESOS2_TPETRA_MULTIVEC_ADAPTER_DECL_HPP 56 #include <Teuchos_RCP.hpp> 57 #include <Teuchos_Array.hpp> 58 #include <Teuchos_as.hpp> 59 #include <Tpetra_MultiVector.hpp> 61 #include "Amesos2_MultiVecAdapter_decl.hpp" 70 template<
typename Scalar,
71 typename LocalOrdinal,
72 typename GlobalOrdinal,
82 typedef Tpetra::MultiVector<Scalar,
86 typedef Scalar scalar_t;
87 typedef LocalOrdinal local_ordinal_t;
88 typedef GlobalOrdinal global_ordinal_t;
90 typedef Tpetra::global_size_t global_size_t;
92 friend Teuchos::RCP<MultiVecAdapter<multivec_t> > createMultiVecAdapter<>(Teuchos::RCP<multivec_t>);
93 friend Teuchos::RCP<const MultiVecAdapter<multivec_t> > createConstMultiVecAdapter<>(Teuchos::RCP<const multivec_t>);
95 static const char* name;
122 if(getComm()->getSize() == 1){
128 bool isGloballyIndexed()
const;
131 const Teuchos::RCP<
const Tpetra::Map<
137 return mv_->getMap();
141 const Teuchos::RCP<const Teuchos::Comm<int> >&
getComm()
const 143 return getMap()->getComm();
149 return Teuchos::as<size_t>(mv_->getLocalLength());
156 return mv_->getNumVectors();
163 return mv_->getGlobalLength();
171 return Teuchos::as<global_size_t>(mv_->getNumVectors());
178 return mv_->getStride();
185 return mv_->isConstantStride();
190 Teuchos::RCP<const Tpetra::Vector<scalar_t,local_ordinal_t,global_ordinal_t,node_t> >
193 return mv_->getVector(j);
198 Teuchos::RCP<Tpetra::Vector<scalar_t,local_ordinal_t,global_ordinal_t,node_t> >
201 return mv_->getVectorNonConst(j);
231 void get1dCopy(
const Teuchos::ArrayView<scalar_t>& A,
234 const Tpetra::Map<local_ordinal_t,
236 node_t> > distribution_map )
const;
251 Teuchos::ArrayRCP<scalar_t> get1dViewNonConst(
bool local =
false );
261 void put1dData(
const Teuchos::ArrayView<const scalar_t>& new_data,
264 const Tpetra::Map<local_ordinal_t,
266 node_t> > source_map );
270 std::string description()
const;
274 void describe( Teuchos::FancyOStream& os,
275 const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default )
const;
281 Teuchos::RCP<multivec_t>
mv_;
285 mutable Teuchos::RCP<Tpetra::Import<local_ordinal_t,
288 mutable Teuchos::RCP<Tpetra::Export<local_ordinal_t,
293 mutable Teuchos::RCP<
const Tpetra::Map<local_ordinal_t,
302 #endif // AMESOS2_TPETRA_MULTIVEC_ADAPTER_DECL_HPP global_size_t getGlobalLength() const
Get the length of vectors in the global space.
Definition: Amesos2_TpetraMultiVecAdapter_decl.hpp:161
Teuchos::RCP< const Tpetra::Vector< scalar_t, local_ordinal_t, global_ordinal_t, node_t > > getVector(size_t j) const
Const vector access.
Definition: Amesos2_TpetraMultiVecAdapter_decl.hpp:191
Teuchos::RCP< Tpetra::Import< local_ordinal_t, global_ordinal_t, node_t > > importer_
Used for transferring between local and global multivectors.
Definition: Amesos2_TpetraMultiVecAdapter_decl.hpp:287
global_size_t getGlobalNumVectors() const
Get the number of global vectors.
Definition: Amesos2_TpetraMultiVecAdapter_decl.hpp:169
const Teuchos::RCP< const Teuchos::Comm< int > > & getComm() const
Returns the Teuchos::Comm object associated with this multi-vector.
Definition: Amesos2_TpetraMultiVecAdapter_decl.hpp:141
Definition: Amesos2_AbstractConcreteMatrixAdapter.hpp:48
bool isConstantStride() const
Return true if this MV has constant stride between vectors on this node.
Definition: Amesos2_TpetraMultiVecAdapter_decl.hpp:183
size_t getLocalLength() const
Get the length of vectors local to the calling node.
Definition: Amesos2_TpetraMultiVecAdapter_decl.hpp:147
size_t getLocalNumVectors() const
Get the number of vectors on this node.
Definition: Amesos2_TpetraMultiVecAdapter_decl.hpp:154
bool isLocallyIndexed() const
Checks whether this multivector is local to the calling node.
Definition: Amesos2_TpetraMultiVecAdapter_decl.hpp:120
Teuchos::RCP< multivec_t > mv_
The multivector this adapter wraps.
Definition: Amesos2_TpetraMultiVecAdapter_decl.hpp:281
A templated MultiVector class adapter for Amesos2.
Definition: Amesos2_MultiVecAdapter_decl.hpp:175
Teuchos::RCP< Tpetra::Vector< scalar_t, local_ordinal_t, global_ordinal_t, node_t > > getVectorNonConst(size_t j)
Nonconst vector access.
Definition: Amesos2_TpetraMultiVecAdapter_decl.hpp:199
Teuchos::RCP< const Tpetra::Map< local_ordinal_t, global_ordinal_t, node_t > > mv_map_
The adapted multivector's map.
Definition: Amesos2_TpetraMultiVecAdapter_decl.hpp:295
size_t getStride() const
Return the stride between vectors on this node.
Definition: Amesos2_TpetraMultiVecAdapter_decl.hpp:176