11 #ifndef __Panzer_ResponseMESupport_Default_hpp__
12 #define __Panzer_ResponseMESupport_Default_hpp__
15 #include "Teuchos_ArrayRCP.hpp"
17 #include "Teuchos_OpaqueWrapper.hpp"
21 #include "Thyra_DefaultSpmdVectorSpace.hpp"
22 #include "Thyra_SpmdVectorBase.hpp"
24 #include "PanzerDiscFE_config.hpp"
25 #ifdef PANZER_HAVE_EPETRA_STACK
26 #include "Epetra_LocalMap.h"
27 #include "Epetra_Map.h"
28 #include "Thyra_EpetraThyraWrappers.hpp"
33 template <
typename EvalT>
38 #ifdef PANZER_HAVE_EPETRA_STACK
54 #ifdef PANZER_HAVE_EPETRA_STACK
96 #ifdef PANZER_HAVE_EPETRA_STACK
115 #ifdef PANZER_HAVE_EPETRA_STACK
151 {
return derivative_; }
153 #ifdef PANZER_HAVE_EPETRA_STACK
164 if(eMap_==Teuchos::null)
165 eMap_ = Thyra::get_Epetra_Map(*getDerivativeVectorSpace(),Thyra::get_Epetra_Comm(*
tComm_));
180 derivative_ = Thyra::create_MultiVector(derivative,getDerivativeVectorSpace());
193 return Thyra::createMember(*getDerivativeVectorSpace());
204 derivative_ = derivative;
213 {
return derivVecSpace_; }
217 { derivVecSpace_ = vs; }
226 #ifdef PANZER_HAVE_EPETRA_STACK
240 #ifdef PANZER_HAVE_EPETRA_STACK
256 #ifdef PANZER_HAVE_EPETRA_STACK
263 "Reponse field \"" << this->
getName() <<
"\" has previously been initialized as a "
264 "Thyra object, now trying to initalize as a Epetra! Error!");
266 if(map_==Teuchos::null) {
280 "Reponse field \"" << this->
getName() <<
"\" has previously been initialized as a "
281 "Thyra object, now trying to initalize as a Epetra! Error!");
293 "Reponse field \"" << this->
getName() <<
"\" has previously been initialized as an "
294 "Epetra object, now trying to initalize as a Thyra object! Error!");
310 "Reponse field \"" << this->
getName() <<
"\" has previously been initialized as an "
311 "Epetra object, now trying to initalize as a Thyra object! Error!");
326 #ifdef PANZER_HAVE_EPETRA_STACK
337 const int num_col =
tVector_->domain()->dim();
338 Thyra::ArrayRCP< Thyra::ArrayRCP<double> > data(num_col);
339 for (
int i=0; i<num_col; ++i)
340 Teuchos::rcp_dynamic_cast<Thyra::SpmdVectorBase<double> >(
tVector_->col(i),
true)->getNonconstLocalData(Teuchos::outArg(data[i]));
346 #ifdef PANZER_HAVE_EPETRA_STACK
348 return eVector_->NumVectors();
361 #ifdef PANZER_HAVE_EPETRA_STACK
373 #ifdef Panzer_BUILD_HESSIAN_SUPPORT
399 {
return derivative_; }
407 return Thyra::createMember(*getDerivativeVectorSpace());
418 derivative_ = derivative;
427 {
return derivVecSpace_; }
431 { 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