18#include "Epetra_Export.h"
24#include "Thyra_EpetraThyraWrappers.hpp"
25#include "Thyra_LinearOpBase.hpp"
26#include "Thyra_SpmdVectorBase.hpp"
27#include "Thyra_SpmdVectorSpaceBase.hpp"
28#include "Thyra_VectorBase.hpp"
29#include "Thyra_VectorStdOps.hpp"
41 const Teuchos::RCP<const Epetra_Export>& exporter,
42 const Teuchos::RCP<const Epetra_Map>& ghostedMap,
43 const Teuchos::RCP<const Epetra_Map>& ownedMap)
47 using Thyra::create_Vector;
48 using Thyra::create_VectorSpace;
80 using std::invalid_argument;
81 using std::logic_error;
83 using Thyra::get_Epetra_Vector;
84 TEUCHOS_TEST_FOR_EXCEPTION(
ownedVector_.is_null(), logic_error,
85 "EpetraVector_Write_GlobalEvaluationData::ghostToGlobal(): Owned " \
86 "vector has not been set; can't perform the halo exchange!")
105 TEUCHOS_TEST_FOR_EXCEPTION(
true, invalid_argument,
106 "EpetraVector_Write_GlobalEvaluationData::ghostToGlobal(): " \
107 "Invalid CombineMode. Valid modes are CM_Sum, CM_Max, CM_Min, " \
112 RCP<Epetra_Vector> ownedVector_ep = get_Epetra_Vector(*
ownedMap_,
126 using std::logic_error;
127 using Thyra::put_scalar;
129 "EpetraVector_Write_GlobalEvaluationData has not been initialized; " \
130 "cannot call \"initializeData()\"!")
142 const Teuchos::RCP<Epetra_Vector>& ownedVector)
145 using std::logic_error;
146 using Thyra::create_Vector;
148 "EpetraVector_Write_GlobalEvaluationData::setOwnedVector_Epetra(): " \
149 "This object hasn't yet been initialized.")
159 Teuchos::RCP<Epetra_Vector>
163 using std::logic_error;
165 "EpetraVector_Write_GlobalEvaluationData::setGhostedVector_Epetra(): " \
166 "This object hasn't yet been initialized.")
168 "EpetraVector_Write_GlobalEvaluationData::setGhostedVector_Epetra(): " \
169 "The ghosted vector is just a null RCP.")
184 using std::logic_error;
186 "EpetraVector_Write_GlobalEvaluationData::setOwnedVector(): This " \
187 "object hasn't yet been initialized.")
197 Teuchos::RCP<Thyra::VectorBase<double>>
201 using std::logic_error;
203 "EpetraVector_Write_GlobalEvaluationData::getOwnedVector(): This " \
204 "object hasn't yet been initialized.")
213 Teuchos::RCP<Thyra::VectorBase<double>>
217 using std::logic_error;
218 using Thyra::create_Vector;
220 "EpetraVector_Write_GlobalEvaluationData::getGhostedVector(): This " \
221 "object hasn't yet been initialized.")
223 "EpetraVector_Write_GlobalEvaluationData::getGhostedVector(): The " \
224 "ghosted vector is just a null RCP.")
236 std::ostream& os)
const
239 const string tab(
" ");
241 os << tab <<
"EpetraVector_Write_GlobalEvaluationData\n"
Teuchos::RCP< const Thyra::VectorSpaceBase< double > > ownedSpace_
The vector space corresponding to the owned vector.
Teuchos::RCP< Thyra::VectorBase< double > > getGhostedVector() const
Get the ghosted vector (Thyra version).
Teuchos::RCP< const Epetra_Map > ghostedMap_
The map corresponding to the ghosted vector.
void initialize(const Teuchos::RCP< const Epetra_Export > &exporter, const Teuchos::RCP< const Epetra_Map > &ghostedMap, const Teuchos::RCP< const Epetra_Map > &ownedMap)
Initialize this object with some Epetra communication objects.
Teuchos::RCP< const Epetra_Export > exporter_
The exporter used to communicate between the owned and ghosted vectors.
virtual void ghostToGlobal(int mem)
Communicate the ghosted data to the owned vector.
void setOwnedVector(const Teuchos::RCP< Thyra::VectorBase< double > > &ownedVector)
Set the owned vector (Thyra version).
Teuchos::RCP< Epetra_Vector > getGhostedVector_Epetra() const
Get the ghosted vector (Epetra version).
bool isInitialized_
A flag indicating whether or not the object has been initialized.
Teuchos::RCP< const Epetra_Map > ownedMap_
The map corresponding to the owned vector.
virtual void initializeData()
Clear out the ghosted vector. // JMG: Is this right?
Teuchos::RCP< Epetra_Vector > ghostedVector_
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.
Teuchos::RCP< Thyra::VectorBase< double > > ownedVector_
The owned vector.
Teuchos::RCP< Thyra::VectorBase< double > > getOwnedVector() const
Get the owned vector (Thyra version).
void setOwnedVector_Epetra(const Teuchos::RCP< Epetra_Vector > &ownedVector)
Set the owned vector (Epetra version).
CombineMode getCombineMode() const
Get the combine mode, to be used by sub classes.
VectorToViewTraits< VectorType >::View getView(typename VectorToViewTraits< VectorType >::ThyraVector &v)