50 #include "Epetra_Export.h" 56 #include "Thyra_EpetraThyraWrappers.hpp" 57 #include "Thyra_LinearOpBase.hpp" 58 #include "Thyra_SpmdVectorBase.hpp" 59 #include "Thyra_SpmdVectorSpaceBase.hpp" 60 #include "Thyra_VectorBase.hpp" 61 #include "Thyra_VectorStdOps.hpp" 73 const Teuchos::RCP<const Epetra_Export>& exporter,
74 const Teuchos::RCP<const Epetra_Map>& ghostedMap,
75 const Teuchos::RCP<const Epetra_Map>& ownedMap)
79 using Thyra::create_Vector;
80 using Thyra::create_VectorSpace;
93 auto ownedVector = rcp(
new Epetra_Vector(*
ownedMap_));
112 using std::invalid_argument;
113 using std::logic_error;
115 using Thyra::get_Epetra_Vector;
116 TEUCHOS_TEST_FOR_EXCEPTION(
ownedVector_.is_null(), logic_error,
117 "EpetraVector_Write_GlobalEvaluationData::ghostToGlobal(): Owned " \
118 "vector has not been set; can't perform the halo exchange!")
121 Epetra_CombineMode cm = Add;
137 TEUCHOS_TEST_FOR_EXCEPTION(
true, invalid_argument,
138 "EpetraVector_Write_GlobalEvaluationData::ghostToGlobal(): " \
139 "Invalid CombineMode. Valid modes are CM_Sum, CM_Max, CM_Min, " \
144 RCP<Epetra_Vector> ownedVector_ep = get_Epetra_Vector(*
ownedMap_,
158 using std::logic_error;
159 using Thyra::put_scalar;
161 "EpetraVector_Write_GlobalEvaluationData has not been initialized; " \
162 "cannot call \"initializeData()\"!")
174 const Teuchos::RCP<Epetra_Vector>& ownedVector)
177 using std::logic_error;
178 using Thyra::create_Vector;
180 "EpetraVector_Write_GlobalEvaluationData::setOwnedVector_Epetra(): " \
181 "This object hasn't yet been initialized.")
191 Teuchos::RCP<Epetra_Vector>
195 using std::logic_error;
197 "EpetraVector_Write_GlobalEvaluationData::setGhostedVector_Epetra(): " \
198 "This object hasn't yet been initialized.")
200 "EpetraVector_Write_GlobalEvaluationData::setGhostedVector_Epetra(): " \
201 "The ghosted vector is just a null RCP.")
216 using std::logic_error;
218 "EpetraVector_Write_GlobalEvaluationData::setOwnedVector(): This " \
219 "object hasn't yet been initialized.")
229 Teuchos::RCP<Thyra::VectorBase<double>>
233 using std::logic_error;
235 "EpetraVector_Write_GlobalEvaluationData::getOwnedVector(): This " \
236 "object hasn't yet been initialized.")
245 Teuchos::RCP<Thyra::VectorBase<double>>
249 using std::logic_error;
250 using Thyra::create_Vector;
252 "EpetraVector_Write_GlobalEvaluationData::getGhostedVector(): This " \
253 "object hasn't yet been initialized.")
255 "EpetraVector_Write_GlobalEvaluationData::getGhostedVector(): The " \
256 "ghosted vector is just a null RCP.")
268 std::ostream& os)
const 271 const string tab(
" ");
273 os << tab <<
"EpetraVector_Write_GlobalEvaluationData\n" void setOwnedVector(const Teuchos::RCP< Thyra::VectorBase< double >> &ownedVector)
Set the owned vector (Thyra version).
CombineMode getCombineMode() const
Get the combine mode, to be used by sub classes.
VectorToViewTraits< VectorType >::View getView(typename VectorToViewTraits< VectorType >::ThyraVector &v)
void setOwnedVector_Epetra(const Teuchos::RCP< Epetra_Vector > &ownedVector)
Set the owned vector (Epetra version).
Teuchos::RCP< Epetra_Vector > getGhostedVector_Epetra() const
Get the ghosted vector (Epetra version).
Teuchos::RCP< Thyra::VectorBase< double > > ownedVector_
The owned 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.
VectorToViewTraits< Epetra_Vector >::View getView< Epetra_Vector >(typename VectorToViewTraits< Epetra_Vector >::ThyraVector &v)
Teuchos::RCP< const Epetra_Map > ownedMap_
The map corresponding to the owned vector.
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.
Teuchos::RCP< Thyra::VectorBase< double > > getOwnedVector() const
Get the owned vector (Thyra version).
panzer::kokkos_utils::VectorToViewTraits< Epetra_Vector >::View ghostedView_
The Kokkos::View of the ghosted vector.
void print(std::ostream &os) const
Print the object.
bool isInitialized_
A flag indicating whether or not the object has been initialized.
Teuchos::RCP< Thyra::VectorBase< double > > getGhostedVector() const
Get the ghosted vector (Thyra version).
Teuchos::RCP< Epetra_Vector > ghostedVector_
The ghosted vector.
virtual void ghostToGlobal(int mem)
Communicate the ghosted data to the owned vector.
Teuchos::RCP< const Epetra_Map > ghostedMap_
The map corresponding to the ghosted vector.
virtual void initializeData()
Clear out the ghosted vector. // JMG: Is this right?
Teuchos::RCP< const Epetra_Export > exporter_
The exporter used to communicate between the owned and ghosted vectors.
panzer::kokkos_utils::VectorToViewTraits< Epetra_Vector >::View ownedView_
The Kokkos::View of the owned vector.