49 #ifndef __INTREPID2_HCURL_TET_I1_FEM_DEF_HPP__
50 #define __INTREPID2_HCURL_TET_I1_FEM_DEF_HPP__
57 template<EOperator opType>
58 template<
typename outputViewType,
59 typename inputViewType>
60 KOKKOS_INLINE_FUNCTION
62 Basis_HCURL_TET_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);
69 const auto z = input(2);
72 output.access(0, 0) = 1.0 - y - z;
73 output.access(0, 1) = x;
74 output.access(0, 2) = x;
76 output.access(1, 0) =-y;
77 output.access(1, 1) = x;
78 output.access(1, 2) = 0.0;
80 output.access(2, 0) = -y;
81 output.access(2, 1) = -1.0 + x + z;
82 output.access(2, 2) = -y;
84 output.access(3, 0) = z;
85 output.access(3, 1) = z;
86 output.access(3, 2) = 1.0 - x - y;
88 output.access(4, 0) =-z;
89 output.access(4, 1) = 0.0;
90 output.access(4, 2) = x;
92 output.access(5, 0) = 0.0;
93 output.access(5, 1) =-z;
94 output.access(5, 2) = y;
99 output.access(0, 0) = 0.0;
100 output.access(0, 1) =-2.0;
101 output.access(0, 2) = 2.0;
103 output.access(1, 0) = 0.0;
104 output.access(1, 1) = 0.0;
105 output.access(1, 2) = 2.0;
107 output.access(2, 0) =-2.0;
108 output.access(2, 1) = 0.0;
109 output.access(2, 2) = 2.0;
111 output.access(3, 0) =-2.0;
112 output.access(3, 1) = 2.0;
113 output.access(3, 2) = 0.0;
115 output.access(4, 0) = 0.0;
116 output.access(4, 1) =-2.0;
117 output.access(4, 2) = 0.0;
119 output.access(5, 0) = 2.0;
120 output.access(5, 1) = 0.0;
121 output.access(5, 2) = 0.0;
125 INTREPID2_TEST_FOR_ABORT( opType != OPERATOR_VALUE &&
126 opType != OPERATOR_CURL,
127 ">>> ERROR: (Intrepid2::Basis_HCURL_TET_I1_FEM::Serial::getValues) operator is not supported");
132 template<
typename SpT,
133 typename outputValueValueType,
class ...outputValueProperties,
134 typename inputPointValueType,
class ...inputPointProperties>
136 Basis_HCURL_TET_I1_FEM::
137 getValues( Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValues,
138 const Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPoints,
139 const EOperator operatorType ) {
140 typedef Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValueViewType;
141 typedef Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPointViewType;
142 typedef typename ExecSpace<typename inputPointViewType::execution_space,SpT>::ExecSpaceType ExecSpaceType;
145 const auto loopSize = inputPoints.extent(0);
146 Kokkos::RangePolicy<ExecSpaceType,Kokkos::Schedule<Kokkos::Static> > policy(0, loopSize);
148 switch (operatorType) {
150 case OPERATOR_VALUE: {
151 typedef Functor<outputValueViewType, inputPointViewType, OPERATOR_VALUE> FunctorType;
152 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints) );
155 case OPERATOR_CURL: {
156 typedef Functor<outputValueViewType, inputPointViewType, OPERATOR_CURL> FunctorType;
157 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints) );
161 INTREPID2_TEST_FOR_EXCEPTION( (operatorType == OPERATOR_DIV), std::invalid_argument,
162 ">>> ERROR (Basis_HCURL_TET_I1_FEM): DIV is invalid operator for HCURL Basis Functions");
165 case OPERATOR_GRAD: {
166 INTREPID2_TEST_FOR_EXCEPTION( (operatorType == OPERATOR_GRAD), std::invalid_argument,
167 ">>> ERROR (Basis_HCURL_TET_I1_FEM): GRAD is invalid operator for HCURL Basis Functions");
180 INTREPID2_TEST_FOR_EXCEPTION( ( (operatorType == OPERATOR_D1) ||
181 (operatorType == OPERATOR_D2) ||
182 (operatorType == OPERATOR_D3) ||
183 (operatorType == OPERATOR_D4) ||
184 (operatorType == OPERATOR_D5) ||
185 (operatorType == OPERATOR_D6) ||
186 (operatorType == OPERATOR_D7) ||
187 (operatorType == OPERATOR_D8) ||
188 (operatorType == OPERATOR_D9) ||
189 (operatorType == OPERATOR_D10) ),
190 std::invalid_argument,
191 ">>> ERROR (Basis_HCURL_TET_I1_FEM): Invalid operator type");
195 INTREPID2_TEST_FOR_EXCEPTION( ( (operatorType != OPERATOR_VALUE) &&
196 (operatorType != OPERATOR_GRAD) &&
197 (operatorType != OPERATOR_CURL) &&
198 (operatorType != OPERATOR_DIV) &&
199 (operatorType != OPERATOR_D1) &&
200 (operatorType != OPERATOR_D2) &&
201 (operatorType != OPERATOR_D3) &&
202 (operatorType != OPERATOR_D4) &&
203 (operatorType != OPERATOR_D5) &&
204 (operatorType != OPERATOR_D6) &&
205 (operatorType != OPERATOR_D7) &&
206 (operatorType != OPERATOR_D8) &&
207 (operatorType != OPERATOR_D9) &&
208 (operatorType != OPERATOR_D10) ),
209 std::invalid_argument,
210 ">>> ERROR (Basis_HCURL_TET_I1_FEM): Invalid operator type");
219 template<
typename SpT,
typename OT,
typename PT >
222 this->basisCardinality_ = 6;
223 this->basisDegree_ = 1;
224 this->basisCellTopology_ = shards::CellTopology(shards::getCellTopologyData<shards::Tetrahedron<4> >() );
225 this->basisType_ = BASIS_FEM_DEFAULT;
226 this->basisCoordinates_ = COORDINATES_CARTESIAN;
231 const ordinal_type tagSize = 4;
232 const ordinal_type posScDim = 0;
233 const ordinal_type posScOrd = 1;
234 const ordinal_type posDfOrd = 2;
237 ordinal_type tags[24] = {
249 this->setOrdinalTagData(this->tagToOrdinal_,
252 this->basisCardinality_,
259 Kokkos::DynRankView<typename scalarViewType::value_type,typename SpT::array_layout,Kokkos::HostSpace>
260 dofCoords(
"dofCoordsHost", this->basisCardinality_,this->basisCellTopology_.getDimension());
262 dofCoords(0,0) = 0.5; dofCoords(0,1) = 0.0; dofCoords(0,2) = 0.0;
263 dofCoords(1,0) = 0.5; dofCoords(1,1) = 0.5; dofCoords(1,2) = 0.0;
264 dofCoords(2,0) = 0.0; dofCoords(2,1) = 0.5; dofCoords(2,2) = 0.0;
265 dofCoords(3,0) = 0.0; dofCoords(3,1) = 0.0; dofCoords(3,2) = 0.5;
266 dofCoords(4,0) = 0.5; dofCoords(4,1) = 0.0; dofCoords(4,2) = 0.5;
267 dofCoords(5,0) = 0.0; dofCoords(5,1) = 0.5; dofCoords(5,2) = 0.5;
269 this->dofCoords_ = Kokkos::create_mirror_view(
typename SpT::memory_space(), dofCoords);
270 Kokkos::deep_copy(this->dofCoords_, dofCoords);
273 Kokkos::DynRankView<typename scalarViewType::value_type,typename SpT::array_layout,Kokkos::HostSpace>
274 dofCoeffs(
"dofCoeffsHost", this->basisCardinality_,this->basisCellTopology_.getDimension());
276 dofCoeffs(0,0) = 1.0; dofCoeffs(0,1) = 0.0; dofCoeffs(0,2) = 0.0;
277 dofCoeffs(1,0) = -1.0; dofCoeffs(1,1) = 1.0; dofCoeffs(1,2) = 0.0;
278 dofCoeffs(2,0) = 0.0; dofCoeffs(2,1) = -1.0; dofCoeffs(2,2) = 0.0;
279 dofCoeffs(3,0) = 0.0; dofCoeffs(3,1) = 0.0; dofCoeffs(3,2) = 1.0;
280 dofCoeffs(4,0) = -1.0; dofCoeffs(4,1) = 0.0; dofCoeffs(4,2) = 1.0;
281 dofCoeffs(5,0) = 0.0; dofCoeffs(5,1) = -1.0; dofCoeffs(5,2) = 1.0;
283 this->dofCoeffs_ = Kokkos::create_mirror_view(
typename SpT::memory_space(), dofCoeffs);
284 Kokkos::deep_copy(this->dofCoeffs_, dofCoeffs);
Kokkos::View< ordinal_type *,typename ExecSpaceType::array_layout, Kokkos::HostSpace > ordinal_type_array_1d_host
View type for 1d host array.
Basis_HCURL_TET_I1_FEM()
Constructor.