30 :
public CubatureTensor<DeviceType,pointValueType,weightValueType> {
32 using TensorPointDataType =
typename CubatureTensor<DeviceType,pointValueType,weightValueType>::TensorPointDataType;
33 using TensorWeightDataType =
typename CubatureTensor<DeviceType,pointValueType,weightValueType>::TensorWeightDataType;
35 using WeightViewTypeAllocatable =
typename CubatureTensor<DeviceType,pointValueType,weightValueType>::WeightViewTypeAllocatable;
37 template<
typename cubPointViewType,
38 typename cubWeightViewType>
40 cubPointViewType _cubPoints;
41 cubWeightViewType _cubWeights;
43 KOKKOS_INLINE_FUNCTION
44 Functor( cubPointViewType cubPoints_,
45 cubWeightViewType cubWeights_)
46 : _cubPoints(cubPoints_), _cubWeights(cubWeights_) {}
48 KOKKOS_INLINE_FUNCTION
49 void operator()(
const ordinal_type i)
const {
50 const auto tmp = 0.5*(1.0 - _cubPoints(i,2));
51 _cubPoints(i,0) *= tmp;
52 _cubPoints(i,1) *= tmp;
53 _cubPoints(i,2) = 1.0 - tmp;
55 _cubWeights(i) /= 8.0;
60 template<
typename cubPointValueType,
class ...cubPointProperties,
61 typename cubWeightValueType,
class ...cubWeightProperties>
63 getCubatureImpl( Kokkos::DynRankView<cubPointValueType, cubPointProperties...> cubPoints,
64 Kokkos::DynRankView<cubWeightValueType,cubWeightProperties...> cubWeights )
const;
66 using typename Cubature<DeviceType,pointValueType,weightValueType>::PointViewType;
67 using typename Cubature<DeviceType,pointValueType,weightValueType>::weightViewType;
70 using typename CubatureTensor<DeviceType,pointValueType,weightValueType>::ExecSpaceType;
75 weightViewType cubWeights )
const override {
76 getCubatureImpl( cubPoints,
83 CubatureTensorPyr(
const CubatureTensorPyr &b)
84 : CubatureTensor<DeviceType,pointValueType,weightValueType>(b) {}
86 template<
typename CubatureLineType>
87 CubatureTensorPyr(
const CubatureLineType line )
88 : CubatureTensor<DeviceType,pointValueType,weightValueType>(line, line, line) {}
90 template<
typename CubatureLineType0,
91 typename CubatureLineType1,
92 typename CubatureLineType2>
93 CubatureTensorPyr(
const CubatureLineType0 line0,
94 const CubatureLineType1 line1,
95 const CubatureLineType2 line2 )
96 : CubatureTensor<DeviceType,pointValueType,weightValueType>(line0, line1, line2) {}
105 std::vector< PointViewTypeAllocatable > cubaturePointComponents(1);
109 for (ordinal_type i=0;i<numCubatures;++i)
115 cubaturePointComponents[0] = PointViewTypeAllocatable(
"cubature points", numPoints, dim);
117 return TensorPointDataType(cubaturePointComponents);
128 std::vector< WeightDataType > cubatureWeightComponents(1);
131 for (ordinal_type i=0;i<numCubatures;++i)
136 cubatureWeightComponents[0] = WeightDataType(WeightViewTypeAllocatable(
"cubature weights", numPoints));
138 return TensorWeightDataType(cubatureWeightComponents);
149 const TensorWeightDataType & tensorCubWeights)
const override {
151 auto points = tensorCubPoints.getTensorComponent(0);
152 auto weights = tensorCubWeights.getTensorComponent(0).getUnderlyingView();
virtual void getCubature(const TensorPointDataType &tensorCubPoints, const TensorWeightDataType &tensorCubWeights) const override
Returns tensor cubature points and weights. For non-tensor cubatures, the tensor structures are trivi...