11 #ifndef PANZER_EVALUATOR_CrossProduct_IMPL_HPP
12 #define PANZER_EVALUATOR_CrossProduct_IMPL_HPP
24 template<
typename EvalT,
typename Traits>
29 std::string result_name = p.
get<std::string>(
"Result Name");
30 std::string vec_a_name = p.
get<std::string>(
"Vector A Name");
31 std::string vec_b_name = p.
get<std::string>(
"Vector B Name");
37 useScalarField = (pr->spatial_dimension==2);
47 this->addEvaluatedField(vec_a_cross_vec_b);
48 this->addDependentField(vec_a);
49 this->addDependentField(vec_b);
51 std::string n =
"CrossProduct: " + result_name +
" = " + vec_a_name +
" . " + vec_b_name;
56 template<
typename EvalT,
typename Traits>
63 num_pts = vec_a.extent(1);
64 num_dim = vec_a.extent(2);
71 template<
typename EvalT,
typename Traits>
78 for (index_t cell = 0; cell < workset.
num_cells; ++cell) {
79 for (
int p = 0; p < num_pts; ++p) {
80 vec_a_cross_vec_b(cell,p) = vec_a(cell,p,0)*vec_b(cell,p,1)-vec_a(cell,p,1)*vec_b(cell,p,0);
85 for (index_t cell = 0; cell < workset.
num_cells; ++cell) {
86 for (
int p = 0; p < num_pts; ++p) {
87 vec_a_cross_vec_b(cell,p,0) = vec_a(cell,p,1)*vec_b(cell,p,2)-vec_a(cell,p,2)*vec_b(cell,p,1);
88 vec_a_cross_vec_b(cell,p,1) = -(vec_a(cell,p,0)*vec_b(cell,p,2)-vec_a(cell,p,2)*vec_b(cell,p,0));
89 vec_a_cross_vec_b(cell,p,2) = vec_a(cell,p,0)*vec_b(cell,p,1)-vec_a(cell,p,1)*vec_b(cell,p,0);
int num_cells
DEPRECATED - use: numCells()
void postRegistrationSetup(typename Traits::SetupData d, PHX::FieldManager< Traits > &fm)
T & get(const std::string &name, T def_value)
void evaluateFields(typename Traits::EvalData d)
#define TEUCHOS_ASSERT(assertion_test)
CrossProduct(const Teuchos::ParameterList &p)