16#ifndef __INTREPID2_CUBATURE_TENSOR_HPP__
17#define __INTREPID2_CUBATURE_TENSOR_HPP__
19#include "Intrepid2_ConfigDefs.hpp"
28 template<
typename DeviceType = void,
29 typename pointValueType = double,
30 typename weightValueType =
double>
32 :
public Cubature<DeviceType,pointValueType,weightValueType> {
47 template<
typename cubPointValueType,
class ...cubPointProperties,
48 typename cubWeightValueType,
class ...cubWeightProperties>
50 getCubatureImpl( Kokkos::DynRankView<cubPointValueType, cubPointProperties...> cubPoints,
51 Kokkos::DynRankView<cubWeightValueType,cubWeightProperties...> cubWeights )
const;
53 using PointViewType =
typename Cubature<DeviceType,pointValueType,weightValueType>::PointViewType;
54 using weightViewType =
typename Cubature<DeviceType,pointValueType,weightValueType>::weightViewType;
58 using WeightViewTypeAllocatable =
typename Cubature<DeviceType,pointValueType,weightValueType>::WeightViewTypeAllocatable;
67 weightViewType cubWeights )
const override {
78 std::vector< PointViewTypeAllocatable > cubaturePointComponents(
numCubatures_);
85 return TensorPointDataType(cubaturePointComponents);
96 std::vector< WeightDataType > cubatureWeightComponents(
numCubatures_);
99 cubatureWeightComponents[i] = WeightDataType(WeightViewTypeAllocatable(
"cubature weights", cubatures_[i].
getNumPoints()));
102 return TensorWeightDataType(cubatureWeightComponents);
113 const TensorWeightDataType & tensorCubWeights)
const override {
116 cubatures_[i].
getCubature(tensorCubPoints.getTensorComponent(i), tensorCubWeights.getTensorComponent(i).getUnderlyingView());
125 ordinal_type numCubPoints = 1;
144 return "CubatureTensor";
150 ordinal_type r_val = 0;
165 return cubatures_[i];
179 CubatureTensor(
const CubatureTensor &b)
183 cubatures_[i] = b.cubatures_[i];
191 template<
typename CubatureType0,
192 typename CubatureType1>
194 const CubatureType1 cubature1 )
197 cubatures_[0] = cubature0;
198 cubatures_[1] = cubature1;
207 template<
typename CubatureType0,
208 typename CubatureType1,
209 typename CubatureType2>
211 const CubatureType1 cubature1,
212 const CubatureType2 cubature2 )
215 cubatures_[0] = cubature0;
216 cubatures_[1] = cubature1;
217 cubatures_[2] = cubature2;
225 template<
typename DirectCubature>
227 const DirectCubature cubatureExtension )
231 cubatures_[i] = cubatureTensor.cubatures_[i];
Header file for the Intrepid2::CubatureDirect class.
Definition file for the Intrepid2::CubatureTensor class.
Header file for the Intrepid2::Cubature class.
Defines direct cubature (integration) rules in Intrepid.
virtual void getCubature(PointViewType cubPoints, weightViewType cubWeights) const override
Returns cubature points and weights (return arrays must be pre-sized/pre-allocated).
Defines tensor-product cubature (integration) rules in Intrepid.
ordinal_type dimension_
Dimension of integration domain.
ordinal_type numCubatures_
Array of cubature rules.
virtual void getCubature(PointViewType cubPoints, weightViewType cubWeights) const override
Returns cubature points and weights (return arrays must be pre-sized/pre-allocated).
void getCubatureImpl(Kokkos::DynRankView< cubPointValueType, cubPointProperties... > cubPoints, Kokkos::DynRankView< cubWeightValueType, cubWeightProperties... > cubWeights) const
virtual TensorPointDataType allocateCubaturePoints() const override
Returns a points container appropriate for passing to getCubature().
ordinal_type getNumCubatures() const
Return the number of cubatures.
virtual ordinal_type getDimension() const override
Returns dimension of integration domain.
virtual const char * getName() const override
Returns cubature name.
virtual ordinal_type getAccuracy() const override
Returns dimension of the integration domain.
typename Cubature< DeviceType, pointValueType, weightValueType >::PointViewTypeAllocatable PointViewTypeAllocatable
KK: following should be updated with nate's tensor work.
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...
virtual TensorWeightDataType allocateCubatureWeights() const override
Returns a weight container appropriate for passing to getCubature().
CubatureDirect< DeviceType, pointValueType, weightValueType > getCubatureComponent(ordinal_type i) const
Return the number of cubatures.
virtual ordinal_type getNumPoints() const override
Returns the number of cubature points.
CubatureTensor(const CubatureTensor cubatureTensor, const DirectCubature cubatureExtension)
Constructor for extending an existing CubatureTensor object with an additional direct cubature rule.
void getAccuracy(ordinal_type *accuracy) const
Returns max. degree of polynomials that are integrated exactly.
CubatureTensor(const CubatureType0 cubature0, const CubatureType1 cubature1, const CubatureType2 cubature2)
Constructor.
CubatureTensor(const CubatureType0 cubature0, const CubatureType1 cubature1)
Constructor.
Defines the base class for cubature (integration) rules in Intrepid.
Wrapper around a Kokkos::View that allows data that is constant or repeating in various logical dimen...
static constexpr ordinal_type MaxTensorComponents
Maximum number of tensor/Cartesian products that can be taken: this allows hypercube basis in 7D to b...
View-like interface to tensor data; tensor components are stored separately and multiplied together a...
View-like interface to tensor points; point components are stored separately; the appropriate coordin...