63 "order in 'a' direction is higher than order in 'c' direction");
97 Array<OneD, NekDouble> &out_dxi1,
98 Array<OneD, NekDouble> &out_dxi2,
99 Array<OneD, NekDouble> &out_dxi3 )
101 int Qx =
m_base[0]->GetNumPoints();
102 int Qy =
m_base[1]->GetNumPoints();
103 int Qz =
m_base[2]->GetNumPoints();
106 Array<OneD, NekDouble> dEta_bar1(Qtot,0.0);
108 Array<OneD, const NekDouble> eta_x, eta_z;
109 eta_x =
m_base[0]->GetZ();
110 eta_z =
m_base[2]->GetZ();
114 bool Do_1 = (out_dxi1.num_elements() > 0)?
true:
false;
115 bool Do_3 = (out_dxi3.num_elements() > 0)?
true:
false;
134 for (k = 0; k < Qz; ++k)
136 Vmath::Smul(Qx*Qy,2.0/(1.0-eta_z[k]),&dEta_bar1[0] + k*Qx*Qy,1,
137 &out_dxi1[0] + k*Qx*Qy,1);
144 for (k = 0; k < Qz; ++k)
146 Vmath::Smul(Qx*Qy, 1.0/(1.0-eta_z[k]),&dEta_bar1[0]+k*Qx*Qy,1,
147 &dEta_bar1[0]+k*Qx*Qy,1);
151 for (i = 0; i < Qx; ++i)
154 &out_dxi3[0]+i,Qx,&out_dxi3[0]+i,Qx);
161 const Array<OneD, const NekDouble>& inarray,
162 Array<OneD, NekDouble>& outarray)
189 ASSERTL1(
false,
"input dir is out of range");
196 Array<OneD, NekDouble>& out_d0,
197 Array<OneD, NekDouble>& out_d1,
198 Array<OneD, NekDouble>& out_d2)
204 const Array<OneD, const NekDouble>& inarray,
205 Array<OneD, NekDouble>& outarray)
241 Array<OneD, NekDouble>& outarray)
245 "Basis[1] is not a general tensor type");
249 "Basis[2] is not a general tensor type");
251 if(
m_base[0]->Collocation() &&
252 m_base[1]->Collocation() &&
258 inarray, 1, outarray, 1);
267 Array<OneD, NekDouble>& outarray)
269 int nquad1 =
m_base[1]->GetNumPoints();
270 int nquad2 =
m_base[2]->GetNumPoints();
271 int order0 =
m_base[0]->GetNumModes();
272 int order1 =
m_base[1]->GetNumModes();
274 Array<OneD, NekDouble> wsp(nquad2*order1*order0 +
275 nquad1*nquad2*order0);
280 inarray,outarray,wsp,
true,
true,
true);
285 const Array<OneD, const NekDouble> &base0,
286 const Array<OneD, const NekDouble> &base1,
287 const Array<OneD, const NekDouble> &base2,
288 const Array<OneD, const NekDouble> &inarray,
289 Array<OneD, NekDouble> &outarray,
290 Array<OneD, NekDouble> &wsp,
291 bool doCheckCollDir0,
292 bool doCheckCollDir1,
293 bool doCheckCollDir2)
296 int nquad0 =
m_base[0]->GetNumPoints();
297 int nquad1 =
m_base[1]->GetNumPoints();
298 int nquad2 =
m_base[2]->GetNumPoints();
299 int nummodes0 =
m_base[0]->GetNumModes();
300 int nummodes1 =
m_base[1]->GetNumModes();
301 int nummodes2 =
m_base[2]->GetNumModes();
302 Array<OneD, NekDouble> tmp0 = wsp;
303 Array<OneD, NekDouble> tmp1 = tmp0 + nquad2*nummodes1*nummodes0;
305 for (i = mode = 0; i < nummodes0; ++i)
307 Blas::Dgemm(
'N',
'N', nquad2, nummodes1, nummodes2-i,
308 1.0, base2.get() + mode*nquad2, nquad2,
309 inarray.get() + mode*nummodes1, nummodes2-i,
310 0.0, tmp0.get() + i*nquad2*nummodes1, nquad2);
316 for(i = 0; i < nummodes1; i++)
318 Blas::Daxpy(nquad2,inarray[1+i*nummodes2],base2.get()+nquad2,1,
319 tmp0.get()+nquad2*(nummodes1+i),1);
323 for (i = 0; i < nummodes0; i++)
325 Blas::Dgemm(
'N',
'T', nquad1, nquad2, nummodes1,
326 1.0, base1.get(), nquad1,
327 tmp0.get() + i*nquad2*nummodes1, nquad2,
328 0.0, tmp1.get() + i*nquad2*nquad1, nquad1);
331 Blas::Dgemm(
'N',
'T', nquad0, nquad2*nquad1, nummodes0,
332 1.0, base0.get(), nquad0,
333 tmp1.get(), nquad2*nquad1,
334 0.0, outarray.get(), nquad0);
349 Array<OneD, NekDouble>& outarray)
396 const Array<OneD, const NekDouble>& inarray,
397 Array<OneD, NekDouble>& outarray)
401 "Basis[1] is not a general tensor type");
405 "Basis[2] is not a general tensor type");
407 if(
m_base[0]->Collocation() &&
m_base[1]->Collocation())
421 const Array<OneD, const NekDouble>& inarray,
422 Array<OneD, NekDouble>& outarray)
428 Blas::Dgemv(
'N',
m_ncoeffs,nq,1.0,iprodmat->GetPtr().get(),
429 m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
433 const Array<OneD, const NekDouble>& inarray,
434 Array<OneD, NekDouble>& outarray)
436 int nquad1 =
m_base[1]->GetNumPoints();
437 int nquad2 =
m_base[2]->GetNumPoints();
438 int order0 =
m_base[0]->GetNumModes();
439 int order1 =
m_base[1]->GetNumModes();
441 Array<OneD, NekDouble> tmp(inarray.num_elements());
442 Array<OneD, NekDouble> wsp(order0*nquad2*(nquad1+order1));
454 const Array<OneD, const NekDouble>& base0,
455 const Array<OneD, const NekDouble>& base1,
456 const Array<OneD, const NekDouble>& base2,
457 const Array<OneD, const NekDouble>& inarray,
458 Array<OneD, NekDouble> &outarray,
459 Array<OneD, NekDouble> &wsp,
460 bool doCheckCollDir0,
461 bool doCheckCollDir1,
462 bool doCheckCollDir2)
466 const int nquad0 =
m_base[0]->GetNumPoints();
467 const int nquad1 =
m_base[1]->GetNumPoints();
468 const int nquad2 =
m_base[2]->GetNumPoints();
469 const int order0 =
m_base[0]->GetNumModes ();
470 const int order1 =
m_base[1]->GetNumModes ();
471 const int order2 =
m_base[2]->GetNumModes ();
475 ASSERTL1(wsp.num_elements() >= nquad1*nquad2*order0 +
476 nquad2*order0*order1,
477 "Insufficient workspace size");
479 Array<OneD, NekDouble> tmp0 = wsp;
480 Array<OneD, NekDouble> tmp1 = wsp + nquad1*nquad2*order0;
483 Blas::Dgemm(
'T',
'N', nquad1*nquad2, order0, nquad0,
484 1.0, inarray.get(), nquad0,
486 0.0, tmp0.get(), nquad1*nquad2);
489 Blas::Dgemm(
'T',
'N', nquad2*order0, order1, nquad1,
490 1.0, tmp0.get(), nquad1,
492 0.0, tmp1.get(), nquad2*order0);
495 for (mode=i=0; i < order0; ++i)
497 Blas::Dgemm(
'T',
'N', order2-i, order1, nquad2,
498 1.0, base2.get() + mode*nquad2, nquad2,
499 tmp1.get() + i*nquad2, nquad2*order0,
500 0.0, outarray.get()+mode*order1, order2-i);
508 for (i = 0; i < order1; ++i)
512 nquad2, base2.get()+nquad2, 1,
513 tmp1.get()+i*order0*nquad2+nquad2, 1);
524 const Array<OneD, const NekDouble>& inarray,
525 Array<OneD, NekDouble>& outarray)
532 const Array<OneD, const NekDouble>& inarray,
533 Array<OneD, NekDouble>& outarray)
535 ASSERTL0(dir >= 0 && dir <= 2,
"input dir is out of range");
556 Blas::Dgemv(
'N',
m_ncoeffs,nq,1.0,iprodmat->GetPtr().get(),
557 m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
562 const Array<OneD, const NekDouble>& inarray,
563 Array<OneD, NekDouble>& outarray)
565 ASSERTL0(dir >= 0 && dir <= 2,
"input dir is out of range");
568 int order0 =
m_base[0]->GetNumModes ();
569 int order1 =
m_base[1]->GetNumModes ();
570 int nquad0 =
m_base[0]->GetNumPoints();
571 int nquad1 =
m_base[1]->GetNumPoints();
572 int nquad2 =
m_base[2]->GetNumPoints();
574 const Array<OneD, const NekDouble> &z0 =
m_base[0]->GetZ();
575 const Array<OneD, const NekDouble> &z2 =
m_base[2]->GetZ();
576 Array<OneD, NekDouble> gfac0(nquad0);
577 Array<OneD, NekDouble> gfac2(nquad2);
578 Array<OneD, NekDouble> tmp0 (nquad0*nquad1*nquad2);
579 Array<OneD, NekDouble> wsp (order0*nquad2*(nquad1+order1));
582 for (i = 0; i < nquad0; ++i)
584 gfac0[i] = 0.5*(1+z0[i]);
588 for (i = 0; i < nquad2; ++i)
590 gfac2[i] = 2.0/(1-z2[i]);
596 for (i = 0; i < nquad2; ++i)
599 &inarray[0]+i*nquad0*nquad1,1,
600 &tmp0 [0]+i*nquad0*nquad1,1);
633 for(i = 0; i < nquad1*nquad2; ++i)
635 Vmath::Vmul(nquad0,&gfac0[0],1,&tmp0[0]+i*nquad0,1,&tmp0[0]+i*nquad0,1);
665 const Array<OneD, const NekDouble>& xi,
666 Array<OneD, NekDouble>& eta)
682 eta[0] = 2.0*(1.0 + xi[0])/(1.0 - xi[2]) - 1.0;
687 Array<OneD, NekDouble>& xi_y,
688 Array<OneD, NekDouble>& xi_z)
690 Array<OneD, const NekDouble> etaBar_x =
m_base[0]->GetZ();
691 Array<OneD, const NekDouble> eta_y =
m_base[1]->GetZ();
692 Array<OneD, const NekDouble> eta_z =
m_base[2]->GetZ();
698 for (
int k = 0; k < Qz; ++k) {
699 for (
int j = 0; j < Qy; ++j) {
700 for (
int i = 0; i < Qx; ++i) {
701 int s = i + Qx*(j + Qy*k);
702 xi_x[s] = (1.0 - eta_z[k])*(1.0 + etaBar_x[i]) / 2.0 - 1.0;
712 Array<OneD, NekDouble> tmp(
m_ncoeffs,0.0);
750 "BasisType is not a boundary interior form");
753 "BasisType is not a boundary interior form");
756 "BasisType is not a boundary interior form");
758 int P =
m_base[0]->GetNumModes();
759 int Q =
m_base[1]->GetNumModes();
760 int R =
m_base[2]->GetNumModes();
770 "BasisType is not a boundary interior form");
773 "BasisType is not a boundary interior form");
776 "BasisType is not a boundary interior form");
778 int P =
m_base[0]->GetNumModes()-1;
779 int Q =
m_base[1]->GetNumModes()-1;
780 int R =
m_base[2]->GetNumModes()-1;
784 + 2*(R+1) + P*(1 + 2*R - P);
789 ASSERTL2(i >= 0 && i <= 8,
"edge id is out of range");
791 if (i == 0 || i == 2)
795 else if (i == 1 || i == 3 || i == 8)
816 ASSERTL2(i >= 0 && i <= 4,
"face id is out of range");
821 else if (i == 1 || i == 3)
824 return Q+1 + (P*(1 + 2*Q - P))/2;
834 ASSERTL2(i >= 0 && i <= 4,
"face id is out of range");
844 else if (i == 1 || i == 3)
846 return Pi * (2*Ri - Pi - 1) / 2;
861 Pi * (2*Ri - Pi - 1) +
867 ASSERTL2(i >= 0 && i <= 4,
"face id is out of range");
871 return m_base[0]->GetNumPoints()*
872 m_base[1]->GetNumPoints();
874 else if (i == 1 || i == 3)
876 return m_base[0]->GetNumPoints()*
877 m_base[2]->GetNumPoints();
881 return m_base[1]->GetNumPoints()*
882 m_base[2]->GetNumPoints();
887 const int i,
const int j)
const
889 ASSERTL2(i >= 0 && i <= 4,
"face id is out of range");
890 ASSERTL2(j == 0 || j == 1,
"face direction is out of range");
894 return m_base[j]->GetPointsKey();
896 else if (i == 1 || i == 3)
898 return m_base[2*j]->GetPointsKey();
902 return m_base[j+1]->GetPointsKey();
907 const int i,
const int k)
const
909 ASSERTL2(i >= 0 && i <= 4,
"face id is out of range");
910 ASSERTL2(k >= 0 && k <= 1,
"basis key id is out of range");
919 m_base[k]->GetNumModes());
927 m_base[k+1]->GetNumModes());
935 m_base[2*k]->GetNumModes());
949 nummodes[modes_offset],
950 nummodes[modes_offset+1],
951 nummodes[modes_offset+2]);
959 ASSERTL2(i >= 0 && i <= 8,
"edge id is out of range");
960 if (i == 0 || i == 2)
964 else if (i == 1 || i == 3 || i == 8)
989 Array<OneD, unsigned int> &maparray,
990 Array<OneD, int> &signarray,
995 "Method only implemented if BasisType is identical"
996 "in x and y directions");
999 "Method only implemented for Modified_A BasisType"
1000 "(x and y direction) and Modified_B BasisType (z "
1003 int i, j, p, q, r, nFaceCoeffs, idx = 0;
1005 if (nummodesA == -1)
1010 nummodesA =
m_base[0]->GetNumModes();
1011 nummodesB =
m_base[1]->GetNumModes();
1015 nummodesA =
m_base[0]->GetNumModes();
1016 nummodesB =
m_base[2]->GetNumModes();
1020 nummodesA =
m_base[1]->GetNumModes();
1021 nummodesB =
m_base[2]->GetNumModes();
1026 else if (fid == 1 || fid == 3)
1028 nFaceCoeffs = nummodesB + (nummodesA-1)*(1+2*(nummodesB-1)-(nummodesA-1))/2;
1032 nFaceCoeffs = nummodesA*nummodesB;
1036 if (maparray.num_elements() != nFaceCoeffs)
1038 maparray = Array<OneD, unsigned int>(nFaceCoeffs);
1041 if (signarray.num_elements() != nFaceCoeffs)
1043 signarray = Array<OneD, int>(nFaceCoeffs,1);
1047 fill(signarray.get(), signarray.get() + nFaceCoeffs, 1);
1052 Array<OneD, int> arrayindx(nFaceCoeffs,-1);
1054 if (fid != 1 && fid != 3)
1056 for (i = 0; i < nummodesB; i++)
1058 for (j = 0; j < nummodesA; j++)
1062 arrayindx[i*nummodesA+j] = i*nummodesA+j;
1066 arrayindx[i*nummodesA+j] = j*nummodesB+i;
1077 for (q = 0; q < nummodesB; ++q)
1079 for (p = 0; p < nummodesA; ++p)
1081 maparray[arrayindx[q*nummodesA+p]] =
GetMode(p,q,0);
1087 for (p = 0; p < nummodesA; ++p)
1089 for (r = 0; r < nummodesB-p; ++r)
1091 if ((
int)faceOrient == 7 && p > 1)
1093 signarray[idx] = p % 2 ? -1 : 1;
1095 maparray[idx++] =
GetMode(p,0,r);
1101 for (q = 0; q < nummodesA; ++q)
1103 maparray[arrayindx[q]] =
GetMode(1,q,0);
1105 for (q = 0; q < nummodesA; ++q)
1107 maparray[arrayindx[nummodesA+q]] =
GetMode(0,q,1);
1109 for (r = 1; r < nummodesB-1; ++r)
1111 for (q = 0; q < nummodesA; ++q)
1113 maparray[arrayindx[(r+1)*nummodesA+q]] =
GetMode(1,q,r);
1119 for (p = 0; p < nummodesA; ++p)
1121 for (r = 0; r < nummodesB-p; ++r)
1123 if ((
int)faceOrient == 7 && p > 1)
1125 signarray[idx] = p % 2 ? -1 : 1;
1127 maparray[idx++] =
GetMode(p, 1, r);
1133 for (r = 0; r < nummodesB; ++r)
1135 for (q = 0; q < nummodesA; ++q)
1137 maparray[arrayindx[r*nummodesA+q]] =
GetMode(0, q, r);
1143 ASSERTL0(
false,
"Face to element map unavailable.");
1146 if (fid == 1 || fid == 3)
1150 if ((
int)faceOrient == 7)
1152 swap(maparray[0], maparray[nummodesA]);
1153 for (i = 1; i < nummodesA-1; ++i)
1155 swap(maparray[i+1], maparray[nummodesA+i]);
1165 if (faceOrient == 6 || faceOrient == 8 ||
1166 faceOrient == 11 || faceOrient == 12)
1170 for (i = 3; i < nummodesB; i += 2)
1172 for (j = 0; j < nummodesA; j++)
1174 signarray[arrayindx[i*nummodesA+j]] *= -1;
1178 for (i = 0; i < nummodesA; i++)
1180 swap(maparray [i], maparray [i+nummodesA]);
1181 swap(signarray[i], signarray[i+nummodesA]);
1186 for (i = 0; i < nummodesB; i++)
1188 for (j = 3; j < nummodesA; j += 2)
1190 signarray[arrayindx[i*nummodesA+j]] *= -1;
1194 for (i = 0; i < nummodesB; i++)
1196 swap (maparray [i], maparray [i+nummodesB]);
1197 swap (signarray[i], signarray[i+nummodesB]);
1202 if (faceOrient == 7 || faceOrient == 8 ||
1203 faceOrient == 10 || faceOrient == 12)
1207 for (i = 0; i < nummodesB; i++)
1209 for (j = 3; j < nummodesA; j += 2)
1211 signarray[arrayindx[i*nummodesA+j]] *= -1;
1215 for(i = 0; i < nummodesB; i++)
1217 swap(maparray [i*nummodesA], maparray [i*nummodesA+1]);
1218 swap(signarray[i*nummodesA], signarray[i*nummodesA+1]);
1223 for (i = 3; i < nummodesB; i += 2)
1225 for (j = 0; j < nummodesA; j++)
1227 signarray[arrayindx[i*nummodesA+j]] *= -1;
1231 for (i = 0; i < nummodesA; i++)
1233 swap(maparray [i*nummodesB], maparray [i*nummodesB+1]);
1234 swap(signarray[i*nummodesB], signarray[i*nummodesB+1]);
1246 "Mapping not defined for this type of basis");
1250 if(useCoeffPacking ==
true)
1273 ASSERTL0(
false,
"local vertex id must be between 0 and 5");
1299 ASSERTL0(
false,
"local vertex id must be between 0 and 5");
1309 Array<OneD, unsigned int> &maparray,
1310 Array<OneD, int> &signarray)
1314 const int P =
m_base[0]->GetNumModes() - 1;
1315 const int Q =
m_base[1]->GetNumModes() - 1;
1316 const int R =
m_base[2]->GetNumModes() - 1;
1319 if (maparray.num_elements() != nEdgeIntCoeffs)
1321 maparray = Array<OneD, unsigned int>(nEdgeIntCoeffs);
1324 if(signarray.num_elements() != nEdgeIntCoeffs)
1326 signarray = Array<OneD, int>(nEdgeIntCoeffs,1);
1330 fill(signarray.get(), signarray.get()+nEdgeIntCoeffs, 1);
1340 for (i = 2; i <= P; ++i)
1342 maparray[i-2] =
GetMode(i,0,0);
1347 for (i = 2; i <= Q; ++i)
1349 maparray[i-2] =
GetMode(1,i,0);
1356 for (i = 2; i <= P; ++i)
1358 maparray[i-2] =
GetMode(i,1,0);
1365 for (i = 2; i <= Q; ++i)
1367 maparray[i-2] =
GetMode(0,i,0);
1372 for (i = 2; i <= R; ++i)
1374 maparray[i-2] =
GetMode(0,0,i);
1379 for (i = 1; i <= R-1; ++i)
1381 maparray[i-1] =
GetMode(1,0,i);
1386 for (i = 1; i <= R-1; ++i)
1388 maparray[i-1] =
GetMode(1,1,i);
1393 for (i = 2; i <= R; ++i)
1395 maparray[i-2] =
GetMode(0,1,i);
1400 for (i = 2; i <= Q; ++i)
1402 maparray[i-2] =
GetMode(0,i,1);
1407 ASSERTL0(
false,
"Edge not defined.");
1413 for (i = 1; i < nEdgeIntCoeffs; i += 2)
1423 Array<OneD, unsigned int> &maparray,
1424 Array<OneD, int> &signarray)
1426 const int P =
m_base[0]->GetNumModes() - 1;
1427 const int Q =
m_base[1]->GetNumModes() - 1;
1428 const int R =
m_base[2]->GetNumModes() - 1;
1430 int p, q, r, idx = 0;
1436 if (maparray.num_elements() != nFaceIntCoeffs)
1438 maparray = Array<OneD, unsigned int>(nFaceIntCoeffs);
1441 if (signarray.num_elements() != nFaceIntCoeffs)
1443 signarray = Array<OneD, int>(nFaceIntCoeffs, 1);
1447 fill(signarray.get(), signarray.get()+nFaceIntCoeffs, 1);
1452 Array<OneD, int> arrayindx(nFaceIntCoeffs);
1453 if (fid != 1 && fid != 3)
1466 for (i = 0; i < nummodesB; i++)
1468 for (j = 0; j < nummodesA; j++)
1472 arrayindx[i*nummodesA+j] = i*nummodesA+j;
1476 arrayindx[i*nummodesA+j] = j*nummodesB+i;
1485 for (q = 2; q <= Q; ++q)
1487 for (p = 2; p <= P; ++p)
1489 maparray[arrayindx[(q-2)*nummodesA+(p-2)]] =
GetMode(p,q,0);
1495 for (p = 2; p <= P; ++p)
1497 for (r = 1; r <= R-p; ++r)
1499 if ((
int)faceOrient == 7)
1501 signarray[idx] = p % 2 ? -1 : 1;
1503 maparray[idx++] =
GetMode(p,0,r);
1509 for (r = 1; r <= R-1; ++r)
1511 for (q = 2; q <= Q; ++q)
1513 maparray[arrayindx[(r-1)*nummodesA+(q-2)]] =
GetMode(1, q, r);
1519 for (p = 2; p <= P; ++p)
1521 for (r = 1; r <= R-p; ++r)
1523 if ((
int)faceOrient == 7)
1525 signarray[idx] = p % 2 ? -1 : 1;
1527 maparray[idx++] =
GetMode(p, 1, r);
1533 for (r = 2; r <= R; ++r)
1535 for (q = 2; q <= Q; ++q)
1537 maparray[arrayindx[(r-2)*nummodesA+(q-2)]] =
GetMode(0, q, r);
1543 ASSERTL0(
false,
"Face interior map not available.");
1548 if (fid == 1 || fid == 3)
1551 if (faceOrient == 6 || faceOrient == 8 ||
1552 faceOrient == 11 || faceOrient == 12)
1556 for (i = 1; i < nummodesB; i += 2)
1558 for (j = 0; j < nummodesA; j++)
1560 signarray[arrayindx[i*nummodesA+j]] *= -1;
1566 for (i = 0; i < nummodesB; i++)
1568 for (j = 1; j < nummodesA; j += 2)
1570 signarray[arrayindx[i*nummodesA+j]] *= -1;
1576 if (faceOrient == 7 || faceOrient == 8 ||
1577 faceOrient == 10 || faceOrient == 12)
1581 for (i = 0; i < nummodesB; i++)
1583 for (j = 1; j < nummodesA; j += 2)
1585 signarray[arrayindx[i*nummodesA+j]] *= -1;
1591 for (i = 1; i < nummodesB; i += 2)
1593 for (j = 0; j < nummodesA; j++)
1595 signarray[arrayindx[i*nummodesA+j]] *= -1;
1606 "BasisType is not a boundary interior form");
1609 "BasisType is not a boundary interior form");
1612 "BasisType is not a boundary interior form");
1614 int P =
m_base[0]->GetNumModes() - 1, p;
1615 int Q =
m_base[1]->GetNumModes() - 1, q;
1616 int R =
m_base[2]->GetNumModes() - 1, r;
1620 if(outarray.num_elements()!=nIntCoeffs)
1622 outarray = Array<OneD, unsigned int>(nIntCoeffs);
1628 for (p = 2; p <= P; ++p)
1630 for (q = 2; q <= Q; ++q)
1632 for (r = 1; r <= R-p; ++r)
1634 outarray[idx++] =
GetMode(p,q,r);
1644 "BasisType is not a boundary interior form");
1647 "BasisType is not a boundary interior form");
1650 "BasisType is not a boundary interior form");
1652 int P =
m_base[0]->GetNumModes() - 1, p;
1653 int Q =
m_base[1]->GetNumModes() - 1, q;
1654 int R =
m_base[2]->GetNumModes() - 1, r;
1658 for (p = 0; p <= P; ++p)
1663 for (q = 0; q <= Q; ++q)
1665 for (r = 0; r <= R-p; ++r)
1667 maparray[idx++] =
GetMode(p,q,r);
1675 for (q = 0; q <= Q; ++q)
1679 for (r = 0; r <= R-p; ++r)
1681 maparray[idx++] =
GetMode(p,q,r);
1686 maparray[idx++] =
GetMode(p,q,0);
1710 int nq0 =
m_base[0]->GetNumPoints();
1711 int nq1 =
m_base[1]->GetNumPoints();
1712 int nq2 =
m_base[2]->GetNumPoints();
1713 int nq = max(nq0,max(nq1,nq2));
1716 Array<OneD, Array<OneD, NekDouble> > coords (neq);
1717 Array<OneD, NekDouble> coll (3);
1718 Array<OneD, DNekMatSharedPtr> I (3);
1719 Array<OneD, NekDouble> tmp (nq0);
1724 for(
int i = 0; i < nq; ++i)
1726 for(
int j = 0; j < nq; ++j)
1728 for(
int k = 0; k < nq-i; ++k,++cnt)
1730 coords[cnt] = Array<OneD, NekDouble>(3);
1731 coords[cnt][0] = -1.0 + 2*k/(
NekDouble)(nq-1);
1732 coords[cnt][1] = -1.0 + 2*j/(
NekDouble)(nq-1);
1733 coords[cnt][2] = -1.0 + 2*i/(
NekDouble)(nq-1);
1738 for(
int i = 0; i < neq; ++i)
1742 I[0] =
m_base[0]->GetI(coll );
1743 I[1] =
m_base[1]->GetI(coll+1);
1744 I[2] =
m_base[2]->GetI(coll+2);
1748 for(
int k = 0; k < nq2; ++k)
1750 for (
int j = 0; j < nq1; ++j)
1753 fac = (I[1]->GetPtr())[j]*(I[2]->GetPtr())[k];
1758 k * nq0 * nq1 * neq +
1803 int Q =
m_base[1]->GetNumModes() - 1;
1804 int R =
m_base[2]->GetNumModes() - 1;
1808 (Q+1)*(p*R + 1-(p-2)*(p-1)/2);
1812 const Array<OneD, const NekDouble>& inarray,
1813 Array<OneD, NekDouble>& outarray)
1816 int nquad0 =
m_base[0]->GetNumPoints();
1817 int nquad1 =
m_base[1]->GetNumPoints();
1818 int nquad2 =
m_base[2]->GetNumPoints();
1820 const Array<OneD, const NekDouble>& w0 =
m_base[0]->GetW();
1821 const Array<OneD, const NekDouble>& w1 =
m_base[1]->GetW();
1822 const Array<OneD, const NekDouble>& w2 =
m_base[2]->GetW();
1824 const Array<OneD, const NekDouble>& z2 =
m_base[2]->GetZ();
1827 for(i = 0; i < nquad1*nquad2; ++i)
1830 w0.get(), 1, outarray.get()+i*nquad0,1);
1834 for(j = 0; j < nquad2; ++j)
1836 for(i = 0; i < nquad1; ++i)
1838 Blas::Dscal(nquad0,w1[i], &outarray[0]+i*nquad0 +
1850 for(i = 0; i < nquad2; ++i)
1852 Blas::Dscal(nquad0*nquad1, 0.5*w2[i],
1853 &outarray[0]+i*nquad0*nquad1, 1);
1858 for(i = 0; i < nquad2; ++i)
1860 Blas::Dscal(nquad0*nquad1,0.25*(1-z2[i])*w2[i],
1861 &outarray[0]+i*nquad0*nquad1,1);
1872 int qa =
m_base[0]->GetNumPoints();
1873 int qb =
m_base[1]->GetNumPoints();
1874 int qc =
m_base[2]->GetNumPoints();
1875 int nmodes_a =
m_base[0]->GetNumModes();
1876 int nmodes_b =
m_base[1]->GetNumModes();
1877 int nmodes_c =
m_base[2]->GetNumModes();
1888 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);
1905 OrthoExp.
FwdTrans(array,orthocoeffs);
1906 int nmodes = min(min(nmodes_a,nmodes_b),nmodes_c);
1907 NekDouble cutoff = min(min(cutoff_a,cutoff_b),cutoff_c);
1910 for(i = 0; i < nmodes_a; ++i)
1912 for(j = 0; j < nmodes_b; ++j)
1914 for(k = 0; k < nmodes_c-i; ++k)
1916 if(j >= cutoff || i + k >= cutoff)
1918 orthocoeffs[cnt] *= (1.0+SvvDiffCoeff*exp(-(i+k-nmodes)*(i+k-nmodes)/((
NekDouble)((i+k-cutoff+epsilon)*(i+k-cutoff+epsilon))))*exp(-(j-nmodes)*(j-nmodes)/((
NekDouble)((j-cutoff+epsilon)*(j-cutoff+epsilon)))));
1926 OrthoExp.
BwdTrans(orthocoeffs,array);
1933 const Array<OneD, const NekDouble> &inarray,
1934 Array<OneD, NekDouble> &outarray)
1936 int nquad0 =
m_base[0]->GetNumPoints();
1937 int nquad1 =
m_base[1]->GetNumPoints();
1938 int nquad2 =
m_base[2]->GetNumPoints();
1939 int nqtot = nquad0*nquad1*nquad2;
1940 int nmodes0 =
m_base[0]->GetNumModes();
1941 int nmodes1 =
m_base[1]->GetNumModes();
1942 int nmodes2 =
m_base[2]->GetNumModes();
1943 int numMax = nmodes0;
1945 Array<OneD, NekDouble> coeff (
m_ncoeffs);
1946 Array<OneD, NekDouble> coeff_tmp1(
m_ncoeffs, 0.0);
1947 Array<OneD, NekDouble> phys_tmp (nqtot, 0.0);
1948 Array<OneD, NekDouble> tmp, tmp2, tmp3, tmp4;
1971 OrthoPrismExp->FwdTrans(phys_tmp, coeff);
1974 for (u = 0; u < numMin; ++u)
1976 for (i = 0; i < numMin; ++i)
1979 tmp2 = coeff_tmp1 + cnt, 1);
1983 for (i = numMin; i < numMax; ++i)
1989 OrthoPrismExp->BwdTrans(coeff_tmp1, phys_tmp);