49 #ifndef __INTREPID2_CUBATURE_DIRECT_HPP__
50 #define __INTREPID2_CUBATURE_DIRECT_HPP__
52 #include "Intrepid2_ConfigDefs.hpp"
73 template<
typename DeviceType = void,
74 typename pointValueType = double,
75 typename weightValueType =
double>
77 :
public Cubature<DeviceType,pointValueType,weightValueType> {
109 Kokkos::DynRankView<pointValueType,DeviceType>
points_;
113 Kokkos::DynRankView<weightValueType,DeviceType>
weights_;
136 template<
typename cubPointValueType,
class ...cubPointProperties,
137 typename cubWeightValueType,
class ...cubWeightProperties>
140 Kokkos::DynRankView<cubWeightValueType,cubWeightProperties...> cubWeights,
142 #ifdef HAVE_INTREPID2_DEBUG
144 INTREPID2_TEST_FOR_EXCEPTION( rank(cubPoints) != 2, std::invalid_argument,
145 ">>> ERROR (CubatureDirect): cubPoints must be rank 2." );
147 INTREPID2_TEST_FOR_EXCEPTION( rank(cubWeights) != 1, std::invalid_argument,
148 ">>> ERROR (CubatureDirect): cubPoints must be rank 1." );
150 INTREPID2_TEST_FOR_EXCEPTION( static_cast<ordinal_type>(cubPoints.extent(0)) < this->
getNumPoints() ||
151 static_cast<ordinal_type
>(cubPoints.extent(1)) < this->
getDimension(), std::out_of_range,
152 ">>> ERROR (CubatureDirect): Insufficient space allocated for cubature points.");
154 INTREPID2_TEST_FOR_EXCEPTION( static_cast<ordinal_type>(cubWeights.extent(0)) < this->
getNumPoints(), std::out_of_range,
155 ">>> ERROR (CubatureDirect): Insufficient space allocated for cubature weights.");
158 typedef Kokkos::pair<ordinal_type,ordinal_type> range_type;
163 const auto src = Kokkos::subdynrankview(cubData.
points_, pointRange, dimRange);
164 auto dst = Kokkos::subdynrankview(cubPoints, pointRange, dimRange);
166 Kokkos::deep_copy( dst, src );
169 const auto src = Kokkos::subdynrankview(cubData.
weights_, pointRange);
170 auto dst = Kokkos::subdynrankview(cubWeights, pointRange);
172 Kokkos::deep_copy(dst ,src);
181 typedef typename Cubature<DeviceType,pointValueType,weightValueType>::PointViewType PointViewType;
182 typedef typename Cubature<DeviceType,pointValueType,weightValueType>::weightViewType weightViewType;
189 weightViewType cubWeights )
const override {
214 return "CubatureDirect";
231 CubatureDirect(
const CubatureDirect &b)
236 CubatureDirect& operator=(
const CubatureDirect &b) {
243 CubatureDirect(
const ordinal_type degree,
244 const ordinal_type dimension)
Defines the base class for cubature (integration) rules in Intrepid.
static constexpr ordinal_type MaxDimension
The maximum ambient space dimension.
ordinal_type dimension_
Dimension of integration domain.
pointValueType points_[Parameters::MaxIntegrationPoints][Parameters::MaxDimension]
Array with the (X,Y,Z) coordinates of the cubature points.
virtual ordinal_type getDimension() const override
Returns dimension of integration domain.
virtual void getCubature(PointViewType cubPoints, weightViewType cubWeights) const override
Returns cubature points and weights (return arrays must be pre-sized/pre-allocated).
Kokkos::DynRankView< weightValueType, DeviceType > weights_
Array with the associated cubature weights.
virtual ordinal_type getAccuracy() const override
Returns max. degree of polynomials that are integrated exactly. The return vector has size 1...
virtual ordinal_type getNumPoints() const override
Returns the number of cubature points.
Header file for the Intrepid2::Cubature class.
void getCubatureFromData(Kokkos::DynRankView< cubPointValueType, cubPointProperties...> cubPoints, Kokkos::DynRankView< cubWeightValueType, cubWeightProperties...> cubWeights, const CubatureData cubData) const
Returns cubature points and weights.
virtual const char * getName() const override
Returns cubature name.
CubatureData cubatureData_
Cubature data on device.
ordinal_type numPoints_
Number of cubature points stored in the template.
static constexpr ordinal_type MaxIntegrationPoints
The maximum number of integration points for direct cubature rules.
weightValueType weights_[Parameters::MaxIntegrationPoints]
Array with the associated cubature weights.
Defines direct cubature (integration) rules in Intrepid.
Cubature data is defined on the host space and is static.
Cubature data is defined on exec space and deep-copied when an object is created. ...
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.
ordinal_type degree_
The degree of polynomials that are integrated exactly by this cubature rule.