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_EpetraThyraWrappers.hpp"
55 #include "Thyra_DefaultSpmdVectorSpace.hpp"
56 #include "Thyra_SpmdVectorBase.hpp"
58 #include "Epetra_LocalMap.h"
59 #include "Epetra_Map.h"
63 template <
typename EvalT>
171 {
return derivative_; }
183 if(eMap_==Teuchos::null)
184 eMap_ = Thyra::get_Epetra_Map(*getDerivativeVectorSpace(),Thyra::get_Epetra_Comm(*
tComm_));
199 derivative_ = Thyra::create_MultiVector(derivative,getDerivativeVectorSpace());
211 return Thyra::createMember(*getDerivativeVectorSpace());
222 derivative_ = derivative;
231 {
return derivVecSpace_; }
235 { derivVecSpace_ = vs; }
274 "Reponse field \"" << this->
getName() <<
"\" has previously been initialized as a "
275 "Thyra object, now trying to initalize as a Epetra! Error!");
277 if(
map_==Teuchos::null) {
291 "Reponse field \"" << this->
getName() <<
"\" has previously been initialized as a "
292 "Thyra object, now trying to initalize as a Epetra! Error!");
303 "Reponse field \"" << this->
getName() <<
"\" has previously been initialized as an "
304 "Epetra object, now trying to initalize as a Thyra object! Error!");
320 "Reponse field \"" << this->
getName() <<
"\" has previously been initialized as an "
321 "Epetra object, now trying to initalize as a Thyra object! Error!");
345 const int num_col =
tVector_->domain()->dim();
346 Thyra::ArrayRCP< Thyra::ArrayRCP<double> > data(num_col);
347 for (
int i=0; i<num_col; ++i)
348 Teuchos::rcp_dynamic_cast<Thyra::SpmdVectorBase<double> >(
tVector_->col(i),
true)->getNonconstLocalData(Teuchos::outArg(data[i]));
377 #ifdef Panzer_BUILD_HESSIAN_SUPPORT
403 {
return derivative_; }
411 return Thyra::createMember(*getDerivativeVectorSpace());
422 derivative_ = derivative;
431 {
return derivVecSpace_; }
435 { 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.
virtual void setDerivative(const Teuchos::RCP< Epetra_MultiVector > &derivative)
Teuchos::RCP< Epetra_Vector > eVector_
bool supportsDerivative() const
Does this response support derivative evaluation?
virtual Teuchos::RCP< Epetra_MultiVector > buildEpetraDerivative() const
Get the Epetra_Map for this response, map is constructed lazily.
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_
Teuchos::RCP< const Epetra_Map > getMap() const
Get the Epetra_Map for this response, map is constructed lazily.
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::RCP< const Epetra_Map > getMap() const
Get the Epetra_Map for this response, map is constructed lazily.
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.
Epetra_Vector & getEpetraVector() const
Access the epetra vector.
Teuchos::RCP< const Epetra_Map > eMap_
Teuchos::RCP< const Teuchos::Comm< Thyra::Ordinal > > tComm_
Teuchos::RCP< Thyra::MultiVectorBase< double > > getDerivative() const
Teuchos::RCP< const Epetra_Map > map_
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.
Epetra_MultiVector & getEpetraMultiVector() const
Access the epetra vector.
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 setVector(const Teuchos::RCP< Epetra_Vector > &destVec)
void setVectorSpace(Teuchos::RCP< const Thyra::VectorSpaceBase< double > > vs)
set the vector space for this response
Teuchos::RCP< Epetra_MultiVector > eVector_
Teuchos::RCP< Thyra::VectorBase< double > > tVector_
virtual ~ResponseMESupport_Default()
Teuchos::RCP< Thyra::MultiVectorBase< double > > derivative_
Teuchos::RCP< const Teuchos::Comm< Thyra::Ordinal > > tComm_
void setVector(const Teuchos::RCP< Epetra_MultiVector > &destVec)
#define TEUCHOS_ASSERT(assertion_test)
ResponseMESupport_Default(const std::string &responseName, MPI_Comm comm, const Teuchos::RCP< const Thyra::VectorSpaceBase< double > > &derivVecSpace=Teuchos::null)
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 Epetra_Map > map_
Teuchos::RCP< const Teuchos::Comm< Thyra::Ordinal > > getComm() const
Get the teuchos comm object.
Teuchos::RCP< Thyra::MultiVectorBase< double > > getDerivative() const