60 const Teuchos::ParameterList& p)
62 dof_name_ = (p.get< std::string >(
"DOF Name"));
64 if(p.isType< Teuchos::RCP<PureBasis> >(
"Basis"))
65 basis_ = p.get< Teuchos::RCP<PureBasis> >(
"Basis");
67 basis_ = p.get< Teuchos::RCP<const PureBasis> >(
"Basis");
69 pointRule_ = p.get<Teuchos::RCP<const PointRule> >(
"Point Rule");
71 Teuchos::RCP<PHX::DataLayout> basis_layout =
basis_->functional;
72 Teuchos::RCP<PHX::DataLayout> vector_layout_vector =
basis_->functional_grad;
75 TEUCHOS_ASSERT(
basis_->isVectorBasis());
78 std::string orientationFieldName =
basis_->name() +
" Orientation";
90 this->setName(
"Gather Normals");
100 orientations_ = Kokkos::View<Intrepid2::Orientation*>(
"orientations_",orientations->size());
101 auto orientations_host = Kokkos::create_mirror_view(
orientations_);
102 for (
size_t i=0; i < orientations->size(); ++i)
103 orientations_host(i) = (*orientations)[i];
108 const shards::CellTopology & parentCell = *
basis_->getCellTopology();
109 int sideDim = parentCell.getDimension()-1;
110 sideParam_ = Intrepid2::RefSubcellParametrization<PHX::Device>::get(sideDim, parentCell.getKey());
113 keys_ = Kokkos::View<unsigned int*>(
"parentCell.keys",numFaces);
114 auto keys_host = Kokkos::create_mirror_view(
keys_);
115 for (
int i=0; i < numFaces; ++i)
116 keys_host(i) = parentCell.getKey(sideDim,i);
117 Kokkos::deep_copy(
keys_,keys_host);
120 int cellDim = parentCell.getDimension();
121 refEdges_ = Kokkos::createDynRankViewWithType<Kokkos::DynRankView<ScalarT,PHX::Device>>(
gatherFieldNormals_.get_static_view(),
"ref_edges", (*d.
worksets_)[0].num_cells, sideDim, cellDim);
122 phyEdges_ = Kokkos::createDynRankViewWithType<Kokkos::DynRankView<ScalarT,PHX::Device>>(
gatherFieldNormals_.get_static_view(),
"phy_edges", (*d.
worksets_)[0].num_cells, sideDim, cellDim);
135 const auto worksetJacobians =
pointValues_.jac.get_view();
145 Kokkos::parallel_for(
"panzer::GatherNormals",workset.
num_cells,KOKKOS_LAMBDA(
const int c){
146 int faceOrts[6] = {};
147 orientations(cell_local_ids(c)).getFaceOrientation(faceOrts, numFaces);
149 for(
int pt = 0; pt < numFaces; pt++) {
150 auto ortEdgeTan_U = Kokkos::subview(refEdges, c, 0, Kokkos::ALL());
151 auto ortEdgeTan_V = Kokkos::subview(refEdges, c, 1, Kokkos::ALL());
153 auto tmpRefEdges = Kokkos::subview(refEdges, c, Kokkos::ALL(), Kokkos::ALL());
154 Intrepid2::Impl::OrientationTools::getRefSubcellTangents(tmpRefEdges,
160 auto phyEdgeTan_U = Kokkos::subview(phyEdges, c, 0, Kokkos::ALL());
161 auto phyEdgeTan_V = Kokkos::subview(phyEdges, c, 1, Kokkos::ALL());
162 auto J = Kokkos::subview(worksetJacobians, c, pt, Kokkos::ALL(), Kokkos::ALL());
164 Intrepid2::Kernels::Serial::matvec_product(phyEdgeTan_U, J, ortEdgeTan_U);
165 Intrepid2::Kernels::Serial::matvec_product(phyEdgeTan_V, J, ortEdgeTan_V);
168 gatherFieldNormals(c,pt,0) = (phyEdgeTan_U(1)*phyEdgeTan_V(2) - phyEdgeTan_U(2)*phyEdgeTan_V(1));
169 gatherFieldNormals(c,pt,1) = (phyEdgeTan_U(2)*phyEdgeTan_V(0) - phyEdgeTan_U(0)*phyEdgeTan_V(2));
170 gatherFieldNormals(c,pt,2) = (phyEdgeTan_U(0)*phyEdgeTan_V(1) - phyEdgeTan_U(1)*phyEdgeTan_V(0));