49 #ifndef __INTREPID2_HCURL_TRI_I1_FEM_DEF_HPP__
50 #define __INTREPID2_HCURL_TRI_I1_FEM_DEF_HPP__
57 template<EOperator opType>
58 template<
typename outputViewType,
59 typename inputViewType>
60 KOKKOS_INLINE_FUNCTION
62 Basis_HCURL_TRI_I1_FEM::Serial<opType>::
63 getValues( outputViewType output,
64 const inputViewType input ) {
66 case OPERATOR_VALUE: {
67 const auto x = input(0);
68 const auto y = input(1);
71 output.access(0, 0) = 1.0 - y;
72 output.access(0, 1) = x;
74 output.access(1, 0) = -y;
75 output.access(1, 1) = x;
77 output.access(2, 0) = -y;
78 output.access(2, 1) = -1.0 + x;
83 output.access(0) = 2.0;
84 output.access(1) = 2.0;
85 output.access(2) = 2.0;
90 INTREPID2_TEST_FOR_ABORT( opType != OPERATOR_VALUE &&
91 opType != OPERATOR_CURL,
92 ">>> ERROR: (Intrepid2::Basis_HCURL_TRI_I1_FEM::Serial::getValues) operator is not supported");
97 template<
typename SpT,
98 typename outputValueValueType,
class ...outputValueProperties,
99 typename inputPointValueType,
class ...inputPointProperties>
101 Basis_HCURL_TRI_I1_FEM::
102 getValues( Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValues,
103 const Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPoints,
104 const EOperator operatorType ) {
105 typedef Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValueViewType;
106 typedef Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPointViewType;
107 typedef typename ExecSpace<typename inputPointViewType::execution_space,SpT>::ExecSpaceType ExecSpaceType;
110 const auto loopSize = inputPoints.extent(0);
111 Kokkos::RangePolicy<ExecSpaceType,Kokkos::Schedule<Kokkos::Static> > policy(0, loopSize);
113 switch (operatorType) {
114 case OPERATOR_VALUE: {
115 typedef Functor<outputValueViewType,inputPointViewType,OPERATOR_VALUE> FunctorType;
116 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints) );
119 case OPERATOR_CURL: {
120 typedef Functor<outputValueViewType,inputPointViewType,OPERATOR_CURL> FunctorType;
121 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints) );
125 INTREPID2_TEST_FOR_EXCEPTION( (operatorType == OPERATOR_DIV), std::invalid_argument,
126 ">>> ERROR (Basis_HCURL_TRI_I1_FEM): DIV is invalid operator for HCURL Basis Functions");
129 case OPERATOR_GRAD: {
130 INTREPID2_TEST_FOR_EXCEPTION( (operatorType == OPERATOR_GRAD), std::invalid_argument,
131 ">>> ERROR (Basis_HCURL_TRI_I1_FEM): GRAD is invalid operator for HCURL 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_HCURL_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_HCURL_TRI_I1_FEM): Invalid operator type");
180 template<
typename SpT,
typename OT,
typename PT >
183 this->basisCardinality_ = 3;
184 this->basisDegree_ = 1;
185 this->basisCellTopology_ = shards::CellTopology(shards::getCellTopologyData<shards::Triangle<3> >() );
186 this->basisType_ = BASIS_FEM_DEFAULT;
187 this->basisCoordinates_ = COORDINATES_CARTESIAN;
192 const ordinal_type tagSize = 4;
193 const ordinal_type posScDim = 0;
194 const ordinal_type posScOrd = 1;
195 const ordinal_type posDfOrd = 2;
198 ordinal_type tags[12] = {
207 this->setOrdinalTagData(this->tagToOrdinal_,
210 this->basisCardinality_,
218 Kokkos::DynRankView<typename scalarViewType::value_type,typename SpT::array_layout,Kokkos::HostSpace>
219 dofCoords(
"dofCoordsHost", this->basisCardinality_,this->basisCellTopology_.getDimension());
221 dofCoords(0,0) = 0.5; dofCoords(0,1) = 0.0;
222 dofCoords(1,0) = 0.5; dofCoords(1,1) = 0.5;
223 dofCoords(2,0) = 0.0; dofCoords(2,1) = 0.5;
225 this->dofCoords_ = Kokkos::create_mirror_view(
typename SpT::memory_space(), dofCoords);
226 Kokkos::deep_copy(this->dofCoords_, dofCoords);
229 Kokkos::DynRankView<typename scalarViewType::value_type,typename SpT::array_layout,Kokkos::HostSpace>
230 dofCoeffs(
"dofCoeffsHost", this->basisCardinality_,this->basisCellTopology_.getDimension());
232 dofCoeffs(0,0) = 1.0; dofCoeffs(0,1) = 0.0;
233 dofCoeffs(1,0) = -1.0; dofCoeffs(1,1) = 1.0;
234 dofCoeffs(2,0) = 0.0; dofCoeffs(2,1) = -1.0;
236 this->dofCoeffs_ = Kokkos::create_mirror_view(
typename SpT::memory_space(), dofCoeffs);
237 Kokkos::deep_copy(this->dofCoeffs_, dofCoeffs);
Basis_HCURL_TRI_I1_FEM()
Constructor.
Kokkos::View< ordinal_type *,typename ExecSpaceType::array_layout, Kokkos::HostSpace > ordinal_type_array_1d_host
View type for 1d host array.