43#ifndef __Panzer_TpetraVector_ReadOnly_GlobalEvaluationData_impl_hpp__
44#define __Panzer_TpetraVector_ReadOnly_GlobalEvaluationData_impl_hpp__
46#include "Thyra_TpetraThyraWrappers.hpp"
52template <
typename ScalarT,
typename LocalOrdinalT,
typename GlobalOrdinalT,
typename NodeT>
58 "TpetraVector_ReadOnly_GED has been initialized, cannot call \"useConstantValues\"!");
67template <
typename ScalarT,
typename LocalOrdinalT,
typename GlobalOrdinalT,
typename NodeT>
70initialize(
const RCP<const ImportType>& importer,
71 const RCP<const MapType>& ghostedMap,
72 const RCP<const MapType>& ownedMap)
82 ghostedSpace_ = Thyra::tpetraVectorSpace<ScalarT, LocalOrdinalT,
84 ownedSpace_ = Thyra::tpetraVectorSpace<ScalarT, LocalOrdinalT,
92 std::vector<LocalOrdinalT> lids;
94 for(std::size_t j=0;j<gids.size();j++) {
95 LocalOrdinalT lid = ghostedMap->getLocalElement(gids[j]);
110template <
typename ScalarT,
typename LocalOrdinalT,
typename GlobalOrdinalT,
typename NodeT>
115 TEUCHOS_TEST_FOR_EXCEPTION(
ownedVector_ == Teuchos::null, std::logic_error,
116 "Owned vector has not been set, can't perform the halo exchange!");
124 PHX::ExecSpace().fence();
127template <
typename ScalarT,
typename LocalOrdinalT,
typename GlobalOrdinalT,
typename NodeT>
133 "TpetraVector_ReadOnly_GED has not been initialized, cannot call \"initializeData\"!");
136 PHX::ExecSpace().fence();
138 typedef typename VectorType::dual_view_type::t_dev::memory_space DMS;
139 auto values =
ghostedVector_->getLocalViewHost(Tpetra::Access::OverwriteAll);
145 for(std::size_t j=0;j<lids.size();j++)
146 values(lids[j], 0) = value;
150template <
typename ScalarT,
typename LocalOrdinalT,
typename GlobalOrdinalT,
typename NodeT>
159template <
typename ScalarT,
typename LocalOrdinalT,
typename GlobalOrdinalT,
typename NodeT>
160Teuchos::RCP<const typename TpetraVector_ReadOnly_GlobalEvaluationData<ScalarT,LocalOrdinalT,GlobalOrdinalT,NodeT>::VectorType>
168template <
typename ScalarT,
typename LocalOrdinalT,
typename GlobalOrdinalT,
typename NodeT>
169Teuchos::RCP<typename TpetraVector_ReadOnly_GlobalEvaluationData<ScalarT,LocalOrdinalT,GlobalOrdinalT,NodeT>::VectorType>
179template <
typename ScalarT,
typename LocalOrdinalT,
typename GlobalOrdinalT,
typename NodeT>
185 typedef Thyra::TpetraOperatorVectorExtraction<ScalarT,LocalOrdinalT,GlobalOrdinalT,NodeT> TOE;
190template <
typename ScalarT,
typename LocalOrdinalT,
typename GlobalOrdinalT,
typename NodeT>
191Teuchos::RCP<const Thyra::VectorBase<double> >
196 return (
ownedVector_ == Teuchos::null) ? Teuchos::null :
200template <
typename ScalarT,
typename LocalOrdinalT,
typename GlobalOrdinalT,
typename NodeT>
201Teuchos::RCP<Thyra::VectorBase<double> >
211template <
typename ScalarT,
typename LocalOrdinalT,
typename GlobalOrdinalT,
typename NodeT>
214print(std::ostream & os)
const
216 const std::string tab =
" ";
218 os << tab <<
"TpetraVector_ReadOnly_GlobalEvaluationData\n"
Teuchos::RCP< const VectorType > getOwnedVector_Tpetra() const
Get the owned vector (Tpetra version)
void useConstantValues(const std::vector< GlobalOrdinalT > &indices, double value)
Teuchos::RCP< Thyra::VectorBase< double > > getGhostedVector() const
Get the ghosted vector (Thyra version)
std::vector< FilteredGlobalPair > globalFilteredPairs_
Teuchos::RCP< const MapType > ownedMap_
Teuchos::RCP< const Thyra::VectorSpaceBase< double > > ghostedSpace_
std::vector< FilteredLocalPair > filteredPairs_
virtual void globalToGhost(int mem)
Teuchos::RCP< VectorType > getGhostedVector_Tpetra() const
Get the ghosted vector (Tpetra version)
Teuchos::RCP< const VectorType > ownedVector_
Teuchos::RCP< const Thyra::VectorSpaceBase< double > > ownedSpace_
void print(std::ostream &os) const
Diagnostic function.
virtual void initializeData()
Clear out the ghosted vector.
void setOwnedVector(const Teuchos::RCP< const Thyra::VectorBase< double > > &ownedVector)
Set the owned vector (Thyra version)
void setOwnedVector_Tpetra(const Teuchos::RCP< const VectorType > &ownedVector)
Set the owned vector (Tpetra version)
std::pair< std::vector< GlobalOrdinalT >, double > FilteredGlobalPair
Tpetra::Vector< ScalarT, LocalOrdinalT, GlobalOrdinalT, NodeT > VectorType
Teuchos::RCP< VectorType > ghostedVector_
void initialize(const Teuchos::RCP< const ImportType > &importer, const Teuchos::RCP< const MapType > &ghostedMap, const Teuchos::RCP< const MapType > &ownedMap)
Teuchos::RCP< const Thyra::VectorBase< double > > getOwnedVector() const
Get the owned vector (Thyra version)
Teuchos::RCP< const MapType > ghostedMap_
Teuchos::RCP< const ImportType > importer_