43 #ifndef PANZER_NORMALS_IMPL_HPP
44 #define PANZER_NORMALS_IMPL_HPP
49 #include "Intrepid2_FunctionSpaceTools.hpp"
50 #include "Intrepid2_CellTools.hpp"
55 template<
typename EvalT,
typename Traits>
62 const std::string name = p.
get<std::string>(
"Name");
74 normals = PHX::MDField<ScalarT,Cell,Point,Dim>(name, vector_dl);
75 this->addEvaluatedField(
normals);
77 std::string n =
"Normals: " + name;
82 template<
typename EvalT,
typename Traits>
89 num_qp = normals.extent(1);
90 num_dim = normals.extent(2);
96 template<
typename EvalT,
typename Traits>
105 Intrepid2::CellTools<PHX::exec_space>::getPhysicalSideNormals(normals.get_view(),
106 this->wda(workset).int_rules[quad_index]->jac.get_view(),
107 side_id, *this->wda(workset).int_rules[quad_index]->int_rule->topology);
112 for(index_t c=0;c<workset.
num_cells;c++) {
113 for(std::size_t q=0;q<num_qp;q++) {
117 for(std::size_t d=0;d<num_dim;d++)
118 norm += normals(c,q,d)*normals(c,q,d);
122 for(std::size_t d=0;d<num_dim;d++)
123 normals(c,q,d) /= norm;
T & get(const std::string &name, T def_value)
Normals(const Teuchos::ParameterList &p)
std::vector< std::string >::size_type getIntegrationRuleIndex(int ir_degree, const panzer::Workset &workset, WorksetDetailsAccessor &wda)
bool isParameter(const std::string &name) const
PHX::MDField< ScalarT, Cell, Point, Dim > normals
typename EvalT::ScalarT ScalarT
void postRegistrationSetup(typename Traits::SetupData d, PHX::FieldManager< Traits > &fm)
void evaluateFields(typename Traits::EvalData d)
Teuchos::RCP< const std::vector< panzer::Workset > > worksets_