11#ifndef __Panzer_ResponseMESupport_Default_impl_hpp__
12#define __Panzer_ResponseMESupport_Default_impl_hpp__
16#ifdef PANZER_HAVE_EPETRA_STACK
17template <
typename EvalT>
21 TEUCHOS_ASSERT(useEpetra());
27template <
typename EvalT>
33 Teuchos::ArrayRCP<double> data;
34 Teuchos::rcp_dynamic_cast<Thyra::SpmdVectorBase<double> >(
tVector_,
true)->getNonconstLocalData(Teuchos::outArg(data));
39#ifdef PANZER_HAVE_EPETRA_STACK
40template <
typename EvalT>
44 TEUCHOS_TEST_FOR_EXCEPTION(useThyra_,std::logic_error,
45 "Reponse field \"" << this->getName() <<
"\" has previously been initialized as a "
46 "Thyra object, now trying to initalize as a Epetra! Error!");
49 if(map_==Teuchos::null) {
50 if(this->vectorIsDistributed())
51 map_ = Teuchos::rcp(
new Epetra_Map(-1,(
int) this->localSizeRequired(),0,eComm_));
53 map_ = Teuchos::rcp(
new Epetra_LocalMap((
int) this->localSizeRequired(),0,eComm_));
59template <
typename EvalT>
61setVector(
const Teuchos::RCP<Epetra_Vector> & destVec)
63 TEUCHOS_TEST_FOR_EXCEPTION(useThyra_,std::logic_error,
64 "Reponse field \"" << this->getName() <<
"\" has previously been initialized as a "
65 "Thyra object, now trying to initalize as a Epetra! Error!");
73template <
typename EvalT>
77 TEUCHOS_TEST_FOR_EXCEPTION(
useEpetra_,std::logic_error,
78 "Reponse field \"" << this->
getName() <<
"\" has previously been initialized as an "
79 "Epetra object, now trying to initalize as a Thyra object! Error!");
92template <
typename EvalT>
96 TEUCHOS_TEST_FOR_EXCEPTION(
useEpetra_,std::logic_error,
97 "Reponse field \"" << this->
getName() <<
"\" has previously been initialized as an "
98 "Epetra object, now trying to initalize as a Thyra object! Error!");
std::string getName() const
virtual bool vectorIsDistributed() const =0
Is the vector distributed (or replicated). For derivative assembly this must be false!
virtual std::size_t localSizeRequired() const =0
What is the number of values you need locally.
Teuchos::RCP< const Teuchos::Comm< Thyra::Ordinal > > tComm_
Teuchos::RCP< Thyra::VectorBase< double > > tVector_
Teuchos::RCP< const Thyra::VectorSpaceBase< double > > vSpace_
void setVector(const Teuchos::RCP< Thyra::VectorBase< double > > &destVec)
Thyra::ArrayRCP< double > getThyraVector() const
Access the thyra vector.
Teuchos::RCP< const Thyra::VectorSpaceBase< double > > getVectorSpace() const
Get the vector space for this response, vector space is constructed lazily.
bool useThyra() const
Is Thyra the right vector.