Intrepid2
Intrepid2_HDIV_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_HDIV_TRI_IN_FEM_DEF_HPP__
17#define __INTREPID2_HDIV_TRI_IN_FEM_DEF_HPP__
18
21
22namespace Intrepid2 {
23
24// -------------------------------------------------------------------------------------
25namespace Impl {
26
27template<EOperator OpType>
28template<typename OutputViewType,
29typename InputViewType,
30typename WorkViewType,
31typename VinvViewType>
32KOKKOS_INLINE_FUNCTION
33void
35getValues( OutputViewType output,
36 const InputViewType input,
37 WorkViewType work,
38 const VinvViewType coeffs ) {
39
40 constexpr ordinal_type spaceDim = 2;
41 const ordinal_type
42 cardPn = coeffs.extent(0)/spaceDim,
43 card = coeffs.extent(1),
44 npts = input.extent(0);
45
46 // compute order
47 ordinal_type order = 0;
48 for (ordinal_type p=0;p<=Parameters::MaxOrder;++p) {
49 if (card == CardinalityHDivTri(p)) {
50 order = p;
51 break;
52 }
53 }
54
55 typedef typename Kokkos::DynRankView<typename InputViewType::value_type, typename WorkViewType::memory_space> ViewType;
56 auto ptr = work.data();
57
58 switch (OpType) {
59 case OPERATOR_VALUE: {
60 const ViewType phis = createMatchingUnmanagedView<ViewType>(input, ptr, card, npts);
61 ViewType 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.access(k,j);
72 }
73 break;
74 }
75 case OPERATOR_DIV: {
76 const ViewType phis = createMatchingUnmanagedView<ViewType>(input, ptr, card, npts, spaceDim);
77 ptr += card*npts*spaceDim*get_dimension_scalar(work);
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 for (ordinal_type d=0; d<spaceDim; ++d)
88 output.access(i,j) += coeffs(k+d*cardPn,i)*phis.access(k,j,d);
89 }
90 break;
91 }
92 default: {
93 INTREPID2_TEST_FOR_ABORT( true,
94 ">>> ERROR (Basis_HDIV_TRI_In_FEM): Operator type not implemented");
95 }
96 }
97}
98
99template<typename DT, ordinal_type numPtsPerEval,
100typename outputValueValueType, class ...outputValueProperties,
101typename inputPointValueType, class ...inputPointProperties,
102typename vinvValueType, class ...vinvProperties>
103void
104Basis_HDIV_TRI_In_FEM::
105getValues( /* */ Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValues,
106 const Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPoints,
107 const Kokkos::DynRankView<vinvValueType, vinvProperties...> coeffs,
108 const EOperator operatorType) {
109 typedef Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValueViewType;
110 typedef Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPointViewType;
111 typedef Kokkos::DynRankView<vinvValueType, vinvProperties...> vinvViewType;
112 typedef typename ExecSpace<typename inputPointViewType::execution_space,typename DT::execution_space>::ExecSpaceType ExecSpaceType;
113
114 // loopSize corresponds to cardinality
115 const auto loopSizeTmp1 = (inputPoints.extent(0)/numPtsPerEval);
116 const auto loopSizeTmp2 = (inputPoints.extent(0)%numPtsPerEval != 0);
117 const auto loopSize = loopSizeTmp1 + loopSizeTmp2;
118 Kokkos::RangePolicy<ExecSpaceType,Kokkos::Schedule<Kokkos::Static> > policy(0, loopSize);
119
120 const ordinal_type cardinality = outputValues.extent(0);
121 const ordinal_type spaceDim = 2;
122
123 switch (operatorType) {
124 case OPERATOR_VALUE: {
125 auto work = createMatchingDynRankView(inputPoints, "Basis_HDIV_TRI_In_FEM::getValues::work", cardinality, inputPoints.extent(0));
126 typedef Functor<outputValueViewType,inputPointViewType,vinvViewType, decltype(work),
127 OPERATOR_VALUE,numPtsPerEval> FunctorType;
128 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints, coeffs, work) );
129 break;
130 }
131 case OPERATOR_DIV: {
132 auto work = createMatchingDynRankView(inputPoints, "Basis_HDIV_TRI_In_FEM::getValues::work", cardinality*(2*spaceDim+1), inputPoints.extent(0));
133 typedef Functor<outputValueViewType,inputPointViewType,vinvViewType, decltype(work),
134 OPERATOR_DIV,numPtsPerEval> FunctorType;
135 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints, coeffs, work) );
136 break;
137 }
138 default: {
139 INTREPID2_TEST_FOR_EXCEPTION( true , std::invalid_argument,
140 ">>> ERROR (Basis_HDIV_TRI_In_FEM): Operator type not implemented" );
141 }
142 }
143}
144}
145
146// -------------------------------------------------------------------------------------
147template<typename DT, typename OT, typename PT>
149Basis_HDIV_TRI_In_FEM( const ordinal_type order,
150 const EPointType pointType ) {
151 // 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.
152 // 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.)
153 INTREPID2_TEST_FOR_EXCEPTION( order > Parameters::MaxOrder, std::invalid_argument, "polynomial order exceeds the max supported by this class");
154
155 constexpr ordinal_type spaceDim = 2;
156 this->basisCardinality_ = CardinalityHDivTri(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_HDIV;
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
173 // Basis-dependent initializations
174 constexpr ordinal_type tagSize = 4; // size of DoF tag, i.e., number of fields in the tag
175 constexpr ordinal_type maxCard = CardinalityHDivTri(Parameters::MaxOrder);
176 ordinal_type tags[maxCard][tagSize];
177
178 // points are computed in the host and will be copied
179 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace>
180 dofCoords("Hdiv::Tri::In::dofCoords", card, spaceDim);
181
182 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace>
183 dofCoeffs("Hdiv::Tri::In::dofCoeffs", card, spaceDim);
184
185 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace>
186 coeffs("Hdiv::Tri::In::coeffs", cardVecPn, card);
187
188 // first, need to project the basis for RT space onto the
189 // orthogonal basis of degree n
190 // get coefficients of PkHx
191
192 const ordinal_type lwork = card*card;
193 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace>
194 V1("Hdiv::Tri::In::V1", cardVecPn, card);
195
196 // basis for the space is
197 // { (phi_i,0) }_{i=0}^{cardPnm1-1} ,
198 // { (0,phi_i) }_{i=0}^{cardPnm1-1} ,
199 // { (x,y) . phi_i}_{i=cardPnm2}^{cardPnm1-1}
200 // columns of V1 are expansion of this basis in terms of the basis
201 // for P_{n}^2
202
203 // these two loops get the first two sets of basis functions
204 for (ordinal_type i=0;i<cardPnm1;i++) {
205 V1(i,i) = 1.0;
206 V1(cardPn+i,cardPnm1+i) = 1.0;
207 }
208
209 // now I need to integrate { (x,y) phi } against the big basis
210 // first, get a cubature rule.
212 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace> cubPoints("Hdiv::Tri::In::cubPoints", myCub.getNumPoints() , spaceDim );
213 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace> cubWeights("Hdiv::Tri::In::cubWeights", myCub.getNumPoints() );
214 myCub.getCubature( cubPoints , cubWeights );
215
216 // tabulate the scalar orthonormal basis at cubature points
217 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace> phisAtCubPoints("Hdiv::Tri::In::phisAtCubPoints", cardPn , myCub.getNumPoints() );
218 Impl::Basis_HGRAD_TRI_Cn_FEM_ORTH::getValues<Kokkos::HostSpace::execution_space,Parameters::MaxNumPtsPerBasisEval>(typename Kokkos::HostSpace::execution_space{},
219 phisAtCubPoints,
220 cubPoints,
221 order,
222 OPERATOR_VALUE);
223
224 // now do the integration
225 for (ordinal_type i=0;i<order;i++) {
226 for (ordinal_type j=0;j<cardPn;j++) { // int (x,y) phi_i \cdot (phi_j,phi_{j+cardPn})
227 V1(j,cardVecPnm1+i) = 0.0;
228 for (ordinal_type d=0; d< spaceDim; ++d)
229 for (ordinal_type k=0;k<myCub.getNumPoints();k++) {
230 V1(j+d*cardPn,cardVecPnm1+i) +=
231 cubWeights(k) * cubPoints(k,d)
232 * phisAtCubPoints(cardPnm2+i,k)
233 * phisAtCubPoints(j,k);
234 }
235 }
236 }
237
238 // next, apply the RT nodes (rows) to the basis for (P_n)^2 (columns)
239 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace>
240 V2("Hdiv::Tri::In::V2", card ,cardVecPn);
241
242 const shards::CellTopology cellTopo(shards::getCellTopologyData<shards::Triangle<3>>());
243 const ordinal_type numEdges = cellTopo.getEdgeCount();
244 shards::CellTopology edgeTopo(shards::getCellTopologyData<shards::Line<2> >() );
245
246 const int numPtsPerEdge = PointTools::getLatticeSize( edgeTopo ,
247 order+1 ,
248 1 );
249
250 // first numEdges * degree nodes are normals at each edge
251 // get the points on the line
252 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace> linePts("Hdiv::Tri::In::linePts", numPtsPerEdge , 1 );
253
254 // construct lattice
255 const ordinal_type offset = 1;
256 PointTools::getLattice( linePts,
257 edgeTopo,
258 order+1, offset,
259 pointType_ );
260
261 // holds the image of the line points
262 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace> edgePts("Hdiv::Tri::In::edgePts", numPtsPerEdge , spaceDim );
263 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace> phisAtEdgePoints("Hdiv::Tri::In::phisAtEdgePoints", cardPn , numPtsPerEdge );
264 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace> edgeNormal("Hcurl::Tri::In::edgeNormal", spaceDim );
265
266 // these are normal scaled by the appropriate edge lengths.
267 for (ordinal_type edge=0;edge<numEdges;edge++) { // loop over edges
269 edge ,
270 cellTopo);
271
273 linePts ,
274 1 ,
275 edge ,
276 cellTopo );
277
278 Impl::Basis_HGRAD_TRI_Cn_FEM_ORTH::getValues<Kokkos::HostSpace::execution_space,Parameters::MaxNumPtsPerBasisEval>(typename Kokkos::HostSpace::execution_space{},
279 phisAtEdgePoints,
280 edgePts,
281 order,
282 OPERATOR_VALUE);
283
284 // loop over points (rows of V2)
285 for (ordinal_type j=0;j<numPtsPerEdge;j++) {
286
287 const ordinal_type i_card = numPtsPerEdge*edge+j;
288
289 // loop over orthonormal basis functions (columns of V2)
290 for (ordinal_type k=0;k<cardPn;k++) {
291 // loop over space dimension
292 for (ordinal_type l=0; l<spaceDim; l++)
293 V2(i_card,k+l*cardPn) = edgeNormal(l) * phisAtEdgePoints(k,j);
294 }
295
296
297 //save dof coordinates and coefficients
298 for(ordinal_type l=0; l<spaceDim; ++l) {
299 dofCoords(i_card,l) = edgePts(j,l);
300 dofCoeffs(i_card,l) = edgeNormal(l);
301 }
302
303 tags[i_card][0] = 1; // edge dof
304 tags[i_card][1] = edge; // edge id
305 tags[i_card][2] = j; // local dof id
306 tags[i_card][3] = numPtsPerEdge; // total vert dof
307
308 }
309
310
311 }
312
313 // remaining nodes are divided into two pieces: point value of x
314 // components and point values of y components. These are
315 // evaluated at the interior of a lattice of degree + 1, For then
316 // the degree == 1 space corresponds classicaly to RT0 and so gets
317 // no internal nodes, and degree == 2 corresponds to RT1 and needs
318 // one internal node per vector component.
319 const ordinal_type numPtsPerCell = PointTools::getLatticeSize( cellTopo ,
320 order + 1 ,
321 1 );
322
323 if (numPtsPerCell > 0) {
324 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace>
325 internalPoints( "Hdiv::Tri::In::internalPoints", numPtsPerCell , spaceDim );
326 PointTools::getLattice( internalPoints ,
327 cellTopo ,
328 order + 1 ,
329 1 ,
330 pointType_ );
331
332 Kokkos::DynRankView<scalarType,typename DT::execution_space::array_layout,Kokkos::HostSpace>
333 phisAtInternalPoints("Hdiv::Tri::In::phisAtInternalPoints", cardPn , numPtsPerCell );
334 Impl::Basis_HGRAD_TRI_Cn_FEM_ORTH::getValues<Kokkos::HostSpace::execution_space,Parameters::MaxNumPtsPerBasisEval>(typename Kokkos::HostSpace::execution_space{},
335 phisAtInternalPoints,
336 internalPoints,
337 order,
338 OPERATOR_VALUE);
339
340 // copy values into right positions of V2
341 for (ordinal_type j=0;j<numPtsPerCell;j++) {
342
343 const ordinal_type i_card = numEdges*order+spaceDim*j;
344
345 for (ordinal_type k=0;k<cardPn;k++) {
346 for (ordinal_type l=0;l<spaceDim;l++) {
347 V2(i_card+l,l*cardPn+k) = phisAtInternalPoints(k,j);
348 }
349 }
350
351 //save dof coordinates and coefficients
352 for(ordinal_type d=0; d<spaceDim; ++d) {
353 for(ordinal_type l=0; l<spaceDim; ++l) {
354 dofCoords(i_card+d,l) = internalPoints(j,l);
355 dofCoeffs(i_card+d,l) = (l==d);
356 }
357
358 tags[i_card+d][0] = spaceDim; // elem dof
359 tags[i_card+d][1] = 0; // elem id
360 tags[i_card+d][2] = spaceDim*j+d; // local dof id
361 tags[i_card+d][3] = spaceDim*numPtsPerCell; // total vert dof
362 }
363 }
364 }
365
366 // form Vandermonde matrix. Actually, this is the transpose of the VDM,
367 // so we transpose on copy below.
368 Kokkos::DynRankView<scalarType,Kokkos::LayoutLeft,Kokkos::HostSpace>
369 vmat("Hdiv::Tri::In::vmat", card, card),
370 work("Hdiv::Tri::In::work", lwork),
371 ipiv("Hdiv::Tri::In::ipiv", card);
372
373 //vmat' = V2*V1;
374 for(ordinal_type i=0; i< card; ++i) {
375 for(ordinal_type j=0; j< card; ++j) {
376 scalarType s=0;
377 for(ordinal_type k=0; k< cardVecPn; ++k)
378 s += V2(i,k)*V1(k,j);
379 vmat(i,j) = s;
380 }
381 }
382
383 ordinal_type info = 0;
384 Teuchos::LAPACK<ordinal_type,scalarType> lapack;
385
386 lapack.GETRF(card, card,
387 vmat.data(), vmat.stride(1),
388 (ordinal_type*)ipiv.data(),
389 &info);
390
391 INTREPID2_TEST_FOR_EXCEPTION( info != 0,
392 std::runtime_error ,
393 ">>> ERROR: (Intrepid2::Basis_HDIV_TRI_In_FEM) lapack.GETRF returns nonzero info." );
394
395 lapack.GETRI(card,
396 vmat.data(), vmat.stride(1),
397 (ordinal_type*)ipiv.data(),
398 work.data(), lwork,
399 &info);
400
401 INTREPID2_TEST_FOR_EXCEPTION( info != 0,
402 std::runtime_error ,
403 ">>> ERROR: (Intrepid2::Basis_HDIV_TRI_In_FEM) lapack.GETRI returns nonzero info." );
404
405 for (ordinal_type i=0;i<cardVecPn;++i)
406 for (ordinal_type j=0;j<card;++j){
407 scalarType s=0;
408 for(ordinal_type k=0; k< card; ++k)
409 s += V1(i,k)*vmat(k,j);
410 coeffs(i,j) = s;
411 }
412
413 this->coeffs_ = Kokkos::create_mirror_view(typename DT::memory_space(), coeffs);
414 Kokkos::deep_copy(this->coeffs_ , coeffs);
415
416 this->dofCoords_ = Kokkos::create_mirror_view(typename DT::memory_space(), dofCoords);
417 Kokkos::deep_copy(this->dofCoords_, dofCoords);
418
419 this->dofCoeffs_ = Kokkos::create_mirror_view(typename DT::memory_space(), dofCoeffs);
420 Kokkos::deep_copy(this->dofCoeffs_, dofCoeffs);
421
422
423 // set tags
424 {
425 // Basis-dependent initializations
426 const ordinal_type posScDim = 0; // position in the tag, counting from 0, of the subcell dim
427 const ordinal_type posScOrd = 1; // position in the tag, counting from 0, of the subcell ordinal
428 const ordinal_type posDfOrd = 2; // position in the tag, counting from 0, of DoF ordinal relative to the subcell
429
430 OrdinalTypeArray1DHost tagView(&tags[0][0], card*tagSize);
431
432 // Basis-independent function sets tag and enum data in tagToOrdinal_ and ordinalToTag_ arrays:
433 // tags are constructed on host
435 this->ordinalToTag_,
436 tagView,
437 this->basisCardinality_,
438 tagSize,
439 posScDim,
440 posScOrd,
441 posDfOrd);
442 }
443}
444
445 template<typename DT, typename OT, typename PT>
446 void
447 Basis_HDIV_TRI_In_FEM<DT,OT,PT>::getScratchSpaceSize(
448 ordinal_type& perTeamSpaceSize,
449 ordinal_type& perThreadSpaceSize,
450 const PointViewType inputPoints,
451 const EOperator operatorType) const {
452 perTeamSpaceSize = 0;
453 ordinal_type scalarWorkViewExtent = (operatorType == OPERATOR_VALUE) ? this->basisCardinality_ : 5*this->basisCardinality_;
454 perThreadSpaceSize = scalarWorkViewExtent*get_dimension_scalar(inputPoints)*sizeof(scalarType);
455 }
456
457 template<typename DT, typename OT, typename PT>
458 KOKKOS_INLINE_FUNCTION
459 void
460 Basis_HDIV_TRI_In_FEM<DT,OT,PT>::getValues(
461 OutputViewType outputValues,
462 const PointViewType inputPoints,
463 const EOperator operatorType,
464 const typename Kokkos::TeamPolicy<typename DT::execution_space>::member_type& team_member,
465 const typename DT::execution_space::scratch_memory_space & scratchStorage,
466 const ordinal_type subcellDim,
467 const ordinal_type subcellOrdinal) const {
468
469 INTREPID2_TEST_FOR_ABORT( !((subcellDim == -1) && (subcellOrdinal == -1)),
470 ">>> ERROR: (Intrepid2::Basis_HDIV_TRI_In_FEM::getValues), The capability of selecting subsets of basis functions has not been implemented yet.");
471
472 const int numPoints = inputPoints.extent(0);
473 using WorkViewType = Kokkos::DynRankView< scalarType, typename DT::execution_space::scratch_memory_space,Kokkos::MemoryTraits<Kokkos::Unmanaged> >;
474 ordinal_type scalarSizePerPoint = (operatorType == OPERATOR_VALUE) ? this->basisCardinality_ : 5*this->basisCardinality_;
475 ordinal_type sizePerPoint = scalarSizePerPoint*get_dimension_scalar(inputPoints);
476 WorkViewType workView(scratchStorage, sizePerPoint*team_member.team_size());
477 using range_type = Kokkos::pair<ordinal_type,ordinal_type>;
478
479 switch(operatorType) {
480 case OPERATOR_VALUE:
481 Kokkos::parallel_for (Kokkos::TeamThreadRange (team_member, numPoints), [=, &coeffs_ = this->coeffs_] (ordinal_type& pt) {
482 auto output = Kokkos::subview( outputValues, Kokkos::ALL(), range_type (pt,pt+1), Kokkos::ALL() );
483 const auto input = Kokkos::subview( inputPoints, range_type(pt, pt+1), Kokkos::ALL() );
484 WorkViewType work(workView.data() + sizePerPoint*team_member.team_rank(), sizePerPoint);
485 Impl::Basis_HDIV_TRI_In_FEM::Serial<OPERATOR_VALUE>::getValues( output, input, work, coeffs_ );
486 });
487 break;
488 case OPERATOR_DIV:
489 Kokkos::parallel_for (Kokkos::TeamThreadRange (team_member, numPoints), [=, &coeffs_ = this->coeffs_] (ordinal_type& pt) {
490 auto output = Kokkos::subview( outputValues, Kokkos::ALL(), range_type(pt,pt+1), Kokkos::ALL() );
491 const auto input = Kokkos::subview( inputPoints, range_type(pt,pt+1), Kokkos::ALL() );
492 WorkViewType work(workView.data() + sizePerPoint*team_member.team_rank(), sizePerPoint);
493 Impl::Basis_HDIV_TRI_In_FEM::Serial<OPERATOR_DIV>::getValues( output, input, work, coeffs_ );
494 });
495 break;
496 default: {
497 INTREPID2_TEST_FOR_ABORT( true,
498 ">>> ERROR (Basis_HDIV_TRI_In_FEM): getValues not implemented for this operator");
499 }
500 }
501 }
502
503} // namespace Intrepid2
504
505#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_HDIV_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_
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 getReferenceSideNormal(RefSideNormalViewType refSideNormal, const ordinal_type sideOrd, const shards::CellTopology parentCell)
Computes constant normal vectors to sides 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...