Intrepid2
Intrepid2_HCURL_TRI_In_FEMDef.hpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// Intrepid2 Package
4//
5// Copyright 2007 NTESS and the Intrepid2 contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
15
16#ifndef __INTREPID2_HCURL_TRI_IN_FEM_DEF_HPP__
17#define __INTREPID2_HCURL_TRI_IN_FEM_DEF_HPP__
18
21
22namespace Intrepid2 {
23
24 // -------------------------------------------------------------------------------------
25
26 namespace Impl {
27
28 template<EOperator OpType>
29 template<typename OutputViewType,
30 typename InputViewType,
31 typename WorkViewType,
32 typename VinvViewType>
33 KOKKOS_INLINE_FUNCTION
34 void
36 getValues( OutputViewType output,
37 const InputViewType input,
38 WorkViewType work,
39 const VinvViewType coeffs ) {
40
41 constexpr ordinal_type spaceDim = 2;
42 const ordinal_type
43 cardPn = coeffs.extent(0)/spaceDim,
44 card = coeffs.extent(1),
45 npts = input.extent(0);
46
47 // compute order
48 ordinal_type order = 0;
49 for (ordinal_type p=0;p<=Parameters::MaxOrder;++p) {
50 if (card == CardinalityHCurlTri(p)) {
51 order = p;
52 break;
53 }
54 }
55
56 typedef typename Kokkos::DynRankView<typename InputViewType::value_type, typename WorkViewType::memory_space> ViewType;
57 auto ptr = work.data();
58
59 switch (OpType) {
60 case OPERATOR_VALUE: {
61 const ViewType phis = createMatchingUnmanagedView<ViewType>(input, ptr, card, npts), dummyView;
62
63 Impl::Basis_HGRAD_TRI_Cn_FEM_ORTH::
64 Serial<OpType>::getValues(phis, input, dummyView, order);
65
66 for (ordinal_type i=0;i<card;++i)
67 for (ordinal_type j=0;j<npts;++j)
68 for (ordinal_type d=0;d<spaceDim;++d) {
69 output.access(i,j,d) = 0.0;
70 for (ordinal_type k=0;k<cardPn;++k)
71 output.access(i,j,d) += coeffs(k+d*cardPn,i) * phis(k,j);
72 }
73 break;
74 }
75 case OPERATOR_CURL: {
76 const ViewType phis = createMatchingUnmanagedView<ViewType>(input, ptr, card, npts, spaceDim);
77 ptr += card*npts*spaceDim*get_dimension_scalar(input);
78 const ViewType workView = createMatchingUnmanagedView<ViewType>(input, ptr, card, npts, spaceDim+1);
79
80 Impl::Basis_HGRAD_TRI_Cn_FEM_ORTH::
81 Serial<OPERATOR_GRAD>::getValues(phis, input, workView, order);
82
83 for (ordinal_type i=0;i<card;++i)
84 for (ordinal_type j=0;j<npts;++j) {
85 output.access(i,j) = 0.0;
86 for (ordinal_type k=0; k<cardPn; ++k)
87 output.access(i,j) += - coeffs(k,i)*phis(k,j,1) // - dy of x component
88 + coeffs(k+cardPn,i)*phis(k,j,0); // dx of y component
89 }
90 break;
91 }
92 default: {
93 INTREPID2_TEST_FOR_ABORT( true,
94 ">>> ERROR (Basis_HCURL_TRI_In_FEM): Operator type not implemented");
95 }
96 }
97 }
98
99 template<typename DT, ordinal_type numPtsPerEval,
100 typename outputValueValueType, class ...outputValueProperties,
101 typename inputPointValueType, class ...inputPointProperties,
102 typename vinvValueType, class ...vinvProperties>
103 void
104 Basis_HCURL_TRI_In_FEM::
105 getValues( const typename DT::execution_space& space,
106 Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValues,
107 const Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPoints,
108 const Kokkos::DynRankView<vinvValueType, vinvProperties...> coeffs,
109 const EOperator operatorType) {
110 typedef Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValueViewType;
111 typedef Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPointViewType;
112 typedef Kokkos::DynRankView<vinvValueType, vinvProperties...> vinvViewType;
113 typedef typename ExecSpace<typename inputPointViewType::execution_space,typename DT::execution_space>::ExecSpaceType ExecSpaceType;
114
115 // loopSize corresponds to cardinality
116 const auto loopSizeTmp1 = (inputPoints.extent(0)/numPtsPerEval);
117 const auto loopSizeTmp2 = (inputPoints.extent(0)%numPtsPerEval != 0);
118 const auto loopSize = loopSizeTmp1 + loopSizeTmp2;
119 Kokkos::RangePolicy<ExecSpaceType,Kokkos::Schedule<Kokkos::Static> > policy(space, 0, loopSize);
120
121 //typedef typename inputPointViewType::value_type inputPointType;
122
123 const ordinal_type cardinality = outputValues.extent(0);
124 const ordinal_type spaceDim = 2;
125
126 switch (operatorType) {
127 case OPERATOR_VALUE: {
128 auto work = createMatchingDynRankView(inputPoints, "Basis_HCURL_TRI_In_FEM::getValues::work", cardinality, inputPoints.extent(0));
129 typedef Functor<outputValueViewType,inputPointViewType,vinvViewType, decltype(work),
130 OPERATOR_VALUE,numPtsPerEval> FunctorType;
131 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints, coeffs, work) );
132 break;
133 }
134 case OPERATOR_CURL: {
135 auto work = createMatchingDynRankView(inputPoints, "Basis_HCURL_TRI_In_FEM::getValues::work", cardinality*(2*spaceDim+1), inputPoints.extent(0));
136 typedef Functor<outputValueViewType,inputPointViewType,vinvViewType, decltype(work),
137 OPERATOR_CURL,numPtsPerEval> FunctorType;
138 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints, coeffs, work) );
139 break;
140 }
141 default: {
142 INTREPID2_TEST_FOR_EXCEPTION( true , std::invalid_argument,
143 ">>> ERROR (Basis_HCURL_TRI_In_FEM): Operator type not implemented" );
144 }
145 }
146 }
147 }
148
149 // -------------------------------------------------------------------------------------
150 template<typename DT, typename OT, typename PT>
152 Basis_HCURL_TRI_In_FEM( const ordinal_type order,
153 const EPointType pointType ) {
154
155 constexpr ordinal_type spaceDim = 2;
156 this->basisCardinality_ = CardinalityHCurlTri(order);
157 this->basisDegree_ = order; // small n
158 this->basisCellTopologyKey_ = shards::Triangle<3>::key;
159 this->basisType_ = BASIS_FEM_LAGRANGIAN;
160 this->basisCoordinates_ = COORDINATES_CARTESIAN;
161 this->functionSpace_ = FUNCTION_SPACE_HCURL;
162 pointType_ = (pointType == POINTTYPE_DEFAULT) ? POINTTYPE_EQUISPACED : pointType;
163
164 const ordinal_type card = this->basisCardinality_;
165
166 const ordinal_type cardPn = Intrepid2::getPnCardinality<spaceDim>(order); // dim of (P_{n}) -- smaller space
167 const ordinal_type cardPnm1 = Intrepid2::getPnCardinality<spaceDim>(order-1); // dim of (P_{n-1}) -- smaller space
168 const ordinal_type cardPnm2 = Intrepid2::getPnCardinality<spaceDim>(order-2); // dim of (P_{n-2}) -- smaller space
169 const ordinal_type cardVecPn = spaceDim*cardPn; // dim of (P_{n})^2 -- larger space
170 const ordinal_type cardVecPnm1 = spaceDim*cardPnm1; // dim of (P_{n-1})^2 -- smaller space
171
172 // Note: the only reason why equispaced can't support higher order than Parameters::MaxOrder appears to be the fact that the tags below get stored into a fixed-length array.
173 // TODO: relax the maximum order requirement by setting up tags in a different container, perhaps directly into an OrdinalTypeArray1DHost (tagView, below). (As of this writing (1/25/22), looks like other nodal bases do this in a similar way -- those should be fixed at the same time; maybe search for Parameters::MaxOrder.)
174 INTREPID2_TEST_FOR_EXCEPTION( order > Parameters::MaxOrder, std::invalid_argument, "polynomial order exceeds the max supported by this class");
175
176 // Basis-dependent initializations
177 constexpr ordinal_type tagSize = 4; // size of DoF tag, i.e., number of fields in the tag
178 constexpr ordinal_type maxCard = CardinalityHCurlTri(Parameters::MaxOrder);
179 ordinal_type tags[maxCard][tagSize];
180
181 // points are computed in the host and will be copied
182 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace>
183 dofCoords("Hcurl::Tri::In::dofCoords", card, spaceDim);
184
185 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace>
186 coeffs("Hcurl::Tri::In::coeffs", cardVecPn, card);
187
188 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace>
189 dofCoeffs("Hcurl::Tri::In::dofCoeffs", card, spaceDim);
190
191 // first, need to project the basis for RT space onto the
192 // orthogonal basis of degree n
193 // get coefficients of PkHx
194
195 const ordinal_type lwork = card*card;
196 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace>
197 V1("Hcurl::Tri::In::V1", cardVecPn, card);
198
199 // basis for the space is
200 // { (phi_i,0) }_{i=0}^{cardPnm1-1} ,
201 // { (0,phi_i) }_{i=0}^{cardPnm1-1} ,
202 // { (x,y) \times phi_i}_{i=cardPnm2}^{cardPnm1-1}
203 // { (x,y) \times phi = (y phi , -x \phi)
204 // columns of V1 are expansion of this basis in terms of the basis
205 // for P_{n}^2
206
207 // these two loops get the first two sets of basis functions
208 for (ordinal_type i=0;i<cardPnm1;i++)
209 for (ordinal_type d=0;d<spaceDim;d++)
210 V1(d*cardPn+i,d*cardPnm1+i) = 1.0;
211
212
213 // now I need to integrate { (x,y) \times phi } against the big basis
214 // first, get a cubature rule.
216 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace> cubPoints("Hcurl::Tri::In::cubPoints", myCub.getNumPoints() , spaceDim );
217 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace> cubWeights("Hcurl::Tri::In::cubWeights", myCub.getNumPoints() );
218 myCub.getCubature( cubPoints , cubWeights );
219
220 // tabulate the scalar orthonormal basis at cubature points
221 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace> phisAtCubPoints("Hcurl::Tri::In::phisAtCubPoints", cardPn , myCub.getNumPoints() );
222 Impl::Basis_HGRAD_TRI_Cn_FEM_ORTH::getValues<Kokkos::HostSpace::execution_space,Parameters::MaxNumPtsPerBasisEval>(typename Kokkos::HostSpace::execution_space{},
223 phisAtCubPoints,
224 cubPoints,
225 order,
226 OPERATOR_VALUE);
227
228 // now do the integration
229 for (ordinal_type i=0;i<order;i++) {
230 for (ordinal_type j=0;j<cardPn;j++) { // int (x,y) phi_i \cdot (phi_j,phi_{j+cardPn})
231 for (ordinal_type k=0;k<myCub.getNumPoints();k++) {
232 V1(j,cardVecPnm1+i) -=
233 cubWeights(k) * cubPoints(k,1)
234 * phisAtCubPoints(cardPnm2+i,k)
235 * phisAtCubPoints(j,k);
236 V1(j+cardPn,cardVecPnm1+i) +=
237 cubWeights(k) * cubPoints(k,0)
238 * phisAtCubPoints(cardPnm2+i,k)
239 * phisAtCubPoints(j,k);
240 }
241 }
242 }
243
244 // next, apply the RT nodes (rows) to the basis for (P_n)^2 (columns)
245 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace>
246 V2("Hcurl::Tri::In::V2", card ,cardVecPn);
247
248 const shards::CellTopology cellTopo(shards::getCellTopologyData<shards::Triangle<3>>());
249 const ordinal_type numEdges = cellTopo.getEdgeCount();
250
251 shards::CellTopology edgeTopo(shards::getCellTopologyData<shards::Line<2> >() );
252
253 const int numPtsPerEdge = PointTools::getLatticeSize( edgeTopo ,
254 order+1 ,
255 1 );
256
257 // first numEdges * degree nodes are tangents at each edge
258 // get the points on the line
259 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace> linePts("Hcurl::Tri::In::linePts", numPtsPerEdge , 1 );
260
261 // construct lattice
262 const ordinal_type offset = 1;
263 PointTools::getLattice( linePts,
264 edgeTopo,
265 order+1, offset,
266 pointType_ );
267
268 // holds the image of the line points
269 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace> edgePts("Hcurl::Tri::In::edgePts", numPtsPerEdge , spaceDim );
270 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace> phisAtEdgePoints("Hcurl::Tri::In::phisAtEdgePoints", cardPn , numPtsPerEdge );
271 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace> edgeTan("Hcurl::Tri::In::edgeTan", spaceDim );
272
273 // these are tangents scaled by the appropriate edge lengths.
274 for (ordinal_type edge=0;edge<numEdges;edge++) { // loop over edges
276 edge ,
277 cellTopo );
278
280 linePts ,
281 1 ,
282 edge ,
283 cellTopo );
284
285 Impl::Basis_HGRAD_TRI_Cn_FEM_ORTH::getValues<Kokkos::HostSpace::execution_space,Parameters::MaxNumPtsPerBasisEval>(typename Kokkos::HostSpace::execution_space{},
286 phisAtEdgePoints,
287 edgePts,
288 order,
289 OPERATOR_VALUE);
290
291 // loop over points (rows of V2)
292 for (ordinal_type j=0;j<numPtsPerEdge;j++) {
293
294 const ordinal_type i_card = numPtsPerEdge*edge+j;
295
296 // loop over orthonormal basis functions (columns of V2)
297 for (ordinal_type k=0;k<cardPn;k++) {
298 V2(i_card,k) = edgeTan(0) * phisAtEdgePoints(k,j);
299 V2(i_card,k+cardPn) = edgeTan(1) * phisAtEdgePoints(k,j);
300 }
301
302
303 //save dof coordinates
304 for(ordinal_type k=0; k<spaceDim; ++k) {
305 dofCoords(i_card,k) = edgePts(j,k);
306 dofCoeffs(i_card,k) = edgeTan(k);
307 }
308
309 tags[i_card][0] = 1; // edge dof
310 tags[i_card][1] = edge; // edge id
311 tags[i_card][2] = j; // local dof id
312 tags[i_card][3] = numPtsPerEdge; // total edge dof
313
314 }
315
316
317 }
318
319 // remaining nodes are x- and y- components at internal points (this code is same as HDIV).
320 //These are evaluated at the interior of a lattice of degree + 1, For then
321 // the degree == 1 space corresponds classicaly to RT0 and so gets
322 // no internal nodes, and degree == 2 corresponds to RT1 and needs
323 // one internal node per vector component.
324 const ordinal_type numPtsPerCell = PointTools::getLatticeSize( cellTopo ,
325 order + 1 ,
326 1 );
327
328 if (numPtsPerCell > 0) {
329 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace>
330 internalPoints( "Hcurl::Tri::In::internalPoints", numPtsPerCell , spaceDim );
331 PointTools::getLattice( internalPoints ,
332 cellTopo ,
333 order + 1 ,
334 1 ,
335 pointType_ );
336
337 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace>
338 phisAtInternalPoints("Hcurl::Tri::In::phisAtInternalPoints", cardPn , numPtsPerCell );
339 Impl::Basis_HGRAD_TRI_Cn_FEM_ORTH::getValues<Kokkos::HostSpace::execution_space,Parameters::MaxNumPtsPerBasisEval>(typename Kokkos::HostSpace::execution_space{},
340 phisAtInternalPoints,
341 internalPoints,
342 order,
343 OPERATOR_VALUE);
344
345 // copy values into right positions of V2
346 for (ordinal_type j=0;j<numPtsPerCell;j++) {
347
348 const ordinal_type i_card = numEdges*order+spaceDim*j;
349
350 for (ordinal_type k=0;k<cardPn;k++) {
351 // x component
352 V2(i_card,k) = phisAtInternalPoints(k,j);
353 // y component
354 V2(i_card+1,cardPn+k) = phisAtInternalPoints(k,j);
355 }
356
357 //save dof coordinates
358 for(ordinal_type d=0; d<spaceDim; ++d) {
359 for(ordinal_type dim=0; dim<spaceDim; ++dim) {
360 dofCoords(i_card+d,dim) = internalPoints(j,dim);
361 dofCoeffs(i_card+d,dim) = (d==dim);
362 }
363
364 tags[i_card+d][0] = spaceDim; // elem dof
365 tags[i_card+d][1] = 0; // elem id
366 tags[i_card+d][2] = spaceDim*j+d; // local dof id
367 tags[i_card+d][3] = spaceDim*numPtsPerCell; // total vert dof
368 }
369 }
370 }
371
372 // form Vandermonde matrix. Actually, this is the transpose of the VDM,
373 // so we transpose on copy below.
374 Kokkos::DynRankView<scalarType,Kokkos::LayoutLeft,Kokkos::HostSpace>
375 vmat("Hcurl::Tri::In::vmat", card, card),
376 work("Hcurl::Tri::In::work", lwork),
377 ipiv("Hcurl::Tri::In::ipiv", card);
378
379 //vmat' = V2*V1;
380 for(ordinal_type i=0; i< card; ++i) {
381 for(ordinal_type j=0; j< card; ++j) {
382 scalarType s=0;
383 for(ordinal_type k=0; k< cardVecPn; ++k)
384 s += V2(i,k)*V1(k,j);
385 vmat(i,j) = s;
386 }
387 }
388
389 ordinal_type info = 0;
390 Teuchos::LAPACK<ordinal_type,scalarType> lapack;
391
392 lapack.GETRF(card, card,
393 vmat.data(), vmat.stride(1),
394 (ordinal_type*)ipiv.data(),
395 &info);
396
397 INTREPID2_TEST_FOR_EXCEPTION( info != 0,
398 std::runtime_error ,
399 ">>> ERROR: (Intrepid2::Basis_HCURL_TRI_In_FEM) lapack.GETRF returns nonzero info." );
400
401 lapack.GETRI(card,
402 vmat.data(), vmat.stride(1),
403 (ordinal_type*)ipiv.data(),
404 work.data(), lwork,
405 &info);
406
407 INTREPID2_TEST_FOR_EXCEPTION( info != 0,
408 std::runtime_error ,
409 ">>> ERROR: (Intrepid2::Basis_HCURL_TRI_In_FEM) lapack.GETRI returns nonzero info." );
410
411 for (ordinal_type i=0;i<cardVecPn;++i)
412 for (ordinal_type j=0;j<card;++j){
413 scalarType s=0;
414 for(ordinal_type k=0; k< card; ++k)
415 s += V1(i,k)*vmat(k,j);
416 coeffs(i,j) = s;
417 }
418
419 this->coeffs_ = Kokkos::create_mirror_view(typename DT::memory_space(), coeffs);
420 Kokkos::deep_copy(this->coeffs_ , coeffs);
421
422 this->dofCoords_ = Kokkos::create_mirror_view(typename DT::memory_space(), dofCoords);
423 Kokkos::deep_copy(this->dofCoords_, dofCoords);
424
425 this->dofCoeffs_ = Kokkos::create_mirror_view(typename DT::memory_space(), dofCoeffs);
426 Kokkos::deep_copy(this->dofCoeffs_, dofCoeffs);
427
428
429 // set tags
430 {
431 // Basis-dependent initializations
432 const ordinal_type posScDim = 0; // position in the tag, counting from 0, of the subcell dim
433 const ordinal_type posScOrd = 1; // position in the tag, counting from 0, of the subcell ordinal
434 const ordinal_type posDfOrd = 2; // position in the tag, counting from 0, of DoF ordinal relative to the subcell
435
436 OrdinalTypeArray1DHost tagView(&tags[0][0], card*tagSize);
437
438 // Basis-independent function sets tag and enum data in tagToOrdinal_ and ordinalToTag_ arrays:
439 // tags are constructed on host
441 this->ordinalToTag_,
442 tagView,
443 this->basisCardinality_,
444 tagSize,
445 posScDim,
446 posScOrd,
447 posDfOrd);
448 }
449 }
450
451 template<typename DT, typename OT, typename PT>
452 void
453 Basis_HCURL_TRI_In_FEM<DT,OT,PT>::getScratchSpaceSize(
454 ordinal_type& perTeamSpaceSize,
455 ordinal_type& perThreadSpaceSize,
456 const PointViewType inputPoints,
457 const EOperator operatorType) const {
458 perTeamSpaceSize = 0;
459 ordinal_type scalarWorkViewExtent = (operatorType == OPERATOR_VALUE) ? this->basisCardinality_ : 5*this->basisCardinality_;
460 perThreadSpaceSize = scalarWorkViewExtent*get_dimension_scalar(inputPoints)*sizeof(typename BasisBase::scalarType);
461 }
462
463 template<typename DT, typename OT, typename PT>
464 KOKKOS_INLINE_FUNCTION
465 void
466 Basis_HCURL_TRI_In_FEM<DT,OT,PT>::getValues(
467 OutputViewType outputValues,
468 const PointViewType inputPoints,
469 const EOperator operatorType,
470 const typename Kokkos::TeamPolicy<typename DT::execution_space>::member_type& team_member,
471 const typename DT::execution_space::scratch_memory_space & scratchStorage,
472 const ordinal_type subcellDim,
473 const ordinal_type subcellOrdinal) const {
474
475 INTREPID2_TEST_FOR_ABORT( !((subcellDim == -1) && (subcellOrdinal == -1)),
476 ">>> ERROR: (Intrepid2::Basis_HCURL_TRI_In_FEM::getValues), The capability of selecting subsets of basis functions has not been implemented yet.");
477
478 const int numPoints = inputPoints.extent(0);
479 using ScalarType = typename ScalarTraits<typename PointViewType::value_type>::scalar_type;
480 using WorkViewType = Kokkos::DynRankView< ScalarType,typename DT::execution_space::scratch_memory_space,Kokkos::MemoryTraits<Kokkos::Unmanaged> >;
481 ordinal_type scalarSizePerPoint = (operatorType == OPERATOR_VALUE) ? this->basisCardinality_ : 5*this->basisCardinality_;
482 ordinal_type sizePerPoint = scalarSizePerPoint*get_dimension_scalar(inputPoints);
483 WorkViewType workView(scratchStorage, sizePerPoint*team_member.team_size());
484 using range_type = Kokkos::pair<ordinal_type,ordinal_type>;
485
486 switch(operatorType) {
487 case OPERATOR_VALUE:
488 Kokkos::parallel_for (Kokkos::TeamThreadRange (team_member, numPoints), [=, &coeffs_ = this->coeffs_] (ordinal_type& pt) {
489 auto output = Kokkos::subview( outputValues, Kokkos::ALL(), range_type (pt,pt+1), Kokkos::ALL() );
490 const auto input = Kokkos::subview( inputPoints, range_type(pt, pt+1), Kokkos::ALL() );
491 WorkViewType work(workView.data() + sizePerPoint*team_member.team_rank(), sizePerPoint);
492 Impl::Basis_HCURL_TRI_In_FEM::Serial<OPERATOR_VALUE>::getValues( output, input, work, coeffs_ );
493 });
494 break;
495 case OPERATOR_CURL:
496 Kokkos::parallel_for (Kokkos::TeamThreadRange (team_member, numPoints), [=, &coeffs_ = this->coeffs_] (ordinal_type& pt) {
497 auto output = Kokkos::subview( outputValues, Kokkos::ALL(), range_type(pt,pt+1), Kokkos::ALL() );
498 const auto input = Kokkos::subview( inputPoints, range_type(pt,pt+1), Kokkos::ALL() );
499 WorkViewType work(workView.data() + sizePerPoint*team_member.team_rank(), sizePerPoint);
500 Impl::Basis_HCURL_TRI_In_FEM::Serial<OPERATOR_CURL>::getValues( output, input, work, coeffs_ );
501 });
502 break;
503 default: {
504 INTREPID2_TEST_FOR_ABORT( true,
505 ">>> ERROR (Basis_HCURL_TRI_In_FEM): getValues not implemented for this operator");
506 }
507 }
508 }
509
510} // namespace Intrepid2
511
512#endif
KOKKOS_INLINE_FUNCTION ordinal_type getPnCardinality(ordinal_type n)
Returns cardinality of Polynomials of order n (P^n).
Header file for the Intrepid2::CubatureDirectTrisymPos class.
Header file for the Intrepid2::Basis_HGRAD_TRI_Cn_FEM_ORTH class.
KOKKOS_INLINE_FUNCTION std::enable_if< std::is_pointer_v< CtorProp > &&!std::is_convertible_v< CtorProp, constchar * >, OutViewType >::type createMatchingUnmanagedView(const InViewType &view, const CtorProp &data, const Dims... dims)
Creates an unmanaged view that matches the value_type of the provided view The type of the output vie...
DeduceDynRankView< InViewType >::type createMatchingDynRankView(const InViewType &view, const CtorProp &prop, const Dims... dims)
Creates and returns a view that matches the value_type of the provided view The output view type is d...
Kokkos::DynRankView< scalarType, DeviceType > coeffs_
expansion coefficients of the nodal basis in terms of the orthgonal one
Basis_HCURL_TRI_In_FEM(const ordinal_type order, const EPointType pointType=POINTTYPE_EQUISPACED)
Constructor.
EPointType pointType_
type of lattice used for creating the DoF coordinates
void setOrdinalTagData(OrdinalTypeView3D &tagToOrdinal, OrdinalTypeView2D &ordinalToTag, const OrdinalTypeView1D tags, const ordinal_type basisCard, const ordinal_type tagSize, const ordinal_type posScDim, const ordinal_type posScOrd, const ordinal_type posDfOrd)
Kokkos::DynRankView< scalarType, DeviceType > dofCoords_
Kokkos::DynRankView< scalarType, DeviceType > dofCoeffs_
ScalarTraits< double >::scalar_type scalarType
Kokkos::View< ordinal_type *, typename ExecutionSpace::array_layout, Kokkos::HostSpace > OrdinalTypeArray1DHost
static void mapToReferenceSubcell(refSubcellViewType refSubcellPoints, const paramPointViewType paramPoints, const ordinal_type subcellDim, const ordinal_type subcellOrd, const shards::CellTopology parentCell)
Computes parameterization maps of 1- and 2-subcells of reference cells.
static void getReferenceEdgeTangent(RefEdgeTangentViewType refEdgeTangent, const ordinal_type edgeOrd, const shards::CellTopology parentCell)
Computes constant tangent vectors to edges of 2D or 3D reference cells.
virtual ordinal_type getNumPoints() const override
Returns the number of cubature points.
static constexpr ordinal_type MaxOrder
The maximum reconstruction order.
static ordinal_type getLatticeSize(const shards::CellTopology cellType, const ordinal_type order, const ordinal_type offset=0)
Computes the number of points in a lattice of a given order on a simplex (currently disabled for othe...
static void getLattice(Kokkos::DynRankView< pointValueType, pointProperties... > points, const shards::CellTopology cellType, const ordinal_type order, const ordinal_type offset=0, const EPointType pointType=POINTTYPE_EQUISPACED)
Computes a lattice of points of a given order on a reference simplex, quadrilateral or hexahedron (cu...