48 #ifndef __INTREPID2_HDIV_TRI_I1_FEM_DEF_HPP__
49 #define __INTREPID2_HDIV_TRI_I1_FEM_DEF_HPP__
56 template<EOperator opType>
57 template<
typename OutputViewType,
58 typename inputViewType>
59 KOKKOS_INLINE_FUNCTION
61 Basis_HDIV_TRI_I1_FEM::Serial<opType>::
62 getValues( OutputViewType output,
63 const inputViewType input ) {
65 case OPERATOR_VALUE: {
66 const auto x = input(0);
67 const auto y = input(1);
70 output.access(0, 0) = x;
71 output.access(0, 1) = y - 1.0;
73 output.access(1, 0) = x;
74 output.access(1, 1) = y;
76 output.access(2, 0) = x - 1.0;
77 output.access(2, 1) = y;
88 INTREPID2_TEST_FOR_ABORT( opType != OPERATOR_VALUE &&
89 opType != OPERATOR_DIV,
90 ">>> ERROR: (Intrepid2::Basis_HDIV_TRI_I1_FEM::Serial::getValues) operator is not supported");
96 template<
typename SpT,
97 typename outputValueValueType,
class ...outputValueProperties,
98 typename inputPointValueType,
class ...inputPointProperties>
100 Basis_HDIV_TRI_I1_FEM::
101 getValues( Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValues,
102 const Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPoints,
103 const EOperator operatorType ) {
104 typedef Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValueViewType;
105 typedef Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPointViewType;
106 typedef typename ExecSpace<typename inputPointViewType::execution_space,SpT>::ExecSpaceType ExecSpaceType;
109 const auto loopSize = inputPoints.extent(0);
110 Kokkos::RangePolicy<ExecSpaceType,Kokkos::Schedule<Kokkos::Static> > policy(0, loopSize);
112 switch (operatorType) {
113 case OPERATOR_VALUE: {
114 typedef Functor<outputValueViewType,inputPointViewType,OPERATOR_VALUE> FunctorType;
115 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints) );
119 typedef Functor<outputValueViewType,inputPointViewType,OPERATOR_DIV> FunctorType;
120 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints) );
123 case OPERATOR_CURL: {
124 INTREPID2_TEST_FOR_EXCEPTION( (operatorType == OPERATOR_CURL), std::invalid_argument,
125 ">>> ERROR (Basis_HDIV_TRI_I1_FEM): CURL is invalid operator for HDIV Basis Functions");
129 case OPERATOR_GRAD: {
130 INTREPID2_TEST_FOR_EXCEPTION( (operatorType == OPERATOR_GRAD), std::invalid_argument,
131 ">>> ERROR (Basis_HDIV_TRI_I1_FEM): GRAD is invalid operator for HDIV Basis Functions");
144 INTREPID2_TEST_FOR_EXCEPTION( ( (operatorType == OPERATOR_D1) &&
145 (operatorType == OPERATOR_D2) &&
146 (operatorType == OPERATOR_D3) &&
147 (operatorType == OPERATOR_D4) &&
148 (operatorType == OPERATOR_D5) &&
149 (operatorType == OPERATOR_D6) &&
150 (operatorType == OPERATOR_D7) &&
151 (operatorType == OPERATOR_D8) &&
152 (operatorType == OPERATOR_D9) &&
153 (operatorType == OPERATOR_D10) ),
154 std::invalid_argument,
155 ">>> ERROR (Basis_HDIV_TRI_I1_FEM): Invalid operator type");
159 INTREPID2_TEST_FOR_EXCEPTION( ( (operatorType != OPERATOR_VALUE) &&
160 (operatorType != OPERATOR_GRAD) &&
161 (operatorType != OPERATOR_CURL) &&
162 (operatorType != OPERATOR_DIV) &&
163 (operatorType != OPERATOR_D1) &&
164 (operatorType != OPERATOR_D2) &&
165 (operatorType != OPERATOR_D3) &&
166 (operatorType != OPERATOR_D4) &&
167 (operatorType != OPERATOR_D5) &&
168 (operatorType != OPERATOR_D6) &&
169 (operatorType != OPERATOR_D7) &&
170 (operatorType != OPERATOR_D8) &&
171 (operatorType != OPERATOR_D9) &&
172 (operatorType != OPERATOR_D10) ),
173 std::invalid_argument,
174 ">>> ERROR (Basis_HDIV_TRI_I1_FEM): Invalid operator type");
181 template<
typename SpT,
typename OT,
typename PT>
184 this->basisCardinality_ = 3;
185 this->basisDegree_ = 1;
186 this->basisCellTopology_ = shards::CellTopology(shards::getCellTopologyData<shards::Triangle<3> >() );
187 this->basisType_ = BASIS_FEM_DEFAULT;
188 this->basisCoordinates_ = COORDINATES_CARTESIAN;
189 this->functionSpace_ = FUNCTION_SPACE_HDIV;
194 const ordinal_type tagSize = 4;
195 const ordinal_type posScDim = 0;
196 const ordinal_type posScOrd = 1;
197 const ordinal_type posDfOrd = 2;
200 ordinal_type tags[12] = { 1, 0, 0, 1,
210 this->setOrdinalTagData(this->tagToOrdinal_,
213 this->basisCardinality_,
227 Kokkos::DynRankView<typename ScalarViewType::value_type,typename SpT::array_layout,Kokkos::HostSpace>
228 dofCoords(
"dofCoordsHost", this->basisCardinality_,this->basisCellTopology_.getDimension());
230 dofCoords(0,0) = 0.5; dofCoords(0,1) = 0.0;
231 dofCoords(1,0) = 0.5; dofCoords(1,1) = 0.5;
232 dofCoords(2,0) = 0.0; dofCoords(2,1) = 0.5;
234 this->dofCoords_ = Kokkos::create_mirror_view(
typename SpT::memory_space(), dofCoords);
235 Kokkos::deep_copy(this->dofCoords_, dofCoords);
238 Kokkos::DynRankView<typename ScalarViewType::value_type,typename SpT::array_layout,Kokkos::HostSpace>
239 dofCoeffs(
"dofCoeffsHost", this->basisCardinality_,this->basisCellTopology_.getDimension());
242 dofCoeffs(0,0) = 0.0; dofCoeffs(0,1) = -1.0;
243 dofCoeffs(1,0) = 1.0; dofCoeffs(1,1) = 1.0;
244 dofCoeffs(2,0) = -1.0; dofCoeffs(2,1) = 0.0;
246 this->dofCoeffs_ = Kokkos::create_mirror_view(
typename SpT::memory_space(), dofCoeffs); Kokkos::deep_copy(this->dofCoeffs_, dofCoeffs);
Kokkos::View< ordinal_type *, typename ExecSpaceType::array_layout, Kokkos::HostSpace > OrdinalTypeArray1DHost
View type for 1d host array.
Basis_HDIV_TRI_I1_FEM()
Constructor.