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";
81 pointValues.setupArrays(pointRule);
84 constJac_ = pointValues.jac;
85 this->addDependentField(constJac_);
87 gatherFieldNormals = PHX::MDField<ScalarT,Cell,NODE,Dim>(dof_name+
"_Normals",vector_layout_vector);
88 this->addEvaluatedField(gatherFieldNormals);
90 this->setName(
"Gather Normals");
100 this->utils.setFieldData(pointValues.jac,fm);
101 faceNormal = Kokkos::createDynRankView(gatherFieldNormals.get_static_view(),
103 gatherFieldNormals.extent(0),
104 gatherFieldNormals.extent(1),
105 gatherFieldNormals.extent(2));
107 const shards::CellTopology & parentCell = *basis->getCellTopology();
108 int sideDim = parentCell.getDimension()-1;
109 sideParam = Intrepid2::RefSubcellParametrization<PHX::Device>::get(sideDim, parentCell.getKey());
121 const shards::CellTopology & parentCell = *basis->getCellTopology();
122 int cellDim = parentCell.getDimension();
123 int sideDim = parentCell.getDimension()-1;
124 int numFaces = gatherFieldNormals.extent(1);
127 auto refEdges = Kokkos::createDynRankView(gatherFieldNormals.get_static_view(),
"ref_edges", sideDim, cellDim);
128 auto phyEdges = Kokkos::createDynRankView(gatherFieldNormals.get_static_view(),
"phy_edges", sideDim, cellDim);
131 const auto worksetJacobians = pointValues.jac.get_view();
135 for(index_t c=0;c<workset.
num_cells;c++) {
136 int faceOrts[6] = {};
137 orientations->at(
details.cell_local_ids[c]).getFaceOrientation(faceOrts, numFaces);
139 for(
int pt = 0; pt < numFaces; pt++) {
140 auto ortEdgeTan_U = Kokkos::subview(refEdges, 0, Kokkos::ALL());
141 auto ortEdgeTan_V = Kokkos::subview(refEdges, 1, Kokkos::ALL());
143 Intrepid2::Impl::OrientationTools::getRefSubcellTangents(refEdges,
145 parentCell.getKey(sideDim,pt),
149 auto phyEdgeTan_U = Kokkos::subview(phyEdges, 0, Kokkos::ALL());
150 auto phyEdgeTan_V = Kokkos::subview(phyEdges, 1, Kokkos::ALL());
151 auto J = Kokkos::subview(worksetJacobians, c, pt, Kokkos::ALL(), Kokkos::ALL());
153 Intrepid2::Kernels::Serial::matvec_product(phyEdgeTan_U, J, ortEdgeTan_U);
154 Intrepid2::Kernels::Serial::matvec_product(phyEdgeTan_V, J, ortEdgeTan_V);
157 gatherFieldNormals(c,pt,0) = (phyEdgeTan_U(1)*phyEdgeTan_V(2) - phyEdgeTan_U(2)*phyEdgeTan_V(1));
158 gatherFieldNormals(c,pt,1) = (phyEdgeTan_U(2)*phyEdgeTan_V(0) - phyEdgeTan_U(0)*phyEdgeTan_V(2));
159 gatherFieldNormals(c,pt,2) = (phyEdgeTan_U(0)*phyEdgeTan_V(1) - phyEdgeTan_U(1)*phyEdgeTan_V(0));