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) = 2.0*(1.0 - y);
72 output.access(0, 1) = 2.0*x;
74 output.access(1, 0) = -2.0*y;
75 output.access(1, 1) = 2.0*x;
77 output.access(2, 0) = -2.0*y;
78 output.access(2, 1) = 2.0*(-1.0 + x);
83 output.access(0) = 4.0;
84 output.access(1) = 4.0;
85 output.access(2) = 4.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 DT,
98 typename outputValueValueType,
class ...outputValueProperties,
99 typename inputPointValueType,
class ...inputPointProperties>
101 Basis_HCURL_TRI_I1_FEM::
102 getValues(
const typename DT::execution_space& space,
103 Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValues,
104 const Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPoints,
105 const EOperator operatorType ) {
106 typedef Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValueViewType;
107 typedef Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPointViewType;
108 typedef typename ExecSpace<typename inputPointViewType::execution_space,typename DT::execution_space>::ExecSpaceType ExecSpaceType;
111 const auto loopSize = inputPoints.extent(0);
112 Kokkos::RangePolicy<ExecSpaceType,Kokkos::Schedule<Kokkos::Static> > policy(space, 0, loopSize);
114 switch (operatorType) {
115 case OPERATOR_VALUE: {
116 typedef Functor<outputValueViewType,inputPointViewType,OPERATOR_VALUE> FunctorType;
117 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints) );
120 case OPERATOR_CURL: {
121 typedef Functor<outputValueViewType,inputPointViewType,OPERATOR_CURL> FunctorType;
122 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints) );
126 INTREPID2_TEST_FOR_EXCEPTION( (operatorType == OPERATOR_DIV), std::invalid_argument,
127 ">>> ERROR (Basis_HCURL_TRI_I1_FEM): DIV is invalid operator for HCURL Basis Functions");
130 case OPERATOR_GRAD: {
131 INTREPID2_TEST_FOR_EXCEPTION( (operatorType == OPERATOR_GRAD), std::invalid_argument,
132 ">>> ERROR (Basis_HCURL_TRI_I1_FEM): GRAD is invalid operator for HCURL Basis Functions");
145 INTREPID2_TEST_FOR_EXCEPTION( ( (operatorType == OPERATOR_D1) ||
146 (operatorType == OPERATOR_D2) ||
147 (operatorType == OPERATOR_D3) ||
148 (operatorType == OPERATOR_D4) ||
149 (operatorType == OPERATOR_D5) ||
150 (operatorType == OPERATOR_D6) ||
151 (operatorType == OPERATOR_D7) ||
152 (operatorType == OPERATOR_D8) ||
153 (operatorType == OPERATOR_D9) ||
154 (operatorType == OPERATOR_D10) ),
155 std::invalid_argument,
156 ">>> ERROR (Basis_HCURL_TRI_I1_FEM): Invalid operator type");
160 INTREPID2_TEST_FOR_EXCEPTION( ( (operatorType != OPERATOR_VALUE) &&
161 (operatorType != OPERATOR_GRAD) &&
162 (operatorType != OPERATOR_CURL) &&
163 (operatorType != OPERATOR_DIV) &&
164 (operatorType != OPERATOR_D1) &&
165 (operatorType != OPERATOR_D2) &&
166 (operatorType != OPERATOR_D3) &&
167 (operatorType != OPERATOR_D4) &&
168 (operatorType != OPERATOR_D5) &&
169 (operatorType != OPERATOR_D6) &&
170 (operatorType != OPERATOR_D7) &&
171 (operatorType != OPERATOR_D8) &&
172 (operatorType != OPERATOR_D9) &&
173 (operatorType != OPERATOR_D10) ),
174 std::invalid_argument,
175 ">>> ERROR (Basis_HCURL_TRI_I1_FEM): Invalid operator type");
181 template<
typename DT,
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_HCURL;
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] = {
209 this->setOrdinalTagData(this->tagToOrdinal_,
212 this->basisCardinality_,
220 Kokkos::DynRankView<typename ScalarViewType::value_type,typename DT::execution_space::array_layout,Kokkos::HostSpace>
221 dofCoords(
"dofCoordsHost", this->basisCardinality_,this->basisCellTopology_.getDimension());
223 dofCoords(0,0) = 0.5; dofCoords(0,1) = 0.0;
224 dofCoords(1,0) = 0.5; dofCoords(1,1) = 0.5;
225 dofCoords(2,0) = 0.0; dofCoords(2,1) = 0.5;
227 this->dofCoords_ = Kokkos::create_mirror_view(
typename DT::memory_space(), dofCoords);
228 Kokkos::deep_copy(this->dofCoords_, dofCoords);
231 Kokkos::DynRankView<typename ScalarViewType::value_type,typename DT::execution_space::array_layout,Kokkos::HostSpace>
232 dofCoeffs(
"dofCoeffsHost", this->basisCardinality_,this->basisCellTopology_.getDimension());
234 dofCoeffs(0,0) = 0.5; dofCoeffs(0,1) = 0.0;
235 dofCoeffs(1,0) = -0.5; dofCoeffs(1,1) = 0.5;
236 dofCoeffs(2,0) = 0.0; dofCoeffs(2,1) = -0.5;
238 this->dofCoeffs_ = Kokkos::create_mirror_view(
typename DT::memory_space(), dofCoeffs);
239 Kokkos::deep_copy(this->dofCoeffs_, dofCoeffs);
Basis_HCURL_TRI_I1_FEM()
Constructor.
Kokkos::View< ordinal_type *, typename ExecutionSpace::array_layout, Kokkos::HostSpace > OrdinalTypeArray1DHost
View type for 1d host array.