65 "order in 'a' direction is higher than order "
68 "order in 'a' direction is higher than order "
71 "order in 'b' direction is higher than order "
107 const Array<OneD, const NekDouble>& inarray,
108 Array<OneD, NekDouble>& out_dxi0,
109 Array<OneD, NekDouble>& out_dxi1,
110 Array<OneD, NekDouble>& out_dxi2 )
112 int Q0 =
m_base[0]->GetNumPoints();
113 int Q1 =
m_base[1]->GetNumPoints();
114 int Q2 =
m_base[2]->GetNumPoints();
118 Array<OneD, NekDouble> out_dEta0(3*Qtot,0.0);
119 Array<OneD, NekDouble> out_dEta1 = out_dEta0 + Qtot;
120 Array<OneD, NekDouble> out_dEta2 = out_dEta1 + Qtot;
122 bool Do_2 = (out_dxi2.num_elements() > 0)?
true:
false;
123 bool Do_1 = (out_dxi1.num_elements() > 0)?
true:
false;
139 Array<OneD, const NekDouble> eta_0, eta_1, eta_2;
140 eta_0 =
m_base[0]->GetZ();
141 eta_1 =
m_base[1]->GetZ();
142 eta_2 =
m_base[2]->GetZ();
148 for(
int k=0; k< Q2; ++k)
150 for(
int j=0; j<Q1; ++j,dEta0+=Q0)
152 Vmath::Smul(Q0,2.0/(1.0-eta_1[j]),dEta0,1,dEta0,1);
154 fac = 1.0/(1.0-eta_2[k]);
155 Vmath::Smul(Q0*Q1,fac,&out_dEta0[0]+k*Q0*Q1,1,&out_dEta0[0]+k*Q0*Q1,1);
158 if (out_dxi0.num_elements() > 0)
166 Array<OneD, NekDouble> Fac0(Q0);
171 for(
int k = 0; k < Q1*Q2; ++k)
173 Vmath::Vmul(Q0,&Fac0[0],1,&out_dEta0[0]+k*Q0,1,&out_dEta0[0]+k*Q0,1);
176 for(
int k = 0; k < Q2; ++k)
178 Vmath::Smul(Q0*Q1,2.0/(1.0-eta_2[k]),&out_dEta1[0]+k*Q0*Q1,1,
179 &out_dEta1[0]+k*Q0*Q1,1);
186 Vmath::Vadd(Qtot,out_dEta0,1,out_dEta1,1,out_dxi1,1);
194 for(
int k=0; k< Q2; ++k)
196 for(
int j=0; j<Q1; ++j,dEta1+=Q0)
198 Vmath::Smul(Q0,(1.0+eta_1[j])/2.0,dEta1,1,dEta1,1);
205 Vmath::Vadd(Qtot,out_dEta0,1,out_dEta1,1,out_dxi2,1);
206 Vmath::Vadd(Qtot,out_dEta2,1,out_dxi2 ,1,out_dxi2,1);
220 const Array<OneD, const NekDouble>& inarray,
221 Array<OneD, NekDouble>& outarray)
245 ASSERTL1(
false,
"input dir is out of range");
252 const Array<OneD, const NekDouble>& inarray,
253 Array<OneD, NekDouble>& out_d0,
254 Array<OneD, NekDouble>& out_d1,
255 Array<OneD, NekDouble>& out_d2)
262 const Array<OneD, const NekDouble>& inarray,
263 Array<OneD, NekDouble>& outarray)
294 const Array<OneD, const NekDouble>& inarray,
295 Array<OneD, NekDouble>& outarray)
299 "Basis[1] is not a general tensor type");
303 "Basis[2] is not a general tensor type");
306 &&
m_base[2]->Collocation())
311 inarray, 1, outarray, 1);
324 const Array<OneD, const NekDouble>& inarray,
325 Array<OneD, NekDouble>& outarray)
327 int nquad1 =
m_base[1]->GetNumPoints();
328 int nquad2 =
m_base[2]->GetNumPoints();
329 int order0 =
m_base[0]->GetNumModes();
330 int order1 =
m_base[1]->GetNumModes();
332 Array<OneD, NekDouble> wsp(nquad2*order0*order1*(order1+1)/2+
333 nquad2*nquad1*order0);
338 inarray,outarray,wsp,
357 const Array<OneD, const NekDouble>& base0,
358 const Array<OneD, const NekDouble>& base1,
359 const Array<OneD, const NekDouble>& base2,
360 const Array<OneD, const NekDouble>& inarray,
361 Array<OneD, NekDouble>& outarray,
362 Array<OneD, NekDouble>& wsp,
363 bool doCheckCollDir0,
364 bool doCheckCollDir1,
365 bool doCheckCollDir2)
367 int nquad0 =
m_base[0]->GetNumPoints();
368 int nquad1 =
m_base[1]->GetNumPoints();
369 int nquad2 =
m_base[2]->GetNumPoints();
371 int order0 =
m_base[0]->GetNumModes();
372 int order1 =
m_base[1]->GetNumModes();
373 int order2 =
m_base[2]->GetNumModes();
375 Array<OneD, NekDouble > tmp = wsp;
376 Array<OneD, NekDouble > tmp1 = tmp + nquad2*order0*order1*(order1+1)/2;
381 int i, j, mode, mode1, cnt;
384 mode = mode1 = cnt = 0;
385 for(i = 0; i < order0; ++i)
387 for(j = 0; j < order1-i; ++j, ++cnt)
389 Blas::Dgemv(
'N', nquad2, order2-i-j,
390 1.0, base2.get()+mode*nquad2, nquad2,
391 inarray.get()+mode1, 1,
392 0.0, tmp.get()+cnt*nquad2, 1);
397 for(j = order1-i; j < order2-i; ++j)
409 Blas::Daxpy(nquad2,inarray[1],base2.get()+nquad2,1,
413 Blas::Daxpy(nquad2,inarray[1],base2.get()+nquad2,1,
414 &tmp[0]+order1*nquad2,1);
419 for(i = 0; i < order0; ++i)
421 Blas::Dgemm(
'N',
'T', nquad1, nquad2, order1-i,
422 1.0, base1.get()+mode*nquad1, nquad1,
423 tmp.get()+mode*nquad2, nquad2,
424 0.0, tmp1.get()+i*nquad1*nquad2, nquad1);
435 for(i = 0; i < nquad2; ++i)
437 Blas::Daxpy(nquad1,tmp[nquad2+i], base1.get()+nquad1,1,
438 &tmp1[nquad1*nquad2]+i*nquad1,1);
443 Blas::Dgemm(
'N',
'T', nquad0, nquad1*nquad2, order0,
444 1.0, base0.get(), nquad0,
445 tmp1.get(), nquad1*nquad2,
446 0.0, outarray.get(), nquad0);
456 Array<OneD, NekDouble> &outarray)
507 const Array<OneD, const NekDouble>& inarray,
508 Array<OneD, NekDouble> & outarray)
512 "Basis[1] is not a general tensor type");
516 "Basis[2] is not a general tensor type");
518 if(
m_base[0]->Collocation() &&
m_base[1]->Collocation())
530 const Array<OneD, const NekDouble>& inarray,
531 Array<OneD, NekDouble>& outarray)
537 Blas::Dgemv(
'N',
m_ncoeffs,nq,1.0,iprodmat->GetPtr().get(),
538 m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
549 const Array<OneD, const NekDouble>& inarray,
550 Array<OneD, NekDouble>& outarray)
552 int nquad0 =
m_base[0]->GetNumPoints();
553 int nquad1 =
m_base[1]->GetNumPoints();
554 int nquad2 =
m_base[2]->GetNumPoints();
555 int order0 =
m_base[0]->GetNumModes();
556 int order1 =
m_base[1]->GetNumModes();
558 Array<OneD, NekDouble> tmp (nquad0*nquad1*nquad2);
559 Array<OneD, NekDouble> wsp (nquad1*nquad2*order0 +
560 nquad2*order0*(order1+1)/2);
568 tmp, outarray, wsp,
true,
true,
true);
573 const Array<OneD, const NekDouble>& base0,
574 const Array<OneD, const NekDouble>& base1,
575 const Array<OneD, const NekDouble>& base2,
576 const Array<OneD, const NekDouble>& inarray,
577 Array<OneD, NekDouble> &outarray,
578 Array<OneD, NekDouble> &wsp,
579 bool doCheckCollDir0,
580 bool doCheckCollDir1,
581 bool doCheckCollDir2)
583 int nquad0 =
m_base[0]->GetNumPoints();
584 int nquad1 =
m_base[1]->GetNumPoints();
585 int nquad2 =
m_base[2]->GetNumPoints();
587 int order0 =
m_base[0]->GetNumModes();
588 int order1 =
m_base[1]->GetNumModes();
589 int order2 =
m_base[2]->GetNumModes();
591 Array<OneD, NekDouble > tmp1 = wsp;
592 Array<OneD, NekDouble > tmp2 = wsp + nquad1*nquad2*order0;
594 int i,j, mode,mode1, cnt;
597 Blas::Dgemm(
'T',
'N', nquad1*nquad2, order0, nquad0,
598 1.0, inarray.get(), nquad0,
600 0.0, tmp1.get(), nquad1*nquad2);
603 for(mode=i=0; i < order0; ++i)
605 Blas::Dgemm(
'T',
'N', nquad2, order1-i, nquad1,
606 1.0, tmp1.get()+i*nquad1*nquad2, nquad1,
607 base1.get()+mode*nquad1, nquad1,
608 0.0, tmp2.get()+mode*nquad2, nquad2);
617 Blas::Dgemv(
'T', nquad1, nquad2,
618 1.0, tmp1.get()+nquad1*nquad2, nquad1,
619 base1.get()+nquad1, 1,
620 1.0, tmp2.get()+nquad2, 1);
624 mode = mode1 = cnt = 0;
625 for(i = 0; i < order0; ++i)
627 for(j = 0; j < order1-i; ++j, ++cnt)
629 Blas::Dgemv(
'T', nquad2, order2-i-j,
630 1.0, base2.get()+mode*nquad2, nquad2,
631 tmp2.get()+cnt*nquad2, 1,
632 0.0, outarray.get()+mode1, 1);
637 for(j = order1-i; j < order2-i; ++j)
648 outarray[1] +=
Blas::Ddot(nquad2,base2.get()+nquad2,1,
652 outarray[1] +=
Blas::Ddot(nquad2,base2.get()+nquad2,1,
653 &tmp2[nquad2*order1],1);
660 const Array<OneD, const NekDouble>& inarray,
661 Array<OneD, NekDouble>& outarray)
669 const Array<OneD, const NekDouble>& inarray,
670 Array<OneD, NekDouble>& outarray)
672 ASSERTL0((dir==0)||(dir==1)||(dir==2),
"input dir is out of range");
693 Blas::Dgemv(
'N',
m_ncoeffs,nq,1.0,iprodmat->GetPtr().get(),
694 m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
706 const Array<OneD, const NekDouble>& inarray,
707 Array<OneD, NekDouble>& outarray)
710 int nquad0 =
m_base[0]->GetNumPoints();
711 int nquad1 =
m_base[1]->GetNumPoints();
712 int nquad2 =
m_base[2]->GetNumPoints();
713 int nqtot = nquad0*nquad1*nquad2;
714 int nmodes0 =
m_base[0]->GetNumModes();
715 int nmodes1 =
m_base[1]->GetNumModes();
716 int wspsize = nquad0 + nquad1 + nquad2 + max(nqtot,
m_ncoeffs)
717 + nquad1*nquad2*nmodes0 + nquad2*nmodes0*(nmodes1+1)/2;
719 Array<OneD, NekDouble> gfac0(wspsize);
720 Array<OneD, NekDouble> gfac1(gfac0 + nquad0);
721 Array<OneD, NekDouble> gfac2(gfac1 + nquad1);
722 Array<OneD, NekDouble> tmp0 (gfac2 + nquad2);
723 Array<OneD, NekDouble> wsp(tmp0 + max(nqtot,
m_ncoeffs));
725 const Array<OneD, const NekDouble>& z0 =
m_base[0]->GetZ();
726 const Array<OneD, const NekDouble>& z1 =
m_base[1]->GetZ();
727 const Array<OneD, const NekDouble>& z2 =
m_base[2]->GetZ();
730 for(i = 0; i < nquad0; ++i)
732 gfac0[i] = 0.5*(1+z0[i]);
736 for(i = 0; i < nquad1; ++i)
738 gfac1[i] = 2.0/(1-z1[i]);
742 for(i = 0; i < nquad2; ++i)
744 gfac2[i] = 2.0/(1-z2[i]);
748 for(i = 0; i < nquad1*nquad2; ++i)
750 Vmath::Smul(nquad0,gfac1[i%nquad1],&inarray[0]+i*nquad0,1,&tmp0[0]+i*nquad0,1);
752 for(i = 0; i < nquad2; ++i)
754 Vmath::Smul(nquad0*nquad1,gfac2[i],&tmp0[0]+i*nquad0*nquad1,1,&tmp0[0]+i*nquad0*nquad1,1);
774 for(i = 0; i < nquad1*nquad2; ++i)
776 Vmath::Vmul(nquad0,&gfac0[0],1,&tmp0[0]+i*nquad0,1,&tmp0[0]+i*nquad0,1);
785 for(i = 0; i < nquad2; ++i)
787 Vmath::Smul(nquad0*nquad1,gfac2[i],&inarray[0]+i*nquad0*nquad1,1,&tmp0[0]+i*nquad0*nquad1,1);
802 for(i = 0; i < nquad1; ++i)
804 gfac1[i] = (1+z1[i])/2;
807 for(i = 0; i < nquad1*nquad2; ++i)
809 Vmath::Vmul(nquad0,&gfac0[0],1,&tmp0[0]+i*nquad0,1,&tmp0[0]+i*nquad0,1);
817 for(i = 0; i < nquad2; ++i)
819 Vmath::Smul(nquad0*nquad1,gfac2[i],&inarray[0]+i*nquad0*nquad1,1,&tmp0[0]+i*nquad0*nquad1,1);
821 for(i = 0; i < nquad1*nquad2; ++i)
823 Vmath::Smul(nquad0,gfac1[i%nquad1],&tmp0[0]+i*nquad0,1,&tmp0[0]+i*nquad0,1);
845 ASSERTL1(
false,
"input dir is out of range");
858 const Array<OneD, const NekDouble>& xi,
859 Array<OneD, NekDouble>& eta)
882 eta[0] = 2.0*(1.0+xi[0])/(-xi[1]-xi[2]) - 1.0;
884 eta[1] = 2.0*(1.0+xi[1])/(1.0-xi[2]) - 1.0;
891 Array<OneD, NekDouble> &outarray)
893 Array<OneD, NekDouble> tmp(
m_ncoeffs,0.0);
927 "BasisType is not a boundary interior form");
930 "BasisType is not a boundary interior form");
933 "BasisType is not a boundary interior form");
935 int P =
m_base[0]->GetNumModes();
936 int Q =
m_base[1]->GetNumModes();
937 int R =
m_base[2]->GetNumModes();
947 "BasisType is not a boundary interior form");
950 "BasisType is not a boundary interior form");
953 "BasisType is not a boundary interior form");
955 int P =
m_base[0]->GetNumModes()-1;
956 int Q =
m_base[1]->GetNumModes()-1;
957 int R =
m_base[2]->GetNumModes()-1;
960 return (Q+1) + P*(1 + 2*Q - P)/2
961 + (R+1) + P*(1 + 2*R - P)/2
962 + 2*(R+1) + Q*(1 + 2*R - Q);
967 ASSERTL2((i >= 0) && (i <= 5),
"edge id is out of range");
968 int P =
m_base[0]->GetNumModes();
969 int Q =
m_base[1]->GetNumModes();
970 int R =
m_base[2]->GetNumModes();
976 else if (i == 1 || i == 2)
988 int P =
m_base[0]->GetNumModes()-2;
989 int Q =
m_base[1]->GetNumModes()-2;
990 int R =
m_base[2]->GetNumModes()-2;
997 ASSERTL2((i >= 0) && (i <= 3),
"face id is out of range");
999 int nummodesA, nummodesB, P, Q;
1005 else if ((i == 1) || (i == 2))
1017 nFaceCoeffs = Q+1 + (P*(1 + 2*Q - P))/2;
1023 ASSERTL2((i >= 0) && (i <= 3),
"face id is out of range");
1024 int Pi =
m_base[0]->GetNumModes() - 2;
1025 int Qi =
m_base[1]->GetNumModes() - 2;
1026 int Ri =
m_base[2]->GetNumModes() - 2;
1030 return Pi * (2*Qi - Pi - 1) / 2;
1034 return Pi * (2*Ri - Pi - 1) / 2;
1038 return Qi * (2*Ri - Qi - 1) / 2;
1044 int Pi =
m_base[0]->GetNumModes() - 2;
1045 int Qi =
m_base[1]->GetNumModes() - 2;
1046 int Ri =
m_base[2]->GetNumModes() - 2;
1048 return Pi * (2*Qi - Pi - 1) / 2 +
1049 Pi * (2*Ri - Pi - 1) / 2 +
1050 Qi * (2*Ri - Qi - 1);
1055 ASSERTL2(i >= 0 && i <= 3,
"face id is out of range");
1059 return m_base[0]->GetNumPoints()*
1060 m_base[1]->GetNumPoints();
1064 return m_base[0]->GetNumPoints()*
1065 m_base[2]->GetNumPoints();
1069 return m_base[1]->GetNumPoints()*
1070 m_base[2]->GetNumPoints();
1075 const int i,
const int j)
const
1077 ASSERTL2(i >= 0 && i <= 3,
"face id is out of range");
1078 ASSERTL2(j == 0 || j == 1,
"face direction is out of range");
1082 return m_base[j]->GetPointsKey();
1086 return m_base[2*j]->GetPointsKey();
1090 return m_base[j+1]->GetPointsKey();
1095 const std::vector<unsigned int>& nummodes,
1099 nummodes[modes_offset],
1100 nummodes[modes_offset+1],
1101 nummodes[modes_offset+2]);
1108 const int i,
const int k)
const
1110 ASSERTL2(i >= 0 && i <= 4,
"face id is out of range");
1111 ASSERTL2(k == 0 || k == 1,
"face direction out of range");
1112 int nummodes =
GetBasis(0)->GetNumModes();
1138 ASSERTL2(i >= 0 && i <= 5,
"edge id is out of range");
1144 else if (i == 1 || i == 2)
1155 Array<OneD, NekDouble> &xi_x,
1156 Array<OneD, NekDouble> &xi_y,
1157 Array<OneD, NekDouble> &xi_z)
1159 Array<OneD, const NekDouble> eta_x =
m_base[0]->GetZ();
1160 Array<OneD, const NekDouble> eta_y =
m_base[1]->GetZ();
1161 Array<OneD, const NekDouble> eta_z =
m_base[2]->GetZ();
1168 for(
int k = 0; k < Qz; ++k ) {
1169 for(
int j = 0; j < Qy; ++j ) {
1170 for(
int i = 0; i < Qx; ++i ) {
1171 int s = i + Qx*(j + Qy*k);
1172 xi_x[s] = (eta_x[i] + 1.0) * (1.0 - eta_y[j]) * (1.0 - eta_z[k]) / 4 - 1.0;
1173 xi_y[s] = (eta_y[j] + 1.0) * (1.0 - eta_z[k]) / 2 - 1.0;
1199 Array<OneD, unsigned int> &maparray,
1200 Array<OneD, int> &signarray,
1204 int P, Q, i, j, k, idx;
1207 "Method only implemented for Modified_A BasisType (x "
1208 "direction), Modified_B BasisType (y direction), and "
1209 "Modified_C BasisType(z direction)");
1211 int nFaceCoeffs = 0;
1213 if (nummodesA == -1)
1218 nummodesA =
m_base[0]->GetNumModes();
1219 nummodesB =
m_base[1]->GetNumModes();
1222 nummodesA =
m_base[0]->GetNumModes();
1223 nummodesB =
m_base[2]->GetNumModes();
1227 nummodesA =
m_base[1]->GetNumModes();
1228 nummodesB =
m_base[2]->GetNumModes();
1236 nFaceCoeffs = Q + ((P-1)*(1 + 2*(Q-1) - (P-1)))/2;
1239 if(maparray.num_elements() != nFaceCoeffs)
1241 maparray = Array<OneD, unsigned int>(nFaceCoeffs,1);
1244 if(signarray.num_elements() != nFaceCoeffs)
1246 signarray = Array<OneD, int>(nFaceCoeffs,1);
1250 fill( signarray.get() , signarray.get()+nFaceCoeffs, 1 );
1257 for (i = 0; i < P; ++i)
1259 for (j = 0; j < Q-i; ++j)
1261 if ((
int)faceOrient == 7 && i > 1)
1263 signarray[idx] = (i%2 ? -1 : 1);
1265 maparray[idx++] =
GetMode(i,j,0);
1271 for (i = 0; i < P; ++i)
1273 for (k = 0; k < Q-i; ++k)
1275 if ((
int)faceOrient == 7 && i > 1)
1277 signarray[idx] = (i%2 ? -1: 1);
1279 maparray[idx++] =
GetMode(i,0,k);
1285 for (j = 0; j < P-1; ++j)
1287 for (k = 0; k < Q-1-j; ++k)
1289 if ((
int)faceOrient == 7 && j > 1)
1291 signarray[idx] = ((j+1)%2 ? -1: 1);
1293 maparray[idx++] =
GetMode(1,j,k);
1295 if (j == 0 && k == 0) {
1296 maparray[idx++] =
GetMode(0,0,1);
1298 if (j == 0 && k == Q-2) {
1299 for (
int r = 0; r < Q-1; ++r) {
1300 maparray[idx++] =
GetMode(0,1,r);
1308 for (j = 0; j < P; ++j)
1310 for (k = 0; k < Q-j; ++k)
1312 if ((
int)faceOrient == 7 && j > 1)
1314 signarray[idx] = (j%2 ? -1: 1);
1316 maparray[idx++] =
GetMode(0,j,k);
1321 ASSERTL0(
false,
"Element map not available.");
1324 if ((
int)faceOrient == 7)
1326 swap(maparray[0], maparray[Q]);
1328 for (i = 1; i < Q-1; ++i)
1330 swap(maparray[i+1], maparray[Q+i]);
1340 "Mapping not defined for this type of basis");
1343 if(useCoeffPacking ==
true)
1345 switch(localVertexId)
1369 ASSERTL0(
false,
"Vertex ID must be between 0 and 3");
1376 switch(localVertexId)
1400 ASSERTL0(
false,
"Vertex ID must be between 0 and 3");
1416 Array<OneD, unsigned int> &maparray,
1417 Array<OneD, int> &signarray)
1420 const int P =
m_base[0]->GetNumModes();
1421 const int Q =
m_base[1]->GetNumModes();
1422 const int R =
m_base[2]->GetNumModes();
1426 if(maparray.num_elements() != nEdgeIntCoeffs)
1428 maparray = Array<OneD, unsigned int>(nEdgeIntCoeffs);
1432 fill( maparray.get(), maparray.get() + nEdgeIntCoeffs, 0);
1435 if(signarray.num_elements() != nEdgeIntCoeffs)
1437 signarray = Array<OneD, int>(nEdgeIntCoeffs,1);
1441 fill( signarray.get() , signarray.get()+nEdgeIntCoeffs, 1 );
1447 for (i = 0; i < P-2; ++i)
1449 maparray[i] =
GetMode(i+2, 0, 0);
1453 for(i = 1; i < nEdgeIntCoeffs; i+=2)
1460 for (i = 0; i < Q-2; ++i)
1462 maparray[i] =
GetMode(1, i+1, 0);
1466 for(i = 1; i < nEdgeIntCoeffs; i+=2)
1473 for (i = 0; i < Q-2; ++i)
1475 maparray[i] =
GetMode(0, i+2, 0);
1479 for(i = 1; i < nEdgeIntCoeffs; i+=2)
1486 for (i = 0; i < R-2; ++i)
1488 maparray[i] =
GetMode(0, 0, i+2);
1492 for(i = 1; i < nEdgeIntCoeffs; i+=2)
1499 for (i = 0; i < R - 2; ++i)
1501 maparray[i] =
GetMode(1, 0, i+1);
1505 for(i = 1; i < nEdgeIntCoeffs; i+=2)
1512 for (i = 0; i < R-2; ++i)
1514 maparray[i] =
GetMode(0, 1, i+1);
1518 for(i = 1; i < nEdgeIntCoeffs; i+=2)
1525 ASSERTL0(
false,
"Edge not defined.");
1533 Array<OneD, unsigned int> &maparray,
1534 Array<OneD, int> &signarray)
1537 const int P =
m_base[0]->GetNumModes();
1538 const int Q =
m_base[1]->GetNumModes();
1539 const int R =
m_base[2]->GetNumModes();
1543 if(maparray.num_elements() != nFaceIntCoeffs)
1545 maparray = Array<OneD, unsigned int>(nFaceIntCoeffs);
1548 if(signarray.num_elements() != nFaceIntCoeffs)
1550 signarray = Array<OneD, int>(nFaceIntCoeffs,1);
1554 fill( signarray.get() , signarray.get()+nFaceIntCoeffs, 1 );
1561 for (i = 2; i < P-1; ++i)
1563 for (j = 1; j < Q-i; ++j)
1565 if ((
int)faceOrient == 7)
1567 signarray[idx] = (i%2 ? -1 : 1);
1569 maparray[idx++] =
GetMode(i,j,0);
1575 for (i = 2; i < P; ++i)
1577 for (k = 1; k < R-i; ++k)
1579 if ((
int)faceOrient == 7)
1581 signarray[idx] = (i%2 ? -1: 1);
1583 maparray[idx++] =
GetMode(i,0,k);
1589 for (j = 1; j < Q-2; ++j)
1591 for (k = 1; k < R-1-j; ++k)
1593 if ((
int)faceOrient == 7)
1595 signarray[idx] = ((j+1)%2 ? -1: 1);
1597 maparray[idx++] =
GetMode(1,j,k);
1603 for (j = 2; j < Q-1; ++j)
1605 for (k = 1; k < R-j; ++k)
1607 if ((
int)faceOrient == 7)
1609 signarray[idx] = (j%2 ? -1: 1);
1611 maparray[idx++] =
GetMode(0,j,k);
1616 ASSERTL0(
false,
"Face interior map not available.");
1628 "BasisType is not a boundary interior form");
1631 "BasisType is not a boundary interior form");
1634 "BasisType is not a boundary interior form");
1636 int P =
m_base[0]->GetNumModes();
1637 int Q =
m_base[1]->GetNumModes();
1638 int R =
m_base[2]->GetNumModes();
1642 if(outarray.num_elements() != nIntCoeffs)
1644 outarray = Array<OneD, unsigned int>(nIntCoeffs);
1648 for (
int i = 2; i < P-2; ++i)
1650 for (
int j = 1; j < Q-i-1; ++j)
1652 for (
int k = 1; k < R-i-j; ++k)
1654 outarray[idx++] =
GetMode(i,j,k);
1667 "BasisType is not a boundary interior form");
1670 "BasisType is not a boundary interior form");
1673 "BasisType is not a boundary interior form");
1675 int P =
m_base[0]->GetNumModes();
1676 int Q =
m_base[1]->GetNumModes();
1677 int R =
m_base[2]->GetNumModes();
1682 for (i = 0; i < P; ++i)
1687 for (j = 0; j < Q-i; j++)
1689 for (k = 0; k < R-i-j; ++k)
1691 outarray[idx++] =
GetMode(i,j,k);
1699 for (k = 0; k < R-i; ++k)
1701 outarray[idx++] =
GetMode(i,0,k);
1703 for (j = 1; j < Q-i; ++j)
1705 outarray[idx++] =
GetMode(i,j,0);
1754 const int Q =
m_base[1]->GetNumModes();
1755 const int R =
m_base[2]->GetNumModes();
1757 int i,j,q_hat,k_hat;
1761 for (i = 0; i < I; ++i)
1766 k_hat = max(R-Q-i,0);
1767 cnt += q_hat*(q_hat+1)/2 + k_hat*Q;
1772 for (j = 0; j < J; ++j)
1785 const Array<OneD, const NekDouble>& inarray,
1786 Array<OneD, NekDouble>& outarray)
1790 int nquad0 =
m_base[0]->GetNumPoints();
1791 int nquad1 =
m_base[1]->GetNumPoints();
1792 int nquad2 =
m_base[2]->GetNumPoints();
1794 const Array<OneD, const NekDouble>& w0 =
m_base[0]->GetW();
1795 const Array<OneD, const NekDouble>& w1 =
m_base[1]->GetW();
1796 const Array<OneD, const NekDouble>& w2 =
m_base[2]->GetW();
1798 const Array<OneD, const NekDouble>& z1 =
m_base[1]->GetZ();
1799 const Array<OneD, const NekDouble>& z2 =
m_base[2]->GetZ();
1802 for(i = 0; i < nquad1*nquad2; ++i)
1805 w0.get(),1, &outarray[0]+i*nquad0,1);
1812 for(j = 0; j < nquad2; ++j)
1814 for(i = 0; i < nquad1; ++i)
1816 Blas::Dscal(nquad0,0.5*w1[i], &outarray[0]+i*nquad0+
1823 for(j = 0; j < nquad2; ++j)
1825 for(i = 0; i < nquad1; ++i)
1828 0.5*(1-z1[i])*w1[i],
1829 &outarray[0]+i*nquad0 + j*nquad0*nquad1,
1840 for(i = 0; i < nquad2; ++i)
1842 Blas::Dscal(nquad0*nquad1, 0.25*w2[i],
1843 &outarray[0]+i*nquad0*nquad1, 1);
1848 for(i = 0; i < nquad2; ++i)
1850 Blas::Dscal(nquad0*nquad1,0.25*(1-z2[i])*(1-z2[i])*w2[i],
1851 &outarray[0]+i*nquad0*nquad1,1);
1868 int qa =
m_base[0]->GetNumPoints();
1869 int qb =
m_base[1]->GetNumPoints();
1870 int qc =
m_base[2]->GetNumPoints();
1871 int nmodes_a =
m_base[0]->GetNumModes();
1872 int nmodes_b =
m_base[1]->GetNumModes();
1873 int nmodes_c =
m_base[2]->GetNumModes();
1887 Array<OneD, NekDouble> orthocoeffs(OrthoExp.
GetNcoeffs());
1898 int cutoff_a = (int) (SVVCutOff*nmodes_a);
1899 int cutoff_b = (int) (SVVCutOff*nmodes_b);
1900 int cutoff_c = (int) (SVVCutOff*nmodes_c);
1901 int nmodes = min(min(nmodes_a,nmodes_b),nmodes_c);
1902 NekDouble cutoff = min(min(cutoff_a,cutoff_b),cutoff_c);
1906 OrthoExp.
FwdTrans(array,orthocoeffs);
1909 for(i = 0; i < nmodes_a; ++i)
1911 for(j = 0; j < nmodes_b-i; ++j)
1913 for(k = 0; k < nmodes_c-i-j; ++k)
1915 if(i + j + k >= cutoff)
1917 orthocoeffs[cnt] *= ((1.0+SvvDiffCoeff)*exp(-(i+j+k-nmodes)*(i+j+k-nmodes)/((
NekDouble)((i+j+k-cutoff+epsilon)*(i+j+k-cutoff+epsilon)))));
1924 OrthoExp.
BwdTrans(orthocoeffs,array);