49 #ifndef __INTREPID2_HDIV_HEX_I1_FEM_DEF_HPP__
50 #define __INTREPID2_HDIV_HEX_I1_FEM_DEF_HPP__
57 template<EOperator opType>
58 template<
typename OutputViewType,
59 typename inputViewType>
60 KOKKOS_INLINE_FUNCTION
62 Basis_HDIV_HEX_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) = 0.0;
73 output.access(0, 1) = (y - 1.0)/8.0;
74 output.access(0, 2) = 0.0;
76 output.access(1, 0) = (1.0 + x)/8.0;
77 output.access(1, 1) = 0.0;
78 output.access(1, 2) = 0.0;
80 output.access(2, 0) = 0.0;
81 output.access(2, 1) = (1.0 + y)/8.0;
82 output.access(2, 2) = 0.0;
84 output.access(3, 0) = (x - 1.0)/8.0;
85 output.access(3, 1) = 0.0;
86 output.access(3, 2) = 0.0;
88 output.access(4, 0) = 0.0;
89 output.access(4, 1) = 0.0;
90 output.access(4, 2) = (z - 1.0)/8.0;
92 output.access(5, 0) = 0.0;
93 output.access(5, 1) = 0.0;
94 output.access(5, 2) = (1.0 + z)/8.0;
101 output.access(0) = 0.125;
102 output.access(1) = 0.125;
103 output.access(2) = 0.125;
104 output.access(3) = 0.125;
105 output.access(4) = 0.125;
106 output.access(5) = 0.125;
110 INTREPID2_TEST_FOR_ABORT( opType != OPERATOR_VALUE &&
111 opType != OPERATOR_DIV,
112 ">>> ERROR: (Intrepid2::Basis_HDIV_HEX_I1_FEM::Serial::getValues) operator is not supported");
117 template<
typename SpT,
118 typename outputValueValueType,
class ...outputValueProperties,
119 typename inputPointValueType,
class ...inputPointProperties>
121 Basis_HDIV_HEX_I1_FEM::
122 getValues( Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValues,
123 const Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPoints,
124 const EOperator operatorType ) {
125 typedef Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValueViewType;
126 typedef Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPointViewType;
127 typedef typename ExecSpace<typename inputPointViewType::execution_space,SpT>::ExecSpaceType ExecSpaceType;
130 const auto loopSize = inputPoints.extent(0);
131 Kokkos::RangePolicy<ExecSpaceType,Kokkos::Schedule<Kokkos::Static> > policy(0, loopSize);
133 switch (operatorType) {
135 case OPERATOR_VALUE: {
136 typedef Functor<outputValueViewType,inputPointViewType,OPERATOR_VALUE> FunctorType;
137 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints) );
141 typedef Functor<outputValueViewType,inputPointViewType,OPERATOR_DIV> FunctorType;
142 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints) );
145 case OPERATOR_CURL: {
146 INTREPID2_TEST_FOR_EXCEPTION( (operatorType == OPERATOR_CURL), std::invalid_argument,
147 ">>> ERROR (Basis_HDIV_HEX_I1_FEM::getValues): CURL is invalid operator for HDIV Basis Functions");
150 case OPERATOR_GRAD: {
151 INTREPID2_TEST_FOR_EXCEPTION( (operatorType == OPERATOR_GRAD), std::invalid_argument,
152 ">>> ERROR (Basis_HDIV_HEX_I1_FEM::getValues): GRAD is invalid operator for HDIV Basis Functions");
165 INTREPID2_TEST_FOR_EXCEPTION( ( (operatorType == OPERATOR_D1) ||
166 (operatorType == OPERATOR_D2) ||
167 (operatorType == OPERATOR_D3) ||
168 (operatorType == OPERATOR_D4) ||
169 (operatorType == OPERATOR_D5) ||
170 (operatorType == OPERATOR_D6) ||
171 (operatorType == OPERATOR_D7) ||
172 (operatorType == OPERATOR_D8) ||
173 (operatorType == OPERATOR_D9) ||
174 (operatorType == OPERATOR_D10) ),
175 std::invalid_argument,
176 ">>> ERROR (Basis_HDIV_HEX_I1_FEM::getValues): Invalid operator type");
180 INTREPID2_TEST_FOR_EXCEPTION( ( (operatorType != OPERATOR_VALUE) &&
181 (operatorType != OPERATOR_GRAD) &&
182 (operatorType != OPERATOR_CURL) &&
183 (operatorType != OPERATOR_DIV) &&
184 (operatorType != OPERATOR_D1) &&
185 (operatorType != OPERATOR_D2) &&
186 (operatorType != OPERATOR_D3) &&
187 (operatorType != OPERATOR_D4) &&
188 (operatorType != OPERATOR_D5) &&
189 (operatorType != OPERATOR_D6) &&
190 (operatorType != OPERATOR_D7) &&
191 (operatorType != OPERATOR_D8) &&
192 (operatorType != OPERATOR_D9) &&
193 (operatorType != OPERATOR_D10) ),
194 std::invalid_argument,
195 ">>> ERROR (Basis_HDIV_HEX_I1_FEM::getValues): Invalid operator type");
201 template<
typename SpT,
typename OT,
typename PT>
204 this->basisCardinality_ = 6;
205 this->basisDegree_ = 1;
206 this->basisCellTopology_ = shards::CellTopology(shards::getCellTopologyData<shards::Hexahedron<8> >() );
207 this->basisType_ = BASIS_FEM_DEFAULT;
208 this->basisCoordinates_ = COORDINATES_CARTESIAN;
209 this->functionSpace_ = FUNCTION_SPACE_HDIV;
214 const ordinal_type tagSize = 4;
215 const ordinal_type posScDim = 0;
216 const ordinal_type posScOrd = 1;
217 const ordinal_type posDfOrd = 2;
220 ordinal_type tags[24] = { 2, 0, 0, 1,
231 this->setOrdinalTagData(this->tagToOrdinal_,
234 this->basisCardinality_,
241 Kokkos::DynRankView<typename ScalarViewType::value_type,typename SpT::array_layout,Kokkos::HostSpace>
242 dofCoords(
"dofCoordsHost", this->basisCardinality_,this->basisCellTopology_.getDimension());
244 dofCoords(0,0) = 0.0; dofCoords(0,1) = -1.0; dofCoords(0,2) = 0.0;
245 dofCoords(1,0) = 1.0; dofCoords(1,1) = 0.0; dofCoords(1,2) = 0.0;
246 dofCoords(2,0) = 0.0; dofCoords(2,1) = 1.0; dofCoords(2,2) = 0.0;
247 dofCoords(3,0) = -1.0; dofCoords(3,1) = 0.0; dofCoords(3,2) = 0.0;
248 dofCoords(4,0) = 0.0; dofCoords(4,1) = 0.0; dofCoords(4,2) = -1.0;
249 dofCoords(5,0) = 0.0; dofCoords(5,1) = 0.0; dofCoords(5,2) = 1.0;
251 this->dofCoords_ = Kokkos::create_mirror_view(
typename SpT::memory_space(), dofCoords);
252 Kokkos::deep_copy(this->dofCoords_, dofCoords);
255 Kokkos::DynRankView<typename ScalarViewType::value_type,typename SpT::array_layout,Kokkos::HostSpace>
256 dofCoeffs(
"dofCoeffsHost", this->basisCardinality_,this->basisCellTopology_.getDimension());
259 dofCoeffs(0,0) = 0.0; dofCoeffs(0,1) = -4.0; dofCoeffs(0,2) = 0.0;
260 dofCoeffs(1,0) = 4.0; dofCoeffs(1,1) = 0.0; dofCoeffs(1,2) = 0.0;
261 dofCoeffs(2,0) = 0.0; dofCoeffs(2,1) = 4.0; dofCoeffs(2,2) = 0.0;
262 dofCoeffs(3,0) = -4.0; dofCoeffs(3,1) = 0.0; dofCoeffs(3,2) = 0.0;
263 dofCoeffs(4,0) = 0.0; dofCoeffs(4,1) = 0.0; dofCoeffs(4,2) = -4.0;
264 dofCoeffs(5,0) = 0.0; dofCoeffs(5,1) = 0.0; dofCoeffs(5,2) = 4.0;
266 this->dofCoeffs_ = Kokkos::create_mirror_view(
typename SpT::memory_space(), dofCoeffs);
267 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_HEX_I1_FEM()
Constructor.