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;
205 const ordinal_type tagSize = 4;
206 const ordinal_type posScDim = 0;
207 const ordinal_type posScOrd = 1;
208 const ordinal_type posDfOrd = 2;
211 ordinal_type tags[16] = { 2, 0, 0, 1,
222 this->setOrdinalTagData(this->tagToOrdinal_,
225 this->basisCardinality_,
239 Kokkos::DynRankView<typename scalarViewType::value_type,typename SpT::array_layout,Kokkos::HostSpace>
240 dofCoords(
"dofCoordsHost", this->basisCardinality_,this->basisCellTopology_.getDimension());
242 dofCoords(0,0) = 1.0/3.0; dofCoords(0,1) = 0.0; dofCoords(0,2) = 1.0/3.0;
243 dofCoords(1,0) = 1.0/3.0; dofCoords(1,1) = 1.0/3.0; dofCoords(1,2) = 1.0/3.0;;
244 dofCoords(2,0) = 0.0; dofCoords(2,1) = 1.0/3.0; dofCoords(2,2) = 1.0/3.0;
245 dofCoords(3,0) = 1.0/3.0; dofCoords(3,1) = 1.0/3.0; dofCoords(3,2) = 0.0;
247 this->dofCoords_ = Kokkos::create_mirror_view(
typename SpT::memory_space(), dofCoords);
248 Kokkos::deep_copy(this->dofCoords_, dofCoords);
251 Kokkos::DynRankView<typename scalarViewType::value_type,typename SpT::array_layout,Kokkos::HostSpace>
252 dofCoeffs(
"dofCoeffsHost", this->basisCardinality_,this->basisCellTopology_.getDimension());
255 dofCoeffs(0,0) = 0.0; dofCoeffs(0,1) = -0.5; dofCoeffs(0,2) = 0.0;
256 dofCoeffs(1,0) = 0.5; dofCoeffs(1,1) = 0.5; dofCoeffs(1,2) = 0.5;
257 dofCoeffs(2,0) = -0.5; dofCoeffs(2,1) = 0.0; dofCoeffs(2,2) = 0.0;
258 dofCoeffs(3,0) = 0.0; dofCoeffs(3,1) = 0.0; dofCoeffs(3,2) = -0.5;
260 this->dofCoeffs_ = Kokkos::create_mirror_view(
typename SpT::memory_space(), dofCoeffs);
261 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_HDIV_TET_I1_FEM()
Constructor.