43 #ifndef __Panzer_Integrator_DivBasisTimesScalar_impl_hpp__ 44 #define __Panzer_Integrator_DivBasisTimesScalar_impl_hpp__ 46 #include "Intrepid2_FunctionSpaceTools.hpp" 51 #include "Kokkos_ViewFactory.hpp" 62 p.validateParameters(*valid_params);
69 "Integrator_DivBasisTimesScalar: Basis of type \"" <<
basis->
name() <<
"\" does not support DIV.");
71 "Integration_DivBasisTimesScalar: Basis of type \"" <<
basis->
name() <<
"\" should require orientations. So we are throwing.");
73 scalar = PHX::MDField<ScalarT,Cell,IP>( p.get<std::string>(
"Value Name"),
77 this->addDependentField(
scalar);
80 if (p.isType<
Teuchos::RCP<
const std::vector<std::string> > >(
"Field Multipliers")) {
82 const std::vector<std::string>& field_multiplier_names =
85 for (std::vector<std::string>::const_iterator name = field_multiplier_names.begin();
86 name != field_multiplier_names.end(); ++name) {
94 this->addDependentField(*
field);
97 "Integrator_DivBasisTimesScalar: " +
residual.fieldTag().name();
105 this->utils.setFieldData(
residual,fm);
106 this->utils.setFieldData(
scalar,fm);
111 this->utils.setFieldData(*
field,fm);
127 for (index_t cell = 0; cell < workset.num_cells; ++cell) {
128 for (std::size_t qp = 0; qp <
num_qp; ++qp) {
129 ScalarT tmpVar = 1.0;
132 tmpVar = tmpVar * (*
field)(cell,qp);
143 for (index_t cell = 0; cell < workset.num_cells; ++cell)
145 for (std::size_t qp = 0; qp <
num_qp; ++qp)
161 template<
typename EvalT,
typename TRAITS>
166 p->
set<std::string>(
"Residual Name",
"?");
167 p->
set<std::string>(
"Value Name",
"?");
168 p->
set<std::string>(
"Test Field Name",
"?");
173 p->
set<
double>(
"Multiplier", 1.0);
175 p->
set(
"Field Multipliers", fms);
PHX::MDField< ScalarT > residual
Evaluates a Dirichlet BC residual corresponding to a field value.
std::vector< std::string >::size_type getBasisIndex(std::string basis_name, panzer::Workset &workset, WorksetDetailsAccessor &wda)
Returns the index in the workset bases for a particular BasisIRLayout name.
std::string name() const
A unique key that is the combination of the basis type and basis order.
PHX::MDField< ScalarT, Cell > tmp
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
PHX::MDField< ScalarT > vector
bool requiresOrientations() const
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.
Teuchos::RCP< Teuchos::ParameterList > getValidParameters() const
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Teuchos::RCP< PHX::DataLayout > dl_scalar
Data layout for scalar fields.
PHX_EVALUATOR_CTOR(BasisValues_Evaluator, p)
PHX::MDField< const ScalarT, Cell, IP > field
PHX::MDField< const ScalarT, Cell, IP > scalar
PHX_EVALUATE_FIELDS(BasisValues_Evaluator, workset)
Teuchos::RCP< const panzer::PureBasis > basis
Interpolates basis DOF values to IP DOF values.
Array_CellBasisIP weighted_div_basis
std::vector< PHX::MDField< const ScalarT, Cell, IP > > field_multipliers
PHX_POST_REGISTRATION_SETUP(BasisValues_Evaluator, sd, fm)