51 template <
typename SpT,
typename PT,
typename WT>
52 CubaturePolylib<SpT,PT,WT>::
53 CubaturePolylib(
const ordinal_type degree,
54 const EPolyType polytype,
57 : CubatureDirect<SpT,PT,WT>(degree, 1) {
59 INTREPID2_TEST_FOR_EXCEPTION( degree < 0 ||
61 ">>> ERROR (CubaturePolylib): No cubature rule implemented for the desired polynomial degree.");
62 INTREPID2_TEST_FOR_EXCEPTION( !isValidPolyType(polytype), std::invalid_argument,
63 ">>> ERROR (CubaturePolylib): Invalid poly type.");
65 ordinal_type npts = 0;
67 case POLYTYPE_GAUSS: npts = (degree+2)/2;
break;
68 case POLYTYPE_GAUSS_RADAU_LEFT:
69 case POLYTYPE_GAUSS_RADAU_RIGHT: npts = (degree == 0 ? 2 : (degree+3)/2);
break;
70 case POLYTYPE_GAUSS_LOBATTO: npts = (degree+4)/2;
break;
71 case POLYTYPE_MAX:
break;
75 auto points = Kokkos::DynRankView<PT,Kokkos::HostSpace>(
"CubaturePolylib::points", npts);
76 auto weights = Kokkos::DynRankView<WT,Kokkos::HostSpace>(
"CubaturePolylib::weights", npts);
78 Polylib::Serial::getCubature( points,
85 this->
cubatureData_.
points_ = Kokkos::DynRankView<PT,SpT>(
"CubaturePolylib::cubatureData_::points_", npts, 1);
86 this->
cubatureData_.
weights_ = Kokkos::DynRankView<WT,SpT>(
"CubaturePolylib::cubatureData_::weights_", npts);
88 Kokkos::deep_copy(Kokkos::subdynrankview(this->
cubatureData_.
points_, Kokkos::ALL(), 0), points );
Kokkos::DynRankView< pointValueType, ExecSpaceType > points_
Array with the (X,Y,Z) coordinates of the cubature points.
CubatureData cubatureData_
Cubature data on device.
static constexpr ordinal_type MaxCubatureDegreeEdge
The maximum degree of the polynomial that can be integrated exactly by a direct edge rule...
ordinal_type numPoints_
Number of cubature points stored in the template.
Kokkos::DynRankView< weightValueType, ExecSpaceType > weights_
Array with the associated cubature weights.