16 #ifndef __INTREPID2_HCURL_HEX_IN_FEM_DEF_HPP__
17 #define __INTREPID2_HCURL_HEX_IN_FEM_DEF_HPP__
24 template<EOperator OpType>
25 template<
typename OutputViewType,
26 typename InputViewType,
27 typename WorkViewType,
28 typename VinvViewType>
29 KOKKOS_INLINE_FUNCTION
31 Basis_HCURL_HEX_In_FEM::Serial<OpType>::
32 getValues( OutputViewType output,
33 const InputViewType input,
35 const VinvViewType vinvLine,
36 const VinvViewType vinvBubble) {
37 const ordinal_type cardLine = vinvLine.extent(0);
38 const ordinal_type cardBubble = vinvBubble.extent(0);
40 const ordinal_type npts = input.extent(0);
42 typedef Kokkos::pair<ordinal_type,ordinal_type> range_type;
43 const auto input_x = Kokkos::subview(input, Kokkos::ALL(), range_type(0,1));
44 const auto input_y = Kokkos::subview(input, Kokkos::ALL(), range_type(1,2));
45 const auto input_z = Kokkos::subview(input, Kokkos::ALL(), range_type(2,3));
47 const ordinal_type dim_s = get_dimension_scalar(input);
48 auto ptr0 = work.data();
49 auto ptr1 = work.data() + cardLine*npts*dim_s;
50 auto ptr2 = work.data() + 2*cardLine*npts*dim_s;
51 auto ptr3 = work.data() + 3*cardLine*npts*dim_s;
53 typedef typename Kokkos::DynRankView<typename InputViewType::value_type, typename WorkViewType::memory_space> ViewType;
54 auto vcprop = Kokkos::common_view_alloc_prop(input);
57 case OPERATOR_VALUE: {
59 ViewType workLine(Kokkos::view_wrap(ptr0, vcprop), cardLine, npts);
60 ViewType outputLine_A(Kokkos::view_wrap(ptr1, vcprop), cardLine, npts);
61 ViewType outputLine_B(Kokkos::view_wrap(ptr2, vcprop), cardLine, npts);
62 ViewType outputBubble(Kokkos::view_wrap(ptr3, vcprop), cardBubble, npts);
67 Impl::Basis_HGRAD_LINE_Cn_FEM::Serial<OPERATOR_VALUE>::
68 getValues(outputBubble, input_x, workLine, vinvBubble);
70 Impl::Basis_HGRAD_LINE_Cn_FEM::Serial<OPERATOR_VALUE>::
71 getValues(outputLine_A, input_y, workLine, vinvLine);
73 Impl::Basis_HGRAD_LINE_Cn_FEM::Serial<OPERATOR_VALUE>::
74 getValues(outputLine_B, input_z, workLine, vinvLine);
77 const auto output_x = outputBubble;
78 const auto output_y = outputLine_A;
79 const auto output_z = outputLine_B;
81 for (ordinal_type k=0;k<cardLine;++k)
82 for (ordinal_type j=0;j<cardLine;++j)
83 for (ordinal_type i=0;i<cardBubble;++i,++idx)
84 for (ordinal_type l=0;l<npts;++l) {
85 output.access(idx,l,0) = output_x.access(i,l)*output_y.access(j,l)*output_z.access(k,l);
86 output.access(idx,l,1) = 0.0;
87 output.access(idx,l,2) = 0.0;
91 Impl::Basis_HGRAD_LINE_Cn_FEM::Serial<OPERATOR_VALUE>::
92 getValues(outputLine_A, input_x, workLine, vinvLine);
94 Impl::Basis_HGRAD_LINE_Cn_FEM::Serial<OPERATOR_VALUE>::
95 getValues(outputBubble, input_y, workLine, vinvBubble);
101 const auto output_x = outputLine_A;
102 const auto output_y = outputBubble;
103 const auto output_z = outputLine_B;
105 for (ordinal_type k=0;k<cardLine;++k)
106 for (ordinal_type j=0;j<cardBubble;++j)
107 for (ordinal_type i=0;i<cardLine;++i,++idx)
108 for (ordinal_type l=0;l<npts;++l) {
109 output.access(idx,l,0) = 0.0;
110 output.access(idx,l,1) = output_x.access(i,l)*output_y.access(j,l)*output_z.access(k,l);
111 output.access(idx,l,2) = 0.0;
118 Impl::Basis_HGRAD_LINE_Cn_FEM::Serial<OPERATOR_VALUE>::
119 getValues(outputLine_B, input_y, workLine, vinvLine);
121 Impl::Basis_HGRAD_LINE_Cn_FEM::Serial<OPERATOR_VALUE>::
122 getValues(outputBubble, input_z, workLine, vinvBubble);
125 const auto output_x = outputLine_A;
126 const auto output_y = outputLine_B;
127 const auto output_z = outputBubble;
129 for (ordinal_type k=0;k<cardBubble;++k)
130 for (ordinal_type j=0;j<cardLine;++j)
131 for (ordinal_type i=0;i<cardLine;++i,++idx)
132 for (ordinal_type l=0;l<npts;++l) {
133 output.access(idx,l,0) = 0.0;
134 output.access(idx,l,1) = 0.0;
135 output.access(idx,l,2) = output_x.access(i,l)*output_y.access(j,l)*output_z.access(k,l);
140 case OPERATOR_CURL: {
142 auto ptr4 = work.data() + 4*cardLine*npts*dim_s;
143 auto ptr5 = work.data() + 5*cardLine*npts*dim_s;
145 ViewType workLine(Kokkos::view_wrap(ptr0, vcprop), cardLine, npts);
146 ViewType outputLine_A(Kokkos::view_wrap(ptr1, vcprop), cardLine, npts);
147 ViewType outputLine_B(Kokkos::view_wrap(ptr2, vcprop), cardLine, npts);
148 ViewType outputLine_DA(Kokkos::view_wrap(ptr3, vcprop), cardLine, npts, 1);
149 ViewType outputLine_DB(Kokkos::view_wrap(ptr4, vcprop), cardLine, npts, 1);
150 ViewType outputBubble(Kokkos::view_wrap(ptr5, vcprop), cardBubble, npts);
153 ordinal_type idx = 0;
156 Impl::Basis_HGRAD_LINE_Cn_FEM::Serial<OPERATOR_VALUE>::
157 getValues(outputBubble, input_x, workLine, vinvBubble);
159 Impl::Basis_HGRAD_LINE_Cn_FEM::Serial<OPERATOR_VALUE>::
160 getValues(outputLine_A, input_y, workLine, vinvLine);
162 Impl::Basis_HGRAD_LINE_Cn_FEM::Serial<OPERATOR_Dn>::
163 getValues(outputLine_DA, input_y, workLine, vinvLine, 1);
165 Impl::Basis_HGRAD_LINE_Cn_FEM::Serial<OPERATOR_VALUE>::
166 getValues(outputLine_B, input_z, workLine, vinvLine);
168 Impl::Basis_HGRAD_LINE_Cn_FEM::Serial<OPERATOR_Dn>::
169 getValues(outputLine_DB, input_z, workLine, vinvLine, 1);
172 const auto output_x = outputBubble;
173 const auto output_y = outputLine_A;
174 const auto output_dy = outputLine_DA;
175 const auto output_z = outputLine_B;
176 const auto output_dz = outputLine_DB;
178 for (ordinal_type k=0;k<cardLine;++k)
179 for (ordinal_type j=0;j<cardLine;++j)
180 for (ordinal_type i=0;i<cardBubble;++i,++idx)
181 for (ordinal_type l=0;l<npts;++l) {
182 output.access(idx,l,0) = 0.0;
183 output.access(idx,l,1) = output_x.access(i,l)*output_y.access (j,l) *output_dz.access(k,l,0);
184 output.access(idx,l,2) = -output_x.access(i,l)*output_dy.access(j,l,0)*output_z.access (k,l);
188 Impl::Basis_HGRAD_LINE_Cn_FEM::Serial<OPERATOR_VALUE>::
189 getValues(outputLine_A, input_x, workLine, vinvLine);
191 Impl::Basis_HGRAD_LINE_Cn_FEM::Serial<OPERATOR_Dn>::
192 getValues(outputLine_DA, input_x, workLine, vinvLine, 1);
194 Impl::Basis_HGRAD_LINE_Cn_FEM::Serial<OPERATOR_VALUE>::
195 getValues(outputBubble, input_y, workLine, vinvBubble);
204 const auto output_x = outputLine_A;
205 const auto output_dx = outputLine_DA;
206 const auto output_y = outputBubble;
207 const auto output_z = outputLine_B;
208 const auto output_dz = outputLine_DB;
210 for (ordinal_type k=0;k<cardLine;++k)
211 for (ordinal_type j=0;j<cardBubble;++j)
212 for (ordinal_type i=0;i<cardLine;++i,++idx)
213 for (ordinal_type l=0;l<npts;++l) {
214 output.access(idx,l,0) = -output_x.access (i,l) *output_y.access(j,l)*output_dz.access(k,l,0);
215 output.access(idx,l,1) = 0.0;
216 output.access(idx,l,2) = output_dx(i,l,0)*output_y.access(j,l)*output_z.access (k,l);
226 Impl::Basis_HGRAD_LINE_Cn_FEM::Serial<OPERATOR_VALUE>::
227 getValues(outputLine_B, input_y, workLine, vinvLine);
229 Impl::Basis_HGRAD_LINE_Cn_FEM::Serial<OPERATOR_Dn>::
230 getValues(outputLine_DB, input_y, workLine, vinvLine, 1);
232 Impl::Basis_HGRAD_LINE_Cn_FEM::Serial<OPERATOR_VALUE>::
233 getValues(outputBubble, input_z, workLine, vinvBubble);
236 const auto output_x = outputLine_A;
237 const auto output_dx = outputLine_DA;
238 const auto output_y = outputLine_B;
239 const auto output_dy = outputLine_DB;
240 const auto output_z = outputBubble;
242 for (ordinal_type k=0;k<cardBubble;++k)
243 for (ordinal_type j=0;j<cardLine;++j)
244 for (ordinal_type i=0;i<cardLine;++i,++idx)
245 for (ordinal_type l=0;l<npts;++l) {
246 output.access(idx,l,0) = output_x.access (i,l) *output_dy.access(j,l,0)*output_z.access(k,l);
247 output.access(idx,l,1) = -output_dx(i,l,0)*output_y.access (j,l) *output_z.access(k,l);
248 output.access(idx,l,2) = 0.0;
254 INTREPID2_TEST_FOR_ABORT(
true,
255 ">>> ERROR: (Intrepid2::Basis_HCURL_HEX_In_FEM::Serial::getValues) operator is not supported" );
259 template<
typename DT, ordinal_type numPtsPerEval,
260 typename outputValueValueType,
class ...outputValueProperties,
261 typename inputPointValueType,
class ...inputPointProperties,
262 typename vinvValueType,
class ...vinvProperties>
264 Basis_HCURL_HEX_In_FEM::
265 getValues( Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValues,
266 const Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPoints,
267 const Kokkos::DynRankView<vinvValueType, vinvProperties...> vinvLine,
268 const Kokkos::DynRankView<vinvValueType, vinvProperties...> vinvBubble,
269 const EOperator operatorType ) {
270 typedef Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValueViewType;
271 typedef Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPointViewType;
272 typedef Kokkos::DynRankView<vinvValueType, vinvProperties...> vinvViewType;
273 typedef typename ExecSpace<typename inputPointViewType::execution_space,typename DT::execution_space>::ExecSpaceType ExecSpaceType;
276 const auto loopSizeTmp1 = (inputPoints.extent(0)/numPtsPerEval);
277 const auto loopSizeTmp2 = (inputPoints.extent(0)%numPtsPerEval != 0);
278 const auto loopSize = loopSizeTmp1 + loopSizeTmp2;
279 Kokkos::RangePolicy<ExecSpaceType,Kokkos::Schedule<Kokkos::Static> > policy(0, loopSize);
281 typedef typename inputPointViewType::value_type inputPointType;
283 const ordinal_type cardinality = outputValues.extent(0);
285 ordinal_type order = 0;
286 ordinal_type cardBubble;
287 ordinal_type cardLine;
289 cardBubble = Intrepid2::getPnCardinality<1>(order);
290 cardLine = Intrepid2::getPnCardinality<1>(++order);
292 auto vcprop = Kokkos::common_view_alloc_prop(inputPoints);
293 typedef typename Kokkos::DynRankView< inputPointType, typename inputPointViewType::memory_space> workViewType;
295 switch (operatorType) {
296 case OPERATOR_VALUE: {
297 auto workSize = Serial<OPERATOR_VALUE>::getWorkSizePerPoint(order);
298 workViewType work(Kokkos::view_alloc(
"Basis_CURL_HEX_In_FEM::getValues::work", vcprop), workSize, inputPoints.extent(0));
299 typedef Functor<outputValueViewType,inputPointViewType,vinvViewType, workViewType,
300 OPERATOR_VALUE,numPtsPerEval> FunctorType;
301 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints, vinvLine, vinvBubble, work) );
304 case OPERATOR_CURL: {
305 auto workSize = Serial<OPERATOR_CURL>::getWorkSizePerPoint(order);
306 workViewType work(Kokkos::view_alloc(
"Basis_CURL_HEX_In_FEM::getValues::work", vcprop), workSize, inputPoints.extent(0));
307 typedef Functor<outputValueViewType,inputPointViewType,vinvViewType, workViewType,
308 OPERATOR_CURL,numPtsPerEval> FunctorType;
309 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints, vinvLine, vinvBubble, work) );
313 INTREPID2_TEST_FOR_EXCEPTION(
true , std::invalid_argument,
314 ">>> ERROR (Basis_HCURL_HEX_In_FEM): Operator type not implemented" );
323 template<
typename DT,
typename OT,
typename PT>
326 const EPointType pointType ) {
328 INTREPID2_TEST_FOR_EXCEPTION( !(pointType == POINTTYPE_EQUISPACED ||
329 pointType == POINTTYPE_WARPBLEND), std::invalid_argument,
330 ">>> ERROR (Basis_HCURL_HEX_In_FEM): pointType must be either equispaced or warpblend.");
340 this->vinvLine_ = Kokkos::DynRankView<typename ScalarViewType::value_type,DT>(
"Hcurl::Hex::In::vinvLine", cardLine, cardLine);
341 this->vinvBubble_ = Kokkos::DynRankView<typename ScalarViewType::value_type,DT>(
"Hcurl::Hex::In::vinvBubble", cardBubble, cardBubble);
343 lineBasis.getVandermondeInverse(this->vinvLine_);
344 bubbleBasis.getVandermondeInverse(this->vinvBubble_);
346 const ordinal_type spaceDim = 3;
347 this->basisCardinality_ = 3*cardLine*cardLine*cardBubble;
348 this->basisDegree_ = order;
349 this->basisCellTopologyKey_ = shards::Hexahedron<8>::key;
350 this->basisType_ = BASIS_FEM_LAGRANGIAN;
351 this->basisCoordinates_ = COORDINATES_CARTESIAN;
352 this->functionSpace_ = FUNCTION_SPACE_HCURL;
353 pointType_ = pointType;
358 const ordinal_type tagSize = 4;
359 const ordinal_type posScDim = 0;
360 const ordinal_type posScOrd = 1;
361 const ordinal_type posDfOrd = 2;
365 INTREPID2_TEST_FOR_EXCEPTION( order >
Parameters::MaxOrder, std::invalid_argument,
"polynomial order exceeds the max supported by this class");
369 ordinal_type tags[3*maxCardLine*maxCardLine*maxCardLine][4];
371 const ordinal_type edge_x[2][2] = { {0, 4}, {2, 6} };
372 const ordinal_type edge_y[2][2] = { {3, 7}, {1, 5} };
373 const ordinal_type edge_z[2][2] = { {8,11}, {9,10} };
375 const ordinal_type face_yz[2] = {3, 1};
376 const ordinal_type face_xz[2] = {0, 2};
377 const ordinal_type face_xy[2] = {4, 5};
380 ordinal_type idx = 0;
390 face_ndofs_per_direction = (cardLine-2)*cardBubble,
391 face_ndofs = 2*face_ndofs_per_direction,
392 intr_ndofs_per_direction = (cardLine-2)*(cardLine-2)*cardBubble,
393 intr_ndofs = 3*intr_ndofs_per_direction;
396 for (ordinal_type k=0;k<cardLine;++k) {
397 const auto tag_z = lineBasis.
getDofTag(k);
398 for (ordinal_type j=0;j<cardLine;++j) {
399 const auto tag_y = lineBasis.
getDofTag(j);
400 for (ordinal_type i=0;i<cardBubble;++i,++idx) {
401 const auto tag_x = bubbleBasis.
getDofTag(i);
403 if (tag_x(0) == 1 && tag_y(0) == 0 && tag_z(0) == 0) {
406 tags[idx][1] = edge_x[tag_y(1)][tag_z(1)];
407 tags[idx][2] = tag_x(2);
408 tags[idx][3] = tag_x(3);
409 }
else if (tag_x(0) == 1 && tag_y(0) == 0 && tag_z(0) == 1) {
412 tags[idx][1] = face_xz[tag_y(1)];
413 tags[idx][2] = tag_x(2) + tag_x(3)*tag_z(2);
414 tags[idx][3] = face_ndofs;
415 }
else if (tag_x(0) == 1 && tag_y(0) == 1 && tag_z(0) == 0) {
418 tags[idx][1] = face_xy[tag_z(1)];
419 tags[idx][2] = tag_x(2) + tag_x(3)*tag_y(2);
420 tags[idx][3] = face_ndofs;
425 tags[idx][2] = tag_x(2) + tag_x(3)*tag_y(2) + tag_x(3)*tag_y(3)*tag_z(2);
426 tags[idx][3] = intr_ndofs;
433 for (ordinal_type k=0;k<cardLine;++k) {
434 const auto tag_z = lineBasis.
getDofTag(k);
435 for (ordinal_type j=0;j<cardBubble;++j) {
436 const auto tag_y = bubbleBasis.
getDofTag(j);
437 for (ordinal_type i=0;i<cardLine;++i,++idx) {
438 const auto tag_x = lineBasis.
getDofTag(i);
440 if (tag_x(0) == 0 && tag_y(0) == 1 && tag_z(0) == 0) {
443 tags[idx][1] = edge_y[tag_x(1)][tag_z(1)];
444 tags[idx][2] = tag_y(2);
445 tags[idx][3] = tag_y(3);
446 }
else if (tag_x(0) == 0 && tag_y(0) == 1 && tag_z(0) == 1) {
449 tags[idx][1] = face_yz[tag_x(1)];
450 tags[idx][2] = tag_y(2) + tag_y(3)*tag_z(2);
451 tags[idx][3] = face_ndofs;
452 }
else if (tag_x(0) == 1 && tag_y(0) == 1 && tag_z(0) == 0) {
455 tags[idx][1] = face_xy[tag_z(1)];
456 tags[idx][2] = face_ndofs_per_direction + tag_x(2) + tag_x(3)*tag_y(2);
457 tags[idx][3] = face_ndofs;
462 tags[idx][2] = intr_ndofs_per_direction + tag_x(2) + tag_x(3)*tag_y(2) + tag_x(3)*tag_y(3)*tag_z(2);
463 tags[idx][3] = intr_ndofs;
470 for (ordinal_type k=0;k<cardBubble;++k) {
471 const auto tag_z = bubbleBasis.
getDofTag(k);
472 for (ordinal_type j=0;j<cardLine;++j) {
473 const auto tag_y = lineBasis.
getDofTag(j);
474 for (ordinal_type i=0;i<cardLine;++i,++idx) {
475 const auto tag_x = lineBasis.
getDofTag(i);
477 if (tag_x(0) == 0 && tag_y(0) == 0 && tag_z(0) == 1) {
480 tags[idx][1] = edge_z[tag_x(1)][tag_y(1)];
481 tags[idx][2] = tag_z(2);
482 tags[idx][3] = tag_z(3);
483 }
else if (tag_x(0) == 0 && tag_y(0) == 1 && tag_z(0) == 1) {
486 tags[idx][1] = face_yz[tag_x(1)];
487 tags[idx][2] = face_ndofs_per_direction + tag_y(2) + tag_y(3)*tag_z(2);
488 tags[idx][3] = face_ndofs;
489 }
else if (tag_x(0) == 1 && tag_y(0) == 0 && tag_z(0) == 1) {
492 tags[idx][1] = face_xz[tag_y(1)];
493 tags[idx][2] = face_ndofs_per_direction + tag_x(2) + tag_x(3)*tag_z(2);
494 tags[idx][3] = face_ndofs;
499 tags[idx][2] = 2*intr_ndofs_per_direction + tag_x(2) + tag_x(3)*tag_y(2) + tag_x(3)*tag_y(3)*tag_z(2);
500 tags[idx][3] = intr_ndofs;
506 INTREPID2_TEST_FOR_EXCEPTION( idx != this->basisCardinality_ , std::runtime_error,
507 ">>> ERROR (Basis_HCURL_HEX_In_FEM): " \
508 "counted tag index is not same as cardinality." );
511 OrdinalTypeArray1DHost tagView(&tags[0][0], this->basisCardinality_*4);
515 this->setOrdinalTagData(this->tagToOrdinal_,
518 this->basisCardinality_,
526 Kokkos::DynRankView<typename ScalarViewType::value_type,typename DT::execution_space::array_layout,Kokkos::HostSpace>
527 dofCoordsHost(
"dofCoordsHost", this->basisCardinality_, spaceDim);
530 Kokkos::DynRankView<typename ScalarViewType::value_type,typename DT::execution_space::array_layout,Kokkos::HostSpace>
531 dofCoeffsHost(
"dofCoeffsHost", this->basisCardinality_, spaceDim);
533 Kokkos::DynRankView<typename ScalarViewType::value_type,DT>
534 dofCoordsLine(
"dofCoordsLine", cardLine, 1),
535 dofCoordsBubble(
"dofCoordsBubble", cardBubble, 1);
538 auto dofCoordsLineHost = Kokkos::create_mirror_view(Kokkos::HostSpace(), dofCoordsLine);
539 Kokkos::deep_copy(dofCoordsLineHost, dofCoordsLine);
542 auto dofCoordsBubbleHost = Kokkos::create_mirror_view(Kokkos::HostSpace(), dofCoordsBubble);
543 Kokkos::deep_copy(dofCoordsBubbleHost, dofCoordsBubble);
546 ordinal_type idx = 0;
549 for (ordinal_type k=0;k<cardLine;++k) {
550 for (ordinal_type j=0;j<cardLine;++j) {
551 for (ordinal_type i=0;i<cardBubble;++i,++idx) {
552 dofCoordsHost(idx,0) = dofCoordsBubbleHost(i,0);
553 dofCoordsHost(idx,1) = dofCoordsLineHost(j,0);
554 dofCoordsHost(idx,2) = dofCoordsLineHost(k,0);
555 dofCoeffsHost(idx,0) = 1.0;
561 for (ordinal_type k=0;k<cardLine;++k) {
562 for (ordinal_type j=0;j<cardBubble;++j) {
563 for (ordinal_type i=0;i<cardLine;++i,++idx) {
564 dofCoordsHost(idx,0) = dofCoordsLineHost(i,0);
565 dofCoordsHost(idx,1) = dofCoordsBubbleHost(j,0);
566 dofCoordsHost(idx,2) = dofCoordsLineHost(k,0);
567 dofCoeffsHost(idx,1) = 1.0;
573 for (ordinal_type k=0;k<cardBubble;++k) {
574 for (ordinal_type j=0;j<cardLine;++j) {
575 for (ordinal_type i=0;i<cardLine;++i,++idx) {
576 dofCoordsHost(idx,0) = dofCoordsLineHost(i,0);
577 dofCoordsHost(idx,1) = dofCoordsLineHost(j,0);
578 dofCoordsHost(idx,2) = dofCoordsBubbleHost(k,0);
579 dofCoeffsHost(idx,2) = 1.0;
585 this->dofCoords_ = Kokkos::create_mirror_view(
typename DT::memory_space(), dofCoordsHost);
586 Kokkos::deep_copy(this->dofCoords_, dofCoordsHost);
588 this->dofCoeffs_ = Kokkos::create_mirror_view(
typename DT::memory_space(), dofCoeffsHost);
589 Kokkos::deep_copy(this->dofCoeffs_, dofCoeffsHost);
592 template<
typename DT,
typename OT,
typename PT>
595 ordinal_type& perTeamSpaceSize,
596 ordinal_type& perThreadSpaceSize,
597 const PointViewType inputPoints,
598 const EOperator operatorType)
const {
599 perTeamSpaceSize = 0;
600 ordinal_type scalarWorkViewExtent = (operatorType == OPERATOR_VALUE) ?
601 3*this->vinvLine_.extent(0)+this->vinvBubble_.extent(0):
602 5*this->vinvLine_.extent(0)+this->vinvBubble_.extent(0);
603 perThreadSpaceSize = scalarWorkViewExtent*get_dimension_scalar(inputPoints)*
sizeof(
typename BasisBase::scalarType);
606 template<
typename DT,
typename OT,
typename PT>
607 KOKKOS_INLINE_FUNCTION
609 Basis_HCURL_HEX_In_FEM<DT,OT,PT>::getValues(
610 OutputViewType outputValues,
611 const PointViewType inputPoints,
612 const EOperator operatorType,
613 const typename Kokkos::TeamPolicy<typename DT::execution_space>::member_type& team_member,
614 const typename DT::execution_space::scratch_memory_space & scratchStorage,
615 const ordinal_type subcellDim,
616 const ordinal_type subcellOrdinal)
const {
618 INTREPID2_TEST_FOR_ABORT( !((subcellDim == -1) && (subcellOrdinal == -1)),
619 ">>> ERROR: (Intrepid2::Basis_HCURL_HEX_In_FEM::getValues), The capability of selecting subsets of basis functions has not been implemented yet.");
621 const int numPoints = inputPoints.extent(0);
622 using ScalarType =
typename ScalarTraits<typename PointViewType::value_type>::scalar_type;
623 using WorkViewType = Kokkos::DynRankView< ScalarType,typename DT::execution_space::scratch_memory_space,Kokkos::MemoryTraits<Kokkos::Unmanaged> >;
624 ordinal_type scalarSizePerPoint = (operatorType == OPERATOR_VALUE) ?
625 3*this->vinvLine_.extent(0)+this->vinvBubble_.extent(0):
626 5*this->vinvLine_.extent(0)+this->vinvBubble_.extent(0);
627 ordinal_type sizePerPoint = scalarSizePerPoint*get_dimension_scalar(inputPoints);
628 WorkViewType workView(scratchStorage, sizePerPoint*team_member.team_size());
629 using range_type = Kokkos::pair<ordinal_type,ordinal_type>;
631 switch(operatorType) {
633 Kokkos::parallel_for (Kokkos::TeamThreadRange (team_member, numPoints), [=] (ordinal_type& pt) {
634 auto output = Kokkos::subview( outputValues, Kokkos::ALL(), range_type (pt,pt+1), Kokkos::ALL() );
635 const auto input = Kokkos::subview( inputPoints, range_type(pt, pt+1), Kokkos::ALL() );
636 WorkViewType work(workView.data() + sizePerPoint*team_member.team_rank(), sizePerPoint);
637 Impl::Basis_HCURL_HEX_In_FEM::Serial<OPERATOR_VALUE>::getValues( output, input, work, this->vinvLine_, this->vinvBubble_ );
641 Kokkos::parallel_for (Kokkos::TeamThreadRange (team_member, numPoints), [=] (ordinal_type& pt) {
642 auto output = Kokkos::subview( outputValues, Kokkos::ALL(), range_type(pt,pt+1), Kokkos::ALL() );
643 const auto input = Kokkos::subview( inputPoints, range_type(pt,pt+1), Kokkos::ALL() );
644 WorkViewType work(workView.data() + sizePerPoint*team_member.team_rank(), sizePerPoint);
645 Impl::Basis_HCURL_HEX_In_FEM::Serial<OPERATOR_CURL>::getValues( output, input, work, this->vinvLine_, this->vinvBubble_ );
649 INTREPID2_TEST_FOR_ABORT(
true,
650 ">>> ERROR (Basis_HCURL_HEX_In_FEM): getValues not implemented for this operator");
const OrdinalTypeArrayStride1DHost getDofTag(const ordinal_type dofOrd) const
DoF ordinal to DoF tag lookup.
virtual void getDofCoords(ScalarViewType dofCoords) const override
Returns spatial locations (coordinates) of degrees of freedom on the reference cell.
ordinal_type getCardinality() const
Returns cardinality of the basis.
Implementation of the default H(curl)-compatible FEM basis on Hexahedron cell.
virtual void getDofCoords(ScalarViewType dofCoords) const override
Returns spatial locations (coordinates) of degrees of freedom on the reference cell.
Implementation of the locally H(grad)-compatible FEM basis of variable order on the [-1...
Implementation of the locally HVOL-compatible FEM basis of variable order on the [-1,1] reference line cell, using Lagrange polynomials.
Basis_HCURL_HEX_In_FEM(const ordinal_type order, const EPointType pointType=POINTTYPE_EQUISPACED)
Constructor.
static constexpr ordinal_type MaxOrder
The maximum reconstruction order.