43 #ifndef PANZER_EVALUATOR_SCALAR_IMPL_HPP
44 #define PANZER_EVALUATOR_SCALAR_IMPL_HPP
46 #include "Intrepid2_FunctionSpaceTools.hpp"
49 #include "Kokkos_ViewFactory.hpp"
50 #include "Phalanx_DataLayout_MDALayout.hpp"
55 template<
typename EvalT,
typename Traits>
67 integral = PHX::MDField<ScalarT>( p.
get<std::string>(
"Integral Name"), dl_cell);
68 scalar = PHX::MDField<const ScalarT,Cell,IP>( p.
get<std::string>(
"Integrand Name"), ir->
dl_scalar);
71 this->addDependentField(
scalar);
74 if(p.
isType<
double>(
"Multiplier"))
78 const std::vector<std::string>& field_multiplier_names =
81 for (std::vector<std::string>::const_iterator name =
82 field_multiplier_names.begin();
83 name != field_multiplier_names.end(); ++name) {
89 for (
typename std::vector<PHX::MDField<const ScalarT,Cell,IP> >::iterator
field =
field_multipliers.begin();
91 this->addDependentField(*
field);
93 std::string n =
"Integrator_Scalar: " +
integral.fieldTag().name();
98 template<
typename EvalT,
typename Traits>
105 num_qp = scalar.extent(1);
111 template<
typename EvalT,
typename Traits>
122 for (index_t cell = 0; cell < workset.
num_cells; ++cell) {
123 for (std::size_t qp = 0; qp < num_qp; ++qp) {
125 for (
typename std::vector<PHX::MDField<const ScalarT,Cell,IP> >::iterator
field = field_multipliers.begin();
127 tmp(cell,qp) = tmp(cell,qp) * (*field)(cell,qp);
152 for(index_t cl = 0; cl < workset.
num_cells; cl++) {
161 template<
typename EvalT,
typename TRAITS>
166 p->
set<std::string>(
"Integral Name",
"?");
167 p->
set<std::string>(
"Integrand Name",
"?");
171 p->
set<
double>(
"Multiplier", 1.0);
174 p->
set(
"Field Multipliers", fms);
Kokkos::DynRankView< typename InputArray::value_type, PHX::Device > createDynRankView(const InputArray &a, const std::string &name, const DimensionPack...dims)
Wrapper to simplify Panzer use of Sacado ViewFactory.
T & get(const std::string &name, T def_value)
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
std::vector< std::string >::size_type getIntegrationRuleIndex(int ir_degree, const panzer::Workset &workset, WorksetDetailsAccessor &wda)
Teuchos::RCP< Teuchos::ParameterList > getValidParameters() const
double multiplier
The scalar multiplier out in front of the integral ( ).
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Teuchos::RCP< PHX::DataLayout > dl_scalar
Data layout for scalar fields.
Integrator_Scalar(const Teuchos::ParameterList &p)
PHX::MDField< const ScalarT, Cell, IP > scalar
Array_CellIP weighted_measure
void validateParameters(ParameterList const &validParamList, int const depth=1000, EValidateUsed const validateUsed=VALIDATE_USED_ENABLED, EValidateDefaults const validateDefaults=VALIDATE_DEFAULTS_ENABLED) const
PHX::MDField< ScalarT, panzer::Cell, panzer::BASIS > field
A field to which we'll contribute, or in which we'll store, the result of computing this integral...
PHX::MDField< ScalarT > integral
std::vector< PHX::MDField< const ScalarT, Cell, IP > > field_multipliers
bool isType(const std::string &name) const
void evaluateFields(typename Traits::EvalData d)
void postRegistrationSetup(typename Traits::SetupData d, PHX::FieldManager< Traits > &fm)
Teuchos::RCP< const std::vector< panzer::Workset > > worksets_