54 #include "Thyra_DefaultProductVector.hpp"
55 #include "Thyra_DefaultProductVectorSpace.hpp"
56 #include "Thyra_VectorBase.hpp"
67 : isInitialized_(false)
94 const std::vector<Teuchos::RCP<ReadOnlyVector_GlobalEvaluationData>>&
99 initialize(ghostedSpace, ownedSpace, gedBlocks);
112 const std::vector<Teuchos::RCP<ReadOnlyVector_GlobalEvaluationData>>&
115 using std::logic_error;
117 using Teuchos::rcp_dynamic_cast;
121 for (
size_t i(0); i < gedBlocks.size(); ++i)
122 TEUCHOS_TEST_FOR_EXCEPTION(not gedBlocks[i]->
isInitialized(),
123 logic_error,
"BlockedVector_ReadOnly_GlobalEvaluationData::" \
124 "initialize: GED block " << i <<
" is not initialized.")
127 rcp_dynamic_cast<const DefaultProductVectorSpace<double>>(ghostedSpace);
128 TEUCHOS_TEST_FOR_EXCEPTION(
ghostedSpace_.is_null(), logic_error,
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;
188 RCP<const ProductVectorBase<double>> blocks =
190 TEUCHOS_TEST_FOR_EXCEPTION(blocks->productSpace()->numBlocks() !=
192 "BlockedVector_ReadOnly_GlobalEvaluationData owned vector has the " \
193 "wrong number of blocks!");
203 Teuchos::RCP<const Thyra::VectorBase<double>>
215 Teuchos::RCP<Thyra::VectorBase<double>>
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));