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);
Defines the base class for cubature (integration) rules in Intrepid.
shards::CellTopology primaryCellTopo_
The topology of the primary cell side.
Defines cubature (integration) rules over Neumann boundaries for control volume method.
CubatureControlVolumeBoundary(const shards::CellTopology cellTopology, const ordinal_type sideIndex)
virtual ordinal_type getNumPoints() const
Returns the number of cubature points.
virtual ordinal_type getDimension() const
Returns dimension of integration domain.
Header file for the Intrepid2::Cubature class.
Definition file for the Intrepid2::CubatureControlVolumeBoundary class.
virtual const char * getName() const
Returns cubature name.
ordinal_type sideIndex_
Index of cell side.
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
Returns cubature points and weights (return arrays must be pre-sized/pre-allocated).