28 template <
class T,
unsigned Dim>
36 template <
unsigned Dim>
47 template <
class FT,
class M,
class C,
class PT>
58 ngp =
FindNGP(mesh, ppos, ctag);
84 ERRORMSG(
"IntTSC::scatter: not implemented for Dim>3!!"<<
endl);
90 template <
class FT,
class M,
class C,
class PT>
99 ngp =
FindNGP(mesh, ppos, ctag);
101 FindPos(gpos, mesh, ngp, ctag);
125 ERRORMSG(
"IntTSC::scatter: not implemented for Dim>3!!"<<
endl);
130 template <
class FT,
class M,
class C,
class PT>
141 ERRORMSG(
"IntTSC::scatter: not implemented for Dim>3!!"<<
endl);
146 template <
class FT,
class M,
class C,
class PT>
156 ngp =
FindNGP(mesh, ppos, ctag);
158 FindPos(gpos, mesh, ngp, ctag);
182 ERRORMSG(
"IntTSC::gather: not implemented for Dim>3!!"<<
endl);
188 template <
class FT,
class M,
class C,
class PT>
197 ngp =
FindNGP(mesh, ppos, ctag);
199 FindPos(gpos, mesh, ngp, ctag);
223 ERRORMSG(
"IntTSC::gather: not implemented for Dim>3!!"<<
endl);
228 template <
class FT,
class M,
class C,
class PT>
239 ERRORMSG(
"IntTSC::gather: not implemented for Dim>3!!"<<
endl);
257 template <
class FT,
class M,
class C,
class PT>
266 ngp =
FindNGP(mesh, ppos, ctag);
268 FindPos(gpos, mesh, ngp, ctag);
278 auto W = [dpos](
int p,
unsigned i) {
279 if (p==-1)
return .125 * (1 - 4 * dpos(i) + 4 * dpos(i) * dpos(i));
280 else if (p==0)
return .25 * (3 - 4 * dpos(i) * dpos(i));
281 else if (p==+1)
return .125 * (1 + 4 * dpos(i) + 4 * dpos(i) * dpos(i)); };
283 for (
int p0 = -1; p0 <= 1; ++p0) {
284 fiter.
offset(p0) +=
W(p0,0) * pdata;
291 template <
class FT,
class M,
class C,
class PT>
300 ngp =
FindNGP(mesh, ppos, ctag);
302 FindPos(gpos, mesh, ngp, ctag);
312 auto W = [dpos](
int p,
unsigned i) {
313 if (p==-1)
return .125 * (1 - 4 * dpos(i) + 4 * dpos(i) * dpos(i));
314 else if (p==0)
return .25 * (3 - 4 * dpos(i) * dpos(i));
315 else if (p==+1)
return .125 * (1 + 4 * dpos(i) + 4 * dpos(i) * dpos(i)); };
317 for (
int p0 = -1; p0 <= 1; ++p0) {
318 fiter.
offset(p0) +=
W(p0,0) * pdata;
324 template <
class FT,
class M,
class C,
class PT>
335 auto W = [dpos](
int p,
unsigned i) {
336 if (p==-1)
return .125 * (1 - 4 * dpos(i) + 4 * dpos(i) * dpos(i));
337 else if (p==0)
return .25 * (3 - 4 * dpos(i) * dpos(i));
338 else if (p==+1)
return .125 * (1 + 4 * dpos(i) + 4 * dpos(i) * dpos(i)); };
340 for (
int p0 = -1; p0 <= 1; ++p0) {
341 fiter.
offset(p0) +=
W(p0,0) * pdata;
348 template <
class FT,
class M,
class C,
class PT>
357 ngp =
FindNGP(mesh, ppos, ctag);
359 FindPos(gpos, mesh, ngp, ctag);
369 auto W = [dpos](
int p,
unsigned i) {
370 if (p==-1)
return .125 * (1 - 4 * dpos(i) + 4 * dpos(i) * dpos(i));
371 else if (p==0)
return .25 * (3 - 4 * dpos(i) * dpos(i));
372 else if (p==+1)
return .125 * (1 + 4 * dpos(i) + 4 * dpos(i) * dpos(i)); };
375 for (
int p0 = -1; p0 <= 1; ++p0) {
376 pdata +=
W(p0,0) * fiter.
offset(p0);
383 template <
class FT,
class M,
class C,
class PT>
392 ngp =
FindNGP(mesh, ppos, ctag);
394 FindPos(gpos, mesh, ngp, ctag);
404 auto W = [dpos](
int p,
unsigned i) {
405 if (p==-1)
return .125 * (1 - 4 * dpos(i) + 4 * dpos(i) * dpos(i));
406 else if (p==0)
return .25 * (3 - 4 * dpos(i) * dpos(i));
407 else if (p==+1)
return .125 * (1 + 4 * dpos(i) + 4 * dpos(i) * dpos(i)); };
410 for (
int p0 = -1; p0 <= 1; ++p0) {
411 pdata +=
W(p0,0) * fiter.
offset(p0);
418 template <
class FT,
class M,
class C,
class PT>
427 auto W = [dpos](
int p,
unsigned i) {
428 if (p==-1)
return .125 * (1 - 4 * dpos(i) + 4 * dpos(i) * dpos(i));
429 else if (p==0)
return .25 * (3 - 4 * dpos(i) * dpos(i));
430 else if (p==+1)
return .125 * (1 + 4 * dpos(i) + 4 * dpos(i) * dpos(i)); };
433 for (
int p0 = -1; p0 <= 1; ++p0) {
434 pdata +=
W(p0,0) * fiter.
offset(p0);
454 template <
class FT,
class M,
class C,
class PT>
463 ngp =
FindNGP(mesh, ppos, ctag);
465 FindPos(gpos, mesh, ngp, ctag);
475 auto W = [dpos](
int p,
unsigned i) {
476 if (p==-1)
return .125 * (1 - 4 * dpos(i) + 4 * dpos(i) * dpos(i));
477 else if (p==0)
return .25 * (3 - 4 * dpos(i) * dpos(i));
478 else if (p==+1)
return .125 * (1 + 4 * dpos(i) + 4 * dpos(i) * dpos(i)); };
480 for (
int p0 = -1; p0 <= 1; ++p0) {
481 for (
int p1 = -1; p1 <= 1; ++p1) {
482 fiter.
offset(p0,p1) +=
W(p0,0) *
W(p1,1) * pdata;
490 template <
class FT,
class M,
class C,
class PT>
499 ngp =
FindNGP(mesh, ppos, ctag);
501 FindPos(gpos, mesh, ngp, ctag);
511 auto W = [dpos](
int p,
unsigned i) {
512 if (p==-1)
return .125 * (1 - 4 * dpos(i) + 4 * dpos(i) * dpos(i));
513 else if (p==0)
return .25 * (3 - 4 * dpos(i) * dpos(i));
514 else if (p==+1)
return .125 * (1 + 4 * dpos(i) + 4 * dpos(i) * dpos(i)); };
516 for (
int p0 = -1; p0 <= 1; ++p0) {
517 for (
int p1 = -1; p1 <= 1; ++p1) {
518 fiter.
offset(p0,p1) +=
W(p0,0) *
W(p1,1) * pdata;
526 template <
class FT,
class M,
class C,
class PT>
537 auto W = [dpos](
int p,
unsigned i) {
538 if (p==-1)
return .125 * (1 - 4 * dpos(i) + 4 * dpos(i) * dpos(i));
539 else if (p==0)
return .25 * (3 - 4 * dpos(i) * dpos(i));
540 else if (p==+1)
return .125 * (1 + 4 * dpos(i) + 4 * dpos(i) * dpos(i)); };
542 for (
int p0 = -1; p0 <= 1; ++p0) {
543 for (
int p1 = -1; p1 <= 1; ++p1) {
544 fiter.
offset(p0,p1) +=
W(p0,0) *
W(p1,1) * pdata;
552 template <
class FT,
class M,
class C,
class PT>
561 ngp =
FindNGP(mesh, ppos, ctag);
563 FindPos(gpos, mesh, ngp, ctag);
574 auto W = [dpos](
int p,
unsigned i) {
575 if (p==-1)
return .125 * (1 - 4 * dpos(i) + 4 * dpos(i) * dpos(i));
576 else if (p==0)
return .25 * (3 - 4 * dpos(i) * dpos(i));
577 else if (p==+1)
return .125 * (1 + 4 * dpos(i) + 4 * dpos(i) * dpos(i)); };
579 for (
int p0 = -1; p0 <= 1; ++p0) {
580 for (
int p1 = -1; p1 <= 1; ++p1) {
581 pdata +=
W(p0,0) *
W(p1,1) * fiter.
offset(p0,p1);
589 template <
class FT,
class M,
class C,
class PT>
598 ngp =
FindNGP(mesh, ppos, ctag);
600 FindPos(gpos, mesh, ngp, ctag);
611 auto W = [dpos](
int p,
unsigned i) {
612 if (p==-1)
return .125 * (1 - 4 * dpos(i) + 4 * dpos(i) * dpos(i));
613 else if (p==0)
return .25 * (3 - 4 * dpos(i) * dpos(i));
614 else if (p==+1)
return .125 * (1 + 4 * dpos(i) + 4 * dpos(i) * dpos(i)); };
616 for (
int p0 = -1; p0 <= 1; ++p0) {
617 for (
int p1 = -1; p1 <= 1; ++p1) {
618 pdata +=
W(p0,0) *
W(p1,1) * fiter.
offset(p0,p1);
625 template <
class FT,
class M,
class C,
class PT>
635 auto W = [dpos](
int p,
unsigned i) {
636 if (p==-1)
return .125 * (1 - 4 * dpos(i) + 4 * dpos(i) * dpos(i));
637 else if (p==0)
return .25 * (3 - 4 * dpos(i) * dpos(i));
638 else if (p==+1)
return .125 * (1 + 4 * dpos(i) + 4 * dpos(i) * dpos(i)); };
640 for (
int p0 = -1; p0 <= 1; ++p0) {
641 for (
int p1 = -1; p1 <= 1; ++p1) {
642 pdata +=
W(p0,0) *
W(p1,1) * fiter.
offset(p0,p1);
662 template <
class FT,
class M,
class C,
class PT>
673 ngp =
FindNGP(mesh, ppos, ctag);
675 FindPos(gpos, mesh, ngp, ctag);
685 auto W = [dpos](
int p,
unsigned i) {
686 if (p==-1)
return .125 * (1 - 4 * dpos(i) + 4 * dpos(i) * dpos(i));
687 else if (p==0)
return .25 * (3 - 4 * dpos(i) * dpos(i));
688 else if (p==+1)
return .125 * (1 + 4 * dpos(i) + 4 * dpos(i) * dpos(i)); };
690 for (
int p0 = -1; p0 <= 1; ++p0) {
691 for (
int p1 = -1; p1 <= 1; ++p1) {
692 for (
int p2 = -1; p2 <= 1; ++p2) {
693 fiter.
offset(p0,p1,p2) +=
W(p0,0) *
W(p1,1) *
W(p2,2) * pdata;
702 template <
class FT,
class M,
class C,
class PT>
711 ngp =
FindNGP(mesh, ppos, ctag);
713 FindPos(gpos, mesh, ngp, ctag);
723 auto W = [dpos](
int p,
unsigned i) {
724 if (p==-1)
return .125 * (1 - 4 * dpos(i) + 4 * dpos(i) * dpos(i));
725 else if (p==0)
return .25 * (3 - 4 * dpos(i) * dpos(i));
726 else if (p==+1)
return .125 * (1 + 4 * dpos(i) + 4 * dpos(i) * dpos(i)); };
728 for (
int p0 = -1; p0 <= 1; ++p0) {
729 for (
int p1 = -1; p1 <= 1; ++p1) {
730 for (
int p2 = -1; p2 <= 1; ++p2) {
731 fiter.
offset(p0,p1,p2) +=
W(p0,0) *
W(p1,1) *
W(p2,2) * pdata;
739 template <
class FT,
class M,
class C,
class PT>
748 auto W = [dpos](
int p,
unsigned i) {
749 if (p==-1)
return .125 * (1 - 4 * dpos(i) + 4 * dpos(i) * dpos(i));
750 else if (p==0)
return .25 * (3 - 4 * dpos(i) * dpos(i));
751 else if (p==+1)
return .125 * (1 + 4 * dpos(i) + 4 * dpos(i) * dpos(i)); };
753 for (
int p0 = -1; p0 <= 1; ++p0) {
754 for (
int p1 = -1; p1 <= 1; ++p1) {
755 for (
int p2 = -1; p2 <= 1; ++p2) {
756 fiter.
offset(p0,p1,p2) +=
W(p0,0) *
W(p1,1) *
W(p2,2) * pdata;
764 template <
class FT,
class M,
class C,
class PT>
773 ngp =
FindNGP(mesh, ppos, ctag);
775 FindPos(gpos, mesh, ngp, ctag);
786 auto W = [dpos](
int p,
unsigned i) {
787 if (p==-1)
return .125 * (1 - 4 * dpos(i) + 4 * dpos(i) * dpos(i));
788 else if (p==0)
return .25 * (3 - 4 * dpos(i) * dpos(i));
789 else if (p==+1)
return .125 * (1 + 4 * dpos(i) + 4 * dpos(i) * dpos(i)); };
791 for (
int p0 = -1; p0 <= 1; ++p0) {
792 for (
int p1 = -1; p1 <= 1; ++p1) {
793 for (
int p2 = -1; p2 <= 1; ++p2) {
794 pdata +=
W(p0,0) *
W(p1,1) *
W(p2,2) * fiter.
offset(p0,p1,p2);
803 template <
class FT,
class M,
class C,
class PT>
812 ngp =
FindNGP(mesh, ppos, ctag);
814 FindPos(gpos, mesh, ngp, ctag);
825 auto W = [dpos](
int p,
unsigned i) {
826 if (p==-1)
return .125 * (1 - 4 * dpos(i) + 4 * dpos(i) * dpos(i));
827 else if (p==0)
return .25 * (3 - 4 * dpos(i) * dpos(i));
828 else if (p==+1)
return .125 * (1 + 4 * dpos(i) + 4 * dpos(i) * dpos(i)); };
830 for (
int p0 = -1; p0 <= 1; ++p0) {
831 for (
int p1 = -1; p1 <= 1; ++p1) {
832 for (
int p2 = -1; p2 <= 1; ++p2) {
833 pdata +=
W(p0,0) *
W(p1,1) *
W(p2,2) * fiter.
offset(p0,p1,p2);
841 template <
class FT,
class M,
class C,
class PT>
853 auto W = [dpos](
int p,
unsigned i) {
854 if (p==-1)
return .125 * (1 - 4 * dpos(i) + 4 * dpos(i) * dpos(i));
855 else if (p==0)
return .25 * (3 - 4 * dpos(i) * dpos(i));
856 else if (p==+1)
return .125 * (1 + 4 * dpos(i) + 4 * dpos(i) * dpos(i)); };
858 for (
int p0 = -1; p0 <= 1; ++p0) {
859 for (
int p1 = -1; p1 <= 1; ++p1) {
860 for (
int p2 = -1; p2 <= 1; ++p2) {
861 pdata +=
W(p0,0) *
W(p1,1) *
W(p2,2) * fiter.
offset(p0,p1,p2);
882 template <
class FT,
unsigned Dim,
class M,
class C,
class PT>
891 template <
class FT,
unsigned Dim,
class M,
class C,
class PT>
901 template <
class FT,
unsigned Dim,
class M,
class C,
class PT>
910 template <
class FT,
unsigned Dim,
class M,
class C,
class PT>
919 template <
class FT,
unsigned Dim,
class M,
class C,
class PT>
929 template <
class FT,
unsigned Dim,
class M,
class C,
class PT>
NDIndex< Dim > FindNGP(const M &mesh, const Vektor< PT, Dim > &ppos, CenteringTag< Cell >)
void FindDelta(Vektor< PT, Dim > &delta, const M &mesh, const NDIndex< Dim > &gp, CenteringTag< Cell >)
void FindPos(Vektor< PT, Dim > &pos, const M &mesh, const NDIndex< Dim > &indices, CenteringTag< Cell >)
Inform & endl(Inform &inf)
static CompressedBrickIterator< T, Dim > getFieldIter(const BareField< T, Dim > &f, const NDIndex< Dim > &pt)
CacheDataTSC< T, Dim > Cache_t
static void gather(FT &, const Field< FT, Dim, M, C > &f, const Vektor< PT, Dim > &ppos, const M &mesh)
static void scatter(const FT &, Field< FT, Dim, M, C > &f, const Vektor< PT, Dim > &ppos, const M &mesh, NDIndex< Dim > &ngp, int[Dim], Vektor< PT, Dim > &dpos)
static void scatter(const FT &, Field< FT, Dim, M, C > &f, const NDIndex< Dim > &ngp, const int[Dim], const Vektor< PT, Dim > &)
static void gather(FT &, const Field< FT, Dim, M, C > &f, const Vektor< PT, Dim > &ppos, const M &mesh, NDIndex< Dim > &ngp, int[Dim], Vektor< PT, Dim > &dpos)
static void scatter(const FT &, Field< FT, Dim, M, C > &f, const Vektor< PT, Dim > &ppos, const M &mesh)
static void gather(FT &, const Field< FT, Dim, M, C > &f, const NDIndex< Dim > &ngp, const int[Dim], const Vektor< PT, Dim > &)
static void gather(FT &pdata, const Field< FT, 1U, M, C > &f, const Vektor< PT, 1U > &ppos, const M &mesh, NDIndex< 1U > &ngp, int[1U], Vektor< PT, 1U > &dpos)
static void scatter(const FT &pdata, Field< FT, 1U, M, C > &f, const Vektor< PT, 1U > &ppos, const M &mesh, NDIndex< 1U > &ngp, int[1U], Vektor< PT, 1U > &dpos)
static void scatter(const FT &pdata, Field< FT, 1U, M, C > &f, const NDIndex< 1U > &ngp, const int[1U], const Vektor< PT, 1U > &dpos)
static void scatter(const FT &pdata, Field< FT, 1U, M, C > &f, const Vektor< PT, 1U > &ppos, const M &mesh)
static void gather(FT &pdata, const Field< FT, 1U, M, C > &f, const NDIndex< 1U > &ngp, const int[1U], const Vektor< PT, 1U > &dpos)
static void gather(FT &pdata, const Field< FT, 1U, M, C > &f, const Vektor< PT, 1U > &ppos, const M &mesh)
static void scatter(const FT &pdata, Field< FT, 2U, M, C > &f, const Vektor< PT, 2U > &ppos, const M &mesh, NDIndex< 2U > &ngp, int[2U], Vektor< PT, 2U > &dpos)
static void scatter(const FT &pdata, Field< FT, 2U, M, C > &f, const Vektor< PT, 2U > &ppos, const M &mesh)
static void gather(FT &pdata, const Field< FT, 2U, M, C > &f, const Vektor< PT, 2U > &ppos, const M &mesh, NDIndex< 2U > &ngp, int[2U], Vektor< PT, 2U > &dpos)
static void scatter(const FT &pdata, Field< FT, 2U, M, C > &f, const NDIndex< 2U > &ngp, const int[2U], const Vektor< PT, 2U > &dpos)
static void gather(FT &pdata, const Field< FT, 2U, M, C > &f, const Vektor< PT, 2U > &ppos, const M &mesh)
static void gather(FT &pdata, const Field< FT, 2U, M, C > &f, const NDIndex< 2U > &ngp, const int[2U], const Vektor< PT, 2U > &dpos)
static void scatter(const FT &pdata, Field< FT, 3U, M, C > &f, const Vektor< PT, 3U > &ppos, const M &mesh, NDIndex< 3U > &ngp, int[3U], Vektor< PT, 3U > &dpos)
static void scatter(const FT &pdata, Field< FT, 3U, M, C > &f, const NDIndex< 3U > &ngp, const int[3U], const Vektor< PT, 3U > &dpos)
static void gather(FT &pdata, const Field< FT, 3U, M, C > &f, const Vektor< PT, 3U > &ppos, const M &mesh)
static void gather(FT &pdata, const Field< FT, 3U, M, C > &f, const Vektor< PT, 3U > &ppos, const M &mesh, NDIndex< 3U > &ngp, int[3U], Vektor< PT, 3U > &dpos)
static void scatter(const FT &pdata, Field< FT, 3U, M, C > &f, const Vektor< PT, 3U > &ppos, const M &mesh)
static void gather(FT &pdata, const Field< FT, 3U, M, C > &f, const NDIndex< 3U > &ngp, const int[3U], const Vektor< PT, 3U > &dpos)
static void gather(FT &pdata, const Field< FT, Dim, M, C > &f, const CacheDataTSC< PT, Dim > &cache)
static void gather(FT &pdata, const Field< FT, Dim, M, C > &f, const Vektor< PT, Dim > &ppos, const M &mesh, CacheDataTSC< PT, Dim > &cache)
static void gather(FT &pdata, const Field< FT, Dim, M, C > &f, const Vektor< PT, Dim > &ppos, const M &mesh)
static void scatter(const FT &pdata, Field< FT, Dim, M, C > &f, const Vektor< PT, Dim > &ppos, const M &mesh, CacheDataTSC< PT, Dim > &cache)
static void scatter(const FT &pdata, Field< FT, Dim, M, C > &f, const Vektor< PT, Dim > &ppos, const M &mesh)
static void scatter(const FT &pdata, Field< FT, Dim, M, C > &f, const CacheDataTSC< PT, Dim > &cache)