25 template <
typename Real>
32 Real xSpacing, Real yMin, Real ySpacing, Real zMin, Real zSpacing,
40 inline Real
const*
GetF()
const;
59 Real
operator()(
int xOrder,
int yOrder,
int zOrder, Real x, Real y, Real z)
const;
70 Real&
A(
int ix,
int iy,
int iz);
72 Real
operator()(
int xOrder,
int yOrder,
int zOrder, Real x, Real y, Real z)
const;
92 Real
const FX[2][2][2], Real
const FY[2][2][2],
93 Real
const FZ[2][2][2], Real
const FXY[2][2][2],
94 Real
const FXZ[2][2][2], Real
const FYZ[2][2][2],
95 Real
const FXYZ[2][2][2]);
97 void XLookup(Real x,
int& xIndex, Real& dx)
const;
98 void YLookup(Real y,
int& yIndex, Real& dy)
const;
99 void ZLookup(Real z,
int& zIndex, Real& dz)
const;
110 template <
typename Real>
115 template <
typename Real>
117 Real xMin, Real xSpacing, Real yMin, Real ySpacing, Real zMin,
118 Real zSpacing, Real
const* F)
131 mPoly(xBound - 1, yBound - 1, zBound - 1)
171 template <
typename Real>
inline 177 template <
typename Real>
inline 183 template <
typename Real>
inline 189 template <
typename Real>
inline 195 template <
typename Real>
inline 201 template <
typename Real>
inline 207 template <
typename Real>
inline 213 template <
typename Real>
inline 219 template <
typename Real>
inline 225 template <
typename Real>
inline 231 template <
typename Real>
inline 237 template <
typename Real>
inline 243 template <
typename Real>
inline 249 template <
typename Real>
inline 255 template <
typename Real>
266 return mPoly[iz][iy][ix](dx, dy, dz);
269 template <
typename Real>
271 Real
x, Real
y, Real
z)
const 281 return mPoly[iz][iy][ix](xOrder, yOrder, zOrder, dx, dy, dz);
284 template <
typename Real>
290 for (iz = 0; iz <
mZBound; ++iz)
292 for (iy = 0; iy <
mYBound; ++iy)
294 for (ix = 0; ix <
mXBound - 1; ++ix)
296 slope[iz][iy][ix + 2] = (F[iz][iy][ix + 1] - F[iz][iy][ix]) * invDX;
299 slope[iz][iy][1] = ((Real)2) * slope[iz][iy][2] - slope[iz][iy][3];
300 slope[iz][iy][0] = ((Real)2) * slope[iz][iy][1] - slope[iz][iy][2];
301 slope[iz][iy][mXBound + 1] = ((Real)2) * slope[iz][iy][
mXBound] - slope[iz][iy][mXBound - 1];
302 slope[iz][iy][mXBound + 2] = ((Real)2) * slope[iz][iy][mXBound + 1] - slope[iz][iy][
mXBound];
306 for (iz = 0; iz <
mZBound; ++iz)
308 for (iy = 0; iy <
mYBound; ++iy)
310 for (ix = 0; ix <
mXBound; ++ix)
318 template <
typename Real>
324 for (iz = 0; iz <
mZBound; ++iz)
326 for (ix = 0; ix <
mXBound; ++ix)
328 for (iy = 0; iy <
mYBound - 1; ++iy)
330 slope[iz][ix][iy + 2] = (F[iz][iy + 1][ix] - F[iz][iy][ix]) * invDY;
333 slope[iz][ix][1] = ((Real)2) * slope[iz][ix][2] - slope[iz][ix][3];
334 slope[iz][ix][0] = ((Real)2) * slope[iz][ix][1] - slope[iz][ix][2];
335 slope[iz][ix][mYBound + 1] = ((Real)2) * slope[iz][ix][
mYBound] - slope[iz][ix][mYBound - 1];
336 slope[iz][ix][mYBound + 2] = ((Real)2) * slope[iz][ix][mYBound + 1] - slope[iz][ix][
mYBound];
340 for (iz = 0; iz <
mZBound; ++iz)
342 for (ix = 0; ix <
mXBound; ++ix)
344 for (iy = 0; iy <
mYBound; ++iy)
352 template <
typename Real>
358 for (iy = 0; iy <
mYBound; ++iy)
360 for (ix = 0; ix <
mXBound; ++ix)
362 for (iz = 0; iz <
mZBound - 1; ++iz)
364 slope[iy][ix][iz + 2] = (F[iz + 1][iy][ix] - F[iz][iy][ix]) * invDZ;
367 slope[iy][ix][1] = ((Real)2) * slope[iy][ix][2] - slope[iy][ix][3];
368 slope[iy][ix][0] = ((Real)2) * slope[iy][ix][1] - slope[iy][ix][2];
369 slope[iy][ix][mZBound + 1] = ((Real)2) * slope[iy][ix][
mZBound] - slope[iy][ix][mZBound - 1];
370 slope[iy][ix][mZBound + 2] = ((Real)2) * slope[iy][ix][mZBound + 1] - slope[iy][ix][
mZBound];
374 for (iy = 0; iy <
mYBound; ++iy)
376 for (ix = 0; ix <
mXBound; ++ix)
378 for (iz = 0; iz <
mZBound; ++iz)
386 template <
typename Real>
391 int ix0 = xBoundM1, ix1 = ix0 - 1, ix2 = ix1 - 1;
392 int iy0 = yBoundM1, iy1 = iy0 - 1, iy2 = iy1 - 1;
396 for (iz = 0; iz <
mZBound; ++iz)
399 FXY[iz][0][0] = ((Real)0.25)*invDXDY*(
400 ((Real)9)*F[iz][0][0]
401 - ((Real)12)*F[iz][0][1]
402 + ((Real)3)*F[iz][0][2]
403 - ((Real)12)*F[iz][1][0]
404 + ((Real)16)*F[iz][1][1]
405 - ((Real)4)*F[iz][1][2]
406 + ((Real)3)*F[iz][2][0]
407 - ((Real)4)*F[iz][2][1]
410 FXY[iz][0][xBoundM1] = ((Real)0.25)*invDXDY*(
411 ((Real)9)*F[iz][0][ix0]
412 - ((Real)12)*F[iz][0][ix1]
413 + ((Real)3)*F[iz][0][ix2]
414 - ((Real)12)*F[iz][1][ix0]
415 + ((Real)16)*F[iz][1][ix1]
416 - ((Real)4)*F[iz][1][ix2]
417 + ((Real)3)*F[iz][2][ix0]
418 - ((Real)4)*F[iz][2][ix1]
421 FXY[iz][yBoundM1][0] = ((Real)0.25)*invDXDY*(
422 ((Real)9)*F[iz][iy0][0]
423 - ((Real)12)*F[iz][iy0][1]
424 + ((Real)3)*F[iz][iy0][2]
425 - ((Real)12)*F[iz][iy1][0]
426 + ((Real)16)*F[iz][iy1][1]
427 - ((Real)4)*F[iz][iy1][2]
428 + ((Real)3)*F[iz][iy2][0]
429 - ((Real)4)*F[iz][iy2][1]
432 FXY[iz][yBoundM1][xBoundM1] = ((Real)0.25)*invDXDY*(
433 ((Real)9)*F[iz][iy0][ix0]
434 - ((Real)12)*F[iz][iy0][ix1]
435 + ((Real)3)*F[iz][iy0][ix2]
436 - ((Real)12)*F[iz][iy1][ix0]
437 + ((Real)16)*F[iz][iy1][ix1]
438 - ((Real)4)*F[iz][iy1][ix2]
439 + ((Real)3)*F[iz][iy2][ix0]
440 - ((Real)4)*F[iz][iy2][ix1]
444 for (ix = 1; ix < xBoundM1; ++ix)
446 FXY[iz][0][ix] = ((Real)0.25)*invDXDY*(
447 ((Real)3)*(F[iz][0][ix - 1] - F[iz][0][ix + 1]) -
448 ((Real)4)*(F[iz][1][ix - 1] - F[iz][1][ix + 1]) +
449 (F[iz][2][ix - 1] - F[iz][2][ix + 1]));
451 FXY[iz][yBoundM1][ix] = ((Real)0.25)*invDXDY*(
452 ((Real)3)*(F[iz][iy0][ix - 1] - F[iz][iy0][ix + 1])
453 - ((Real)4)*(F[iz][iy1][ix - 1] - F[iz][iy1][ix + 1]) +
454 (F[iz][iy2][ix - 1] - F[iz][iy2][ix + 1]));
458 for (iy = 1; iy < yBoundM1; ++iy)
460 FXY[iz][iy][0] = ((Real)0.25)*invDXDY*(
461 ((Real)3)*(F[iz][iy - 1][0] - F[iz][iy + 1][0]) -
462 ((Real)4)*(F[iz][iy - 1][1] - F[iz][iy + 1][1]) +
463 (F[iz][iy - 1][2] - F[iz][iy + 1][2]));
465 FXY[iz][iy][xBoundM1] = ((Real)0.25)*invDXDY*(
466 ((Real)3)*(F[iz][iy - 1][ix0] - F[iz][iy + 1][ix0])
467 - ((Real)4)*(F[iz][iy - 1][ix1] - F[iz][iy + 1][ix1]) +
468 (F[iz][iy - 1][ix2] - F[iz][iy + 1][ix2]));
472 for (iy = 1; iy < yBoundM1; ++iy)
474 for (ix = 1; ix < xBoundM1; ++ix)
476 FXY[iz][iy][ix] = ((Real)0.25)*invDXDY*(
477 F[iz][iy - 1][ix - 1] - F[iz][iy - 1][ix + 1] -
478 F[iz][iy + 1][ix - 1] + F[iz][iy + 1][ix + 1]);
484 template <
typename Real>
489 int ix0 = xBoundM1, ix1 = ix0 - 1, ix2 = ix1 - 1;
490 int iz0 = zBoundM1, iz1 = iz0 - 1, iz2 = iz1 - 1;
494 for (iy = 0; iy <
mYBound; ++iy)
497 FXZ[0][iy][0] = ((Real)0.25)*invDXDZ*(
498 ((Real)9)*F[0][iy][0]
499 - ((Real)12)*F[0][iy][1]
500 + ((Real)3)*F[0][iy][2]
501 - ((Real)12)*F[1][iy][0]
502 + ((Real)16)*F[1][iy][1]
503 - ((Real)4)*F[1][iy][2]
504 + ((Real)3)*F[2][iy][0]
505 - ((Real)4)*F[2][iy][1]
508 FXZ[0][iy][xBoundM1] = ((Real)0.25)*invDXDZ*(
509 ((Real)9)*F[0][iy][ix0]
510 - ((Real)12)*F[0][iy][ix1]
511 + ((Real)3)*F[0][iy][ix2]
512 - ((Real)12)*F[1][iy][ix0]
513 + ((Real)16)*F[1][iy][ix1]
514 - ((Real)4)*F[1][iy][ix2]
515 + ((Real)3)*F[2][iy][ix0]
516 - ((Real)4)*F[2][iy][ix1]
519 FXZ[zBoundM1][iy][0] = ((Real)0.25)*invDXDZ*(
520 ((Real)9)*F[iz0][iy][0]
521 - ((Real)12)*F[iz0][iy][1]
522 + ((Real)3)*F[iz0][iy][2]
523 - ((Real)12)*F[iz1][iy][0]
524 + ((Real)16)*F[iz1][iy][1]
525 - ((Real)4)*F[iz1][iy][2]
526 + ((Real)3)*F[iz2][iy][0]
527 - ((Real)4)*F[iz2][iy][1]
530 FXZ[zBoundM1][iy][xBoundM1] = ((Real)0.25)*invDXDZ*(
531 ((Real)9)*F[iz0][iy][ix0]
532 - ((Real)12)*F[iz0][iy][ix1]
533 + ((Real)3)*F[iz0][iy][ix2]
534 - ((Real)12)*F[iz1][iy][ix0]
535 + ((Real)16)*F[iz1][iy][ix1]
536 - ((Real)4)*F[iz1][iy][ix2]
537 + ((Real)3)*F[iz2][iy][ix0]
538 - ((Real)4)*F[iz2][iy][ix1]
542 for (ix = 1; ix < xBoundM1; ++ix)
544 FXZ[0][iy][ix] = ((Real)0.25)*invDXDZ*(
545 ((Real)3)*(F[0][iy][ix - 1] - F[0][iy][ix + 1]) -
546 ((Real)4)*(F[1][iy][ix - 1] - F[1][iy][ix + 1]) +
547 (F[2][iy][ix - 1] - F[2][iy][ix + 1]));
549 FXZ[zBoundM1][iy][ix] = ((Real)0.25)*invDXDZ*(
550 ((Real)3)*(F[iz0][iy][ix - 1] - F[iz0][iy][ix + 1])
551 - ((Real)4)*(F[iz1][iy][ix - 1] - F[iz1][iy][ix + 1]) +
552 (F[iz2][iy][ix - 1] - F[iz2][iy][ix + 1]));
556 for (iz = 1; iz < zBoundM1; ++iz)
558 FXZ[iz][iy][0] = ((Real)0.25)*invDXDZ*(
559 ((Real)3)*(F[iz - 1][iy][0] - F[iz + 1][iy][0]) -
560 ((Real)4)*(F[iz - 1][iy][1] - F[iz + 1][iy][1]) +
561 (F[iz - 1][iy][2] - F[iz + 1][iy][2]));
563 FXZ[iz][iy][xBoundM1] = ((Real)0.25)*invDXDZ*(
564 ((Real)3)*(F[iz - 1][iy][ix0] - F[iz + 1][iy][ix0])
565 - ((Real)4)*(F[iz - 1][iy][ix1] - F[iz + 1][iy][ix1]) +
566 (F[iz - 1][iy][ix2] - F[iz + 1][iy][ix2]));
570 for (iz = 1; iz < zBoundM1; ++iz)
572 for (ix = 1; ix < xBoundM1; ++ix)
574 FXZ[iz][iy][ix] = ((Real)0.25)*invDXDZ*(
575 F[iz - 1][iy][ix - 1] - F[iz - 1][iy][ix + 1] -
576 F[iz + 1][iy][ix - 1] + F[iz + 1][iy][ix + 1]);
582 template <
typename Real>
587 int iy0 = yBoundM1, iy1 = iy0 - 1, iy2 = iy1 - 1;
588 int iz0 = zBoundM1, iz1 = iz0 - 1, iz2 = iz1 - 1;
592 for (ix = 0; ix <
mXBound; ++ix)
595 FYZ[0][0][ix] = ((Real)0.25)*invDYDZ*(
596 ((Real)9)*F[0][0][ix]
597 - ((Real)12)*F[0][1][ix]
598 + ((Real)3)*F[0][2][ix]
599 - ((Real)12)*F[1][0][ix]
600 + ((Real)16)*F[1][1][ix]
601 - ((Real)4)*F[1][2][ix]
602 + ((Real)3)*F[2][0][ix]
603 - ((Real)4)*F[2][1][ix]
606 FYZ[0][yBoundM1][ix] = ((Real)0.25)*invDYDZ*(
607 ((Real)9)*F[0][iy0][ix]
608 - ((Real)12)*F[0][iy1][ix]
609 + ((Real)3)*F[0][iy2][ix]
610 - ((Real)12)*F[1][iy0][ix]
611 + ((Real)16)*F[1][iy1][ix]
612 - ((Real)4)*F[1][iy2][ix]
613 + ((Real)3)*F[2][iy0][ix]
614 - ((Real)4)*F[2][iy1][ix]
617 FYZ[zBoundM1][0][ix] = ((Real)0.25)*invDYDZ*(
618 ((Real)9)*F[iz0][0][ix]
619 - ((Real)12)*F[iz0][1][ix]
620 + ((Real)3)*F[iz0][2][ix]
621 - ((Real)12)*F[iz1][0][ix]
622 + ((Real)16)*F[iz1][1][ix]
623 - ((Real)4)*F[iz1][2][ix]
624 + ((Real)3)*F[iz2][0][ix]
625 - ((Real)4)*F[iz2][1][ix]
628 FYZ[zBoundM1][yBoundM1][ix] = ((Real)0.25)*invDYDZ*(
629 ((Real)9)*F[iz0][iy0][ix]
630 - ((Real)12)*F[iz0][iy1][ix]
631 + ((Real)3)*F[iz0][iy2][ix]
632 - ((Real)12)*F[iz1][iy0][ix]
633 + ((Real)16)*F[iz1][iy1][ix]
634 - ((Real)4)*F[iz1][iy2][ix]
635 + ((Real)3)*F[iz2][iy0][ix]
636 - ((Real)4)*F[iz2][iy1][ix]
640 for (iy = 1; iy < yBoundM1; ++iy)
642 FYZ[0][iy][ix] = ((Real)0.25)*invDYDZ*(
643 ((Real)3)*(F[0][iy - 1][ix] - F[0][iy + 1][ix]) -
644 ((Real)4)*(F[1][iy - 1][ix] - F[1][iy + 1][ix]) +
645 (F[2][iy - 1][ix] - F[2][iy + 1][ix]));
647 FYZ[zBoundM1][iy][ix] = ((Real)0.25)*invDYDZ*(
648 ((Real)3)*(F[iz0][iy - 1][ix] - F[iz0][iy + 1][ix])
649 - ((Real)4)*(F[iz1][iy - 1][ix] - F[iz1][iy + 1][ix]) +
650 (F[iz2][iy - 1][ix] - F[iz2][iy + 1][ix]));
654 for (iz = 1; iz < zBoundM1; ++iz)
656 FYZ[iz][0][ix] = ((Real)0.25)*invDYDZ*(
657 ((Real)3)*(F[iz - 1][0][ix] - F[iz + 1][0][ix]) -
658 ((Real)4)*(F[iz - 1][1][ix] - F[iz + 1][1][ix]) +
659 (F[iz - 1][2][ix] - F[iz + 1][2][ix]));
661 FYZ[iz][yBoundM1][ix] = ((Real)0.25)*invDYDZ*(
662 ((Real)3)*(F[iz - 1][iy0][ix] - F[iz + 1][iy0][ix])
663 - ((Real)4)*(F[iz - 1][iy1][ix] - F[iz + 1][iy1][ix]) +
664 (F[iz - 1][iy2][ix] - F[iz + 1][iy2][ix]));
668 for (iz = 1; iz < zBoundM1; ++iz)
670 for (iy = 1; iy < yBoundM1; ++iy)
672 FYZ[iz][iy][ix] = ((Real)0.25)*invDYDZ*(
673 F[iz - 1][iy - 1][ix] - F[iz - 1][iy + 1][ix] -
674 F[iz + 1][iy - 1][ix] + F[iz + 1][iy + 1][ix]);
680 template <
typename Real>
686 int ix, iy, iz, ix0, iy0, iz0;
692 Real CDer[3] = { -(Real)0.5, (Real)0, (Real)0.5 };
694 Real ODer[3] = { -(Real)1.5, (Real)2, -(Real)0.5 };
698 FXYZ[0][0][0] = (Real)0;
699 FXYZ[0][0][xBoundM1] = (Real)0;
700 FXYZ[0][yBoundM1][0] = (Real)0;
701 FXYZ[0][yBoundM1][xBoundM1] = (Real)0;
702 FXYZ[zBoundM1][0][0] = (Real)0;
703 FXYZ[zBoundM1][0][xBoundM1] = (Real)0;
704 FXYZ[zBoundM1][yBoundM1][0] = (Real)0;
705 FXYZ[zBoundM1][yBoundM1][xBoundM1] = (Real)0;
706 for (iz = 0; iz <= 2; ++iz)
708 for (iy = 0; iy <= 2; ++iy)
710 for (ix = 0; ix <= 2; ++ix)
712 mask = invDXDYDZ*ODer[ix] * ODer[iy] * ODer[iz];
713 FXYZ[0][0][0] += mask * F[iz][iy][ix];
714 FXYZ[0][0][xBoundM1] += mask * F[iz][iy][xBoundM1 - ix];
715 FXYZ[0][yBoundM1][0] += mask * F[iz][yBoundM1 - iy][ix];
716 FXYZ[0][yBoundM1][xBoundM1] += mask * F[iz][yBoundM1 - iy][xBoundM1 - ix];
717 FXYZ[zBoundM1][0][0] += mask * F[zBoundM1 - iz][iy][ix];
718 FXYZ[zBoundM1][0][xBoundM1] += mask * F[zBoundM1 - iz][iy][xBoundM1 - ix];
719 FXYZ[zBoundM1][yBoundM1][0] += mask * F[zBoundM1 - iz][yBoundM1 - iy][ix];
720 FXYZ[zBoundM1][yBoundM1][xBoundM1] += mask * F[zBoundM1 - iz][yBoundM1 - iy][xBoundM1 - ix];
726 for (ix0 = 1; ix0 < xBoundM1; ++ix0)
728 FXYZ[0][0][ix0] = (Real)0;
729 FXYZ[0][yBoundM1][ix0] = (Real)0;
730 FXYZ[zBoundM1][0][ix0] = (Real)0;
731 FXYZ[zBoundM1][yBoundM1][ix0] = (Real)0;
732 for (iz = 0; iz <= 2; ++iz)
734 for (iy = 0; iy <= 2; ++iy)
736 for (ix = 0; ix <= 2; ++ix)
738 mask = invDXDYDZ*CDer[ix] * ODer[iy] * ODer[iz];
739 FXYZ[0][0][ix0] += mask * F[iz][iy][ix0 + ix - 1];
740 FXYZ[0][yBoundM1][ix0] += mask * F[iz][yBoundM1 - iy][ix0 + ix - 1];
741 FXYZ[zBoundM1][0][ix0] += mask * F[zBoundM1 - iz][iy][ix0 + ix - 1];
742 FXYZ[zBoundM1][yBoundM1][ix0] += mask * F[zBoundM1 - iz][yBoundM1 - iy][ix0 + ix - 1];
749 for (iy0 = 1; iy0 < yBoundM1; ++iy0)
751 FXYZ[0][iy0][0] = (Real)0;
752 FXYZ[0][iy0][xBoundM1] = (Real)0;
753 FXYZ[zBoundM1][iy0][0] = (Real)0;
754 FXYZ[zBoundM1][iy0][xBoundM1] = (Real)0;
755 for (iz = 0; iz <= 2; ++iz)
757 for (iy = 0; iy <= 2; ++iy)
759 for (ix = 0; ix <= 2; ++ix)
761 mask = invDXDYDZ*ODer[ix] * CDer[iy] * ODer[iz];
762 FXYZ[0][iy0][0] += mask * F[iz][iy0 + iy - 1][ix];
763 FXYZ[0][iy0][xBoundM1] += mask * F[iz][iy0 + iy - 1][xBoundM1 - ix];
764 FXYZ[zBoundM1][iy0][0] += mask * F[zBoundM1 - iz][iy0 + iy - 1][ix];
765 FXYZ[zBoundM1][iy0][xBoundM1] += mask * F[zBoundM1 - iz][iy0 + iy - 1][xBoundM1 - ix];
772 for (iz0 = 1; iz0 < zBoundM1; ++iz0)
774 FXYZ[iz0][0][0] = (Real)0;
775 FXYZ[iz0][0][xBoundM1] = (Real)0;
776 FXYZ[iz0][yBoundM1][0] = (Real)0;
777 FXYZ[iz0][yBoundM1][xBoundM1] = (Real)0;
778 for (iz = 0; iz <= 2; ++iz)
780 for (iy = 0; iy <= 2; ++iy)
782 for (ix = 0; ix <= 2; ++ix)
784 mask = invDXDYDZ*ODer[ix] * ODer[iy] * CDer[iz];
785 FXYZ[iz0][0][0] += mask * F[iz0 + iz - 1][iy][ix];
786 FXYZ[iz0][0][xBoundM1] += mask * F[iz0 + iz - 1][iy][xBoundM1 - ix];
787 FXYZ[iz0][yBoundM1][0] += mask * F[iz0 + iz - 1][yBoundM1 - iy][ix];
788 FXYZ[iz0][yBoundM1][xBoundM1] += mask * F[iz0 + iz - 1][yBoundM1 - iy][xBoundM1 - ix];
795 for (iy0 = 1; iy0 < yBoundM1; ++iy0)
797 for (ix0 = 1; ix0 < xBoundM1; ++ix0)
799 FXYZ[0][iy0][ix0] = (Real)0;
800 FXYZ[zBoundM1][iy0][ix0] = (Real)0;
801 for (iz = 0; iz <= 2; ++iz)
803 for (iy = 0; iy <= 2; ++iy)
805 for (ix = 0; ix <= 2; ++ix)
807 mask = invDXDYDZ*CDer[ix] * CDer[iy] * ODer[iz];
808 FXYZ[0][iy0][ix0] += mask * F[iz][iy0 + iy - 1][ix0 + ix - 1];
809 FXYZ[zBoundM1][iy0][ix0] += mask * F[zBoundM1 - iz][iy0 + iy - 1][ix0 + ix - 1];
817 for (iz0 = 1; iz0 < zBoundM1; ++iz0)
819 for (ix0 = 1; ix0 < xBoundM1; ++ix0)
821 FXYZ[iz0][0][ix0] = (Real)0;
822 FXYZ[iz0][yBoundM1][ix0] = (Real)0;
823 for (iz = 0; iz <= 2; ++iz)
825 for (iy = 0; iy <= 2; ++iy)
827 for (ix = 0; ix <= 2; ++ix)
829 mask = invDXDYDZ*CDer[ix] * ODer[iy] * CDer[iz];
830 FXYZ[iz0][0][ix0] += mask * F[iz0 + iz - 1][iy][ix0 + ix - 1];
831 FXYZ[iz0][yBoundM1][ix0] += mask * F[iz0 + iz - 1][yBoundM1 - iy][ix0 + ix - 1];
839 for (iz0 = 1; iz0 < zBoundM1; ++iz0)
841 for (iy0 = 1; iy0 < yBoundM1; ++iy0)
843 FXYZ[iz0][iy0][0] = (Real)0;
844 FXYZ[iz0][iy0][xBoundM1] = (Real)0;
845 for (iz = 0; iz <= 2; ++iz)
847 for (iy = 0; iy <= 2; ++iy)
849 for (ix = 0; ix <= 2; ++ix)
851 mask = invDXDYDZ*ODer[ix] * CDer[iy] * CDer[iz];
852 FXYZ[iz0][iy0][0] += mask * F[iz0 + iz - 1][iy0 + iy - 1][ix];
853 FXYZ[iz0][iy0][xBoundM1] += mask * F[iz0 + iz - 1][iy0 + iy - 1][xBoundM1 - ix];
861 for (iz0 = 1; iz0 < zBoundM1; ++iz0)
863 for (iy0 = 1; iy0 < yBoundM1; ++iy0)
865 for (ix0 = 1; ix0 < xBoundM1; ++ix0)
867 FXYZ[iz0][iy0][ix0] = (Real)0;
869 for (iz = 0; iz <= 2; ++iz)
871 for (iy = 0; iy <= 2; ++iy)
873 for (ix = 0; ix <= 2; ++ix)
875 mask = invDXDYDZ*CDer[ix] * CDer[iy] * CDer[iz];
876 FXYZ[iz0][iy0][ix0] += mask * F[iz0 + iz - 1][iy0 + iy - 1][ix0 + ix - 1];
885 template <
typename Real>
893 for (
int iz = 0; iz < zBoundM1; ++iz)
895 for (
int iy = 0; iy < yBoundM1; ++iy)
897 for (
int ix = 0; ix < xBoundM1; ++ix)
910 F[iz + 1][iy + 1][ix]
916 F[iz + 1][iy][ix + 1]
919 F[iz][iy + 1][ix + 1],
920 F[iz + 1][iy + 1][ix + 1]
934 FX[iz + 1][iy + 1][ix]
940 FX[iz + 1][iy][ix + 1]
943 FX[iz][iy + 1][ix + 1],
944 FX[iz + 1][iy + 1][ix + 1]
958 FY[iz + 1][iy + 1][ix]
964 FY[iz + 1][iy][ix + 1]
967 FY[iz][iy + 1][ix + 1],
968 FY[iz + 1][iy + 1][ix + 1]
982 FZ[iz + 1][iy + 1][ix]
988 FZ[iz + 1][iy][ix + 1]
991 FZ[iz][iy + 1][ix + 1],
992 FZ[iz + 1][iy + 1][ix + 1]
1005 FXY[iz][iy + 1][ix],
1006 FXY[iz + 1][iy + 1][ix]
1011 FXY[iz][iy][ix + 1],
1012 FXY[iz + 1][iy][ix + 1]
1015 FXY[iz][iy + 1][ix + 1],
1016 FXY[iz + 1][iy + 1][ix + 1]
1029 FXZ[iz][iy + 1][ix],
1030 FXZ[iz + 1][iy + 1][ix]
1035 FXZ[iz][iy][ix + 1],
1036 FXZ[iz + 1][iy][ix + 1]
1039 FXZ[iz][iy + 1][ix + 1],
1040 FXZ[iz + 1][iy + 1][ix + 1]
1053 FYZ[iz][iy + 1][ix],
1054 FYZ[iz + 1][iy + 1][ix]
1059 FYZ[iz][iy][ix + 1],
1060 FYZ[iz + 1][iy][ix + 1]
1063 FYZ[iz][iy + 1][ix + 1],
1064 FYZ[iz + 1][iy + 1][ix + 1]
1069 Real GXYZ[2][2][2] =
1074 FXYZ[iz + 1][iy][ix]
1077 FXYZ[iz][iy + 1][ix],
1078 FXYZ[iz + 1][iy + 1][ix]
1083 FXYZ[iz][iy][ix + 1],
1084 FXYZ[iz + 1][iy][ix + 1]
1087 FXYZ[iz][iy + 1][ix + 1],
1088 FXYZ[iz + 1][iy + 1][ix + 1]
1093 Construct(
mPoly[iz][iy][ix], G, GX, GY, GZ, GXY, GXZ, GYZ, GXYZ);
1099 template <
typename Real>
1102 if (slope[1] != slope[2])
1104 if (slope[0] != slope[1])
1106 if (slope[2] != slope[3])
1108 Real ad0 =
std::abs(slope[3] - slope[2]);
1109 Real ad1 =
std::abs(slope[0] - slope[1]);
1110 return (ad0 * slope[1] + ad1 * slope[2]) / (ad0 + ad1);
1119 if (slope[2] != slope[3])
1125 return ((Real)0.5) * (slope[1] + slope[2]);
1135 template <
typename Real>
1137 Real
const F[2][2][2], Real
const FX[2][2][2], Real
const FY[2][2][2],
1138 Real
const FZ[2][2][2], Real
const FXY[2][2][2], Real
const FXZ[2][2][2],
1139 Real
const FYZ[2][2][2], Real
const FXYZ[2][2][2])
1142 Real invDX = ((Real)1) / dx, invDX2 = invDX * invDX;
1143 Real invDY = ((Real)1) / dy, invDY2 = invDY * invDY;
1144 Real invDZ = ((Real)1) / dz, invDZ2 = invDZ * invDZ;
1145 Real b0, b1, b2, b3, b4, b5, b6, b7;
1147 poly.
A(0, 0, 0) = F[0][0][0];
1148 poly.
A(1, 0, 0) = FX[0][0][0];
1149 poly.
A(0, 1, 0) = FY[0][0][0];
1150 poly.
A(0, 0, 1) = FZ[0][0][0];
1151 poly.
A(1, 1, 0) = FXY[0][0][0];
1152 poly.
A(1, 0, 1) = FXZ[0][0][0];
1153 poly.
A(0, 1, 1) = FYZ[0][0][0];
1154 poly.
A(1, 1, 1) = FXYZ[0][0][0];
1157 b0 = (F[1][0][0] - poly(0, 0, 0, dx, (Real)0, (Real)0))*invDX2;
1158 b1 = (FX[1][0][0] - poly(1, 0, 0, dx, (Real)0, (Real)0))*invDX;
1159 poly.
A(2, 0, 0) = ((Real)3)*b0 - b1;
1160 poly.
A(3, 0, 0) = (-((Real)2)*b0 + b1)*invDX;
1162 b0 = (F[0][1][0] - poly(0, 0, 0, (Real)0, dy, (Real)0))*invDY2;
1163 b1 = (FY[0][1][0] - poly(0, 1, 0, (Real)0, dy, (Real)0))*invDY;
1164 poly.
A(0, 2, 0) = ((Real)3)*b0 - b1;
1165 poly.
A(0, 3, 0) = (-((Real)2)*b0 + b1)*invDY;
1167 b0 = (FY[1][0][0] - poly(0, 1, 0, dx, (Real)0, (Real)0))*invDX2;
1168 b1 = (FXY[1][0][0] - poly(1, 1, 0, dx, (Real)0, (Real)0))*invDX;
1169 poly.
A(2, 1, 0) = ((Real)3)*b0 - b1;
1170 poly.
A(3, 1, 0) = (-((Real)2)*b0 + b1)*invDX;
1172 b0 = (FX[0][1][0] - poly(1, 0, 0, (Real)0, dy, (Real)0))*invDY2;
1173 b1 = (FXY[0][1][0] - poly(1, 1, 0, (Real)0, dy, (Real)0))*invDY;
1174 poly.
A(1, 2, 0) = ((Real)3)*b0 - b1;
1175 poly.
A(1, 3, 0) = (-((Real)2)*b0 + b1)*invDY;
1177 b0 = (F[1][1][0] - poly(0, 0, 0, dx, dy, (Real)0))*invDX2*invDY2;
1178 b1 = (FX[1][1][0] - poly(1, 0, 0, dx, dy, (Real)0))*invDX*invDY2;
1179 b2 = (FY[1][1][0] - poly(0, 1, 0, dx, dy, (Real)0))*invDX2*invDY;
1180 b3 = (FXY[1][1][0] - poly(1, 1, 0, dx, dy, (Real)0))*invDX*invDY;
1181 poly.
A(2, 2, 0) = ((Real)9)*b0 - ((Real)3)*b1 - ((Real)3)*b2 + b3;
1182 poly.
A(3, 2, 0) = (-((Real)6)*b0 + ((Real)3)*b1 + ((Real)2)*b2 - b3)*invDX;
1183 poly.
A(2, 3, 0) = (-((Real)6)*b0 + ((Real)2)*b1 + ((Real)3)*b2 - b3)*invDY;
1184 poly.
A(3, 3, 0) = (((Real)4)*b0 - ((Real)2)*b1 - ((Real)2)*b2 + b3)*invDX*invDY;
1187 b0 = (F[0][0][1] - poly(0, 0, 0, (Real)0, (Real)0, dz))*invDZ2;
1188 b1 = (FZ[0][0][1] - poly(0, 0, 1, (Real)0, (Real)0, dz))*invDZ;
1189 poly.
A(0, 0, 2) = ((Real)3)*b0 - b1;
1190 poly.
A(0, 0, 3) = (-((Real)2)*b0 + b1)*invDZ;
1192 b0 = (FZ[1][0][0] - poly(0, 0, 1, dx, (Real)0, (Real)0))*invDX2;
1193 b1 = (FXZ[1][0][0] - poly(1, 0, 1, dx, (Real)0, (Real)0))*invDX;
1194 poly.
A(2, 0, 1) = ((Real)3)*b0 - b1;
1195 poly.
A(3, 0, 1) = (-((Real)2)*b0 + b1)*invDX;
1197 b0 = (FX[0][0][1] - poly(1, 0, 0, (Real)0, (Real)0, dz))*invDZ2;
1198 b1 = (FXZ[0][0][1] - poly(1, 0, 1, (Real)0, (Real)0, dz))*invDZ;
1199 poly.
A(1, 0, 2) = ((Real)3)*b0 - b1;
1200 poly.
A(1, 0, 3) = (-((Real)2)*b0 + b1)*invDZ;
1202 b0 = (F[1][0][1] - poly(0, 0, 0, dx, (Real)0, dz))*invDX2*invDZ2;
1203 b1 = (FX[1][0][1] - poly(1, 0, 0, dx, (Real)0, dz))*invDX*invDZ2;
1204 b2 = (FZ[1][0][1] - poly(0, 0, 1, dx, (Real)0, dz))*invDX2*invDZ;
1205 b3 = (FXZ[1][0][1] - poly(1, 0, 1, dx, (Real)0, dz))*invDX*invDZ;
1206 poly.
A(2, 0, 2) = ((Real)9)*b0 - ((Real)3)*b1 - ((Real)3)*b2 + b3;
1207 poly.
A(3, 0, 2) = (-((Real)6)*b0 + ((Real)3)*b1 + ((Real)2)*b2 - b3)*invDX;
1208 poly.
A(2, 0, 3) = (-((Real)6)*b0 + ((Real)2)*b1 + ((Real)3)*b2 - b3)*invDZ;
1209 poly.
A(3, 0, 3) = (((Real)4)*b0 - ((Real)2)*b1 - ((Real)2)*b2 + b3)*invDX*invDZ;
1212 b0 = (FZ[0][1][0] - poly(0, 0, 1, (Real)0, dy, (Real)0))*invDY2;
1213 b1 = (FYZ[0][1][0] - poly(0, 1, 1, (Real)0, dy, (Real)0))*invDY;
1214 poly.
A(0, 2, 1) = ((Real)3)*b0 - b1;
1215 poly.
A(0, 3, 1) = (-((Real)2)*b0 + b1)*invDY;
1217 b0 = (FY[0][0][1] - poly(0, 1, 0, (Real)0, (Real)0, dz))*invDZ2;
1218 b1 = (FYZ[0][0][1] - poly(0, 1, 1, (Real)0, (Real)0, dz))*invDZ;
1219 poly.
A(0, 1, 2) = ((Real)3)*b0 - b1;
1220 poly.
A(0, 1, 3) = (-((Real)2)*b0 + b1)*invDZ;
1222 b0 = (F[0][1][1] - poly(0, 0, 0, (Real)0, dy, dz))*invDY2*invDZ2;
1223 b1 = (FY[0][1][1] - poly(0, 1, 0, (Real)0, dy, dz))*invDY*invDZ2;
1224 b2 = (FZ[0][1][1] - poly(0, 0, 1, (Real)0, dy, dz))*invDY2*invDZ;
1225 b3 = (FYZ[0][1][1] - poly(0, 1, 1, (Real)0, dy, dz))*invDY*invDZ;
1226 poly.
A(0, 2, 2) = ((Real)9)*b0 - ((Real)3)*b1 - ((Real)3)*b2 + b3;
1227 poly.
A(0, 3, 2) = (-((Real)6)*b0 + ((Real)3)*b1 + ((Real)2)*b2 - b3)*invDY;
1228 poly.
A(0, 2, 3) = (-((Real)6)*b0 + ((Real)2)*b1 + ((Real)3)*b2 - b3)*invDZ;
1229 poly.
A(0, 3, 3) = (((Real)4)*b0 - ((Real)2)*b1 - ((Real)2)*b2 + b3)*invDY*invDZ;
1232 b0 = (FYZ[1][0][0] - poly(0, 1, 1, dx, (Real)0, (Real)0))*invDX2;
1233 b1 = (FXYZ[1][0][0] - poly(1, 1, 1, dx, (Real)0, (Real)0))*invDX;
1234 poly.
A(2, 1, 1) = ((Real)3)*b0 - b1;
1235 poly.
A(3, 1, 1) = (-((Real)2)*b0 + b1)*invDX;
1237 b0 = (FXZ[0][1][0] - poly(1, 0, 1, (Real)0, dy, (Real)0))*invDY2;
1238 b1 = (FXYZ[0][1][0] - poly(1, 1, 1, (Real)0, dy, (Real)0))*invDY;
1239 poly.
A(1, 2, 1) = ((Real)3)*b0 - b1;
1240 poly.
A(1, 3, 1) = (-((Real)2)*b0 + b1)*invDY;
1242 b0 = (FZ[1][1][0] - poly(0, 0, 1, dx, dy, (Real)0))*invDX2*invDY2;
1243 b1 = (FXZ[1][1][0] - poly(1, 0, 1, dx, dy, (Real)0))*invDX*invDY2;
1244 b2 = (FYZ[1][1][0] - poly(0, 1, 1, dx, dy, (Real)0))*invDX2*invDY;
1245 b3 = (FXYZ[1][1][0] - poly(1, 1, 1, dx, dy, (Real)0))*invDX*invDY;
1246 poly.
A(2, 2, 1) = ((Real)9)*b0 - ((Real)3)*b1 - ((Real)3)*b2 + b3;
1247 poly.
A(3, 2, 1) = (-((Real)6)*b0 + ((Real)3)*b1 + ((Real)2)*b2 - b3)*invDX;
1248 poly.
A(2, 3, 1) = (-((Real)6)*b0 + ((Real)2)*b1 + ((Real)3)*b2 - b3)*invDY;
1249 poly.
A(3, 3, 1) = (((Real)4)*b0 - ((Real)2)*b1 - ((Real)2)*b2 + b3)*invDX*invDY;
1252 b0 = (FXY[0][0][1] - poly(1, 1, 0, (Real)0, (Real)0, dz))*invDZ2;
1253 b1 = (FXYZ[0][0][1] - poly(1, 1, 1, (Real)0, (Real)0, dz))*invDZ;
1254 poly.
A(1, 1, 2) = ((Real)3)*b0 - b1;
1255 poly.
A(1, 1, 3) = (-((Real)2)*b0 + b1)*invDZ;
1257 b0 = (FY[1][0][1] - poly(0, 1, 0, dx, (Real)0, dz))*invDX2*invDZ2;
1258 b1 = (FXY[1][0][1] - poly(1, 1, 0, dx, (Real)0, dz))*invDX*invDZ2;
1259 b2 = (FYZ[1][0][1] - poly(0, 1, 1, dx, (Real)0, dz))*invDX2*invDZ;
1260 b3 = (FXYZ[1][0][1] - poly(1, 1, 1, dx, (Real)0, dz))*invDX*invDZ;
1261 poly.
A(2, 1, 2) = ((Real)9)*b0 - ((Real)3)*b1 - ((Real)3)*b2 + b3;
1262 poly.
A(3, 1, 2) = (-((Real)6)*b0 + ((Real)3)*b1 + ((Real)2)*b2 - b3)*invDX;
1263 poly.
A(2, 1, 3) = (-((Real)6)*b0 + ((Real)2)*b1 + ((Real)3)*b2 - b3)*invDZ;
1264 poly.
A(3, 1, 3) = (((Real)4)*b0 - ((Real)2)*b1 - ((Real)2)*b2 + b3)*invDX*invDZ;
1267 b0 = (FX[0][1][1] - poly(1, 0, 0, (Real)0, dy, dz))*invDY2*invDZ2;
1268 b1 = (FXY[0][1][1] - poly(1, 1, 0, (Real)0, dy, dz))*invDY*invDZ2;
1269 b2 = (FXZ[0][1][1] - poly(1, 0, 1, (Real)0, dy, dz))*invDY2*invDZ;
1270 b3 = (FXYZ[0][1][1] - poly(1, 1, 1, (Real)0, dy, dz))*invDY*invDZ;
1271 poly.
A(1, 2, 2) = ((Real)9)*b0 - ((Real)3)*b1 - ((Real)3)*b2 + b3;
1272 poly.
A(1, 3, 2) = (-((Real)6)*b0 + ((Real)3)*b1 + ((Real)2)*b2 - b3)*invDY;
1273 poly.
A(1, 2, 3) = (-((Real)6)*b0 + ((Real)2)*b1 + ((Real)3)*b2 - b3)*invDZ;
1274 poly.
A(1, 3, 3) = (((Real)4)*b0 - ((Real)2)*b1 - ((Real)2)*b2 + b3)*invDY*invDZ;
1277 b0 = (F[1][1][1] - poly(0, 0, 0, dx, dy, dz))*invDX2*invDY2*invDZ2;
1278 b1 = (FX[1][1][1] - poly(1, 0, 0, dx, dy, dz))*invDX*invDY2*invDZ2;
1279 b2 = (FY[1][1][1] - poly(0, 1, 0, dx, dy, dz))*invDX2*invDY*invDZ2;
1280 b3 = (FZ[1][1][1] - poly(0, 0, 1, dx, dy, dz))*invDX2*invDY2*invDZ;
1281 b4 = (FXY[1][1][1] - poly(1, 1, 0, dx, dy, dz))*invDX*invDY*invDZ2;
1282 b5 = (FXZ[1][1][1] - poly(1, 0, 1, dx, dy, dz))*invDX*invDY2*invDZ;
1283 b6 = (FYZ[1][1][1] - poly(0, 1, 1, dx, dy, dz))*invDX2*invDY*invDZ;
1284 b7 = (FXYZ[1][1][1] - poly(1, 1, 1, dx, dy, dz))*invDX*invDY*invDZ;
1285 poly.
A(2, 2, 2) = ((Real)27)*b0 - ((Real)9)*b1 - ((Real)9)*b2 -
1286 ((Real)9)*b3 + ((Real)3)*b4 + ((Real)3)*b5 + ((Real)3)*b6 - b7;
1287 poly.
A(3, 2, 2) = (((Real)-18)*b0 + ((Real)9)*b1 + ((Real)6)*b2 +
1288 ((Real)6)*b3 - ((Real)3)*b4 - ((Real)3)*b5 - ((Real)2)*b6 + b7)*invDX;
1289 poly.
A(2, 3, 2) = (((Real)-18)*b0 + ((Real)6)*b1 + ((Real)9)*b2 +
1290 ((Real)6)*b3 - ((Real)3)*b4 - ((Real)2)*b5 - ((Real)3)*b6 + b7)*invDY;
1291 poly.
A(2, 2, 3) = (((Real)-18)*b0 + ((Real)6)*b1 + ((Real)6)*b2 +
1292 ((Real)9)*b3 - ((Real)2)*b4 - ((Real)3)*b5 - ((Real)3)*b6 + b7)*invDZ;
1293 poly.
A(3, 3, 2) = (((Real)12)*b0 - ((Real)6)*b1 - ((Real)6)*b2 -
1294 ((Real)4)*b3 + ((Real)3)*b4 + ((Real)2)*b5 + ((Real)2)*b6 - b7)*
1296 poly.
A(3, 2, 3) = (((Real)12)*b0 - ((Real)6)*b1 - ((Real)4)*b2 -
1297 ((Real)6)*b3 + ((Real)2)*b4 + ((Real)3)*b5 + ((Real)2)*b6 - b7)*
1299 poly.
A(2, 3, 3) = (((Real)12)*b0 - ((Real)4)*b1 - ((Real)6)*b2 -
1300 ((Real)6)*b3 + ((Real)2)*b4 + ((Real)2)*b5 + ((Real)3)*b6 - b7)*
1302 poly.
A(3, 3, 3) = (((Real)-8)*b0 + ((Real)4)*b1 + ((Real)4)*b2 +
1303 ((Real)4)*b3 - ((Real)2)*b4 - ((Real)2)*b5 - ((Real)2)*b6 + b7)*
1307 template <
typename Real>
1310 for (xIndex = 0; xIndex + 1 <
mXBound; ++xIndex)
1323 template <
typename Real>
1326 for (yIndex = 0; yIndex + 1 <
mYBound; ++yIndex)
1339 template <
typename Real>
1342 for (zIndex = 0; zIndex + 1 <
mZBound; ++zIndex)
1355 template <
typename Real>
1358 memset(&mCoeff[0][0][0], 0, 64 *
sizeof(Real));
1361 template <
typename Real>
1364 return mCoeff[ix][iy][iz];
1367 template <
typename Real>
1371 Real xPow[4] = { (Real)1, x, x * x, x * x * x };
1372 Real yPow[4] = { (Real)1, y, y * y, y * y * y };
1373 Real zPow[4] = { (Real)1, z, z * z, z * z * z };
1376 for (
int iz = 0; iz <= 3; ++iz)
1378 for (
int iy = 0; iy <= 3; ++iy)
1380 for (
int ix = 0; ix <= 3; ++ix)
1382 p += mCoeff[ix][iy][iz] * xPow[ix] * yPow[iy] * zPow[iz];
1390 template <
typename Real>
1392 int zOrder, Real
x, Real
y, Real
z)
const 1401 xPow[3] = x * x *
x;
1406 xPow[2] = ((Real)2) *
x;
1407 xPow[3] = ((Real)3) * x *
x;
1413 xPow[3] = ((Real)6) *
x;
1432 yPow[3] = y * y *
y;
1437 yPow[2] = ((Real)2) *
y;
1438 yPow[3] = ((Real)3) * y *
y;
1444 yPow[3] = ((Real)6) *
y;
1463 zPow[3] = z * z *
z;
1468 zPow[2] = ((Real)2) *
z;
1469 zPow[3] = ((Real)3) * z *
z;
1475 zPow[3] = ((Real)6) *
z;
1489 for (
int iz = 0; iz <= 3; ++iz)
1491 for (
int iy = 0; iy <= 3; ++iy)
1493 for (
int ix = 0; ix <= 3; ++ix)
1495 p += mCoeff[ix][iy][iz] * xPow[ix] * yPow[iy] * zPow[iz];
gte::BSNumber< UIntegerType > abs(gte::BSNumber< UIntegerType > const &number)
#define LogAssert(condition, message)
GLdouble GLdouble GLdouble z