1 #ifndef __Panzer_ResponseMESupport_Default_impl_hpp__ 2 #define __Panzer_ResponseMESupport_Default_impl_hpp__ 6 template <
typename EvalT>
10 TEUCHOS_ASSERT(useEpetra());
15 template <
typename EvalT>
19 TEUCHOS_ASSERT(useThyra());
21 Teuchos::ArrayRCP<double> data;
22 Teuchos::rcp_dynamic_cast<Thyra::SpmdVectorBase<double> >(tVector_,
true)->getNonconstLocalData(Teuchos::outArg(data));
27 template <
typename EvalT>
31 TEUCHOS_TEST_FOR_EXCEPTION(useThyra_,std::logic_error,
32 "Reponse field \"" << this->getName() <<
"\" has previously been initialized as a " 33 "Thyra object, now trying to initalize as a Epetra! Error!");
36 if(map_==Teuchos::null) {
37 if(this->vectorIsDistributed())
38 map_ = Teuchos::rcp(
new Epetra_Map(-1,(
int) this->localSizeRequired(),0,eComm_));
40 map_ = Teuchos::rcp(
new Epetra_LocalMap((
int) this->localSizeRequired(),0,eComm_));
46 template <
typename EvalT>
48 setVector(
const Teuchos::RCP<Epetra_Vector> & destVec)
50 TEUCHOS_TEST_FOR_EXCEPTION(useThyra_,std::logic_error,
51 "Reponse field \"" << this->getName() <<
"\" has previously been initialized as a " 52 "Thyra object, now trying to initalize as a Epetra! Error!");
59 template <
typename EvalT>
63 TEUCHOS_TEST_FOR_EXCEPTION(useEpetra_,std::logic_error,
64 "Reponse field \"" << this->getName() <<
"\" has previously been initialized as an " 65 "Epetra object, now trying to initalize as a Thyra object! Error!");
68 if(vSpace_==Teuchos::null) {
69 if(this->vectorIsDistributed())
70 vSpace_ = Thyra::defaultSpmdVectorSpace<double>(tComm_,this->localSizeRequired(),-1);
72 vSpace_ = Thyra::locallyReplicatedDefaultSpmdVectorSpace<double>(tComm_,this->localSizeRequired());
78 template <
typename EvalT>
82 TEUCHOS_TEST_FOR_EXCEPTION(useEpetra_,std::logic_error,
83 "Reponse field \"" << this->getName() <<
"\" has previously been initialized as an " 84 "Epetra object, now trying to initalize as a Thyra object! Error!");
Teuchos::RCP< const Epetra_Map > getMap() const
Get the Epetra_Map for this response, map is constructed lazily.
Teuchos::RCP< const Thyra::VectorSpaceBase< double > > getVectorSpace() const
Get the vector space for this response, vector space is constructed lazily.
Thyra::ArrayRCP< double > getThyraVector() const
Access the thyra vector.
void setVector(const Teuchos::RCP< Epetra_Vector > &destVec)
Epetra_Vector & getEpetraVector() const
Access the epetra vector.