11 #ifndef PANZER_TEST_SCATTER_IMPL_HPP
12 #define PANZER_TEST_SCATTER_IMPL_HPP
16 template <
typename EvalT,
typename TRAITS>
19 template<
typename EvalT,
typename Traits>
24 std::string test_name = p.
get<std::string>(
"Test Name");
25 std::string test_name_res = p.
get<std::string>(
"Test Name Residual");
30 this->addDependentField(value);
31 this->addEvaluatedField(scatter_value);
35 if(offset==0) offset = 10000;
38 std::string n = scatter_value.fieldTag().name();
42 template<
typename EvalT,
typename Traits>
49 num_nodes = scatter_value.extent(1);
52 template<
typename EvalT,
typename Traits>
60 Kokkos::deep_copy(scatter_value.get_static_view(),
ScalarT(0.0));
62 for (index_t cell = 0; cell < workset.
num_cells; ++cell) {
64 for (std::size_t node = 0; node < num_nodes; ++node)
65 sum += value(cell,node);
66 sum = sum / double(num_nodes);
68 for (std::size_t node = 0; node < num_nodes; ++node) {
71 scatter_value(cell,node) = 3.0*sum;
void postRegistrationSetup(typename Traits::SetupData d, PHX::FieldManager< Traits > &fm)
int num_cells
DEPRECATED - use: numCells()
typename EvalT::ScalarT ScalarT
T & get(const std::string &name, T def_value)
TestScatter(const Teuchos::ParameterList &p)
void evaluateFields(typename Traits::EvalData d)