18 #include "Epetra_Import.h"
24 #include "Thyra_EpetraThyraWrappers.hpp"
25 #include "Thyra_SpmdVectorBase.hpp"
26 #include "Thyra_SpmdVectorSpaceBase.hpp"
27 #include "Thyra_VectorBase.hpp"
28 #include "Thyra_VectorSpaceBase.hpp"
40 const std::vector<int>& indices,
43 using std::logic_error;
45 "EpetraVector_ReadOnly_GlobalEvaluationData has been initialized; " \
46 "cannot call \"useConstantValues()\"!");
71 using Thyra::create_Vector;
72 using Thyra::create_VectorSpace;
94 for (
size_t j(0); j < gids.size(); ++j)
97 int lid = ghostedMap->
LID(gids[j]);
122 using std::logic_error;
124 using Thyra::get_Epetra_Vector;
126 "EpetraVector_ReadOnly_GlobalEvaluationData::globalToGhost(): Owned " \
127 "vector has not been set; can't perform the halo exchange!")
148 using std::logic_error;
152 "EpetraVector_ReadOnly_GlobalEvaluationData has not been initialized, " \
153 "cannot call \"initializeData()\"!");
160 for (
size_t j(0); j < lids.size(); ++j)
188 using std::logic_error;
189 using Thyra::create_Vector;
191 "EpetraVector_ReadOnly_GlobalEvaluationData::" \
192 "setOwnedVector_Epetra(): This object hasn't yet been initialized.")
206 using std::logic_error;
208 "EpetraVector_ReadOnly_GlobalEvaluationData::" \
209 "getGhostedVector_Epetra(): This object hasn't yet been initialized.")
211 "EpetraVector_ReadOnly_GlobalEvaluationData::" \
212 "getGhostedVector_Epetra(): The ghosted vector is just a null RCP.")
227 using std::logic_error;
229 "EpetraVector_ReadOnly_GlobalEvaluationData::setOwnedVector(): This " \
230 "object hasn't yet been initialized.")
244 using std::logic_error;
246 "EpetraVector_ReadOnly_GlobalEvaluationData::getOwnedVector(): This " \
247 "object hasn't yet been initialized.")
260 using std::logic_error;
261 using Thyra::create_Vector;
263 "EpetraVector_ReadOnly_GlobalEvaluationData::getGhostedVector(): " \
264 "This object hasn't yet been initialized.")
266 "EpetraVector_ReadOnly_GlobalEvaluationData::getGhostedVector(): The " \
267 "ghosted vector is just a null RCP.")
279 std::ostream& os)
const
283 const string tab(
" ");
285 << tab <<
"EpetraVector_ReadOnly_GlobalEvaluationData" << endl
virtual void globalToGhost(int mem=0)
Communicate the owned data to the ghosted vector.
VectorToViewTraits< VectorType >::View getView(typename VectorToViewTraits< VectorType >::ThyraVector &v)
Teuchos::RCP< const Epetra_Import > importer_
The importer used to communicate between the owned and ghosted vectors.
VectorToViewTraits< const Epetra_Vector >::View getView< const Epetra_Vector >(typename VectorToViewTraits< const Epetra_Vector >::ThyraVector &v)
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
void setOwnedVector_Epetra(const Teuchos::RCP< const Epetra_Vector > &ownedVector)
Set the owned vector (Epetra version).
VectorToViewTraits< Epetra_Vector >::View getView< Epetra_Vector >(typename VectorToViewTraits< Epetra_Vector >::ThyraVector &v)
void useConstantValues(const std::vector< int > &indices, double value)
Choose a few GIDs and, instead of zeroing them out in the ghosted vector, set them to a specified val...
Kokkos::View< const LO **, Kokkos::LayoutRight, PHX::Device > lids
virtual void initializeData()
Clear out the ghosted vector.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Teuchos::RCP< Epetra_Vector > getGhostedVector_Epetra() const
Get the ghosted vector (Epetra version).
Teuchos::RCP< Epetra_Vector > ghostedVector_
The ghosted vector.
virtual void ghostToGlobal(int mem=0)
Communicate the ghosted data to the owned vector.
Teuchos::RCP< const Thyra::VectorBase< double > > ownedVector_
The owned vector.
void setOwnedVector(const Teuchos::RCP< const Thyra::VectorBase< double >> &ownedVector)
Set the owned vector (Thyra version).
std::vector< FilteredPair > filteredPairs_
The list of filtered pairs, used to initialize values on the ghostedVector_.
void print(std::ostream &os) const
Print the object.
Teuchos::RCP< const Thyra::VectorSpaceBase< double > > ownedSpace_
The vector space corresponding to the owned vector.
Teuchos::RCP< const Thyra::VectorSpaceBase< double > > ghostedSpace_
The vector space corresponding to the ghosted vector.
std::pair< std::vector< int >, double > FilteredPair
A list of global IDs (which will be translated to local IDs), paired with a value to be assigned in t...
Teuchos::RCP< Thyra::VectorBase< double > > getGhostedVector() const
Get the ghosted vector (Thyra version).
Teuchos::RCP< const Epetra_Map > ownedMap_
The map corresponding to the owned vector.
bool isInitialized_
A flag indicating whether or not the object has been initialized.
Teuchos::RCP< const Thyra::VectorBase< double > > getOwnedVector() const
Get the owned vector (Thyra version).
Teuchos::RCP< const Epetra_Map > ghostedMap_
The map corresponding to the ghosted vector.
void initialize(const Teuchos::RCP< const Epetra_Import > &importer, const Teuchos::RCP< const Epetra_Map > &ghostedMap, const Teuchos::RCP< const Epetra_Map > &ownedMap)
Initialize this object with some Epetra communication objects.