43 #ifndef PANZER_TEST_SCATTER_IMPL_HPP
44 #define PANZER_TEST_SCATTER_IMPL_HPP
48 template <
typename EvalT,
typename TRAITS>
51 template<
typename EvalT,
typename Traits>
56 std::string test_name = p.
get<std::string>(
"Test Name");
57 std::string test_name_res = p.
get<std::string>(
"Test Name Residual");
59 value = PHX::MDField<const ScalarT,Cell,NODE>(p.
get<std::string>(
"Test Name"), dl);
60 scatter_value = PHX::MDField<ScalarT,Cell,NODE>(test_name_res, dl);
62 this->addDependentField(value);
63 this->addEvaluatedField(scatter_value);
67 if(offset==0) offset = 10000;
70 std::string n = scatter_value.fieldTag().name();
74 template<
typename EvalT,
typename Traits>
81 num_nodes = scatter_value.extent(1);
84 template<
typename EvalT,
typename Traits>
92 Kokkos::deep_copy(scatter_value.get_static_view(),
ScalarT(0.0));
94 for (index_t cell = 0; cell < workset.
num_cells; ++cell) {
96 for (std::size_t node = 0; node < num_nodes; ++node)
97 sum += value(cell,node);
98 sum = sum / double(num_nodes);
100 for (std::size_t node = 0; node < num_nodes; ++node) {
103 scatter_value(cell,node) = 3.0*sum;
void postRegistrationSetup(typename Traits::SetupData d, PHX::FieldManager< Traits > &fm)
typename EvalT::ScalarT ScalarT
T & get(const std::string &name, T def_value)
TestScatter(const Teuchos::ParameterList &p)
void evaluateFields(typename Traits::EvalData d)