43 #ifndef __Panzer_ResponseMESupport_Default_hpp__
44 #define __Panzer_ResponseMESupport_Default_hpp__
47 #include "Teuchos_ArrayRCP.hpp"
49 #include "Teuchos_OpaqueWrapper.hpp"
53 #include "Thyra_DefaultSpmdVectorSpace.hpp"
54 #include "Thyra_SpmdVectorBase.hpp"
56 #include "PanzerDiscFE_config.hpp"
57 #ifdef PANZER_HAVE_EPETRA_STACK
58 #include "Epetra_LocalMap.h"
59 #include "Epetra_Map.h"
60 #include "Thyra_EpetraThyraWrappers.hpp"
65 template <
typename EvalT>
70 #ifdef PANZER_HAVE_EPETRA_STACK
86 #ifdef PANZER_HAVE_EPETRA_STACK
128 #ifdef PANZER_HAVE_EPETRA_STACK
147 #ifdef PANZER_HAVE_EPETRA_STACK
183 {
return derivative_; }
185 #ifdef PANZER_HAVE_EPETRA_STACK
196 if(eMap_==Teuchos::null)
197 eMap_ = Thyra::get_Epetra_Map(*getDerivativeVectorSpace(),Thyra::get_Epetra_Comm(*
tComm_));
212 derivative_ = Thyra::create_MultiVector(derivative,getDerivativeVectorSpace());
225 return Thyra::createMember(*getDerivativeVectorSpace());
236 derivative_ = derivative;
245 {
return derivVecSpace_; }
249 { derivVecSpace_ = vs; }
258 #ifdef PANZER_HAVE_EPETRA_STACK
272 #ifdef PANZER_HAVE_EPETRA_STACK
288 #ifdef PANZER_HAVE_EPETRA_STACK
295 "Reponse field \"" << this->
getName() <<
"\" has previously been initialized as a "
296 "Thyra object, now trying to initalize as a Epetra! Error!");
298 if(map_==Teuchos::null) {
312 "Reponse field \"" << this->
getName() <<
"\" has previously been initialized as a "
313 "Thyra object, now trying to initalize as a Epetra! Error!");
325 "Reponse field \"" << this->
getName() <<
"\" has previously been initialized as an "
326 "Epetra object, now trying to initalize as a Thyra object! Error!");
342 "Reponse field \"" << this->
getName() <<
"\" has previously been initialized as an "
343 "Epetra object, now trying to initalize as a Thyra object! Error!");
358 #ifdef PANZER_HAVE_EPETRA_STACK
369 const int num_col =
tVector_->domain()->dim();
370 Thyra::ArrayRCP< Thyra::ArrayRCP<double> > data(num_col);
371 for (
int i=0; i<num_col; ++i)
372 Teuchos::rcp_dynamic_cast<Thyra::SpmdVectorBase<double> >(
tVector_->col(i),
true)->getNonconstLocalData(Teuchos::outArg(data[i]));
378 #ifdef PANZER_HAVE_EPETRA_STACK
380 return eVector_->NumVectors();
393 #ifdef PANZER_HAVE_EPETRA_STACK
405 #ifdef Panzer_BUILD_HESSIAN_SUPPORT
431 {
return derivative_; }
439 return Thyra::createMember(*getDerivativeVectorSpace());
450 derivative_ = derivative;
459 {
return derivVecSpace_; }
463 { derivVecSpace_ = vs; }
Teuchos::RCP< const Thyra::VectorSpaceBase< double > > getDerivativeVectorSpace() const
Get the derivative vector space.
bool supportsDerivative() const
Does this response support derivative evaluation?
bool useEpetra() const
Is Epetra the right vector.
virtual void setDerivative(const Teuchos::RCP< Thyra::MultiVectorBase< double > > &derivative)
virtual ~ResponseMESupport_Default()
Teuchos::RCP< const Teuchos::Comm< Thyra::Ordinal > > getComm() const
Get the teuchos comm object.
virtual Teuchos::RCP< Thyra::MultiVectorBase< double > > buildDerivative() const
Get the Epetra_Map for this response, map is constructed lazily.
Teuchos::RCP< Thyra::VectorBase< double > > getVector() const
Access the response vector.
ResponseMESupport_Default(const std::string &responseName, MPI_Comm comm)
Teuchos::RCP< const Thyra::VectorSpaceBase< double > > vSpace_
bool useThyra() const
Is Thyra the right vector.
bool supportsDerivative() const
Does this response support derivative evaluation?
void setDerivativeVectorSpace(const Teuchos::RCP< const Thyra::VectorSpaceBase< double > > &vs)
Set the derivative vector space.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Teuchos::RCP< const Thyra::VectorSpaceBase< double > > vSpace_
Teuchos::RCP< const Teuchos::Comm< Thyra::Ordinal > > tComm_
Teuchos::RCP< const Thyra::VectorSpaceBase< double > > derivVecSpace_
int numDeriv() const
Return the number of columns in the multivector.
virtual Teuchos::RCP< Thyra::MultiVectorBase< double > > buildDerivative() const
Get the Epetra_Map for this response, map is constructed lazily.
ResponseMESupport_Default()
Teuchos::RCP< const Thyra::VectorSpaceBase< double > > getVectorSpace() const
Get the vector space for this response, vector space is constructed lazily.
Teuchos::RCP< Thyra::MultiVectorBase< double > > tVector_
virtual void setDerivative(const Teuchos::RCP< Thyra::MultiVectorBase< double > > &derivative)
ResponseMESupport_Default(const std::string &responseName, MPI_Comm comm, const Teuchos::RCP< const Thyra::VectorSpaceBase< double > > &derivVecSpace=Teuchos::null)
bool useEpetra() const
Is Epetra the right vector.
void setVector(const Teuchos::RCP< Thyra::MultiVectorBase< double > > &destVec)
virtual ~ResponseMESupport_Default()
std::string getName() const
Teuchos::RCP< const Thyra::VectorSpaceBase< double > > getDerivativeVectorSpace() const
Get the derivative vector space.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Teuchos::RCP< Thyra::MultiVectorBase< double > > getThyraMultiVector() const
Access the thyra MultiVector.
Thyra::ArrayRCP< double > getThyraVector() const
Access the thyra vector.
Teuchos::RCP< const Teuchos::Comm< Thyra::Ordinal > > tComm_
Teuchos::RCP< Thyra::MultiVectorBase< double > > getDerivative() const
Teuchos::RCP< const Teuchos::Comm< Thyra::Ordinal > > getComm() const
Get the teuchos comm object.
Teuchos::RCP< const Teuchos::Comm< Thyra::Ordinal > > tComm_
Teuchos::RCP< const Thyra::VectorSpaceBase< double > > derivVecSpace_
virtual ~ResponseMESupport_Default()
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.
void setDerivativeVectorSpace(const Teuchos::RCP< const Thyra::VectorSpaceBase< double > > &vs)
Set the derivative vector space.
virtual std::size_t localSizeRequired() const =0
What is the number of values you need locally.
Teuchos::RCP< const Teuchos::Comm< Thyra::Ordinal > > getComm() const
Get the teuchos comm object.
panzer::Traits::Tangent EvalT
void setVectorSpace(Teuchos::RCP< const Thyra::VectorSpaceBase< double > > vs)
set the vector space for this response
Teuchos::RCP< Thyra::VectorBase< double > > tVector_
virtual ~ResponseMESupport_Default()
Teuchos::RCP< Thyra::MultiVectorBase< double > > derivative_
Teuchos::RCP< const Teuchos::Comm< Thyra::Ordinal > > tComm_
#define TEUCHOS_ASSERT(assertion_test)
ResponseMESupport_Default(const std::string &responseName, MPI_Comm comm, const Teuchos::RCP< const Thyra::VectorSpaceBase< double > > &derivVecSpace=Teuchos::null)
void setVector(const Teuchos::RCP< Thyra::VectorBase< double > > &destVec)
virtual bool vectorIsDistributed() const =0
Is the vector distributed (or replicated)
ResponseMESupport_Default(const std::string &responseName, MPI_Comm comm)
Teuchos::RCP< Thyra::MultiVectorBase< double > > derivative_
Thyra::ArrayRCP< Thyra::ArrayRCP< double > > getThyraMultiVector() const
Access the thyra vector.
Teuchos::RCP< const Teuchos::Comm< Thyra::Ordinal > > getComm() const
Get the teuchos comm object.
Teuchos::RCP< Thyra::MultiVectorBase< double > > getDerivative() const