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()\"!");
63 const Teuchos::RCP<const Epetra_Import>& importer,
64 const Teuchos::RCP<const Epetra_Map>& ghostedMap,
65 const Teuchos::RCP<const Epetra_Map>& ownedMap)
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]);
108 ownedView_ = getView<const Epetra_Vector>(*
ownedVector_);
122 using std::logic_error;
124 using Thyra::get_Epetra_Vector;
125 TEUCHOS_TEST_FOR_EXCEPTION(
ownedVector_.is_null(), logic_error,
126 "EpetraVector_ReadOnly_GlobalEvaluationData::globalToGhost(): Owned " \
127 "vector has not been set; can't perform the halo exchange!")
132 RCP<const Epetra_Vector> ownedVector_ep =
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)
185 const Teuchos::RCP<const Epetra_Vector>& ownedVector)
188 using std::logic_error;
189 using Thyra::create_Vector;
191 "EpetraVector_ReadOnly_GlobalEvaluationData::" \
192 "setOwnedVector_Epetra(): This object hasn't yet been initialized.")
194 ownedView_ = getView<const Epetra_Vector>(*
ownedVector_);
202 Teuchos::RCP<Epetra_Vector>
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.")
232 ownedView_ = getView<const Epetra_Vector>(*
ownedVector_);
240 Teuchos::RCP<const Thyra::VectorBase<double>>
244 using std::logic_error;
246 "EpetraVector_ReadOnly_GlobalEvaluationData::getOwnedVector(): This " \
247 "object hasn't yet been initialized.")
256 Teuchos::RCP<Thyra::VectorBase<double>>
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
PHX::View< const LO ** > lids
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.
Teuchos::RCP< const Epetra_Import > importer_
The importer used to communicate between the owned and ghosted vectors.
Teuchos::RCP< const Thyra::VectorSpaceBase< double > > ownedSpace_
The vector space corresponding 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).
void setOwnedVector_Epetra(const Teuchos::RCP< const Epetra_Vector > &ownedVector)
Set the owned vector (Epetra version).
Teuchos::RCP< Epetra_Vector > ghostedVector_
The ghosted vector.
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 print(std::ostream &os) const
Print the object.
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...
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...
virtual void globalToGhost(int mem=0)
Communicate the owned data to the ghosted vector.
Teuchos::RCP< Epetra_Vector > getGhostedVector_Epetra() const
Get the ghosted vector (Epetra version).
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.
std::vector< FilteredPair > filteredPairs_
The list of filtered pairs, used to initialize values on the ghostedVector_.
virtual void initializeData()
Clear out the ghosted vector.
virtual void ghostToGlobal(int mem=0)
Communicate the ghosted data to the owned vector.
bool isInitialized_
A flag indicating whether or not the object has been initialized.
VectorToViewTraits< VectorType >::View getView(typename VectorToViewTraits< VectorType >::ThyraVector &v)