11#ifndef PANZER_INTERFACE_RESIDUAL_IMPL_HPP
12#define PANZER_INTERFACE_RESIDUAL_IMPL_HPP
19#include "Intrepid2_FunctionSpaceTools.hpp"
20#include "Teuchos_RCP.hpp"
25template<
typename EvalT,
typename Traits>
28 const Teuchos::ParameterList& p)
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;
35 const Teuchos::RCP<const panzer::PureBasis> basis =
36 p.get< Teuchos::RCP<const panzer::PureBasis> >(
"Basis");
38 const Teuchos::RCP<const panzer::IntegrationRule> ir =
39 p.get< Teuchos::RCP<const panzer::IntegrationRule> >(
"IR");
42 residual = PHX::MDField<ScalarT>(residual_name, basis->functional);
43 normal_dot_flux = PHX::MDField<ScalarT>(normal_dot_flux_name, ir->dl_scalar);
44 flux = PHX::MDField<const ScalarT>(flux_name, ir->dl_vector);
45 normal = PHX::MDField<const ScalarT>(normal_name, ir->dl_vector);
49 this->addDependentField(
normal);
50 this->addDependentField(
flux);
54 std::string n =
"Interface Residual Evaluator";
59template<
typename EvalT,
typename Traits>
69 TEUCHOS_ASSERT(
flux.extent(1) ==
normal.extent(1));
70 TEUCHOS_ASSERT(
flux.extent(2) ==
normal.extent(2));
76template<
typename EvalT,
typename Traits>
84 for (index_t cell = 0; cell < workset.
num_cells; ++cell) {
85 for (std::size_t ip = 0; ip <
num_ip; ++ip) {
87 for (std::size_t dim = 0; dim <
num_dim; ++dim) {
94 const Teuchos::RCP<const BasisValues2<double> > bv = this->
wda(workset).bases[
basis_index];
95 for (index_t cell = 0; cell < workset.
num_cells; ++cell) {
96 for (std::size_t basis = 0; basis <
residual.extent(1); ++basis) {
97 for (std::size_t qp = 0; qp <
num_ip; ++qp) {
104 Intrepid2::FunctionSpaceTools<PHX::Device>::
107 (this->wda(workset).bases[
basis_index])->weighted_basis_scalar.get_view());
WorksetDetailsAccessor wda
PHX::MDField< ScalarT > normal_dot_flux
PHX::MDField< ScalarT > residual
PHX::MDField< const ScalarT > flux
void postRegistrationSetup(typename Traits::SetupData d, PHX::FieldManager< Traits > &fm)
typename EvalT::ScalarT ScalarT
PHX::MDField< const ScalarT > normal
InterfaceResidual(const Teuchos::ParameterList &p)
void evaluateFields(typename Traits::EvalData d)
int num_cells
DEPRECATED - use: numCells().
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.
Teuchos::RCP< panzer::BasisIRLayout > basisIRLayout(std::string basis_type, const int basis_order, const PointRule &pt_rule)
Nonmember constructor.
Teuchos::RCP< const std::vector< panzer::Workset > > worksets_
All worksets that will be evaluated over the lifetime of this evaluator.
const panzer::Workset & EvalData
Data type passed to PHX::Evaluator::evaluateFields(): a single workset holding the cell data for one ...
const SD & SetupData
Data type passed to PHX::Evaluator::postRegistrationSetup().