54 #include "Thyra_DefaultProductVector.hpp"
55 #include "Thyra_DefaultProductVectorSpace.hpp"
56 #include "Thyra_VectorBase.hpp"
67 : isInitialized_(false)
99 initialize(ghostedSpace, ownedSpace, gedBlocks);
115 using std::logic_error;
117 using Teuchos::rcp_dynamic_cast;
121 for (
size_t i(0); i < gedBlocks.size(); ++i)
123 logic_error,
"BlockedVector_Write_GlobalEvaluationData::" \
124 "initialize: GED block " << i <<
" is not initialized.")
127 rcp_dynamic_cast<
const DefaultProductVectorSpace<double>>(ghostedSpace);
129 "BlockedVector_Write_GlobalEvaluationData::initialize(): Ghosted " \
130 "space must be a Thyra::DefaultProductVectorSpace");
144 using std::logic_error;
147 "BlockedVector_Write_GlobalEvaluationData has not been " \
148 "initialized; cannot call \"ghostToGlobal()\"!");
162 using std::logic_error;
165 "BlockedVector_Write_GlobalEvaluationData has not been " \
166 "initialized; cannot call \"initializeData()\"!");
181 using std::logic_error;
185 using Thyra::castOrCreateNonconstProductVectorBase;
192 "BlockedVector_Write_GlobalEvaluationData owned vector has the " \
193 "wrong number of blocks!");
219 using std::logic_error;
222 using Teuchos::arrayViewFromVector;
224 using Thyra::defaultProductVector;
227 "BlockedVector_Write_GlobalEvaluationData has not been " \
228 "initialized; cannot call \"getGhostedVector()\"!");
229 vector<RCP<VectorBase<double>>> blocks;
231 blocks.push_back(
gedBlocks_[i]->getGhostedVector());
232 const vector<RCP<VectorBase<double>>>& constBlocks = blocks;
234 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.