43 #ifndef PANZER_MULTIVARIATE_PARAMETER_IMPL_HPP
44 #define PANZER_MULTIVARIATE_PARAMETER_IMPL_HPP
46 #include "PanzerDiscFE_config.hpp"
57 template<
typename EvalT,
typename TRAITS>
61 const std::string field_name,
65 target_field = PHX::MDField<ScalarT, Cell, Point>(field_name, data_layout);
66 this->addEvaluatedField(target_field);
68 param.resize(num_param);
69 for (
int i=0; i<num_param; ++i) {
71 ss << parameter_name <<
"_" << i;
72 param[i] = panzer::createAndRegisterScalarParameter<EvalT>(
78 std::string n =
"Multi-variate Parameter Evaluator";
83 template<
typename EvalT,
typename TRAITS>
88 const int num_param = param.size();
89 for (
int i=0; i<num_param; ++i)
90 sum += param[i]->getValue();
92 for (index_t cell = 0; cell < workset.num_cells; ++cell) {
93 for (
typename PHX::MDField<ScalarT, Cell, Point>::size_type pt = 0;
94 pt < target_field.extent(1); ++pt) {
95 target_field(cell,pt) = sum;
void evaluateFields(typename TRAITS::EvalData ud)
MultiVariateParameter(const std::string parameter_name, const int num_param, const std::string field_name, const Teuchos::RCP< PHX::DataLayout > &data_layout, panzer::ParamLib ¶m_lib)
Sacado::ScalarParameterLibrary< panzer::EvaluationTraits > ParamLib