49 #ifndef __INTREPID2_CUBATURE_CONTROLVOLUME_SIDE_HPP__
50 #define __INTREPID2_CUBATURE_CONTROLVOLUME_SIDE_HPP__
52 #include "Intrepid2_ConfigDefs.hpp"
55 #include "Shards_CellTopology.hpp"
63 template<
typename ExecSpaceType = void,
64 typename pointValueType = double,
65 typename weightValueType =
double>
67 :
public Cubature<ExecSpaceType,pointValueType,weightValueType> {
70 template<
typename cubPointViewType,
71 typename cubWeightViewType,
72 typename subcvCoordViewType,
73 typename subcvSideNormalViewType,
76 cubPointViewType _cubPoints;
77 cubWeightViewType _cubWeights;
78 const subcvCoordViewType _subcvCoords;
79 const subcvSideNormalViewType _subcvSideNormals;
80 const mapViewType _sideMap;
82 KOKKOS_INLINE_FUNCTION
83 Functor( cubPointViewType cubPoints_,
84 cubWeightViewType cubWeights_,
85 subcvCoordViewType subcvCoords_,
86 subcvSideNormalViewType subcvSideNormals_,
87 mapViewType sideMap_ )
88 : _cubPoints(cubPoints_), _cubWeights(cubWeights_),
89 _subcvCoords(subcvCoords_), _subcvSideNormals(subcvSideNormals_), _sideMap(sideMap_) {}
91 KOKKOS_INLINE_FUNCTION
92 void operator()(
const ordinal_type cell)
const {
93 const ordinal_type numNodesPerCell = _cubPoints.extent(1);
94 const ordinal_type spaceDim = _cubPoints.extent(2);
96 const ordinal_type numNodesPerSide = _sideMap(0);
97 const ordinal_type numSubcvPoints = _subcvSideNormals.extent(2);
99 const ordinal_type sideDim = spaceDim - 1;
102 for (ordinal_type node=0;node<numNodesPerCell;++node) {
103 typename cubPointViewType::value_type val[3] = {};
104 for (ordinal_type j=0;j<numNodesPerSide;++j) {
105 for (ordinal_type i=0;i<spaceDim;++i)
106 val[i] += _subcvCoords(cell, node, _sideMap(j+1), i);
108 for (ordinal_type i=0;i<spaceDim;++i)
109 _cubPoints(cell, node, i) = (val[i]/numNodesPerSide);
113 for (ordinal_type node=0;node<numNodesPerCell;++node) {
114 for (ordinal_type i=0;i<spaceDim;++i) {
115 typename cubWeightViewType::value_type val = 0;
116 for (ordinal_type pt=0;pt<numSubcvPoints;++pt)
117 val += _subcvSideNormals(cell, node, pt, i)*pow(2,sideDim);
118 _cubWeights(cell, node, i) = val;
139 Kokkos::View<ordinal_type**,Kokkos::LayoutRight,ExecSpaceType> sideNodeMap_;
140 Kokkos::DynRankView<pointValueType, ExecSpaceType> sidePoints_;
143 typedef typename Cubature<ExecSpaceType,pointValueType,weightValueType>::PointViewType PointViewType;
144 typedef typename Cubature<ExecSpaceType,pointValueType,weightValueType>::weightViewType weightViewType;
158 weightViewType cubWeights,
159 PointViewType cellCoords)
const;
182 return "CubatureControlVolumeSide";
Header file for the Intrepid2::CubatureControlVolume class.
Defines the base class for cubature (integration) rules in Intrepid.
virtual const char * getName() const
Returns cubature name.
ordinal_type degree_
The degree of the polynomials that are integrated exactly.
Defines cubature (integration) rules over control volumes.
virtual void getCubature(PointViewType cubPoints, weightViewType cubWeights, PointViewType cellCoords) const
Returns cubature points and weights (return arrays must be pre-sized/pre-allocated).
shards::CellTopology primaryCellTopo_
The topology of the primary cell.
Header file for the Intrepid2::Cubature class.
shards::CellTopology subcvCellTopo_
The topology of the sub-control volume.
virtual ordinal_type getDimension() const
Returns dimension of integration domain.
virtual ordinal_type getNumPoints() const
Returns the number of cubature points.
CubatureControlVolumeSide(const shards::CellTopology cellTopology)