11 #ifndef PANZER_RESPONSE_SCATTER_EVALUATOR_FUNCTIONAL_IMPL_HPP
12 #define PANZER_RESPONSE_SCATTER_EVALUATOR_FUNCTIONAL_IMPL_HPP
17 #include "PanzerDiscFE_config.hpp"
19 #include "Phalanx_Evaluator_Macros.hpp"
20 #include "Phalanx_MDField.hpp"
21 #include "Phalanx_DataLayout_MDALayout.hpp"
27 #include "Thyra_DefaultProductVector.hpp"
28 #include "Thyra_SpmdVectorBase.hpp"
29 #include "Thyra_ProductVectorBase.hpp"
31 #include "Teuchos_ArrayRCP.hpp"
38 template<
typename EvalT,
typename Traits>
44 , scatterObj_(functionalScatter)
61 std::string n =
"Functional Response Scatter: " + name;
65 template<
typename EvalT,
typename Traits>
68 const std::string & responseName,
71 : responseName_(responseName)
72 , scatterObj_(functionalScatter)
89 std::string n =
"Functional Response Scatter: " + responseName;
93 template<
typename EvalT,
typename Traits>
103 template<
typename EvalT,
typename Traits>
107 auto cellIntegral_h = Kokkos::create_mirror_view ( cellIntegral_.get_static_view());
108 Kokkos::deep_copy(cellIntegral_h, cellIntegral_.get_static_view());
110 responseObj_->value += cellIntegral_h(i);
119 using Teuchos::rcp_dynamic_cast;
120 using Thyra::SpmdVectorBase;
128 std::vector<Teuchos::ArrayRCP<double> > local_dgdxs;
129 for(
int b=0;b<prod_dgdx->productSpace()->numBlocks();b++) {
133 dgdx->getNonconstLocalData(ptrFromRef(local_dgdx));
137 local_dgdxs.push_back(local_dgdx);
140 scatterObj_->scatterDerivative(cellIntegral_,d,this->wda,local_dgdxs);
143 #ifdef Panzer_BUILD_HESSIAN_SUPPORT
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);
171 scatterObj_->scatterHessian(cellIntegral_,d,this->wda,local_dgdxs);
Teuchos::RCP< GlobalEvaluationDataContainer > gedc
int num_cells
DEPRECATED - use: numCells()
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)