16 #ifndef __INTREPID2_HCURL_HEX_IN_FEM_HPP__
17 #define __INTREPID2_HCURL_HEX_IN_FEM_HPP__
31 typedef struct Hexahedron<8> cell_topology_type;
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) {
55 return 3*getPnCardinality<1>(order)+getPnCardinality<1>(order-1);
57 return 5*getPnCardinality<1>(order)+getPnCardinality<1>(order-1);
59 INTREPID2_TEST_FOR_ABORT(
true,
60 ">>> ERROR: (Intrepid2::Basis_HCURL_HEX_In_FEM::Serial::getWorkSizePerPoint) operator is not supported" );
67 template<
typename DeviceType, ordinal_type numPtsPerEval,
68 typename outputValueValueType,
class ...outputValueProperties,
69 typename inputPointValueType,
class ...inputPointProperties,
70 typename vinvValueType,
class ...vinvProperties>
72 getValues( Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValues,
73 const Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPoints,
74 const Kokkos::DynRankView<vinvValueType, vinvProperties...> vinvLine,
75 const Kokkos::DynRankView<vinvValueType, vinvProperties...> vinvBubble,
76 const EOperator operatorType );
81 template<
typename outputValueViewType,
82 typename inputPointViewType,
83 typename vinvViewType,
84 typename workViewType,
86 ordinal_type numPtsEval>
88 outputValueViewType _outputValues;
89 const inputPointViewType _inputPoints;
90 const vinvViewType _vinvLine;
91 const vinvViewType _vinvBubble;
94 KOKKOS_INLINE_FUNCTION
95 Functor( outputValueViewType outputValues_,
96 inputPointViewType inputPoints_,
97 vinvViewType vinvLine_,
98 vinvViewType vinvBubble_,
100 : _outputValues(outputValues_), _inputPoints(inputPoints_),
101 _vinvLine(vinvLine_), _vinvBubble(vinvBubble_), _work(work_) {}
103 KOKKOS_INLINE_FUNCTION
104 void operator()(
const size_type iter)
const {
108 const auto ptRange = Kokkos::pair<ordinal_type,ordinal_type>(ptBegin, ptEnd);
109 const auto input = Kokkos::subview( _inputPoints, ptRange, Kokkos::ALL() );
111 typename workViewType::pointer_type ptr = _work.data() + _work.extent(0)*ptBegin*get_dimension_scalar(_work);
113 auto vcprop = Kokkos::common_view_alloc_prop(_work);
114 workViewType work(Kokkos::view_wrap(ptr,vcprop), (ptEnd-ptBegin)*_work.extent(0));
117 case OPERATOR_VALUE : {
118 auto output = Kokkos::subview( _outputValues, Kokkos::ALL(), ptRange, Kokkos::ALL() );
122 case OPERATOR_CURL : {
123 auto output = Kokkos::subview( _outputValues, Kokkos::ALL(), ptRange, Kokkos::ALL() );
128 INTREPID2_TEST_FOR_ABORT(
true,
129 ">>> ERROR: (Intrepid2::Basis_HCURL_HEX_In_FEM::Functor) operator is not supported." );
145 template<
typename DeviceType = void,
146 typename outputValueType = double,
147 typename pointValueType =
double>
149 :
public Basis<DeviceType,outputValueType,pointValueType> {
159 const EPointType pointType = POINTTYPE_EQUISPACED);
169 getValues( OutputViewType outputValues,
170 const PointViewType inputPoints,
171 const EOperator operatorType = OPERATOR_VALUE )
const override {
172 #ifdef HAVE_INTREPID2_DEBUG
173 Intrepid2::getValues_HCURL_Args(outputValues,
179 constexpr ordinal_type numPtsPerEval = 1;
180 Impl::Basis_HCURL_HEX_In_FEM::
181 getValues<DeviceType,numPtsPerEval>( outputValues,
189 getScratchSpaceSize( ordinal_type& perTeamSpaceSize,
190 ordinal_type& perThreadSpaceSize,
191 const PointViewType inputPointsconst,
192 const EOperator operatorType = OPERATOR_VALUE)
const override;
194 KOKKOS_INLINE_FUNCTION
197 OutputViewType outputValues,
198 const PointViewType inputPoints,
199 const EOperator operatorType,
200 const typename Kokkos::TeamPolicy<typename DeviceType::execution_space>::member_type& team_member,
201 const typename DeviceType::execution_space::scratch_memory_space & scratchStorage,
202 const ordinal_type subcellDim = -1,
203 const ordinal_type subcellOrdinal = -1)
const override;
207 getDofCoords( ScalarViewType dofCoords )
const override {
208 #ifdef HAVE_INTREPID2_DEBUG
210 INTREPID2_TEST_FOR_EXCEPTION( dofCoords.rank() != 2, std::invalid_argument,
211 ">>> ERROR: (Intrepid2::Basis_HCURL_HEX_In_FEM::getDofCoords) rank = 2 required for dofCoords array");
213 INTREPID2_TEST_FOR_EXCEPTION( static_cast<ordinal_type>(dofCoords.extent(0)) != this->
getCardinality(), std::invalid_argument,
214 ">>> ERROR: (Intrepid2::Basis_HCURL_HEX_In_FEM::getDofCoords) mismatch in number of dof and 0th dimension of dofCoords array");
216 INTREPID2_TEST_FOR_EXCEPTION( dofCoords.extent(1) != this->
getBaseCellTopology().getDimension(), std::invalid_argument,
217 ">>> ERROR: (Intrepid2::Basis_HCURL_HEX_In_FEM::getDofCoords) incorrect reference cell (1st) dimension in dofCoords array");
219 Kokkos::deep_copy(dofCoords, this->
dofCoords_);
224 getDofCoeffs( ScalarViewType dofCoeffs )
const override {
225 #ifdef HAVE_INTREPID2_DEBUG
227 INTREPID2_TEST_FOR_EXCEPTION( dofCoeffs.rank() != 2, std::invalid_argument,
228 ">>> ERROR: (Intrepid2::Basis_HCURL_HEX_In_FEM::getDofCoeffs) rank = 2 required for dofCoeffs array");
230 INTREPID2_TEST_FOR_EXCEPTION( static_cast<ordinal_type>(dofCoeffs.extent(0)) != this->
getCardinality(), std::invalid_argument,
231 ">>> ERROR: (Intrepid2::Basis_HCURL_HEX_In_FEM::getDofCoeffs) mismatch in number of dof and 0th dimension of dofCoeffs array");
233 INTREPID2_TEST_FOR_EXCEPTION( dofCoeffs.extent(1) != this->
getBaseCellTopology().getDimension(), std::invalid_argument,
234 ">>> ERROR: (Intrepid2::Basis_HCURL_HEX_In_FEM::getDofCoeffs) incorrect reference cell (1st) dimension in dofCoeffs array");
236 Kokkos::deep_copy(dofCoeffs, this->
dofCoeffs_);
242 return "Intrepid2_HCURL_HEX_In_FEM";
260 BasisPtr<DeviceType,outputValueType,pointValueType>
262 if(subCellDim == 1) {
263 return Teuchos::rcp(
new
266 }
else if(subCellDim == 2) {
267 return Teuchos::rcp(
new
271 INTREPID2_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
"Input parameters out of bounds");
274 BasisPtr<typename Kokkos::HostSpace::device_type,outputValueType,pointValueType>
282 Kokkos::DynRankView<typename ScalarViewType::value_type,DeviceType>
vinvLine_, vinvBubble_;
Kokkos::View< ordinal_type *, typename ExecutionSpace::array_layout, Kokkos::HostSpace > OrdinalTypeArray1DHost
View type for 1d host array.
EPointType pointType_
type of lattice used for creating the DoF coordinates
ordinal_type getCardinality() const
Returns cardinality of the basis.
Implementation of the default H(curl)-compatible FEM basis on Quadrilateral cell. ...
Definition file for FEM basis functions of degree n for H(curl) functions on HEX cells.
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...
See Intrepid2::Basis_HCURL_HEX_In_FEM.
Kokkos::DynRankView< scalarType, Kokkos::LayoutStride, DeviceType > ScalarViewType
View type for scalars.
See Intrepid2::Basis_HCURL_HEX_In_FEM.
virtual const char * getName() const override
Returns basis name.
Implementation of the default H(curl)-compatible FEM basis on Hexahedron cell.
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.
Kokkos::View< ordinal_type **, typename ExecutionSpace::array_layout, Kokkos::HostSpace > OrdinalTypeArray2DHost
View type for 2d host array.
BasisPtr< DeviceType, outputValueType, pointValueType > getSubCellRefBasis(const ordinal_type subCellDim, const ordinal_type subCellOrd) const override
returns the basis associated to a subCell.
Kokkos::DynRankView< OutputValueType, Kokkos::LayoutStride, DeviceType > OutputViewType
View type for basis value output.
See Intrepid2::Basis_HCURL_HEX_In_FEM.
Header file for the Intrepid2::Basis_HCURL_QUAD_In_FEM class.
Kokkos::DynRankView< typename ScalarViewType::value_type, DeviceType > vinvLine_
inverse of Generalized Vandermonde matrix (isotropic order)
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.
Basis_HCURL_HEX_In_FEM(const ordinal_type order, const EPointType pointType=POINTTYPE_EQUISPACED)
Constructor.
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...
Kokkos::DynRankView< scalarType, DeviceType > dofCoeffs_
Coefficients for computing degrees of freedom for Lagrangian basis If P is an element of the space sp...
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.
virtual bool requireOrientation() const override
True if orientation is required.
Header file for the abstract base class Intrepid2::Basis.