90 void buildInvertVectorList();
99 std::vector<std::vector<std::vector<double>>>
dIdJCoefs;
337 unsigned const int nDimentions;
338 unsigned const int nPoints;
339 virtual vector<int> & getVector(unsigned int i)=0;
341 GridTemplate(unsigned int nD, unsigned int nP);
360 template <typename T>
361 inline static const T interpol(const Vec<NV,T> &d, const Vec<ND,lFl> &e) {
362 return d.x()*(1.-e.x())+d.y()*e.x();
382 template <typename T>
383 inline static const T interpol(const Vec<NV,T> &d, const Vec<ND,lFl> &e) {
384 return d[0]*(1.-e.x())*(1.-e.y())+d[1]*e.x()*(1.-e.y())+
385 d[2]*(1.-e.x())*e.y() +d[3]*e.x()*e.y();
410 template <typename T>
411 inline static const T interpol(const Vec<NV,T> &d, const Vec<ND,lFl> &e) {
412 return d[0]*(1.-e.x())*(1.-e.y())*(1.-e.z())
413 +d[1]* e.x()* (1.-e.y())*(1.-e.z())
414 +d[2]*(1.-e.x())* e.y()* (1.-e.z())
415 +d[3]* e.x()* e.y()* (1.-e.z())
416 +d[4]*(1.-e.x())*(1.-e.y())* e.z()
417 +d[5]* e.x()* (1.-e.y())* e.z()
418 +d[6]*(1.-e.x())* e.y()* e.z()
419 +d[7]* e.x()* e.y()* e.z();
446 static inline int io(int i) {
447 static const int inv[NV] = {0,3,4,1,2,7,8,5,6};
450 static inline lFl s(const Vec<NV> &p) {
451 return (w1*p[0]+w2*(p[1]+p[2]+p[3]+p[4])+w3*(p[5]+p[6]+p[7]+p[8]));
453 static inline lFl s(Vec<NV> &p, const lFl &val) {
454 return (p[0] =p[1] =p[2] =p[3] =p[4] =p[5] =p[6] =p[7] =p[8] =val);
457 static inline const Vec<ND> v(const Vec<NV> &p) {
458 return Vec<2>(w2*(p[1]-p[3])+w3*(p[5]-p[6]-p[7]+p[8]),
459 w2*(p[2]-p[4])+w3*(p[5]+p[6]-p[7]-p[8]));
461 static inline const Vec<ND> v(Vec<NV> &p, const Vec<ND> &val) {
463 for (int i(0); i < NV; ++i)
464 p[i] =p0+val*Vec<ND>(l(i))*as2i;
469 static inline lFl lc(int i) {
470 static const lFl c[NV] = {-10./3.,2./3.,2./3.,2./3.,2./3.,1./6.,1./6.,1./6.,1./6.};
493 inline static int io(int i) {
494 static const int inv[NV] = {0,3,4,1,2};
498 static inline lFl lc(int i) {
499 static const lFl c[NV] = {-4.,1.,1.,1.,1.};
522 inline static int io(int i) {
523 static const int inv[NV] = {2,3,0,1};
526 static inline lFl s(const Vec<NV> &p) {return (w1*(p[0]+p[1]+p[2]+p[3]));}
527 static inline lFl s(Vec<NV> &p, const lFl &val) {return (p[0] =p[1] =p[2] =p[3] =val);}
528 static inline const Vec<ND> v(const Vec<NV> &p) {
529 return Vec<ND>(w1*(p[0]-p[2]),w1*(p[1]-p[3]));
531 static inline const Vec<ND> v(Vec<NV> &p, const Vec<ND> &val) {
533 for (int i(0); i < NV; ++i)p[i] =p0+val*Vec<ND>(l(i))*as2i;
558 inline static int io(int i) {
559 static const int inv[NV] = {0,4,5,6,1,2,3};
563 static inline lFl lc(int i) {
564 static const lFl c[NV] = {-6.,1.,1.,1.,1.,1.,1.};
589 inline static int io(int i) {
590 static const int inv[NV] = {3,4,5,0,1,2};
593 static inline lFl s(const Vec<NV> &p) {return (w1*(p[0]+p[1]+p[2]+p[3]+p[4]+p[5]));}
594 static inline lFl s(Vec<NV> &p, const lFl &val) {
595 return (p[0] =p[1] =p[2] =p[3] =p[4] =p[5] =val);
597 static inline const Vec<ND> v(const Vec<NV> &p) {
598 return Vec<ND>(w1*(p[0]-p[3]),w1*(p[1]-p[4]),w1*(p[2]-p[5]));
600 static inline const Vec<ND> v(Vec<NV> &p, const Vec<ND> &val) {
602 for (int i(0); i < NV; ++i)p[i] =p0+val*Vec<ND>(l(i))*as2i;
633 inline static int io(int i) {
634 static const int inv[NV] = {0,4,5,6,1,2,3,9,10,7,8,13,14,11,12,17,18,15,16};
637 static inline lFl s(const Vec<NV> &p) {
638 return (w1*p[0]+w2*(p[1]+p[2]+p[3]+p[4]+p[5]+p[6])
639 +w3*(p[7]+p[8]+p[9]+p[10]+p[11]+p[12]+p[13]+p[14]+p[15]+p[16]+p[17]+p[18]));
641 static inline lFl s(Vec<NV> &p, const lFl &val) {p=val; return val;}
643 static inline const Vec<ND> v(const Vec<NV> &p) {
645 Vec<ND>(w2*(p[1]-p[4])+w3*( p[7] +p[8]- p[9]-p[10]+p[15]+p[16]-p[17]-p[18]),
646 w2*(p[2]-p[5])+w3*( p[7] -p[8]- p[9]+p[10]+p[11]+p[12]-p[13]-p[14]),
647 w2*(p[3]-p[6])+w3*(p[11]-p[12]-p[13]+p[14]+p[15]-p[16]-p[17]+p[18]));
649 static inline const Vec<ND> v(Vec<NV> &p, const Vec<ND> &val) {
651 for (int i(0); i < NV; ++i)p[i] =p0+val*Vec<ND>(l(i))*as2i;
655 static inline lFl lc(int i) {
656 static const lFl c[NV] = {-4.,
657 1./3.,1./3.,1./3.,1./3.,1./3.,1./3.,
658 1./6.,1./6.,1./6.,1./6.,1./6.,1./6.,
659 1./6.,1./6.,1./6.,1./6.,1./6.,1./6.};
687 static inline int io(int i) {
688 static const int inv[NV] = {0,4,5,6,1,2,3,14,13,12,11,10,9,8,7};
691 static inline lFl s(const Vec<NV> &p) {
692 return (w1*p[0]+w2*(p[1]+p[2]+p[3]+p[4]+p[5]+p[6])
693 +w3*(p[7]+p[8]+p[9]+p[10]+p[11]+p[12]+p[13]+p[14]));
695 static inline lFl s(Vec<NV> &p, const lFl &val) {p=val; return val;}
697 template <typename Td,typename SD>
698 static inline const Vec<ND> v(const Vec<NV,Td,SD> &p)
701 Vec<ND>(w2*(p[1]-p[4])+w3*(p[7]+p[8]+p[9]+p[10]-p[11]-p[12]-p[13]-p[14]),
702 w2*(p[2]-p[5])+w3*(p[7]+p[8]-p[9]-p[10]+p[11]+p[12]-p[13]-p[14]),
703 w2*(p[3]-p[6])+w3*(p[7]-p[8]+p[9]-p[10]+p[11]-p[12]+p[13]-p[14]));
705 static inline void v(Vec<NV> &p, const Vec<ND> &val) {
707 for (int i(0); i < NV; ++i)p[i] =p0+val*Vec<ND>(l(i))*as2i;
709 template <typename Ty>
710 static inline void v(Vec<NV,lFl,Ty> p, const Vec<ND> &val)
713 for (int i(0); i < NV; ++i)p[i] =p0+val*Vec<ND>(l(i))*as2i;
717 static inline lFl lc(int i) {
718 static const lFl c[NV] = {-14./3.,
719 2./3.,2./3.,2./3.,2./3.,2./3.,2./3.,
720 1./12.,1./12.,1./12.,1./12.,
721 1./12.,1./12.,1./12.,1./12.};
752 inline static int io(int i) {
753 static const int inv[NV] = {0,
755 9,10,7,8,13,14,11,12,17,18,15,16,
756 26,25,24,23,22,21,20,19};
777 inline static int io(int i) {
778 static const int inv[NV] = {0,2,1};
799 inline static int io(int i) {
800 static const int inv[NV] = {1,0};
806 template <typename Tl> inline Vec<Tl::NV> lrv(const Vec<Tl::NV> &f_) {
808 for (int i(0); i < Tl::NV; ++i) {a[i] =f_[Tl::io(i)];}
812 template <typename Tl,int I> inline void _l1f_c(I2T<I>,Tl, const Vec<Tl::ND> &v_,Vec<Tl::NV> &a){
813 typedef typename Tl::SV SV;
814 a[I] =SV()[I2T<I>()]*v_; _l1f_c(I2T<I-1>(),Tl(),v_,a);
816 template <typename Tl> inline void _l1f_c(I2T<0>,Tl, const Vec<Tl::ND> &v_,Vec<Tl::NV> &a){
817 typedef typename Tl::SV SV;
818 a[0] =SV()[I2T<0>()]*v_;
822 template <typename Tl> inline Vec<Tl::NV> l1f(const Vec<Tl::ND> &v_) {
823 typedef Vec<Tl::ND> TV;
825 // for (int i(0); i < Tl::NV; ++i) {a[i] =TV(Tl::l(i))*v_;}
826 _l1f_c(I2T<Tl::NV-1>(),Tl(),v_,a);
830 template <typename Tl,int I>
831 inline void _l2f_c(I2T<I>,Tl, const Vec<Tl::ND> &v1_, const Vec<Tl::ND> &v2_,Vec<Tl::NV> &a){
832 class Tl::SV q; a[I] =(q[I2T<I>()]*v1_)*(q[I2T<I>()]*v2_); _l2f_c(I2T<I-1>(),Tl(),v1_,v2_,a);
834 template <typename Tl>
835 inline void _l2f_c(I2T<0>,Tl, const Vec<Tl::ND> &v1_, const Vec<Tl::ND> &v2_,Vec<Tl::NV> &a){
836 class Tl::SV q; a[0] =(q[I2T<0>()]*v1_)*(q[I2T<0>()]*v2_);
840 template <typename Tl> inline Vec<Tl::NV> l2f(const Vec<Tl::ND> &v1_, const Vec<Tl::ND> &v2_) {
841 typedef Vec<Tl::ND> TV;
843 // for (int i(0); i < Tl::NV; ++i) {a[i] =(TV(Tl::l(i))*v1_)*(TV(Tl::l(i))*v2_);}
844 _l2f_c(I2T<Tl::NV-1>(),Tl(),v1_,v2_,a);
Defines set of vectros with several properties.
std::vector< double > quasiparticlesCoefs
VectorTemplate(int n, AVec< int > *vec)
std::vector< std::vector< std::vector< double > > > dIdJCoefs
std::vector< AVec< int > > vectors
VectorTemplate(int n, AVec< int > *vec, double *lc, double *gc)
unsigned int numberOfDimentions() const
AVec< int > getInverVector(unsigned int i)
std::vector< double > laplasCoefs
std::vector< std::vector< double > > dxCoefs
std::vector< unsigned int > invertVectors
std::vector< double > gradientCoefs
const unsigned int nD(const Block &b)
SPDataWrapperACLData generateDataContainerACL_SP(const Block &b, unsigned int n=1)
generates pointer to ACL Data field with n components
const VectorTemplate & d1q2ec()
An elementary cell in 1D space.
const VectorTemplate & d2q4ec()
An elementary cell in 2D space.
const VectorTemplate & d3q8ec()
An elementary cell in 3D space.
const VectorTemplate * allNeigboursVT(unsigned int dimNumber)
returns template corresponding to all neighbours
const VectorTemplate * nearestNeigboursVT0(unsigned int dimNumber)
returns template corresponding to nearest neighbours without central point
const VectorTemplate & d3q3uv()
An elementary cell in 3D space.
const VectorTemplate * nearestNeigboursPVT(unsigned int dimNumber)
returns template corresponding to nearest neighbours plus
const VectorTemplate * nearestNeigboursVT(unsigned int dimNumber)
returns template corresponding to nearest neighbours
const VectorTemplate & d2q2uv()
An elementary cell in 2D space.
const VectorTemplate * elementaryCellVT(unsigned int dimNumber)
returns template corresponding to an elementary cell
const VectorTemplate & d2q4()
Vector template.
const VectorTemplate & d1q2()
Vector template.
const VectorTemplate & d3q6()
Vector template.
const VectorTemplate & d1q3()
Vector template.
const VectorTemplate & d3q7()
Vector template.
const VectorTemplate & d2q5()
Vector template.
const VectorTemplate & d2q8()
Vector template.
const VectorTemplate & d3q18()
Vector template.
const VectorTemplate & d3q14()
Vector template.
const VectorTemplate & d3q19()
Vector template.
const VectorTemplate & d3q27()
Vector template.
const VectorTemplate & d3q15()
Vector template.
const VectorTemplate & d1q1uv()
An unit vector in 1D space.
const VectorTemplate & d2q9()
Vector template.
Advanced Simulation Library.
VTName
list of implemented names of VectorTemplate
definition of class АVec<T>