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_ReadOnly_GlobalEvaluationData::" \
124 "initialize: GED block " << i <<
" is not initialized.")
127 rcp_dynamic_cast<
const DefaultProductVectorSpace<double>>(ghostedSpace);
129 "BlockedVector_ReadOnly_GlobalEvaluationData::initialize(): Ghosted " \
130 "space must be a Thyra::DefaultProductVectorSpace");
144 using std::logic_error;
147 "BlockedVector_ReadOnly_GlobalEvaluationData has not been " \
148 "initialized; cannot call \"globalToGhost()\"!");
162 using std::logic_error;
165 "BlockedVector_ReadOnly_GlobalEvaluationData has not been " \
166 "initialized; cannot call \"initializeData()\"!");
181 using std::logic_error;
185 using Thyra::castOrCreateProductVectorBase;
192 "BlockedVector_ReadOnly_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_ReadOnly_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));
Teuchos::RCP< const Thyra::VectorBase< double > > ownedVector_
The owned vector.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
BlockedVector_ReadOnly_GlobalEvaluationData()
Default Constructor.
std::vector< Teuchos::RCP< ReadOnlyVector_GlobalEvaluationData > > gedBlocks_
A vector of the GlobalEvaluationData blocks.
virtual void initializeData()
Initialize internal data for communication.
This class encapsulates the needs of a gather operation to do a halo exchange for blocked vectors...
virtual void globalToGhost(int mem)
Communicate the owned data to the ghosted vector.
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.
virtual Teuchos::RCP< const Thyra::VectorBase< double > > getOwnedVector() const
Get the owned vector.
virtual void setOwnedVector(const Teuchos::RCP< const Thyra::VectorBase< double >> &ownedVector)
Set the owned vector.
TypeTo as(const TypeFrom &t)
bool isInitialized_
A flag indicating whether or not the object has been initialized.
void initialize(const Teuchos::RCP< const Thyra::VectorSpaceBase< double >> &ghostedSpace, const Teuchos::RCP< const Thyra::VectorSpaceBase< double >> &ownedSpace, const std::vector< Teuchos::RCP< ReadOnlyVector_GlobalEvaluationData >> &gedBlocks)
Initialize this object using the sub-GlobalEvaluationData objects.
virtual bool isInitialized() const
Is this object initialized?