11 #ifndef PANZER_WEAKDIRICHLET_RESIDUAL_IMPL_HPP
12 #define PANZER_WEAKDIRICHLET_RESIDUAL_IMPL_HPP
19 #include "Intrepid2_FunctionSpaceTools.hpp"
25 template<
typename EvalT,
typename Traits>
30 std::string residual_name = p.
get<std::string>(
"Residual Name");
31 std::string flux_name = p.
get<std::string>(
"Flux Name");
32 std::string normal_name = p.
get<std::string>(
"Normal Name");
33 std::string normal_dot_flux_name = normal_name +
" dot " + flux_name;
34 std::string dof_name = p.
get<std::string>(
"DOF Name");
35 std::string value_name = p.
get<std::string>(
"Value Name");
36 std::string sigma_name = p.
get<std::string>(
"Sigma Name");
53 this->addEvaluatedField(residual);
54 this->addEvaluatedField(normal_dot_flux_plus_pen);
55 this->addDependentField(normal);
56 this->addDependentField(flux);
57 this->addDependentField(dof);
58 this->addDependentField(value);
59 this->addDependentField(sigma);
63 std::string n =
"Weak Dirichlet Residual Evaluator";
68 template<
typename EvalT,
typename Traits>
75 num_ip = flux.extent(1);
76 num_dim = flux.extent(2);
85 template<
typename EvalT,
typename Traits>
91 for (index_t cell = 0; cell < workset.
num_cells; ++cell) {
92 for (std::size_t ip = 0; ip < num_ip; ++ip) {
93 normal_dot_flux_plus_pen(cell,ip) =
ScalarT(0.0);
94 for (std::size_t dim = 0; dim < num_dim; ++dim) {
95 normal_dot_flux_plus_pen(cell,ip) += normal(cell,ip,dim) * flux(cell,ip,dim);
97 normal_dot_flux_plus_pen(cell,ip) += sigma(cell,ip) * (dof(cell,ip) - value(cell,ip));
102 Intrepid2::FunctionSpaceTools<PHX::exec_space>::
103 integrate(residual.get_view(),
104 normal_dot_flux_plus_pen.get_view(),
105 (this->wda(workset).bases[basis_index])->weighted_basis_scalar.get_view());
int num_cells
DEPRECATED - use: numCells()
WeakDirichletResidual(const Teuchos::ParameterList &p)
T & get(const std::string &name, T def_value)
void postRegistrationSetup(typename Traits::SetupData d, PHX::FieldManager< Traits > &fm)
Teuchos::RCP< panzer::BasisIRLayout > basisIRLayout(std::string basis_type, const int basis_order, const PointRule &pt_rule)
Nonmember constructor.
void evaluateFields(typename Traits::EvalData d)
std::vector< std::string >::size_type getBasisIndex(std::string basis_name, const panzer::Workset &workset, WorksetDetailsAccessor &wda)
Returns the index in the workset bases for a particular BasisIRLayout name.
#define TEUCHOS_ASSERT(assertion_test)
typename EvalT::ScalarT ScalarT
Teuchos::RCP< const std::vector< panzer::Workset > > worksets_