49 #ifndef __INTREPID2_CUBATURE_CONTROLVOLUME_BOUNDARY_HPP__
50 #define __INTREPID2_CUBATURE_CONTROLVOLUME_BOUNDARY_HPP__
52 #include "Intrepid2_ConfigDefs.hpp"
55 #include "Shards_CellTopology.hpp"
69 template<
typename ExecSpaceType = void,
70 typename pointValueType = double,
71 typename weightValueType =
double>
73 :
public Cubature<ExecSpaceType,pointValueType,weightValueType> {
76 template<
typename cubPointViewType,
77 typename subcvCoordViewType,
80 cubPointViewType _cubPoints;
81 const subcvCoordViewType _subcvCoords;
82 const mapViewType _sideMap;
84 KOKKOS_INLINE_FUNCTION
85 Functor( cubPointViewType cubPoints_,
86 subcvCoordViewType subcvCoords_,
87 mapViewType sideMap_ )
88 : _cubPoints(cubPoints_),
89 _subcvCoords(subcvCoords_), _sideMap(sideMap_) {}
91 KOKKOS_INLINE_FUNCTION
92 void operator()(
const ordinal_type cell)
const {
93 const ordinal_type numNodesPerSide = _sideMap(0);
94 const ordinal_type spaceDim = _cubPoints.extent(1);
97 typename cubPointViewType::value_type val[3] = {};
98 for (ordinal_type j=0;j<numNodesPerSide;++j) {
99 for (ordinal_type i=0;i<spaceDim;++i)
100 val[i] += _subcvCoords(cell, _sideMap(j+1), i);
102 for (ordinal_type i=0;i<spaceDim;++i)
103 _cubPoints(cell, i) = (val[i]/numNodesPerSide);
127 Kokkos::View<ordinal_type**,Kokkos::HostSpace> boundarySidesHost_;
128 Kokkos::View<ordinal_type**,Kokkos::LayoutRight,ExecSpaceType> sideNodeMap_;
129 Kokkos::DynRankView<pointValueType, ExecSpaceType> sidePoints_;
132 typedef typename Cubature<ExecSpaceType,pointValueType,weightValueType>::pointViewType pointViewType;
133 typedef typename Cubature<ExecSpaceType,pointValueType,weightValueType>::weightViewType weightViewType;
147 weightViewType cubWeights,
148 pointViewType cellCoords)
const;
173 return "CubatureControlVolumeBoundary";
182 const ordinal_type sideIndex);