50 #ifndef __INTREPID2_HGRAD_TET_COMP12_FEMDEF_HPP__
51 #define __INTREPID2_HGRAD_TET_COMP12_FEMDEF_HPP__
60 template<
typename po
intValueType>
61 KOKKOS_INLINE_FUNCTION
64 const pointValueType y,
65 const pointValueType z ) {
76 if ( (0.0 <= xyz && xyz <= 0.5) &&
77 (0.0 <= x && x <= 0.5) &&
78 (0.0 <= y && y <= 0.5) &&
79 (0.0 <= z && z <= 0.5) )
83 if ( (0.5 <= xyz && xyz <= 1.0) &&
84 (0.5 <= x && x <= 1.0) &&
85 (0.0 <= y && y <= 0.5) &&
86 (0.0 <= z && z <= 0.5) )
90 if ( (0.5 <= xyz && xyz <= 1.0) &&
91 (0.0 <= x && x <= 0.5) &&
92 (0.5 <= y && y <= 1.0) &&
93 (0.0 <= z && z <= 0.5) )
97 if ( (0.5 <= xyz && xyz <= 1.0) &&
98 (0.0 <= x && x <= 0.5) &&
99 (0.0 <= y && y <= 0.5) &&
100 (0.5 <= z && z <= 1.0) )
104 if ( (0.0 <= yz && yz <= 0.5) &&
105 (0.5 <= xy && xy <= 1.0) &&
106 (0.5 <= xz && xz <= 1.0) &&
107 (0.0 <= x && x <= 0.5) )
111 if ( (0.5 <= xy && xy <= 1.0) &&
112 (0.5 <= yz && yz <= 1.0) &&
113 (0.5 <= xz && xz <= 1.0) &&
114 (0.75 <= xyz && xyz <= 1.0) )
118 if ( (0.5 <= yz && yz <= 1.0) &&
119 (0.0 <= xy && xy <= 0.5) &&
120 (0.5 <= xz && xz <= 1.0) &&
121 (0.0 <= z && z <= 0.5) )
125 if ( (0.0 <= yz && yz <= 0.5) &&
126 (0.0 <= xy && xy <= 0.5) &&
127 (0.5 <= xz && xz <= 1.0) &&
128 (0.0 <= y && y <= 0.25) )
132 if ( (0.0 <= xz && xz <= 0.5) &&
133 (0.0 <= yz && yz <= 0.5) &&
134 (0.5 <= xy && xy <= 1.0) &&
135 (0.0 <= z && z <= 0.25) )
139 if ( (0.0 <= xz && xz <= 0.5) &&
140 (0.5 <= xy && xy <= 1.0) &&
141 (0.5 <= yz && yz <= 1.0) &&
142 (0.0 <= y && y <= 0.5) )
146 if ( (0.0 <= xz && xz <= 0.5) &&
147 (0.5 <= yz && yz <= 1.0) &&
148 (0.0 <= xy && xy <= 0.5) &&
149 (0.0 <= x && x <= 0.25) )
153 if ( (0.5 <= xyz && xyz <= 0.75) &&
154 (0.0 <= xz && xz <= 0.5) &&
155 (0.0 <= yz && yz <= 0.5) &&
156 (0.0 <= xy && xy <= 0.5) )
162 template<EOperator opType>
163 template<
typename outputValueViewType,
164 typename inputPointViewType>
165 KOKKOS_INLINE_FUNCTION
169 const inputPointViewType input ) {
171 case OPERATOR_VALUE: {
172 const typename inputPointViewType::value_type r = input(0);
173 const typename inputPointViewType::value_type s = input(1);
174 const typename inputPointViewType::value_type t = input(2);
177 for (
auto i=0;i<10;++i)
178 output.access(i) = 0.0;
180 const auto subtet = getLocalSubTet( r, s, t );
186 typename inputPointViewType::value_type aux = 0.0;
189 output.access(0) = 1. - 2. * (r + s + t);
190 output.access(4) = 2. * r;
191 output.access(6) = 2. * s;
192 output.access(7) = 2. * t;
195 output.access(1) = 2. * r - 1.;
196 output.access(4) = 2. - 2. * (r + s + t);
197 output.access(5) = 2. * s;
198 output.access(8) = 2. * t;
201 output.access(2) = 2. * s - 1.;
202 output.access(5) = 2. * r;
203 output.access(6) = 2. - 2. * (r + s + t);
204 output.access(9) = 2. * t;
207 output.access(3) = 2. * t - 1.;
208 output.access(7) = 2. - 2. * (r + s + t);
209 output.access(8) = 2. * r;
210 output.access(9) = 2. * s;
213 output.access(4) = 1. - 2. * (s + t);
214 output.access(5) = 2. * (r + s) - 1.;
215 output.access(8) = 2. * (r + t) - 1.;
219 output.access(5) = 2. * (r + s) - 1.;
220 output.access(8) = 2. * (r + t) - 1.;
221 output.access(9) = 2. * (s + t) - 1.;
222 aux = 4. - 4. * (r + s + t);
225 output.access(7) = 1. - 2. * (r + s);
226 output.access(8) = 2. * (r + t) - 1.;
227 output.access(9) = 2. * (s + t) - 1.;
231 output.access(4) = 1. - 2. * (s + t);
232 output.access(7) = 1. - 2. * (r + s);
233 output.access(8) = 2. * (r + t) - 1.;
237 output.access(4) = 1. - 2. * (s + t);
238 output.access(5) = 2. * (r + s) - 1.;
239 output.access(6) = 1. - 2. * (r + t);
243 output.access(5) = 2. * (r + s) - 1.;
244 output.access(6) = 1. - 2. * (r + t);
245 output.access(9) = 2. * (s + t) - 1.;
249 output.access(6) = 1. - 2. * (r + t);
250 output.access(7) = 1. - 2. * (r + s);
251 output.access(9) = 2. * (s + t) - 1.;
255 output.access(4) = 1. - 2. * (s + t);
256 output.access(6) = 1. - 2. * (r + t);
257 output.access(7) = 1. - 2. * (r + s);
258 aux = 4. * (r + s + t) - 2.;
261 for (
auto i=4;i<10;++i)
262 output.access(i) += aux/6.0;
266 case OPERATOR_GRAD: {
267 const typename inputPointViewType::value_type r = input(0);
268 const typename inputPointViewType::value_type s = input(1);
269 const typename inputPointViewType::value_type t = input(2);
271 output.access(0,0) = (-17 + 20*r + 20*s + 20*t)/8.;
272 output.access(0,1) = (-17 + 20*r + 20*s + 20*t)/8.;
273 output.access(0,2) = (-17 + 20*r + 20*s + 20*t)/8.;
274 output.access(1,0) = -0.375 + (5*r)/2.;
275 output.access(1,1) = 0.;
276 output.access(1,2) = 0.;
277 output.access(2,0) = 0.;
278 output.access(2,1) = -0.375 + (5*s)/2.;
279 output.access(2,2) = 0.;
280 output.access(3,0) = 0.;
281 output.access(3,1) = 0.;
282 output.access(3,2) = -0.375 + (5*t)/2.;
283 output.access(4,0) = (-35*(-1 + 2*r + s + t))/12.;
284 output.access(4,1) = (-4 - 35*r + 5*s + 10*t)/12.;
285 output.access(4,2) = (-4 - 35*r + 10*s + 5*t)/12.;
286 output.access(5,0) = (-1 + 5*r + 40*s - 5*t)/12.;
287 output.access(5,1) = (-1 + 40*r + 5*s - 5*t)/12.;
288 output.access(5,2) = (-5*(-1 + r + s + 2*t))/12.;
289 output.access(6,0) = (-4 + 5*r - 35*s + 10*t)/12.;
290 output.access(6,1) = (-35*(-1 + r + 2*s + t))/12.;
291 output.access(6,2) = (-4 + 10*r - 35*s + 5*t)/12.;
292 output.access(7,0) = (-4 + 5*r + 10*s - 35*t)/12.;
293 output.access(7,1) = (-4 + 10*r + 5*s - 35*t)/12.;
294 output.access(7,2) = (-35*(-1 + r + s + 2*t))/12.;
295 output.access(8,0) = (-1 + 5*r - 5*s + 40*t)/12.;
296 output.access(8,1) = (-5*(-1 + r + 2*s + t))/12.;
297 output.access(8,2) = (-1 + 40*r - 5*s + 5*t)/12.;
298 output.access(9,0) = (-5*(-1 + 2*r + s + t))/12.;
299 output.access(9,1) = (-1 - 5*r + 5*s + 40*t)/12.;
300 output.access(9,2) = (-1 - 5*r + 40*s + 5*t)/12.;
304 const ordinal_type jend = output.extent(1);
305 const ordinal_type iend = output.extent(0);
307 for (ordinal_type j=0;j<jend;++j)
308 for (
auto i=0;i<iend;++i)
309 output.access(i, j) = 0.0;
313 INTREPID2_TEST_FOR_ABORT(
true ,
314 ">>> ERROR (Basis_HGRAD_TET_COMP12_FEM): Operator type not implemented" );
319 template<
typename SpT,
320 typename outputValueValueType,
class ...outputValueProperties,
321 typename inputPointValueType,
class ...inputPointProperties>
323 Basis_HGRAD_TET_COMP12_FEM::
324 getValues( Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValues,
325 const Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPoints,
326 const EOperator operatorType ) {
327 typedef Kokkos::DynRankView<outputValueValueType,outputValueProperties...> outputValueViewType;
328 typedef Kokkos::DynRankView<inputPointValueType, inputPointProperties...> inputPointViewType;
329 typedef typename ExecSpace<typename inputPointViewType::execution_space,SpT>::ExecSpaceType ExecSpaceType;
332 const auto loopSize = inputPoints.extent(0);
333 Kokkos::RangePolicy<ExecSpaceType,Kokkos::Schedule<Kokkos::Static> > policy(0, loopSize);
335 switch (operatorType) {
337 case OPERATOR_VALUE: {
338 typedef Functor<outputValueViewType,inputPointViewType,OPERATOR_VALUE> FunctorType;
339 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints) );
344 typedef Functor<outputValueViewType,inputPointViewType,OPERATOR_GRAD> FunctorType;
345 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints) );
348 case OPERATOR_CURL: {
349 INTREPID2_TEST_FOR_EXCEPTION( operatorType == OPERATOR_CURL, std::invalid_argument,
350 ">>> ERROR (Basis_HGRAD_TET_COMP12_FEM): CURL is invalid operator for rank-0 (scalar) functions in 3D");
354 INTREPID2_TEST_FOR_EXCEPTION( (operatorType == OPERATOR_DIV), std::invalid_argument,
355 ">>> ERROR (Basis_HGRAD_TET_COMP12_FEM): DIV is invalid operator for rank-0 (scalar) functions in 3D");
367 typedef Functor<outputValueViewType,inputPointViewType,OPERATOR_MAX> FunctorType;
368 Kokkos::parallel_for( policy, FunctorType(outputValues, inputPoints) );
372 INTREPID2_TEST_FOR_EXCEPTION(
true , std::invalid_argument,
373 ">>> ERROR (Basis_HGRAD_TET_COMP12_FEM): Operator type not implemented" );
381 template<
typename SpT,
typename OT,
typename PT>
384 this->basisCardinality_ = 10;
385 this->basisDegree_ = 1;
386 this->basisCellTopology_ = shards::CellTopology(shards::getCellTopologyData<shards::Tetrahedron<11> >() );
387 this->basisType_ = BASIS_FEM_DEFAULT;
388 this->basisCoordinates_ = COORDINATES_CARTESIAN;
392 const ordinal_type tagSize = 4;
393 const ordinal_type posScDim = 0;
394 const ordinal_type posScOrd = 1;
395 const ordinal_type posDfOrd = 2;
398 ordinal_type tags[] = { 0, 0, 0, 1,
413 this->setOrdinalTagData(this->tagToOrdinal_,
416 this->basisCardinality_,
424 Kokkos::DynRankView<typename scalarViewType::value_type,typename SpT::array_layout,Kokkos::HostSpace>
425 dofCoords(
"dofCoordsHost", this->basisCardinality_, this->basisCellTopology_.getDimension());
427 dofCoords(0,0) = 0.0; dofCoords(0,1) = 0.0; dofCoords(0,2) = 0.0;
428 dofCoords(1,0) = 1.0; dofCoords(1,1) = 0.0; dofCoords(1,2) = 0.0;
429 dofCoords(2,0) = 0.0; dofCoords(2,1) = 1.0; dofCoords(2,2) = 0.0;
430 dofCoords(3,0) = 0.0; dofCoords(3,1) = 0.0; dofCoords(3,2) = 1.0;
431 dofCoords(4,0) = 0.5; dofCoords(4,1) = 0.0; dofCoords(4,2) = 0.0;
432 dofCoords(5,0) = 0.5; dofCoords(5,1) = 0.5; dofCoords(5,2) = 0.0;
433 dofCoords(6,0) = 0.0; dofCoords(6,1) = 0.5; dofCoords(6,2) = 0.0;
434 dofCoords(7,0) = 0.0; dofCoords(7,1) = 0.0; dofCoords(7,2) = 0.5;
435 dofCoords(8,0) = 0.5; dofCoords(8,1) = 0.0; dofCoords(8,2) = 0.5;
436 dofCoords(9,0) = 0.0; dofCoords(9,1) = 0.5; dofCoords(9,2) = 0.5;
438 this->dofCoords_ = Kokkos::create_mirror_view(
typename SpT::memory_space(), dofCoords);
439 Kokkos::deep_copy(this->dofCoords_, dofCoords);
Basis_HGRAD_TET_COMP12_FEM()
Constructor.
See Intrepid2::Basis_HGRAD_TET_COMP12_FEM.
static KOKKOS_INLINE_FUNCTION ordinal_type getLocalSubTet(const pointValueType x, const pointValueType y, const pointValueType z)
See Intrepid2::Basis_HGRAD_TET_COMP12_FEM.
Kokkos::View< ordinal_type *,typename ExecSpaceType::array_layout, Kokkos::HostSpace > ordinal_type_array_1d_host
View type for 1d host array.