47 cubPointViewType _cubPoints;
48 cubWeightViewType _cubWeights;
49 const subcvCoordViewType _subcvCoords;
50 const subcvWeightViewType _subcvWeights;
51 const jacDetViewType _jacDets;
53 KOKKOS_INLINE_FUNCTION
54 Functor( cubPointViewType cubPoints_,
55 cubWeightViewType cubWeights_,
56 subcvCoordViewType subcvCoords_,
57 subcvWeightViewType subcvWeights_,
58 jacDetViewType jacDets_ )
59 : _cubPoints(cubPoints_), _cubWeights(cubWeights_),
60 _subcvCoords(subcvCoords_), _subcvWeights(subcvWeights_), _jacDets(jacDets_) {}
62 KOKKOS_INLINE_FUNCTION
63 void operator()(
const ordinal_type cell)
const {
64 const ordinal_type numNodesPerCell = _subcvCoords.extent(1);
65 const ordinal_type numNodesPerSubcv = _subcvCoords.extent(2);
66 const ordinal_type spaceDim = _subcvCoords.extent(3);
67 const ordinal_type numSubcvPoints = _subcvWeights.extent(0);
70 for (ordinal_type node=0;node<numNodesPerCell;++node) {
71 typename cubPointViewType::value_type val[3] = {};
72 for (ordinal_type subcv=0;subcv<numNodesPerSubcv;++subcv) {
73 for (ordinal_type i=0;i<spaceDim;++i)
74 val[i] += _subcvCoords(cell, node, subcv, i);
76 for (ordinal_type i=0;i<spaceDim;++i)
77 _cubPoints(cell, node, i) = (val[i]/numNodesPerSubcv);
81 for (ordinal_type node=0;node<numNodesPerCell;++node) {
82 typename cubWeightViewType::value_type val = 0;
83 for (ordinal_type pt=0;pt<numSubcvPoints;++pt)
84 val += _subcvWeights(pt)*_jacDets(cell, node, pt);
85 _cubWeights(cell, node) = val;