Intrepid2
Intrepid2_CubatureTensorPyrDef.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Intrepid2 Package
4 //
5 // Copyright 2007 NTESS and the Intrepid2 contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
16 #ifndef __INTREPID2_CUBATURE_TENSOR_PYR_DEF_HPP__
17 #define __INTREPID2_CUBATURE_TENSOR_PYR_DEF_HPP__
18 
19 namespace Intrepid2 {
20 
21  template<typename DT, typename PT, typename WT>
22  template<typename cubPointValueType, class ...cubPointProperties,
23  typename cubWeightValueType, class ...cubWeightProperties>
24  void
25  CubatureTensorPyr<DT,PT,WT>::
26  getCubatureImpl( Kokkos::DynRankView<cubPointValueType, cubPointProperties...> cubPoints,
27  Kokkos::DynRankView<cubWeightValueType,cubWeightProperties...> cubWeights ) const {
28 #ifdef HAVE_INTREPID2_DEBUG
29  // check size of cubPoints and cubWeights
30  INTREPID2_TEST_FOR_EXCEPTION( static_cast<ordinal_type>(cubPoints.extent(0)) < this->getNumPoints() ||
31  static_cast<ordinal_type>(cubPoints.extent(1)) < this->getDimension() ||
32  static_cast<ordinal_type>(cubWeights.extent(0)) < this->getNumPoints(), std::out_of_range,
33  ">>> ERROR (CubatureTensor): Insufficient space allocated for cubature points or weights.");
34 #endif
35  CubatureTensor<DT,PT,WT>::getCubatureImpl( cubPoints, cubWeights );
36 
37  typedef Kokkos::DynRankView<cubPointValueType, cubPointProperties...> cubPointViewType;
38  typedef Kokkos::DynRankView<cubWeightValueType,cubWeightProperties...> cubWeightViewType;
39 
40  const auto loopSize = this->getNumPoints();
41  Kokkos::RangePolicy<ExecSpaceType,Kokkos::Schedule<Kokkos::Static> > policy(0, loopSize);
42 
43  typedef Functor<cubPointViewType, cubWeightViewType> FunctorType;
44  Kokkos::parallel_for( policy, FunctorType(cubPoints, cubWeights) );
45  }
46 
47 }
48 
49 #endif
void getCubatureImpl(Kokkos::DynRankView< cubPointValueType, cubPointProperties...> cubPoints, Kokkos::DynRankView< cubWeightValueType, cubWeightProperties...> cubWeights) const