16 #ifndef __INTREPID2_CUBATURE_CONTROLVOLUME_BOUNDARY_HPP__
17 #define __INTREPID2_CUBATURE_CONTROLVOLUME_BOUNDARY_HPP__
19 #include "Intrepid2_ConfigDefs.hpp"
22 #include "Shards_CellTopology.hpp"
36 template<
typename DeviceType = void,
37 typename pointValueType = double,
38 typename weightValueType =
double>
40 :
public Cubature<DeviceType,pointValueType,weightValueType> {
43 template<
typename cubPointViewType,
44 typename subcvCoordViewType,
47 cubPointViewType _cubPoints;
48 const subcvCoordViewType _subcvCoords;
49 const mapViewType _sideMap;
51 KOKKOS_INLINE_FUNCTION
52 Functor( cubPointViewType cubPoints_,
53 subcvCoordViewType subcvCoords_,
54 mapViewType sideMap_ )
55 : _cubPoints(cubPoints_),
56 _subcvCoords(subcvCoords_), _sideMap(sideMap_) {}
58 KOKKOS_INLINE_FUNCTION
59 void operator()(
const ordinal_type cell)
const {
60 const ordinal_type numNodesPerSide = _sideMap(0);
61 const ordinal_type spaceDim = _cubPoints.extent(1);
64 typename cubPointViewType::value_type val[3] = {};
65 for (ordinal_type j=0;j<numNodesPerSide;++j) {
66 for (ordinal_type i=0;i<spaceDim;++i)
67 val[i] += _subcvCoords(cell, _sideMap(j+1), i);
69 for (ordinal_type i=0;i<spaceDim;++i)
70 _cubPoints(cell, i) = (val[i]/numNodesPerSide);
94 Kokkos::View<ordinal_type**,Kokkos::HostSpace> boundarySidesHost_;
95 Kokkos::View<ordinal_type**,Kokkos::LayoutRight,DeviceType> sideNodeMap_;
96 Kokkos::DynRankView<pointValueType, DeviceType> sidePoints_;
99 typedef typename Cubature<DeviceType,pointValueType,weightValueType>::PointViewType PointViewType;
100 typedef typename Cubature<DeviceType,pointValueType,weightValueType>::weightViewType weightViewType;
114 weightViewType cubWeights,
115 PointViewType cellCoords)
const override;
140 return "CubatureControlVolumeBoundary";
149 const ordinal_type sideIndex);
Defines the base class for cubature (integration) rules in Intrepid.
ordinal_type degree_
The degree of the polynomials that are integrated exactly.
virtual ordinal_type getNumPoints() const override
Returns the number of cubature points.
Defines cubature (integration) rules over Neumann boundaries for control volume method.
ordinal_type sideIndex_
Index of cell side.
CubatureControlVolumeBoundary(const shards::CellTopology cellTopology, const ordinal_type sideIndex)
Header file for the Intrepid2::Cubature class.
Definition file for the Intrepid2::CubatureControlVolumeBoundary class.
virtual const char * getName() const override
Returns cubature name.
virtual void getCubature(PointViewType cubPoints, weightViewType cubWeights, PointViewType cellCoords) const override
Returns cubature points and weights (return arrays must be pre-sized/pre-allocated).
virtual ordinal_type getDimension() const override
Returns dimension of integration domain.
shards::CellTopology subcvCellTopo_
The topology of the sub-control volume.
shards::CellTopology primaryCellTopo_
The topology of the primary cell side.