43 #ifndef PANZER_RESPONSE_SCATTER_EVALUATOR_FUNCTIONAL_IMPL_HPP
44 #define PANZER_RESPONSE_SCATTER_EVALUATOR_FUNCTIONAL_IMPL_HPP
49 #include "PanzerDiscFE_config.hpp"
51 #include "Phalanx_Evaluator_Macros.hpp"
52 #include "Phalanx_MDField.hpp"
53 #include "Phalanx_DataLayout_MDALayout.hpp"
59 #include "Thyra_DefaultProductVector.hpp"
60 #include "Thyra_SpmdVectorBase.hpp"
61 #include "Thyra_ProductVectorBase.hpp"
63 #include "Teuchos_ArrayRCP.hpp"
70 template<
typename EvalT,
typename Traits>
76 , scatterObj_(functionalScatter)
90 cellIntegral_ = PHX::MDField<const ScalarT,panzer::Cell>(name,dl_cell);
93 std::string n =
"Functional Response Scatter: " + name;
97 template<
typename EvalT,
typename Traits>
100 const std::string & responseName,
103 : responseName_(responseName)
104 , scatterObj_(functionalScatter)
118 cellIntegral_ = PHX::MDField<const ScalarT,panzer::Cell>(integrandName,dl_cell);
121 std::string n =
"Functional Response Scatter: " + responseName;
125 template<
typename EvalT,
typename Traits>
135 template<
typename EvalT,
typename Traits>
140 responseObj_->value += cellIntegral_(i);
149 using Teuchos::rcp_dynamic_cast;
150 using Thyra::SpmdVectorBase;
158 std::vector<Teuchos::ArrayRCP<double> > local_dgdxs;
159 for(
int b=0;b<prod_dgdx->productSpace()->numBlocks();b++) {
163 dgdx->getNonconstLocalData(ptrFromRef(local_dgdx));
167 local_dgdxs.push_back(local_dgdx);
170 scatterObj_->scatterDerivative(cellIntegral_,d,this->wda,local_dgdxs);
173 #ifdef Panzer_BUILD_HESSIAN_SUPPORT
179 using Teuchos::rcp_dynamic_cast;
180 using Thyra::SpmdVectorBase;
188 std::vector<Teuchos::ArrayRCP<double> > local_dgdxs;
189 for(
int b=0;b<prod_dgdx->productSpace()->numBlocks();b++) {
193 dgdx->getNonconstLocalData(ptrFromRef(local_dgdx));
197 local_dgdxs.push_back(local_dgdx);
201 scatterObj_->scatterHessian(cellIntegral_,d,this->wda,local_dgdxs);
Teuchos::RCP< GlobalEvaluationDataContainer > gedc
ResponseScatterEvaluator_Functional(const std::string &name, const CellData &cd, const Teuchos::RCP< FunctionalScatterBase > &functionalScatter)
A constructor with concrete arguments instead of a parameter list.
static std::string buildLookupName(const std::string &responseName)
void preEvaluate(typename Traits::PreEvalData d)
std::size_t numCells() const
PHX::MDField< const ScalarT, panzer::Cell > cellIntegral_
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Data for determining cell topology and dimensionality.
void evaluateFields(typename Traits::EvalData d)
Teuchos::RCP< PHX::FieldTag > scatterHolder_
#define TEUCHOS_ASSERT(assertion_test)