22 #include "Thyra_DefaultProductVector.hpp"
23 #include "Thyra_DefaultProductVectorSpace.hpp"
24 #include "Thyra_VectorBase.hpp"
35 : isInitialized_(false)
67 initialize(ghostedSpace, ownedSpace, gedBlocks);
83 using std::logic_error;
85 using Teuchos::rcp_dynamic_cast;
89 for (
size_t i(0); i < gedBlocks.size(); ++i)
91 logic_error,
"BlockedVector_Write_GlobalEvaluationData::" \
92 "initialize: GED block " << i <<
" is not initialized.")
95 rcp_dynamic_cast<
const DefaultProductVectorSpace<double>>(ghostedSpace);
97 "BlockedVector_Write_GlobalEvaluationData::initialize(): Ghosted " \
98 "space must be a Thyra::DefaultProductVectorSpace");
112 using std::logic_error;
115 "BlockedVector_Write_GlobalEvaluationData has not been " \
116 "initialized; cannot call \"ghostToGlobal()\"!");
130 using std::logic_error;
133 "BlockedVector_Write_GlobalEvaluationData has not been " \
134 "initialized; cannot call \"initializeData()\"!");
149 using std::logic_error;
153 using Thyra::castOrCreateNonconstProductVectorBase;
160 "BlockedVector_Write_GlobalEvaluationData owned vector has the " \
161 "wrong number of blocks!");
187 using std::logic_error;
190 using Teuchos::arrayViewFromVector;
192 using Thyra::defaultProductVector;
195 "BlockedVector_Write_GlobalEvaluationData has not been " \
196 "initialized; cannot call \"getGhostedVector()\"!");
197 vector<RCP<VectorBase<double>>> blocks;
199 blocks.push_back(
gedBlocks_[i]->getGhostedVector());
200 const vector<RCP<VectorBase<double>>>& constBlocks = blocks;
202 arrayViewFromVector(constBlocks));
std::vector< Teuchos::RCP< WriteVector_GlobalEvaluationData > > gedBlocks_
A vector of the GlobalEvaluationData blocks.
void initialize(const Teuchos::RCP< const Thyra::VectorSpaceBase< double >> &ghostedSpace, const Teuchos::RCP< const Thyra::VectorSpaceBase< double >> &ownedSpace, const std::vector< Teuchos::RCP< WriteVector_GlobalEvaluationData >> &gedBlocks)
Initialize this object using the sub-GlobalEvaluationData objects.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
This class encapsulates the needs of a gather operation to do a // halo exchange for blocked vectors...
virtual void ghostToGlobal(int mem)
Communicate the ghosted data to the owned vector.
BlockedVector_Write_GlobalEvaluationData()
Default Constructor.
virtual void setOwnedVector(const Teuchos::RCP< Thyra::VectorBase< double >> &ownedVector)
Set the owned vector.
virtual Teuchos::RCP< Thyra::VectorBase< double > > getOwnedVector() const
Get the owned vector.
Teuchos::RCP< Thyra::VectorBase< double > > ownedVector_
The owned vector.
virtual void initializeData()
Initialize internal data for communication.
virtual Teuchos::RCP< Thyra::VectorBase< double > > getGhostedVector() const
Get the ghosted vector.
Teuchos::RCP< const Thyra::DefaultProductVectorSpace< double > > ghostedSpace_
The vector space corresponding to the ghosted vector.
TypeTo as(const TypeFrom &t)
virtual bool isInitialized() const
Is this object initialized?
bool isInitialized_
A flag indicating whether or not the object has been initialized.