43 #ifndef PANZER_EVALUATOR_SUM_HPP
44 #define PANZER_EVALUATOR_SUM_HPP
46 #include "Phalanx_Evaluator_Macros.hpp"
47 #include "Phalanx_MDField.hpp"
66 template<
typename EvalT,
typename Traits>
70 public PHX::EvaluatorDerived<EvalT, Traits>
91 PHX::MDField<ScalarT>
sum;
95 Kokkos::View<const double *,typename PHX::DevLayout<double>::type,PHX::Device>
scalars;
100 template<
unsigned int RANK>
103 template<
unsigned int RANK>
104 KOKKOS_INLINE_FUNCTION
113 template<
typename EvalT,
typename TRAITS,
typename Tag0,
typename Tag1=
void,
typename Tag2=
void>
115 public PHX::EvaluatorDerived<EvalT, TRAITS> {
123 template<
typename EvalT,
typename TRAITS,
typename Tag0>
125 public PHX::EvaluatorDerived<EvalT, TRAITS> {
132 PHX::MDField<ScalarT,Tag0>
sum;
133 std::vector< PHX::MDField<const ScalarT,Tag0> >
values;
136 template<
typename EvalT,
typename TRAITS,
typename Tag0,
typename Tag1>
138 public PHX::EvaluatorDerived<EvalT, TRAITS> {
152 SumStatic(
const std::vector<PHX::Tag<typename EvalT::ScalarT>> & inputs,
153 const std::vector<double> & scalar_values,
154 const PHX::Tag<typename EvalT::ScalarT> & output);
155 void postRegistrationSetup(
typename TRAITS::SetupData d,
159 struct ScalarsTag {};
160 KOKKOS_INLINE_FUNCTION
161 void operator()(
const ScalarsTag,
const unsigned c)
const;
163 struct NoScalarsTag {};
164 KOKKOS_INLINE_FUNCTION
165 void operator()(
const NoScalarsTag,
const unsigned c)
const;
170 PHX::MDField<ScalarT,Tag0,Tag1>
sum;
171 std::vector< PHX::MDField<const ScalarT,Tag0,Tag1> >
values;
176 enum {MAX_VALUES=20};
178 Kokkos::View<const ScalarT**,typename PHX::DevLayout<ScalarT>::type,PHX::Device> value_views[MAX_VALUES];
179 Kokkos::View<const double*,typename PHX::DevLayout<ScalarT>::type,PHX::Device>
scalars;
203 template<
typename EvalT,
typename TRAITS,
typename Tag0,
typename Tag1,
typename Tag2>
206 const std::vector<std::string> & value_names,
Teuchos::RCP< PHX::Evaluator< TRAITS > > buildStaticSumEvaluator(const std::string &sum_name, const std::vector< std::string > &value_names, const Teuchos::RCP< PHX::DataLayout > &data_layout)
Sum(const Teuchos::ParameterList &p)
static const int MAX_VALUES
void postRegistrationSetup(typename Traits::SetupData d, PHX::FieldManager< Traits > &fm)
KOKKOS_INLINE_FUNCTION void operator()(PanzerSumTag< RANK >, const int &i) const
PHX::MDField< const ScalarT, Tag0, Tag1 > current_value
SumStatic(const Teuchos::ParameterList &p)
std::vector< PHX::MDField< const ScalarT, Tag0 > > values
Wrapper to PHX::EvaluatorWithBaseImpl that implements Panzer-specific helpers.
Kokkos::View< const double *, typename PHX::DevLayout< ScalarT >::type, PHX::Device > scalars
PHX::MDField< ScalarT > sum
PHX::MDField< ScalarT, Tag0, Tag1 > sum
Kokkos::View< const double *, typename PHX::DevLayout< double >::type, PHX::Device > scalars
void evaluateFields(typename Traits::EvalData d)
typename EvalT::ScalarT ScalarT
std::size_t cell_data_size
void evaluateFields(typename TRAITS::EvalData d)
std::vector< PHX::MDField< const ScalarT, Tag0, Tag1 > > values
PHX::MDField< const ScalarT > values[MAX_VALUES]
PHX::MDField< ScalarT, Tag0 > sum