1 #ifndef INTREPID_HGRAD_WEDGE_I2_FEMDEF_HPP
2 #define INTREPID_HGRAD_WEDGE_I2_FEMDEF_HPP
53 template<
class Scalar,
class ArrayScalar>
56 this -> basisCardinality_ = 15;
57 this -> basisDegree_ = 2;
58 this -> basisCellTopology_ = shards::CellTopology(shards::getCellTopologyData<shards::Wedge<6> >() );
59 this -> basisType_ = BASIS_FEM_DEFAULT;
60 this -> basisCoordinates_ = COORDINATES_CARTESIAN;
61 this -> basisTagsAreSet_ =
false;
65 template<
class Scalar,
class ArrayScalar>
75 int tags[] = { 0, 0, 0, 1,
93 Intrepid::setOrdinalTagData(
this -> tagToOrdinal_,
94 this -> ordinalToTag_,
96 this -> basisCardinality_,
105 template<
class Scalar,
class ArrayScalar>
107 const ArrayScalar & inputPoints,
108 const EOperator operatorType)
const {
111 #ifdef HAVE_INTREPID_DEBUG
112 Intrepid::getValues_HGRAD_Args<Scalar, ArrayScalar>(outputValues,
115 this -> getBaseCellTopology(),
116 this -> getCardinality() );
120 int dim0 = inputPoints.dimension(0);
128 switch (operatorType) {
131 for (
int i0 = 0; i0 < dim0; i0++) {
132 x = inputPoints(i0, 0);
133 y = inputPoints(i0, 1);
134 z = inputPoints(i0, 2);
138 outputValues(0, i0) = 0.5 * w *(2.0*w - 2.0 - z)*(1.0 - z);
139 outputValues(1, i0) = 0.5 * x *(2.0*x - 2.0 - z)*(1.0 - z);
140 outputValues(2, i0) = 0.5 * y *(2.0*y - 2.0 - z)*(1.0 - z);
141 outputValues(3, i0) = 0.5 * w *(2.0*w - 2.0 + z)*(1.0 + z);
142 outputValues(4, i0) = 0.5 * x *(2.0*x - 2.0 + z)*(1.0 + z);
143 outputValues(5, i0) = 0.5 * y *(2.0*y - 2.0 + z)*(1.0 + z);
145 outputValues(6, i0) = 2.0 * w * x * (1.0 - z);
146 outputValues(7, i0) = 2.0 * x * y * (1.0 - z);
147 outputValues(8, i0) = 2.0 * y * w * (1.0 - z);
148 outputValues(9, i0) = w * (1.0 - z*z);
149 outputValues(10,i0) = x * (1.0 - z*z);
150 outputValues(11,i0) = y * (1.0 - z*z);
151 outputValues(12,i0) = 2.0 * w * x * (1.0 + z);
152 outputValues(13,i0) = 2.0 * x * y * (1.0 + z);
153 outputValues(14,i0) = 2.0 * y * w * (1.0 + z);
159 for (
int i0 = 0; i0 < dim0; i0++) {
160 x = inputPoints(i0,0);
161 y = inputPoints(i0,1);
162 z = inputPoints(i0,2);
166 outputValues(0, i0, 0) = -(2.0*w - 1.0 - 0.5*z)*(1.0 - z);
167 outputValues(0, i0, 1) = -(2.0*w - 1.0 - 0.5*z)*(1.0 - z);
168 outputValues(0, i0, 2) = -0.5*w*(2.0*w - 1.0 - 2.0*z);
170 outputValues(1, i0, 0) = (2.0*x - 1.0 - 0.5*z)*(1.0 - z);
171 outputValues(1, i0, 1) = 0.0;
172 outputValues(1, i0, 2) = -0.5*x*(2.0*x - 1.0 - 2.0*z);
174 outputValues(2, i0, 0) = 0.0;
175 outputValues(2, i0, 1) = (2.0*y - 1.0 - 0.5*z)*(1.0 - z);
176 outputValues(2, i0, 2) = -0.5*y*(2.0*y - 1.0 - 2.0*z);
178 outputValues(3, i0, 0) = -(2.0*w - 1.0 + 0.5*z)*(1.0 + z);
179 outputValues(3, i0, 1) = -(2.0*w - 1.0 + 0.5*z)*(1.0 + z);
180 outputValues(3, i0, 2) = 0.5*w*(2.0*w - 1.0 + 2.0*z);
182 outputValues(4, i0, 0) = (2.0*x - 1.0 + 0.5*z)*(1.0 + z);
183 outputValues(4, i0, 1) = 0.0;
184 outputValues(4, i0, 2) = 0.5*x*(2.0*x - 1.0 + 2.0*z);
186 outputValues(5, i0, 0) = 0.0;
187 outputValues(5, i0, 1) = (2.0*y - 1.0 + 0.5*z)*(1.0 + z);
188 outputValues(5, i0, 2) = 0.5*y*(2.0*y - 1.0 + 2.0*z);
190 outputValues(6, i0, 0) = 2.0*(w - x)*(1.0 - z);
191 outputValues(6, i0, 1) = -2.0*x*(1.0 - z);
192 outputValues(6, i0, 2) = -2.0*x*w;
194 outputValues(7, i0, 0) = 2.0*y*(1.0 - z);
195 outputValues(7, i0, 1) = 2.0*x*(1.0 - z);
196 outputValues(7, i0, 2) = -2.0*x*y;
198 outputValues(8, i0, 0) = -2.0*y*(1.0 - z);
199 outputValues(8, i0, 1) = 2.0*(w - y)*(1.0 - z);
200 outputValues(8, i0, 2) = -2.0*w*y;
202 outputValues(9, i0, 0) = -(1.0 - z*z);
203 outputValues(9, i0, 1) = -(1.0 - z*z);
204 outputValues(9, i0, 2) = -2.0*z*w;
206 outputValues(10,i0, 0) = (1.0 - z*z);
207 outputValues(10,i0, 1) = 0.0;
208 outputValues(10,i0, 2) = -2.0*z*x;
210 outputValues(11,i0, 0) = 0.0;
211 outputValues(11,i0, 1) = (1.0 - z*z);
212 outputValues(11,i0, 2) = -2.0*z*y;
214 outputValues(12,i0, 0) = 2.0*(w - x)*(1.0 + z);
215 outputValues(12,i0, 1) = -2.0*x*(1.0 + z);
216 outputValues(12,i0, 2) = 2.0*x*w;
218 outputValues(13,i0, 0) = 2.0*y*(1.0 + z);
219 outputValues(13,i0, 1) = 2.0*x*(1.0 + z);
220 outputValues(13,i0, 2) = 2.0*x*y;
222 outputValues(14,i0, 0) = -2.0*y*(1.0 + z);
223 outputValues(14,i0, 1) = 2.0*(w - y)*(1.0 + z);
224 outputValues(14,i0, 2) = 2.0*w*y;
230 TEUCHOS_TEST_FOR_EXCEPTION( (operatorType == OPERATOR_CURL), std::invalid_argument,
231 ">>> ERROR (Basis_HGRAD_WEDGE_I2_FEM): CURL is invalid operator for rank-0 (scalar) functions in 3D");
235 TEUCHOS_TEST_FOR_EXCEPTION( (operatorType == OPERATOR_DIV), std::invalid_argument,
236 ">>> ERROR (Basis_HGRAD_WEDGE_I2_FEM): DIV is invalid operator for rank-0 (scalar) functions in 3D");
240 for (
int i0 = 0; i0 < dim0; i0++) {
241 x = inputPoints(i0,0);
242 y = inputPoints(i0,1);
243 z = inputPoints(i0,2);
246 outputValues(0, i0, 0) = 2.0*(1.0 - z);
247 outputValues(0, i0, 1) = 2.0*(1.0 - z);
248 outputValues(0, i0, 2) = 2.0*w - 0.5 - z;
249 outputValues(0, i0, 3) = 2.0*(1.0-z);
250 outputValues(0, i0, 4) = 2.0*w -0.5 - z;
251 outputValues(0, i0, 5) = w;
253 outputValues(1, i0, 0) = 2.0*(1.0 - z);
254 outputValues(1, i0, 1) = 0.;
255 outputValues(1, i0, 2) = -2.0*x + 0.5 + z;
256 outputValues(1, i0, 3) = 0.;
257 outputValues(1, i0, 4) = 0.;
258 outputValues(1, i0, 5) = x;
260 outputValues(2, i0, 0) = 0.;
261 outputValues(2, i0, 1) = 0.;
262 outputValues(2, i0, 2) = 0.;
263 outputValues(2, i0, 3) = 2.0*(1.0 - z);
264 outputValues(2, i0, 4) = -2.0*y + 0.5 + z;
265 outputValues(2, i0, 5) = y;
267 outputValues(3, i0, 0) = 2.0*(1.0 + z);
268 outputValues(3, i0, 1) = 2.0*(1.0 + z);
269 outputValues(3, i0, 2) = -2.0*w + 0.5 - z;
270 outputValues(3, i0, 3) = 2.0*(1.0 + z);
271 outputValues(3, i0, 4) = -2.0*w + 0.5 - z;
272 outputValues(3, i0, 5) = w;
274 outputValues(4, i0, 0) = 2.0*(1.0 + z);
275 outputValues(4, i0, 1) = 0.;
276 outputValues(4, i0, 2) = 2.0*x - 0.5 + z;
277 outputValues(4, i0, 3) = 0.;
278 outputValues(4, i0, 4) = 0.;
279 outputValues(4, i0, 5) = x;
281 outputValues(5, i0, 0) = 0.;
282 outputValues(5, i0, 1) = 0.;
283 outputValues(5, i0, 2) = 0.;
284 outputValues(5, i0, 3) = 2.0*(1.0 + z);
285 outputValues(5, i0, 4) = 2.0*y - 0.5 + z;
286 outputValues(5, i0, 5) = y;
288 outputValues(6, i0, 0) = -4.0*(1.0 - z);
289 outputValues(6, i0, 1) = -2.0*(1.0 - z);
290 outputValues(6, i0, 2) = -2.0*(w - x);
291 outputValues(6, i0, 3) = 0.;
292 outputValues(6, i0, 4) = 2.0*x;
293 outputValues(6, i0, 5) = 0.;
295 outputValues(7, i0, 0) = 0.;
296 outputValues(7, i0, 1) = 2.0*(1.0 - z);
297 outputValues(7, i0, 2) = -2.0*y;
298 outputValues(7, i0, 3) = 0.;
299 outputValues(7, i0, 4) = -2.0*x;
300 outputValues(7, i0, 5) = 0.;
302 outputValues(8, i0, 0) = 0.;
303 outputValues(8, i0, 1) = -2.0*(1.0 - z);
304 outputValues(8, i0, 2) = 2.0*y;
305 outputValues(8, i0, 3) = -4.0*(1.0 - z);
306 outputValues(8, i0, 4) = -2.0*(w - y);
307 outputValues(8, i0, 5) = 0.;
309 outputValues(9, i0, 0) = 0.;
310 outputValues(9, i0, 1) = 0.;
311 outputValues(9, i0, 2) = 2.0*z;
312 outputValues(9, i0, 3) = 0.;
313 outputValues(9, i0, 4) = 2.0*z;
314 outputValues(9, i0, 5) = -2.0*w;
316 outputValues(10,i0, 0) = 0.;
317 outputValues(10,i0, 1) = 0.;
318 outputValues(10,i0, 2) = -2.0*z;
319 outputValues(10,i0, 3) = 0.;
320 outputValues(10,i0, 4) = 0.;
321 outputValues(10,i0, 5) = -2.0*x;
323 outputValues(11,i0, 0) = 0.;
324 outputValues(11,i0, 1) = 0.;
325 outputValues(11,i0, 2) = 0.;
326 outputValues(11,i0, 3) = 0.;
327 outputValues(11,i0, 4) = -2.0*z;
328 outputValues(11,i0, 5) = -2.0*y;
330 outputValues(12,i0, 0) = -4.0*(1.0 + z);
331 outputValues(12,i0, 1) = -2.0*(1.0 + z);
332 outputValues(12,i0, 2) = 2.0*(w - x);
333 outputValues(12,i0, 3) = 0.;
334 outputValues(12,i0, 4) = -2.0*x;
335 outputValues(12,i0, 5) = 0.;
337 outputValues(13,i0, 0) = 0.;
338 outputValues(13,i0, 1) = 2.0*(1.0 + z);
339 outputValues(13,i0, 2) = 2.0*y;
340 outputValues(13,i0, 3) = 0.;
341 outputValues(13,i0, 4) = 2.0*x;
342 outputValues(13,i0, 5) = 0.;
344 outputValues(14,i0, 0) = 0.;
345 outputValues(14,i0, 1) = -2.0*(1.0 + z);
346 outputValues(14,i0, 2) = -2.0*y;
347 outputValues(14,i0, 3) = -4.0*(1.0 + z);
348 outputValues(14,i0, 4) = 2.0*(w - y);
349 outputValues(14,i0, 5) = 0.;
355 for (
int i0 = 0; i0 < dim0; i0++) {
356 x = inputPoints(i0,0);
357 y = inputPoints(i0,1);
358 z = inputPoints(i0,2);
360 outputValues(0, i0, 0) = 0.0;
361 outputValues(0, i0, 1) = 0.0;
362 outputValues(0, i0, 2) = -2.0;
363 outputValues(0, i0, 3) = 0.0;
364 outputValues(0, i0, 4) = -2.0;
365 outputValues(0, i0, 5) = -1.0;
366 outputValues(0, i0, 6) = 0.0;
367 outputValues(0, i0, 7) = -2.0;
368 outputValues(0, i0, 8) = -1.0;
369 outputValues(0, i0, 9) = 0.0;
371 outputValues(1, i0, 0) = 0.0;
372 outputValues(1, i0, 1) = 0.0;
373 outputValues(1, i0, 2) = -2.0;
374 outputValues(1, i0, 3) = 0.0;
375 outputValues(1, i0, 4) = 0.0;
376 outputValues(1, i0, 5) = -1.0;
377 outputValues(1, i0, 6) = 0.0;
378 outputValues(1, i0, 7) = 0.0;
379 outputValues(1, i0, 8) = 0.0;
380 outputValues(1, i0, 9) = 0.0;
382 outputValues(2, i0, 0) = 0.0;
383 outputValues(2, i0, 1) = 0.0;
384 outputValues(2, i0, 2) = 0.0;
385 outputValues(2, i0, 3) = 0.0;
386 outputValues(2, i0, 4) = 0.0;
387 outputValues(2, i0, 5) = 0.0;
388 outputValues(2, i0, 6) = 0.0;
389 outputValues(2, i0, 7) = -2.0;
390 outputValues(2, i0, 8) = -1.0;
391 outputValues(2, i0, 9) = 0.0;
393 outputValues(3, i0, 0) = 0.0;
394 outputValues(3, i0, 1) = 0.0;
395 outputValues(3, i0, 2) = 2.0;
396 outputValues(3, i0, 3) = 0.0;
397 outputValues(3, i0, 4) = 2.0;
398 outputValues(3, i0, 5) = -1.0;
399 outputValues(3, i0, 6) = 0.0;
400 outputValues(3, i0, 7) = 2.0;
401 outputValues(3, i0, 8) = -1.0;
402 outputValues(3, i0, 9) = 0.0;
404 outputValues(4, i0, 0) = 0.0;
405 outputValues(4, i0, 1) = 0.0;
406 outputValues(4, i0, 2) = 2.0;
407 outputValues(4, i0, 3) = 0.0;
408 outputValues(4, i0, 4) = 0.0;
409 outputValues(4, i0, 5) = 1.0;
410 outputValues(4, i0, 6) = 0.0;
411 outputValues(4, i0, 7) = 0.0;
412 outputValues(4, i0, 8) = 0.0;
413 outputValues(4, i0, 9) = 0.0;
415 outputValues(5, i0, 0) = 0.0;
416 outputValues(5, i0, 1) = 0.0;
417 outputValues(5, i0, 2) = 0.0;
418 outputValues(5, i0, 3) = 0.0;
419 outputValues(5, i0, 4) = 0.0;
420 outputValues(5, i0, 5) = 0.0;
421 outputValues(5, i0, 6) = 0.0;
422 outputValues(5, i0, 7) = 2.0;
423 outputValues(5, i0, 8) = 1.0;
424 outputValues(5, i0, 9) = 0.0;
426 outputValues(6, i0, 0) = 0.0;
427 outputValues(6, i0, 1) = 0.0;
428 outputValues(6, i0, 2) = 4.0;
429 outputValues(6, i0, 3) = 0.0;
430 outputValues(6, i0, 4) = 2.0;
431 outputValues(6, i0, 5) = 0.0;
432 outputValues(6, i0, 6) = 0.0;
433 outputValues(6, i0, 7) = 0.0;
434 outputValues(6, i0, 8) = 0.0;
435 outputValues(6, i0, 9) = 0.0;
437 outputValues(7, i0, 0) = 0.0;
438 outputValues(7, i0, 1) = 0.0;
439 outputValues(7, i0, 2) = 0.0;
440 outputValues(7, i0, 3) = 0.0;
441 outputValues(7, i0, 4) = -2.0;
442 outputValues(7, i0, 5) = 0.0;
443 outputValues(7, i0, 6) = 0.0;
444 outputValues(7, i0, 7) = 0.0;
445 outputValues(7, i0, 8) = 0.0;
446 outputValues(7, i0, 9) = 0.0;
448 outputValues(8, i0, 0) = 0.0;
449 outputValues(8, i0, 1) = 0.0;
450 outputValues(8, i0, 2) = 0.0;
451 outputValues(8, i0, 3) = 0.0;
452 outputValues(8, i0, 4) = 2.0;
453 outputValues(8, i0, 5) = 0.0;
454 outputValues(8, i0, 6) = 0.0;
455 outputValues(8, i0, 7) = 4.0;
456 outputValues(8, i0, 8) = 0.0;
457 outputValues(8, i0, 9) = 0.0;
459 outputValues(9, i0, 0) = 0.0;
460 outputValues(9, i0, 1) = 0.0;
461 outputValues(9, i0, 2) = 0.0;
462 outputValues(9, i0, 3) = 0.0;
463 outputValues(9, i0, 4) = 0.0;
464 outputValues(9, i0, 5) = 2.0;
465 outputValues(9, i0, 6) = 0.0;
466 outputValues(9, i0, 7) = 0.0;
467 outputValues(9, i0, 8) = 2.0;
468 outputValues(9, i0, 9) = 0.0;
470 outputValues(10,i0, 0) = 0.0;
471 outputValues(10,i0, 1) = 0.0;
472 outputValues(10,i0, 2) = 0.0;
473 outputValues(10,i0, 3) = 0.0;
474 outputValues(10,i0, 4) = 0.0;
475 outputValues(10,i0, 5) = -2.0;
476 outputValues(10,i0, 6) = 0.0;
477 outputValues(10,i0, 7) = 0.0;
478 outputValues(10,i0, 8) = 0.0;
479 outputValues(10,i0, 9) = 0.0;
481 outputValues(11,i0, 0) = 0.0;
482 outputValues(11,i0, 1) = 0.0;
483 outputValues(11,i0, 2) = 0.0;
484 outputValues(11,i0, 3) = 0.0;
485 outputValues(11,i0, 4) = 0.0;
486 outputValues(11,i0, 5) = 0.0;
487 outputValues(11,i0, 6) = 0.0;
488 outputValues(11,i0, 7) = 0.0;
489 outputValues(11,i0, 8) = -2.0;
490 outputValues(11,i0, 9) = 0.0;
492 outputValues(12,i0, 0) = 0.0;
493 outputValues(12,i0, 1) = 0.0;
494 outputValues(12,i0, 2) = -4.0;
495 outputValues(12,i0, 3) = 0.0;
496 outputValues(12,i0, 4) = -2.0;
497 outputValues(12,i0, 5) = 0.0;
498 outputValues(12,i0, 6) = 0.0;
499 outputValues(12,i0, 7) = 0.0;
500 outputValues(12,i0, 8) = 0.0;
501 outputValues(12,i0, 9) = 0.0;
503 outputValues(13,i0, 0) = 0.0;
504 outputValues(13,i0, 1) = 0.0;
505 outputValues(13,i0, 2) = 0.0;
506 outputValues(13,i0, 3) = 0.0;
507 outputValues(13,i0, 4) = 2.0;
508 outputValues(13,i0, 5) = 0.0;
509 outputValues(13,i0, 6) = 0.0;
510 outputValues(13,i0, 7) = 0.0;
511 outputValues(13,i0, 8) = 0.0;
512 outputValues(13,i0, 9) = 0.0;
514 outputValues(14,i0, 0) = 0.0;
515 outputValues(14,i0, 1) = 0.0;
516 outputValues(14,i0, 2) = 0.0;
517 outputValues(14,i0, 3) = 0.0;
518 outputValues(14,i0, 4) = -2.0;
519 outputValues(14,i0, 5) = 0.0;
520 outputValues(14,i0, 6) = 0.0;
521 outputValues(14,i0, 7) = -4.0;
522 outputValues(14,i0, 8) = 0.0;
523 outputValues(14,i0, 9) = 0.0;
537 int DkCardinality = Intrepid::getDkCardinality(operatorType,
538 this -> basisCellTopology_.getDimension() );
539 for(
int dofOrd = 0; dofOrd <
this -> basisCardinality_; dofOrd++) {
540 for (
int i0 = 0; i0 < dim0; i0++) {
541 for(
int dkOrd = 0; dkOrd < DkCardinality; dkOrd++){
542 outputValues(dofOrd, i0, dkOrd) = 0.0;
550 TEUCHOS_TEST_FOR_EXCEPTION( !( Intrepid::isValidOperator(operatorType) ), std::invalid_argument,
551 ">>> ERROR (Basis_HGRAD_WEDGE_I2_FEM): Invalid operator type");
557 template<
class Scalar,
class ArrayScalar>
559 const ArrayScalar & inputPoints,
560 const ArrayScalar & cellVertices,
561 const EOperator operatorType)
const {
562 TEUCHOS_TEST_FOR_EXCEPTION( (
true), std::logic_error,
563 ">>> ERROR (Basis_HGRAD_WEDGE_I2_FEM): FEM Basis calling an FVD member function");
568 #if defined(Intrepid_SHOW_DEPRECATED_WARNINGS)
570 #warning "The Intrepid package is deprecated"
void getValues(ArrayScalar &outputValues, const ArrayScalar &inputPoints, const EOperator operatorType) const
FEM basis evaluation on a reference Wedge cell.
void initializeTags()
Initializes tagToOrdinal_ and ordinalToTag_ lookup arrays.
Basis_HGRAD_WEDGE_I2_FEM()
Constructor.