16 #ifndef __INTREPID2_CUBATURE_CONTROLVOLUME_SIDE_HPP__
17 #define __INTREPID2_CUBATURE_CONTROLVOLUME_SIDE_HPP__
19 #include "Intrepid2_ConfigDefs.hpp"
22 #include "Shards_CellTopology.hpp"
30 template<
typename DeviceType = void,
31 typename pointValueType = double,
32 typename weightValueType =
double>
34 :
public Cubature<DeviceType,pointValueType,weightValueType> {
37 template<
typename cubPointViewType,
38 typename cubWeightViewType,
39 typename subcvCoordViewType,
40 typename subcvSideNormalViewType,
43 cubPointViewType _cubPoints;
44 cubWeightViewType _cubWeights;
45 const subcvCoordViewType _subcvCoords;
46 const subcvSideNormalViewType _subcvSideNormals;
47 const mapViewType _sideMap;
49 KOKKOS_INLINE_FUNCTION
50 Functor( cubPointViewType cubPoints_,
51 cubWeightViewType cubWeights_,
52 subcvCoordViewType subcvCoords_,
53 subcvSideNormalViewType subcvSideNormals_,
54 mapViewType sideMap_ )
55 : _cubPoints(cubPoints_), _cubWeights(cubWeights_),
56 _subcvCoords(subcvCoords_), _subcvSideNormals(subcvSideNormals_), _sideMap(sideMap_) {}
58 KOKKOS_INLINE_FUNCTION
59 void operator()(
const ordinal_type cell)
const {
60 const ordinal_type numNodesPerCell = _cubPoints.extent(1);
61 const ordinal_type spaceDim = _cubPoints.extent(2);
63 const ordinal_type numNodesPerSide = _sideMap(0);
64 const ordinal_type numSubcvPoints = _subcvSideNormals.extent(2);
66 const ordinal_type sideDim = spaceDim - 1;
69 for (ordinal_type node=0;node<numNodesPerCell;++node) {
70 typename cubPointViewType::value_type val[3] = {};
71 for (ordinal_type j=0;j<numNodesPerSide;++j) {
72 for (ordinal_type i=0;i<spaceDim;++i)
73 val[i] += _subcvCoords(cell, node, _sideMap(j+1), i);
75 for (ordinal_type i=0;i<spaceDim;++i)
76 _cubPoints(cell, node, i) = (val[i]/numNodesPerSide);
80 for (ordinal_type node=0;node<numNodesPerCell;++node) {
81 for (ordinal_type i=0;i<spaceDim;++i) {
82 typename cubWeightViewType::value_type val = 0;
83 for (ordinal_type pt=0;pt<numSubcvPoints;++pt)
84 val += _subcvSideNormals(cell, node, pt, i)*pow(2,sideDim);
85 _cubWeights(cell, node, i) = val;
106 Kokkos::View<ordinal_type**,Kokkos::LayoutRight,DeviceType> sideNodeMap_;
107 Kokkos::DynRankView<pointValueType, DeviceType> sidePoints_;
110 typedef typename Cubature<DeviceType,pointValueType,weightValueType>::PointViewType PointViewType;
111 typedef typename Cubature<DeviceType,pointValueType,weightValueType>::weightViewType weightViewType;
125 weightViewType cubWeights,
126 PointViewType cellCoords)
const override;
149 return "CubatureControlVolumeSide";
Header file for the Intrepid2::CubatureControlVolume class.
Defines the base class for cubature (integration) rules in Intrepid.
Defines cubature (integration) rules over control volumes.
virtual const char * getName() const override
Returns cubature name.
virtual ordinal_type getDimension() const override
Returns dimension of integration domain.
virtual ordinal_type getNumPoints() const override
Returns the number of cubature points.
Header file for the Intrepid2::Cubature class.
shards::CellTopology subcvCellTopo_
The topology of the sub-control volume.
ordinal_type degree_
The degree of the polynomials that are integrated exactly.
virtual void getCubature(PointViewType cubPoints, weightViewType cubWeights, PointViewType cellCoords) const override
Returns cubature points and weights (return arrays must be pre-sized/pre-allocated).
shards::CellTopology primaryCellTopo_
The topology of the primary cell.
CubatureControlVolumeSide(const shards::CellTopology cellTopology)