43 #ifndef PANZER_GATHER_TANGENTS_IMPL_HPP
44 #define PANZER_GATHER_TANGENTS_IMPL_HPP
46 #include "Teuchos_Assert.hpp"
47 #include "Phalanx_DataLayout.hpp"
49 #include "Intrepid2_Kernels.hpp"
50 #include "Intrepid2_CellTools.hpp"
51 #include "Intrepid2_OrientationTools.hpp"
54 #include "Kokkos_ViewFactory.hpp"
56 #include "Teuchos_FancyOStream.hpp"
58 template<
typename EvalT,
typename Traits>
63 dof_name = (p.
get< std::string >(
"DOF Name"));
79 std::string orientationFieldName = basis->name() +
" Orientation";
85 constJac_ = pointValues.jac;
86 this->addDependentField(constJac_);
88 gatherFieldTangents = PHX::MDField<ScalarT,Cell,NODE,Dim>(dof_name+
"_Tangents",vector_layout_vector);
89 this->addEvaluatedField(gatherFieldTangents);
91 this->setName(
"Gather Tangents");
95 template<
typename EvalT,
typename Traits>
101 this->utils.setFieldData(pointValues.jac,fm);
105 template<
typename EvalT,
typename Traits>
113 const shards::CellTopology & parentCell = *basis->getCellTopology();
114 int cellDim = parentCell.getDimension();
115 int numEdges = gatherFieldTangents.extent(1);
121 const auto worksetJacobians = pointValues.jac.get_view();
124 for(index_t c=0;c<workset.
num_cells;c++) {
126 int edgeOrts[12] = {};
127 orientations->at(details.cell_local_ids[c]).getEdgeOrientation(edgeOrts, numEdges);
129 for(
int pt = 0; pt < numEdges; pt++) {
130 auto phyEdgeTan = Kokkos::subview(gatherFieldTangents.get_static_view(), c, pt, Kokkos::ALL());
131 auto ortEdgeTan = Kokkos::subview(workspace, 1, Kokkos::ALL());
134 Intrepid2::Orientation::getReferenceEdgeTangent(ortEdgeTan,
139 auto J = Kokkos::subview(worksetJacobians, c, pt, Kokkos::ALL(), Kokkos::ALL());
140 Intrepid2::Kernels::Serial::matvec_product(phyEdgeTan, J, ortEdgeTan);
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< const std::vector< Intrepid2::Orientation > > orientations_
T & get(const std::string &name, T def_value)
void setupArrays(const Teuchos::RCP< const panzer::PointRule > &pr)
Sizes/allocates memory for arrays.
bool isType(const std::string &name) const
#define TEUCHOS_ASSERT(assertion_test)
void evaluateFields(typename Traits::EvalData d)
void postRegistrationSetup(typename Traits::SetupData d, PHX::FieldManager< Traits > &vm)