190 const EPointType pointType ) {
192 constexpr ordinal_type spaceDim = 2;
193 this->basisCardinality_ = CardinalityHCurlTri(order);
194 this->basisDegree_ = order;
195 this->basisCellTopology_ = shards::CellTopology(shards::getCellTopologyData<shards::Triangle<3> >() );
196 this->basisType_ = BASIS_FEM_LAGRANGIAN;
197 this->basisCoordinates_ = COORDINATES_CARTESIAN;
198 this->functionSpace_ = FUNCTION_SPACE_HCURL;
199 pointType_ = pointType;
201 const ordinal_type card = this->basisCardinality_;
203 const ordinal_type cardPn = Intrepid2::getPnCardinality<spaceDim>(order);
204 const ordinal_type cardPnm1 = Intrepid2::getPnCardinality<spaceDim>(order-1);
205 const ordinal_type cardPnm2 = Intrepid2::getPnCardinality<spaceDim>(order-2);
206 const ordinal_type cardVecPn = spaceDim*cardPn;
207 const ordinal_type cardVecPnm1 = spaceDim*cardPnm1;
211 constexpr ordinal_type tagSize = 4;
213 ordinal_type tags[maxCard][tagSize];
216 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace>
217 dofCoords(
"Hcurl::Tri::In::dofCoords", card, spaceDim);
219 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace>
220 coeffs(
"Hcurl::Tri::In::coeffs", cardVecPn, card);
222 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace>
223 dofCoeffs(
"Hcurl::Tri::In::dofCoeffs", card, spaceDim);
229 const ordinal_type lwork = card*card;
230 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace>
231 V1(
"Hcurl::Tri::In::V1", cardVecPn, card);
242 for (ordinal_type i=0;i<cardPnm1;i++)
243 for (ordinal_type d=0;d<spaceDim;d++)
244 V1(d*cardPn+i,d*cardPnm1+i) = 1.0;
250 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace> cubPoints(
"Hcurl::Tri::In::cubPoints", myCub.
getNumPoints() , spaceDim );
251 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace> cubWeights(
"Hcurl::Tri::In::cubWeights", myCub.
getNumPoints() );
255 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace> phisAtCubPoints(
"Hcurl::Tri::In::phisAtCubPoints", cardPn , myCub.
getNumPoints() );
256 Impl::Basis_HGRAD_TRI_Cn_FEM_ORTH::getValues<Kokkos::HostSpace::execution_space,Parameters::MaxNumPtsPerBasisEval>(phisAtCubPoints, cubPoints, order, OPERATOR_VALUE);
259 for (ordinal_type i=0;i<order;i++) {
260 for (ordinal_type j=0;j<cardPn;j++) {
262 V1(j,cardVecPnm1+i) -=
263 cubWeights(k) * cubPoints(k,1)
264 * phisAtCubPoints(cardPnm2+i,k)
265 * phisAtCubPoints(j,k);
266 V1(j+cardPn,cardVecPnm1+i) +=
267 cubWeights(k) * cubPoints(k,0)
268 * phisAtCubPoints(cardPnm2+i,k)
269 * phisAtCubPoints(j,k);
275 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace>
276 V2(
"Hcurl::Tri::In::V2", card ,cardVecPn);
278 const ordinal_type numEdges = this->basisCellTopology_.getEdgeCount();
280 shards::CellTopology edgeTop(shards::getCellTopologyData<shards::Line<2> >() );
288 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace> linePts(
"Hcurl::Tri::In::linePts", numPtsPerEdge , 1 );
291 const ordinal_type offset = 1;
298 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace> edgePts(
"Hcurl::Tri::In::edgePts", numPtsPerEdge , spaceDim );
299 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace> phisAtEdgePoints(
"Hcurl::Tri::In::phisAtEdgePoints", cardPn , numPtsPerEdge );
300 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace> edgeTan(
"Hcurl::Tri::In::edgeTan", spaceDim );
303 for (ordinal_type edge=0;edge<numEdges;edge++) {
306 this->basisCellTopology_ );
312 this->basisCellTopology_ );
314 Impl::Basis_HGRAD_TRI_Cn_FEM_ORTH::getValues<Kokkos::HostSpace::execution_space,Parameters::MaxNumPtsPerBasisEval>(phisAtEdgePoints , edgePts, order, OPERATOR_VALUE);
317 for (ordinal_type j=0;j<numPtsPerEdge;j++) {
319 const ordinal_type i_card = numPtsPerEdge*edge+j;
322 for (ordinal_type k=0;k<cardPn;k++) {
323 V2(i_card,k) = edgeTan(0) * phisAtEdgePoints(k,j);
324 V2(i_card,k+cardPn) = edgeTan(1) * phisAtEdgePoints(k,j);
329 for(ordinal_type k=0; k<spaceDim; ++k) {
330 dofCoords(i_card,k) = edgePts(j,k);
331 dofCoeffs(i_card,k) = edgeTan(k);
335 tags[i_card][1] = edge;
337 tags[i_card][3] = numPtsPerEdge;
353 if (numPtsPerCell > 0) {
354 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace>
355 internalPoints(
"Hcurl::Tri::In::internalPoints", numPtsPerCell , spaceDim );
357 this->basisCellTopology_ ,
362 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace>
363 phisAtInternalPoints(
"Hcurl::Tri::In::phisAtInternalPoints", cardPn , numPtsPerCell );
364 Impl::Basis_HGRAD_TRI_Cn_FEM_ORTH::getValues<Kokkos::HostSpace::execution_space,Parameters::MaxNumPtsPerBasisEval>( phisAtInternalPoints , internalPoints , order, OPERATOR_VALUE );
367 for (ordinal_type j=0;j<numPtsPerCell;j++) {
369 const ordinal_type i_card = numEdges*order+spaceDim*j;
371 for (ordinal_type k=0;k<cardPn;k++) {
373 V2(i_card,k) = phisAtInternalPoints(k,j);
375 V2(i_card+1,cardPn+k) = phisAtInternalPoints(k,j);
379 for(ordinal_type d=0; d<spaceDim; ++d) {
380 for(ordinal_type dim=0; dim<spaceDim; ++dim) {
381 dofCoords(i_card+d,dim) = internalPoints(j,dim);
382 dofCoeffs(i_card+d,dim) = (d==dim);
385 tags[i_card+d][0] = spaceDim;
386 tags[i_card+d][1] = 0;
387 tags[i_card+d][2] = spaceDim*j+d;
388 tags[i_card+d][3] = spaceDim*numPtsPerCell;
395 Kokkos::DynRankView<scalarType,Kokkos::LayoutLeft,Kokkos::HostSpace>
396 vmat(
"Hcurl::Tri::In::vmat", card, card),
397 work(
"Hcurl::Tri::In::work", lwork),
398 ipiv(
"Hcurl::Tri::In::ipiv", card);
401 for(ordinal_type i=0; i< card; ++i) {
402 for(ordinal_type j=0; j< card; ++j) {
404 for(ordinal_type k=0; k< cardVecPn; ++k)
405 s += V2(i,k)*V1(k,j);
410 ordinal_type info = 0;
411 Teuchos::LAPACK<ordinal_type,scalarType> lapack;
413 lapack.GETRF(card, card,
414 vmat.data(), vmat.stride_1(),
415 (ordinal_type*)ipiv.data(),
418 INTREPID2_TEST_FOR_EXCEPTION( info != 0,
420 ">>> ERROR: (Intrepid2::Basis_HCURL_TRI_In_FEM) lapack.GETRF returns nonzero info." );
423 vmat.data(), vmat.stride_1(),
424 (ordinal_type*)ipiv.data(),
428 INTREPID2_TEST_FOR_EXCEPTION( info != 0,
430 ">>> ERROR: (Intrepid2::Basis_HCURL_TRI_In_FEM) lapack.GETRI returns nonzero info." );
432 for (ordinal_type i=0;i<cardVecPn;++i)
433 for (ordinal_type j=0;j<card;++j){
435 for(ordinal_type k=0; k< card; ++k)
436 s += V1(i,k)*vmat(k,j);
440 this->coeffs_ = Kokkos::create_mirror_view(
typename DT::memory_space(), coeffs);
441 Kokkos::deep_copy(this->coeffs_ , coeffs);
443 this->dofCoords_ = Kokkos::create_mirror_view(
typename DT::memory_space(), dofCoords);
444 Kokkos::deep_copy(this->dofCoords_, dofCoords);
446 this->dofCoeffs_ = Kokkos::create_mirror_view(
typename DT::memory_space(), dofCoeffs);
447 Kokkos::deep_copy(this->dofCoeffs_, dofCoeffs);
453 const ordinal_type posScDim = 0;
454 const ordinal_type posScOrd = 1;
455 const ordinal_type posDfOrd = 2;
457 OrdinalTypeArray1DHost tagView(&tags[0][0], card*tagSize);
461 this->setOrdinalTagData(this->tagToOrdinal_,
464 this->basisCardinality_,