18 template <
typename DT,
typename PT,
typename WT>
19 CubaturePolylib<DT,PT,WT>::
20 CubaturePolylib(
const ordinal_type degree,
21 const EPolyType polytype,
24 : CubatureDirect<DT,PT,WT>(degree, 1) {
26 INTREPID2_TEST_FOR_EXCEPTION( degree < 0 ||
28 ">>> ERROR (CubaturePolylib): No cubature rule implemented for the desired polynomial degree.");
29 INTREPID2_TEST_FOR_EXCEPTION( !isValidPolyType(polytype), std::invalid_argument,
30 ">>> ERROR (CubaturePolylib): Invalid poly type.");
32 ordinal_type npts = 0;
34 case POLYTYPE_GAUSS: npts = (degree+2)/2;
break;
35 case POLYTYPE_GAUSS_RADAU_LEFT:
36 case POLYTYPE_GAUSS_RADAU_RIGHT: npts = (degree == 0 ? 2 : (degree+3)/2);
break;
37 case POLYTYPE_GAUSS_LOBATTO: npts = (degree+4)/2;
break;
38 case POLYTYPE_MAX:
break;
42 auto points = Kokkos::DynRankView<PT,Kokkos::HostSpace>(
"CubaturePolylib::points", npts);
43 auto weights = Kokkos::DynRankView<WT,Kokkos::HostSpace>(
"CubaturePolylib::weights", npts);
45 Polylib::Serial::getCubature( points,
52 this->
cubatureData_.
points_ = Kokkos::DynRankView<PT,DT>(
"CubaturePolylib::cubatureData_::points_", npts, 1);
53 this->
cubatureData_.
weights_ = Kokkos::DynRankView<WT,DT>(
"CubaturePolylib::cubatureData_::weights_", npts);
55 Kokkos::deep_copy(Kokkos::subdynrankview(this->
cubatureData_.
points_, Kokkos::ALL(), 0), points );
Kokkos::DynRankView< weightValueType, DeviceType > weights_
Array with the associated cubature weights.
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...
Kokkos::DynRankView< pointValueType, DeviceType > points_
Array with the (X,Y,Z) coordinates of the cubature points.
ordinal_type numPoints_
Number of cubature points stored in the template.