49 #ifndef __INTREPID2_HDIV_TET_I1_FEM_DEF_HPP__
50 #define __INTREPID2_HDIV_TET_I1_FEM_DEF_HPP__
57 template<EOperator opType>
58 template<
typename OutputViewType,
59 typename inputViewType>
60 KOKKOS_INLINE_FUNCTION
62 Basis_HDIV_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) = 2.0*x;
73 output.access(0, 1) = 2.0*(y - 1.0);
74 output.access(0, 2) = 2.0*z;
76 output.access(1, 0) = 2.0*x;
77 output.access(1, 1) = 2.0*y;
78 output.access(1, 2) = 2.0*z;
80 output.access(2, 0) = 2.0*(x - 1.0);
81 output.access(2, 1) = 2.0*y;
82 output.access(2, 2) = 2.0*z;
84 output.access(3, 0) = 2.0*x;
85 output.access(3, 1) = 2.0*y;
86 output.access(3, 2) = 2.0*(z - 1.0);
98 INTREPID2_TEST_FOR_ABORT( opType != OPERATOR_VALUE &&
99 opType != OPERATOR_DIV,
100 ">>> ERROR: (Intrepid2::Basis_HDIV_TET_I1_FEM::Serial::getValues) operator is not supported");
106 template<
typename SpT,
107 typename outputValueValueType,
class ...outputValueProperties,
108 typename inputPointValueType,
class ...inputPointProperties>
110 Basis_HDIV_TET_I1_FEM::
111 getValues( Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValues,
112 const Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPoints,
113 const EOperator operatorType ) {
114 typedef Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValueViewType;
115 typedef Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPointViewType;
116 typedef typename ExecSpace<typename inputPointViewType::execution_space,SpT>::ExecSpaceType ExecSpaceType;
119 const auto loopSize = inputPoints.extent(0);
120 Kokkos::RangePolicy<ExecSpaceType,Kokkos::Schedule<Kokkos::Static> > policy(0, loopSize);
122 switch (operatorType) {
123 case OPERATOR_VALUE: {
124 typedef Functor<outputValueViewType,inputPointViewType,OPERATOR_VALUE> FunctorType;
125 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints) );
129 typedef Functor<outputValueViewType,inputPointViewType,OPERATOR_DIV> FunctorType;
130 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints) );
133 case OPERATOR_CURL: {
134 INTREPID2_TEST_FOR_EXCEPTION( (operatorType == OPERATOR_CURL), std::invalid_argument,
135 ">>> ERROR (Basis_HDIV_TET_I1_FEM): CURL is invalid operator for HDIV Basis Functions");
139 case OPERATOR_GRAD: {
140 INTREPID2_TEST_FOR_EXCEPTION( (operatorType == OPERATOR_GRAD), std::invalid_argument,
141 ">>> ERROR (Basis_HDIV_TET_I1_FEM): GRAD is invalid operator for HDIV Basis Functions");
154 INTREPID2_TEST_FOR_EXCEPTION( ( (operatorType == OPERATOR_D1) &&
155 (operatorType == OPERATOR_D2) &&
156 (operatorType == OPERATOR_D3) &&
157 (operatorType == OPERATOR_D4) &&
158 (operatorType == OPERATOR_D5) &&
159 (operatorType == OPERATOR_D6) &&
160 (operatorType == OPERATOR_D7) &&
161 (operatorType == OPERATOR_D8) &&
162 (operatorType == OPERATOR_D9) &&
163 (operatorType == OPERATOR_D10) ),
164 std::invalid_argument,
165 ">>> ERROR (Basis_HDIV_TET_I1_FEM): Invalid operator type");
169 INTREPID2_TEST_FOR_EXCEPTION( ( (operatorType != OPERATOR_VALUE) &&
170 (operatorType != OPERATOR_GRAD) &&
171 (operatorType != OPERATOR_CURL) &&
172 (operatorType != OPERATOR_DIV) &&
173 (operatorType != OPERATOR_D1) &&
174 (operatorType != OPERATOR_D2) &&
175 (operatorType != OPERATOR_D3) &&
176 (operatorType != OPERATOR_D4) &&
177 (operatorType != OPERATOR_D5) &&
178 (operatorType != OPERATOR_D6) &&
179 (operatorType != OPERATOR_D7) &&
180 (operatorType != OPERATOR_D8) &&
181 (operatorType != OPERATOR_D9) &&
182 (operatorType != OPERATOR_D10) ),
183 std::invalid_argument,
184 ">>> ERROR (Basis_HDIV_TET_I1_FEM): Invalid operator type");
193 template<
typename SpT,
typename OT,
typename PT>
196 this->basisCardinality_ = 4;
197 this->basisDegree_ = 1;
198 this->basisCellTopology_ = shards::CellTopology(shards::getCellTopologyData<shards::Tetrahedron<4> >() );
199 this->basisType_ = BASIS_FEM_DEFAULT;
200 this->basisCoordinates_ = COORDINATES_CARTESIAN;
201 this->functionSpace_ = FUNCTION_SPACE_HDIV;
206 const ordinal_type tagSize = 4;
207 const ordinal_type posScDim = 0;
208 const ordinal_type posScOrd = 1;
209 const ordinal_type posDfOrd = 2;
212 ordinal_type tags[16] = { 2, 0, 0, 1,
223 this->setOrdinalTagData(this->tagToOrdinal_,
226 this->basisCardinality_,
240 Kokkos::DynRankView<typename ScalarViewType::value_type,typename SpT::array_layout,Kokkos::HostSpace>
241 dofCoords(
"dofCoordsHost", this->basisCardinality_,this->basisCellTopology_.getDimension());
243 dofCoords(0,0) = 1.0/3.0; dofCoords(0,1) = 0.0; dofCoords(0,2) = 1.0/3.0;
244 dofCoords(1,0) = 1.0/3.0; dofCoords(1,1) = 1.0/3.0; dofCoords(1,2) = 1.0/3.0;
245 dofCoords(2,0) = 0.0; dofCoords(2,1) = 1.0/3.0; dofCoords(2,2) = 1.0/3.0;
246 dofCoords(3,0) = 1.0/3.0; dofCoords(3,1) = 1.0/3.0; dofCoords(3,2) = 0.0;
248 this->dofCoords_ = Kokkos::create_mirror_view(
typename SpT::memory_space(), dofCoords);
249 Kokkos::deep_copy(this->dofCoords_, dofCoords);
252 Kokkos::DynRankView<typename ScalarViewType::value_type,typename SpT::array_layout,Kokkos::HostSpace>
253 dofCoeffs(
"dofCoeffsHost", this->basisCardinality_,this->basisCellTopology_.getDimension());
256 dofCoeffs(0,0) = 0.0; dofCoeffs(0,1) = -0.5; dofCoeffs(0,2) = 0.0;
257 dofCoeffs(1,0) = 0.5; dofCoeffs(1,1) = 0.5; dofCoeffs(1,2) = 0.5;
258 dofCoeffs(2,0) = -0.5; dofCoeffs(2,1) = 0.0; dofCoeffs(2,2) = 0.0;
259 dofCoeffs(3,0) = 0.0; dofCoeffs(3,1) = 0.0; dofCoeffs(3,2) = -0.5;
261 this->dofCoeffs_ = Kokkos::create_mirror_view(
typename SpT::memory_space(), dofCoeffs);
262 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_TET_I1_FEM()
Constructor.