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>
60 #include <Tpetra_Vector_decl.hpp>
62 #include "Amesos2_MultiVecAdapter_decl.hpp"
71 template<
typename Scalar,
72 typename LocalOrdinal,
73 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;
121 if(getComm()->getSize() == 1){
128 bool isGloballyIndexed()
const;
131 Teuchos::RCP<
const Tpetra::Map<
137 return mv_->getMap();
141 Teuchos::RCP<const Teuchos::Comm<int> >
getComm()
const
143 return mv_->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);
205 typename multivec_t::impl_scalar_type * getMVPointer_impl()
const;
236 get1dCopy (
const Teuchos::ArrayView<scalar_t>& A,
238 Teuchos::Ptr<
const Tpetra::Map<local_ordinal_t,
240 node_t> > distribution_map,
243 template<
typename KV>
245 get1dCopy_kokkos_view (KV& v,
247 Teuchos::Ptr<
const Tpetra::Map<local_ordinal_t,
249 node_t> > distribution_map,
265 Teuchos::ArrayRCP<scalar_t> get1dViewNonConst (
bool local =
false);
277 put1dData (
const Teuchos::ArrayView<const scalar_t>& new_data,
279 Teuchos::Ptr<
const Tpetra::Map<local_ordinal_t,
281 node_t> > source_map,
284 template<
typename KV>
286 put1dData_kokkos_view (KV& kokkos_new_data,
288 Teuchos::Ptr<
const Tpetra::Map<local_ordinal_t,
290 node_t> > source_map,
295 std::string description ()
const;
299 describe (Teuchos::FancyOStream& os,
300 const Teuchos::EVerbosityLevel verbLevel =
301 Teuchos::Describable::verbLevel_default)
const;
305 Teuchos::RCP<multivec_t>
mv_;
308 typedef Tpetra::Export<local_ordinal_t, global_ordinal_t, node_t>
export_type;
311 typedef Tpetra::Import<local_ordinal_t, global_ordinal_t, node_t>
import_type;
333 #endif // AMESOS2_TPETRA_MULTIVEC_ADAPTER_DECL_HPP
size_t getStride() const
Return the stride between vectors on this node.
Definition: Amesos2_TpetraMultiVecAdapter_decl.hpp:176
Teuchos::RCP< import_type > importer_
Used for data redistribution from the solver's output MultiVector to the user's output MultiVector...
Definition: Amesos2_TpetraMultiVecAdapter_decl.hpp:327
global_size_t getGlobalNumVectors() const
Get the number of global vectors.
Definition: Amesos2_TpetraMultiVecAdapter_decl.hpp:169
bool isLocallyIndexed() const
Checks whether this multivector is local to the calling node.
Definition: Amesos2_TpetraMultiVecAdapter_decl.hpp:119
size_t getLocalNumVectors() const
Get the number of vectors on this node.
Definition: Amesos2_TpetraMultiVecAdapter_decl.hpp:154
Teuchos::RCP< multivec_t > mv_
The multivector which this adapter wraps.
Definition: Amesos2_TpetraMultiVecAdapter_decl.hpp:305
Tpetra::Import< local_ordinal_t, global_ordinal_t, node_t > import_type
The Tpetra::Import specialization used by this class.
Definition: Amesos2_TpetraMultiVecAdapter_decl.hpp:311
Tpetra::Export< local_ordinal_t, global_ordinal_t, node_t > export_type
The Tpetra::Export specialization used by this class.
Definition: Amesos2_TpetraMultiVecAdapter_decl.hpp:308
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Returns the Teuchos::Comm object associated with this multi-vector.
Definition: Amesos2_TpetraMultiVecAdapter_decl.hpp:141
Teuchos::RCP< export_type > exporter_
Used for data redistribution from the user's input MultiVector to the solver's input MultiVector...
Definition: Amesos2_TpetraMultiVecAdapter_decl.hpp:319
size_t getLocalLength() const
Get the length of vectors local to the calling node.
Definition: Amesos2_TpetraMultiVecAdapter_decl.hpp:147
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
EDistribution
Definition: Amesos2_TypeDecl.hpp:123
global_size_t getGlobalLength() const
Get the length of vectors in the global space.
Definition: Amesos2_TpetraMultiVecAdapter_decl.hpp:161
A templated MultiVector class adapter for Amesos2.
Definition: Amesos2_MultiVecAdapter_decl.hpp:176
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
bool isConstantStride() const
Return true if this MV has constant stride between vectors on this node.
Definition: Amesos2_TpetraMultiVecAdapter_decl.hpp:183