49 #ifndef __INTREPID2_CUBATURE_DIRECT_HPP__
50 #define __INTREPID2_CUBATURE_DIRECT_HPP__
52 #include "Intrepid2_ConfigDefs.hpp"
73 template<
typename ExecSpaceType = void,
74 typename pointValueType = double,
75 typename weightValueType =
double>
77 :
public Cubature<ExecSpaceType,pointValueType,weightValueType> {
109 Kokkos::DynRankView<pointValueType,ExecSpaceType>
points_;
113 Kokkos::DynRankView<weightValueType,ExecSpaceType>
weights_;
135 template<
typename cubPointValueType,
class ...cubPointProperties,
136 typename cubWeightValueType,
class ...cubWeightProperties>
139 Kokkos::DynRankView<cubWeightValueType,cubWeightProperties...> cubWeights,
141 #ifdef HAVE_INTREPID2_DEBUG
143 INTREPID2_TEST_FOR_EXCEPTION( cubPoints.rank() != 2, std::invalid_argument,
144 ">>> ERROR (CubatureDirect): cubPoints must be rank 2." );
146 INTREPID2_TEST_FOR_EXCEPTION( cubWeights.rank() != 1, std::invalid_argument,
147 ">>> ERROR (CubatureDirect): cubPoints must be rank 1." );
149 INTREPID2_TEST_FOR_EXCEPTION( static_cast<ordinal_type>(cubPoints.extent(0)) < this->
getNumPoints() ||
150 static_cast<ordinal_type
>(cubPoints.extent(1)) < this->
getDimension(), std::out_of_range,
151 ">>> ERROR (CubatureDirect): Insufficient space allocated for cubature points.");
153 INTREPID2_TEST_FOR_EXCEPTION( static_cast<ordinal_type>(cubWeights.extent(0)) < this->
getNumPoints(), std::out_of_range,
154 ">>> ERROR (CubatureDirect): Insufficient space allocated for cubature weights.");
157 typedef Kokkos::pair<ordinal_type,ordinal_type> range_type;
162 const auto src = Kokkos::subdynrankview(cubData.
points_, pointRange, dimRange);
163 auto dst = Kokkos::subdynrankview(cubPoints, pointRange, dimRange);
165 Kokkos::deep_copy( dst, src );
168 const auto src = Kokkos::subdynrankview(cubData.
weights_, pointRange);
169 auto dst = Kokkos::subdynrankview(cubWeights, pointRange);
171 Kokkos::deep_copy(dst ,src);
180 typedef typename Cubature<ExecSpaceType,pointValueType,weightValueType>::PointViewType PointViewType;
181 typedef typename Cubature<ExecSpaceType,pointValueType,weightValueType>::weightViewType weightViewType;
188 weightViewType cubWeights )
const {
213 return "CubatureDirect";
230 CubatureDirect(
const CubatureDirect &b)
235 CubatureDirect(
const ordinal_type degree,
236 const ordinal_type dimension)
Kokkos::DynRankView< pointValueType, ExecSpaceType > points_
Array with the (X,Y,Z) coordinates of the cubature points.
weightValueType weights_[Parameters::MaxIntegrationPoints]
Array with the associated cubature weights.
Defines the base class for 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.
static constexpr ordinal_type MaxDimension
The maximum ambient space dimension.
ordinal_type numPoints_
Number of cubature points stored in the template.
virtual void getCubature(PointViewType cubPoints, weightViewType cubWeights) const
Returns cubature points and weights (return arrays must be pre-sized/pre-allocated).
virtual const char * getName() const
Returns cubature name.
CubatureData cubatureData_
Cubature data on device.
pointValueType points_[Parameters::MaxIntegrationPoints][Parameters::MaxDimension]
Array with the (X,Y,Z) coordinates of the cubature points.
Header file for the Intrepid2::Cubature class.
virtual ordinal_type getDimension() const
Returns dimension of integration domain.
static constexpr ordinal_type MaxIntegrationPoints
The maximum number of integration points for direct cubature rules.
ordinal_type degree_
The degree of polynomials that are integrated exactly by this cubature rule.
ordinal_type dimension_
Dimension of integration domain.
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. ...
ordinal_type numPoints_
Number of cubature points stored in the template.
Kokkos::DynRankView< weightValueType, ExecSpaceType > weights_
Array with the associated cubature weights.
virtual ordinal_type getNumPoints() const
Returns the number of cubature points.
virtual ordinal_type getAccuracy() const
Returns max. degree of polynomials that are integrated exactly. The return vector has size 1...