16 #ifndef __INTREPID2_CUBATURE_TENSOR_PYR_HPP__
17 #define __INTREPID2_CUBATURE_TENSOR_PYR_HPP__
26 template<
typename DeviceType = void,
27 typename pointValueType = double,
28 typename weightValueType =
double>
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);
128 std::vector< WeightDataType > cubatureWeightComponents(1);
131 for (ordinal_type i=0;i<numCubatures;++i)
136 cubatureWeightComponents[0] = WeightDataType(WeightViewTypeAllocatable(
"cubature weights", numPoints));
virtual TensorWeightDataType allocateCubatureWeights() const override
Returns a weight container appropriate for passing to getCubature().
View-like interface to tensor points; point components are stored separately; the appropriate coordin...
typename Cubature< DeviceType, pointValueType, weightValueType >::PointViewTypeAllocatable PointViewTypeAllocatable
KK: following should be updated with nate's tensor work.
Defines tensor-product cubature (integration) rules in Intrepid.
ordinal_type getNumCubatures() const
Return the number of cubatures.
KOKKOS_INLINE_FUNCTION enable_if_t< rank==1, const Kokkos::View< typename RankExpander< DataScalar, rank >::value_type, DeviceType > & > getUnderlyingView() const
Returns the underlying view. Throws an exception if the underlying view is not rank 1...
Defines tensor-product cubature (integration) rules in Intrepid.
Wrapper around a Kokkos::View that allows data that is constant or repeating in various logical dimen...
KOKKOS_INLINE_FUNCTION const Data< Scalar, DeviceType > & getTensorComponent(const ordinal_type &r) const
Returns the requested tensor component.
virtual void getCubature(PointViewType cubPoints, weightViewType cubWeights) const override
Returns cubature points and weights (return arrays must be pre-sized/pre-allocated).
CubatureDirect< DeviceType, pointValueType, weightValueType > getCubatureComponent(ordinal_type i) const
Return the number of cubatures.
virtual TensorPointDataType allocateCubaturePoints() const override
Returns a points container appropriate for passing to getCubature().
Definition file for the Intrepid2::CubatureTensorPyr class.
Header file for the Intrepid2::CubatureTensor class.
View-like interface to tensor data; tensor components are stored separately and multiplied together a...
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...
KOKKOS_INLINE_FUNCTION ScalarView< PointScalar, DeviceType > getTensorComponent(const ordinal_type &r) const
Returns the requested tensor component.