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( cubPoints.rank() != 2, std::invalid_argument,
145 ">>> ERROR (CubatureDirect): cubPoints must be rank 2." );
147 INTREPID2_TEST_FOR_EXCEPTION( cubWeights.rank() != 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) {
237 this->degree_ = b.degree_;
238 this->dimension_ = b.dimension_;
239 this->cubatureData_ = b.cubatureData_;
243 CubatureDirect(
const ordinal_type degree,
244 const ordinal_type dimension)
Header file for the Intrepid2::Cubature class.
Defines direct cubature (integration) rules in Intrepid.
void getCubatureFromData(Kokkos::DynRankView< cubPointValueType, cubPointProperties... > cubPoints, Kokkos::DynRankView< cubWeightValueType, cubWeightProperties... > cubWeights, const CubatureData cubData) const
Returns cubature points and weights.
virtual ordinal_type getAccuracy() const override
Returns max. degree of polynomials that are integrated exactly. The return vector has size 1.
ordinal_type dimension_
Dimension of integration domain.
CubatureData cubatureData_
Cubature data on device.
virtual void getCubature(PointViewType cubPoints, weightViewType cubWeights) const override
Returns cubature points and weights (return arrays must be pre-sized/pre-allocated).
virtual const char * getName() const override
Returns cubature name.
ordinal_type degree_
The degree of polynomials that are integrated exactly by this cubature rule.
virtual ordinal_type getDimension() const override
Returns dimension of integration domain.
virtual ordinal_type getNumPoints() const override
Returns the number of cubature points.
Defines the base class for cubature (integration) rules in Intrepid.
static constexpr ordinal_type MaxIntegrationPoints
The maximum number of integration points for direct cubature rules.
static constexpr ordinal_type MaxDimension
The maximum ambient space dimension.
Cubature data is defined on the host space and is static.
weightValueType weights_[Parameters::MaxIntegrationPoints]
Array with the associated cubature weights.
ordinal_type numPoints_
Number of cubature points stored in the template.
pointValueType points_[Parameters::MaxIntegrationPoints][Parameters::MaxDimension]
Array with the (X,Y,Z) coordinates of the cubature points.
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.
Kokkos::DynRankView< weightValueType, DeviceType > weights_
Array with the associated cubature weights.