16 #ifndef __INTREPID2_HDIV_QUAD_IN_FEM_HPP__
17 #define __INTREPID2_HDIV_QUAD_IN_FEM_HPP__
36 template<EOperator opType>
38 template<
typename outputValueViewType,
39 typename inputPointViewType,
40 typename workViewType,
41 typename vinvViewType>
42 KOKKOS_INLINE_FUNCTION
44 getValues( outputValueViewType outputValues,
45 const inputPointViewType inputPoints,
47 const vinvViewType vinvLine,
48 const vinvViewType vinvBubble );
50 KOKKOS_INLINE_FUNCTION
52 getWorkSizePerPoint(ordinal_type order) {
53 return 2*getPnCardinality<1>(order)+getPnCardinality<1>(order-1);
57 template<
typename DeviceType, ordinal_type numPtsPerEval,
58 typename outputValueValueType,
class ...outputValueProperties,
59 typename inputPointValueType,
class ...inputPointProperties,
60 typename vinvValueType,
class ...vinvProperties>
62 getValues( Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValues,
63 const Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPoints,
64 const Kokkos::DynRankView<vinvValueType, vinvProperties...> vinvLine,
65 const Kokkos::DynRankView<vinvValueType, vinvProperties...> vinvBubble,
66 const EOperator operatorType );
71 template<
typename outputValueViewType,
72 typename inputPointViewType,
73 typename vinvViewType,
74 typename workViewType,
76 ordinal_type numPtsEval>
78 outputValueViewType _outputValues;
79 const inputPointViewType _inputPoints;
80 const vinvViewType _vinvLine;
81 const vinvViewType _vinvBubble;
84 KOKKOS_INLINE_FUNCTION
85 Functor( outputValueViewType outputValues_,
86 inputPointViewType inputPoints_,
87 vinvViewType vinvLine_,
88 vinvViewType vinvBubble_,
90 : _outputValues(outputValues_), _inputPoints(inputPoints_),
91 _vinvLine(vinvLine_), _vinvBubble(vinvBubble_), _work(work_) {}
93 KOKKOS_INLINE_FUNCTION
94 void operator()(
const size_type iter)
const {
98 const auto ptRange = Kokkos::pair<ordinal_type,ordinal_type>(ptBegin, ptEnd);
99 const auto input = Kokkos::subview( _inputPoints, ptRange, Kokkos::ALL() );
101 typename workViewType::pointer_type ptr = _work.data() + _work.extent(0)*ptBegin*get_dimension_scalar(_work);
103 auto vcprop = Kokkos::common_view_alloc_prop(_work);
104 workViewType work(Kokkos::view_wrap(ptr,vcprop), (ptEnd-ptBegin)*_work.extent(0));
107 case OPERATOR_VALUE : {
108 auto output = Kokkos::subview( _outputValues, Kokkos::ALL(), ptRange, Kokkos::ALL() );
112 case OPERATOR_DIV : {
113 auto output = Kokkos::subview( _outputValues, Kokkos::ALL(), ptRange );
118 INTREPID2_TEST_FOR_ABORT(
true,
119 ">>> ERROR: (Intrepid2::Basis_HDIV_QUAD_In_FEM::Functor) operator is not supported");
132 template<
typename DeviceType = void,
133 typename outputValueType = double,
134 typename pointValueType =
double>
136 :
public Basis<DeviceType,outputValueType,pointValueType> {
146 const EPointType pointType = POINTTYPE_EQUISPACED);
156 getValues( OutputViewType outputValues,
157 const PointViewType inputPoints,
158 const EOperator operatorType = OPERATOR_VALUE )
const override {
159 #ifdef HAVE_INTREPID2_DEBUG
160 Intrepid2::getValues_HDIV_Args(outputValues,
167 Impl::Basis_HDIV_QUAD_In_FEM::
168 getValues<DeviceType,numPtsPerEval>( outputValues,
176 getScratchSpaceSize( ordinal_type& perTeamSpaceSize,
177 ordinal_type& perThreadSpaceSize,
178 const PointViewType inputPointsconst,
179 const EOperator operatorType = OPERATOR_VALUE)
const override;
181 KOKKOS_INLINE_FUNCTION
184 OutputViewType outputValues,
185 const PointViewType inputPoints,
186 const EOperator operatorType,
187 const typename Kokkos::TeamPolicy<typename DeviceType::execution_space>::member_type& team_member,
188 const typename DeviceType::execution_space::scratch_memory_space & scratchStorage,
189 const ordinal_type subcellDim = -1,
190 const ordinal_type subcellOrdinal = -1)
const override;
194 getDofCoords( ScalarViewType dofCoords )
const override {
195 #ifdef HAVE_INTREPID2_DEBUG
197 INTREPID2_TEST_FOR_EXCEPTION( dofCoords.rank() != 2, std::invalid_argument,
198 ">>> ERROR: (Intrepid2::Basis_HDIV_QUAD_In_FEM::getDofCoords) rank = 2 required for dofCoords array");
200 INTREPID2_TEST_FOR_EXCEPTION( static_cast<ordinal_type>(dofCoords.extent(0)) != this->
getCardinality(), std::invalid_argument,
201 ">>> ERROR: (Intrepid2::Basis_HDIV_QUAD_In_FEM::getDofCoords) mismatch in number of dof and 0th dimension of dofCoords array");
203 INTREPID2_TEST_FOR_EXCEPTION( dofCoords.extent(1) != this->
getBaseCellTopology().getDimension(), std::invalid_argument,
204 ">>> ERROR: (Intrepid2::Basis_HDIV_QUAD_In_FEM::getDofCoords) incorrect reference cell (1st) dimension in dofCoords array");
206 Kokkos::deep_copy(dofCoords, this->
dofCoords_);
211 getDofCoeffs( ScalarViewType dofCoeffs )
const override {
212 #ifdef HAVE_INTREPID2_DEBUG
214 INTREPID2_TEST_FOR_EXCEPTION( dofCoeffs.rank() != 2, std::invalid_argument,
215 ">>> ERROR: (Intrepid2::Basis_HDIV_QUAD_In_FEM::getDofCoeffs) rank = 2 required for dofCoeffs array");
217 INTREPID2_TEST_FOR_EXCEPTION( static_cast<ordinal_type>(dofCoeffs.extent(0)) != this->
getCardinality(), std::invalid_argument,
218 ">>> ERROR: (Intrepid2::Basis_HDIV_QUAD_In_FEM::getDofCoeffs) mismatch in number of dof and 0th dimension of dofCoeffs array");
220 INTREPID2_TEST_FOR_EXCEPTION( dofCoeffs.extent(1) != this->
getBaseCellTopology().getDimension(), std::invalid_argument,
221 ">>> ERROR: (Intrepid2::Basis_HDIV_QUAD_In_FEM::getDofCoeffs) incorrect reference cell (1st) dimension in dofCoeffs array");
223 Kokkos::deep_copy(dofCoeffs, this->
dofCoeffs_);
229 return "Intrepid2_HDIV_QUAD_In_FEM";
247 BasisPtr<DeviceType,outputValueType,pointValueType>
250 return Teuchos::rcp(
new
254 INTREPID2_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
"Input parameters out of bounds");
257 BasisPtr<typename Kokkos::HostSpace::device_type,outputValueType,pointValueType>
264 Kokkos::DynRankView<typename ScalarViewType::value_type,DeviceType>
vinvLine_, vinvBubble_;
265 EPointType pointType_;
Header file for the Intrepid2::Basis_HGRAD_LINE_Cn_FEM class.
Kokkos::View< ordinal_type *, typename ExecutionSpace::array_layout, Kokkos::HostSpace > OrdinalTypeArray1DHost
View type for 1d host array.
Definition file for FEM basis functions of degree n for H(div) functions on QUAD cells.
Implementation of the default H(div)-compatible FEM basis on Quadrilateral cell.
ordinal_type getCardinality() const
Returns cardinality of the basis.
BasisPtr< typename Kokkos::HostSpace::device_type, outputValueType, pointValueType > getHostBasis() const override
Creates and returns a Basis object whose DeviceType template argument is Kokkos::HostSpace::device_ty...
virtual bool requireOrientation() const override
True if orientation is required.
BasisPtr< DeviceType, outputValueType, pointValueType > getSubCellRefBasis(const ordinal_type subCellDim, const ordinal_type subCellOrd) const override
returns the basis associated to a subCell.
An abstract base class that defines interface for concrete basis implementations for Finite Element (...
shards::CellTopology getBaseCellTopology() const
Returns the base cell topology for which the basis is defined. See Shards documentation https://trili...
Kokkos::DynRankView< scalarType, Kokkos::LayoutStride, DeviceType > ScalarViewType
View type for scalars.
See Intrepid2::Basis_HDIV_QUAD_In_FEM.
Kokkos::DynRankView< typename ScalarViewType::value_type, DeviceType > vinvLine_
inverse of Generalized Vandermonde matrix (isotropic order)
See Intrepid2::Basis_HDIV_QUAD_In_FEM.
ordinal_type basisDegree_
Degree of the largest complete polynomial space that can be represented by the basis.
virtual KOKKOS_INLINE_FUNCTION void getValues(OutputViewType, const PointViewType, const EOperator, const typename Kokkos::TeamPolicy< ExecutionSpace >::member_type &teamMember, const typename ExecutionSpace::scratch_memory_space &scratchStorage, const ordinal_type subcellDim=-1, const ordinal_type subcellOrdinal=-1) const
Team-level evaluation of basis functions on a reference cell.
virtual const char * getName() const override
Returns basis name.
Header file for the Intrepid2::Basis_HVOL_LINE_Cn_FEM class.
Kokkos::View< ordinal_type **, typename ExecutionSpace::array_layout, Kokkos::HostSpace > OrdinalTypeArray2DHost
View type for 2d host array.
static constexpr ordinal_type MaxNumPtsPerBasisEval
The maximum number of points to eval in serial mode.
Kokkos::DynRankView< OutputValueType, Kokkos::LayoutStride, DeviceType > OutputViewType
View type for basis value output.
Implementation of the locally HVOL-compatible FEM basis of variable order on the [-1,1] reference line cell, using Lagrange polynomials.
Kokkos::View< ordinal_type ***, typename ExecutionSpace::array_layout, Kokkos::HostSpace > OrdinalTypeArray3DHost
View type for 3d host array.
Kokkos::DynRankView< scalarType, DeviceType > dofCoeffs_
Coefficients for computing degrees of freedom for Lagrangian basis If P is an element of the space sp...
Basis_HDIV_QUAD_In_FEM(const ordinal_type order, const EPointType pointType=POINTTYPE_EQUISPACED)
Constructor.
See Intrepid2::Basis_HDIV_QUAD_In_FEM.
Kokkos::DynRankView< scalarType, DeviceType > dofCoords_
Coordinates of degrees-of-freedom for basis functions defined in physical space.
Kokkos::DynRankView< PointValueType, Kokkos::LayoutStride, DeviceType > PointViewType
View type for input points.
Header file for the abstract base class Intrepid2::Basis.