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");
911 int nummodes =
GetBasis(0)->GetNumModes();
968 nummodes[modes_offset],
969 nummodes[modes_offset+1],
970 nummodes[modes_offset+2]);
978 ASSERTL2(i >= 0 && i <= 8,
"edge id is out of range");
979 if (i == 0 || i == 2)
983 else if (i == 1 || i == 3 || i == 8)
1008 Array<OneD, unsigned int> &maparray,
1009 Array<OneD, int> &signarray,
1014 "Method only implemented if BasisType is identical"
1015 "in x and y directions");
1018 "Method only implemented for Modified_A BasisType"
1019 "(x and y direction) and Modified_B BasisType (z "
1022 int i, j, p, q, r, nFaceCoeffs, idx = 0;
1024 if (nummodesA == -1)
1029 nummodesA =
m_base[0]->GetNumModes();
1030 nummodesB =
m_base[1]->GetNumModes();
1034 nummodesA =
m_base[0]->GetNumModes();
1035 nummodesB =
m_base[2]->GetNumModes();
1039 nummodesA =
m_base[1]->GetNumModes();
1040 nummodesB =
m_base[2]->GetNumModes();
1045 else if (fid == 1 || fid == 3)
1047 nFaceCoeffs = nummodesB + (nummodesA-1)*(1+2*(nummodesB-1)-(nummodesA-1))/2;
1051 nFaceCoeffs = nummodesA*nummodesB;
1055 if (maparray.num_elements() != nFaceCoeffs)
1057 maparray = Array<OneD, unsigned int>(nFaceCoeffs);
1060 if (signarray.num_elements() != nFaceCoeffs)
1062 signarray = Array<OneD, int>(nFaceCoeffs,1);
1066 fill(signarray.get(), signarray.get() + nFaceCoeffs, 1);
1071 Array<OneD, int> arrayindx(nFaceCoeffs,-1);
1073 if (fid != 1 && fid != 3)
1075 for (i = 0; i < nummodesB; i++)
1077 for (j = 0; j < nummodesA; j++)
1081 arrayindx[i*nummodesA+j] = i*nummodesA+j;
1085 arrayindx[i*nummodesA+j] = j*nummodesB+i;
1096 for (q = 0; q < nummodesB; ++q)
1098 for (p = 0; p < nummodesA; ++p)
1100 maparray[arrayindx[q*nummodesA+p]] =
GetMode(p,q,0);
1106 for (p = 0; p < nummodesA; ++p)
1108 for (r = 0; r < nummodesB-p; ++r)
1110 if ((
int)faceOrient == 7 && p > 1)
1112 signarray[idx] = p % 2 ? -1 : 1;
1114 maparray[idx++] =
GetMode(p,0,r);
1120 for (q = 0; q < nummodesA; ++q)
1122 maparray[arrayindx[q]] =
GetMode(1,q,0);
1124 for (q = 0; q < nummodesA; ++q)
1126 maparray[arrayindx[nummodesA+q]] =
GetMode(0,q,1);
1128 for (r = 1; r < nummodesB-1; ++r)
1130 for (q = 0; q < nummodesA; ++q)
1132 maparray[arrayindx[(r+1)*nummodesA+q]] =
GetMode(1,q,r);
1138 for (p = 0; p < nummodesA; ++p)
1140 for (r = 0; r < nummodesB-p; ++r)
1142 if ((
int)faceOrient == 7 && p > 1)
1144 signarray[idx] = p % 2 ? -1 : 1;
1146 maparray[idx++] =
GetMode(p, 1, r);
1152 for (r = 0; r < nummodesB; ++r)
1154 for (q = 0; q < nummodesA; ++q)
1156 maparray[arrayindx[r*nummodesA+q]] =
GetMode(0, q, r);
1162 ASSERTL0(
false,
"Face to element map unavailable.");
1165 if (fid == 1 || fid == 3)
1169 if ((
int)faceOrient == 7)
1171 swap(maparray[0], maparray[nummodesA]);
1172 for (i = 1; i < nummodesA-1; ++i)
1174 swap(maparray[i+1], maparray[nummodesA+i]);
1184 if (faceOrient == 6 || faceOrient == 8 ||
1185 faceOrient == 11 || faceOrient == 12)
1189 for (i = 3; i < nummodesB; i += 2)
1191 for (j = 0; j < nummodesA; j++)
1193 signarray[arrayindx[i*nummodesA+j]] *= -1;
1197 for (i = 0; i < nummodesA; i++)
1199 swap(maparray [i], maparray [i+nummodesA]);
1200 swap(signarray[i], signarray[i+nummodesA]);
1205 for (i = 0; i < nummodesB; i++)
1207 for (j = 3; j < nummodesA; j += 2)
1209 signarray[arrayindx[i*nummodesA+j]] *= -1;
1213 for (i = 0; i < nummodesB; i++)
1215 swap (maparray [i], maparray [i+nummodesB]);
1216 swap (signarray[i], signarray[i+nummodesB]);
1221 if (faceOrient == 7 || faceOrient == 8 ||
1222 faceOrient == 10 || faceOrient == 12)
1226 for (i = 0; i < nummodesB; i++)
1228 for (j = 3; j < nummodesA; j += 2)
1230 signarray[arrayindx[i*nummodesA+j]] *= -1;
1234 for(i = 0; i < nummodesB; i++)
1236 swap(maparray [i*nummodesA], maparray [i*nummodesA+1]);
1237 swap(signarray[i*nummodesA], signarray[i*nummodesA+1]);
1242 for (i = 3; i < nummodesB; i += 2)
1244 for (j = 0; j < nummodesA; j++)
1246 signarray[arrayindx[i*nummodesA+j]] *= -1;
1250 for (i = 0; i < nummodesA; i++)
1252 swap(maparray [i*nummodesB], maparray [i*nummodesB+1]);
1253 swap(signarray[i*nummodesB], signarray[i*nummodesB+1]);
1265 "Mapping not defined for this type of basis");
1269 if(useCoeffPacking ==
true)
1292 ASSERTL0(
false,
"local vertex id must be between 0 and 5");
1318 ASSERTL0(
false,
"local vertex id must be between 0 and 5");
1328 Array<OneD, unsigned int> &maparray,
1329 Array<OneD, int> &signarray)
1333 const int P =
m_base[0]->GetNumModes() - 1;
1334 const int Q =
m_base[1]->GetNumModes() - 1;
1335 const int R =
m_base[2]->GetNumModes() - 1;
1338 if (maparray.num_elements() != nEdgeIntCoeffs)
1340 maparray = Array<OneD, unsigned int>(nEdgeIntCoeffs);
1343 if(signarray.num_elements() != nEdgeIntCoeffs)
1345 signarray = Array<OneD, int>(nEdgeIntCoeffs,1);
1349 fill(signarray.get(), signarray.get()+nEdgeIntCoeffs, 1);
1359 for (i = 2; i <= P; ++i)
1361 maparray[i-2] =
GetMode(i,0,0);
1366 for (i = 2; i <= Q; ++i)
1368 maparray[i-2] =
GetMode(1,i,0);
1375 for (i = 2; i <= P; ++i)
1377 maparray[i-2] =
GetMode(i,1,0);
1384 for (i = 2; i <= Q; ++i)
1386 maparray[i-2] =
GetMode(0,i,0);
1391 for (i = 2; i <= R; ++i)
1393 maparray[i-2] =
GetMode(0,0,i);
1398 for (i = 1; i <= R-1; ++i)
1400 maparray[i-1] =
GetMode(1,0,i);
1405 for (i = 1; i <= R-1; ++i)
1407 maparray[i-1] =
GetMode(1,1,i);
1412 for (i = 2; i <= R; ++i)
1414 maparray[i-2] =
GetMode(0,1,i);
1419 for (i = 2; i <= Q; ++i)
1421 maparray[i-2] =
GetMode(0,i,1);
1426 ASSERTL0(
false,
"Edge not defined.");
1432 for (i = 1; i < nEdgeIntCoeffs; i += 2)
1442 Array<OneD, unsigned int> &maparray,
1443 Array<OneD, int> &signarray)
1445 const int P =
m_base[0]->GetNumModes() - 1;
1446 const int Q =
m_base[1]->GetNumModes() - 1;
1447 const int R =
m_base[2]->GetNumModes() - 1;
1449 int p, q, r, idx = 0;
1450 int nummodesA, nummodesB, i, j;
1452 if (maparray.num_elements() != nFaceIntCoeffs)
1454 maparray = Array<OneD, unsigned int>(nFaceIntCoeffs);
1457 if (signarray.num_elements() != nFaceIntCoeffs)
1459 signarray = Array<OneD, int>(nFaceIntCoeffs, 1);
1463 fill(signarray.get(), signarray.get()+nFaceIntCoeffs, 1);
1468 Array<OneD, int> arrayindx(nFaceIntCoeffs);
1469 if (fid != 1 && fid != 3)
1482 for (i = 0; i < nummodesB; i++)
1484 for (j = 0; j < nummodesA; j++)
1488 arrayindx[i*nummodesA+j] = i*nummodesA+j;
1492 arrayindx[i*nummodesA+j] = j*nummodesB+i;
1501 for (q = 2; q <= Q; ++q)
1503 for (p = 2; p <= P; ++p)
1505 maparray[arrayindx[(q-2)*nummodesA+(p-2)]] =
GetMode(p,q,0);
1511 for (p = 2; p <= P; ++p)
1513 for (r = 1; r <= R-p; ++r)
1515 if ((
int)faceOrient == 7)
1517 signarray[idx] = p % 2 ? -1 : 1;
1519 maparray[idx++] =
GetMode(p,0,r);
1525 for (r = 1; r <= R-1; ++r)
1527 for (q = 2; q <= Q; ++q)
1529 maparray[arrayindx[(r-1)*nummodesA+(q-2)]] =
GetMode(1, q, r);
1535 for (p = 2; p <= P; ++p)
1537 for (r = 1; r <= R-p; ++r)
1539 if ((
int)faceOrient == 7)
1541 signarray[idx] = p % 2 ? -1 : 1;
1543 maparray[idx++] =
GetMode(p, 1, r);
1549 for (r = 2; r <= R; ++r)
1551 for (q = 2; q <= Q; ++q)
1553 maparray[arrayindx[(r-2)*nummodesA+(q-2)]] =
GetMode(0, q, r);
1559 ASSERTL0(
false,
"Face interior map not available.");
1564 if (fid == 1 || fid == 3)
1567 if (faceOrient == 6 || faceOrient == 8 ||
1568 faceOrient == 11 || faceOrient == 12)
1572 for (i = 1; i < nummodesB; i += 2)
1574 for (j = 0; j < nummodesA; j++)
1576 signarray[arrayindx[i*nummodesA+j]] *= -1;
1582 for (i = 0; i < nummodesB; i++)
1584 for (j = 1; j < nummodesA; j += 2)
1586 signarray[arrayindx[i*nummodesA+j]] *= -1;
1592 if (faceOrient == 7 || faceOrient == 8 ||
1593 faceOrient == 10 || faceOrient == 12)
1597 for (i = 0; i < nummodesB; i++)
1599 for (j = 1; j < nummodesA; j += 2)
1601 signarray[arrayindx[i*nummodesA+j]] *= -1;
1607 for (i = 1; i < nummodesB; i += 2)
1609 for (j = 0; j < nummodesA; j++)
1611 signarray[arrayindx[i*nummodesA+j]] *= -1;
1622 "BasisType is not a boundary interior form");
1625 "BasisType is not a boundary interior form");
1628 "BasisType is not a boundary interior form");
1630 int P =
m_base[0]->GetNumModes() - 1, p;
1631 int Q =
m_base[1]->GetNumModes() - 1, q;
1632 int R =
m_base[2]->GetNumModes() - 1, r;
1636 if(outarray.num_elements()!=nIntCoeffs)
1638 outarray = Array<OneD, unsigned int>(nIntCoeffs);
1644 for (p = 2; p <= P; ++p)
1646 for (q = 2; q <= Q; ++q)
1648 for (r = 1; r <= R-p; ++r)
1650 outarray[idx++] =
GetMode(p,q,r);
1660 "BasisType is not a boundary interior form");
1663 "BasisType is not a boundary interior form");
1666 "BasisType is not a boundary interior form");
1668 int P =
m_base[0]->GetNumModes() - 1, p;
1669 int Q =
m_base[1]->GetNumModes() - 1, q;
1670 int R =
m_base[2]->GetNumModes() - 1, r;
1674 for (p = 0; p <= P; ++p)
1679 for (q = 0; q <= Q; ++q)
1681 for (r = 0; r <= R-p; ++r)
1683 maparray[idx++] =
GetMode(p,q,r);
1691 for (q = 0; q <= Q; ++q)
1695 for (r = 0; r <= R-p; ++r)
1697 maparray[idx++] =
GetMode(p,q,r);
1702 maparray[idx++] =
GetMode(p,q,0);
1749 int Q =
m_base[1]->GetNumModes() - 1;
1750 int R =
m_base[2]->GetNumModes() - 1;
1754 (Q+1)*(p*R + 1-(p-2)*(p-1)/2);
1758 const Array<OneD, const NekDouble>& inarray,
1759 Array<OneD, NekDouble>& outarray)
1762 int nquad0 =
m_base[0]->GetNumPoints();
1763 int nquad1 =
m_base[1]->GetNumPoints();
1764 int nquad2 =
m_base[2]->GetNumPoints();
1766 const Array<OneD, const NekDouble>& w0 =
m_base[0]->GetW();
1767 const Array<OneD, const NekDouble>& w1 =
m_base[1]->GetW();
1768 const Array<OneD, const NekDouble>& w2 =
m_base[2]->GetW();
1770 const Array<OneD, const NekDouble>& z2 =
m_base[2]->GetZ();
1773 for(i = 0; i < nquad1*nquad2; ++i)
1776 w0.get(), 1, outarray.get()+i*nquad0,1);
1780 for(j = 0; j < nquad2; ++j)
1782 for(i = 0; i < nquad1; ++i)
1784 Blas::Dscal(nquad0,w1[i], &outarray[0]+i*nquad0 +
1796 for(i = 0; i < nquad2; ++i)
1798 Blas::Dscal(nquad0*nquad1, 0.5*w2[i],
1799 &outarray[0]+i*nquad0*nquad1, 1);
1804 for(i = 0; i < nquad2; ++i)
1806 Blas::Dscal(nquad0*nquad1,0.25*(1-z2[i])*w2[i],
1807 &outarray[0]+i*nquad0*nquad1,1);
1818 int qa =
m_base[0]->GetNumPoints();
1819 int qb =
m_base[1]->GetNumPoints();
1820 int qc =
m_base[2]->GetNumPoints();
1821 int nmodes_a =
m_base[0]->GetNumModes();
1822 int nmodes_b =
m_base[1]->GetNumModes();
1823 int nmodes_c =
m_base[2]->GetNumModes();
1834 Array<OneD, NekDouble> orthocoeffs(OrthoExp.
GetNcoeffs());
1844 int cutoff_a = (int) (SVVCutOff*nmodes_a);
1845 int cutoff_b = (int) (SVVCutOff*nmodes_b);
1846 int cutoff_c = (int) (SVVCutOff*nmodes_c);
1851 OrthoExp.
FwdTrans(array,orthocoeffs);
1852 int nmodes = min(min(nmodes_a,nmodes_b),nmodes_c);
1853 NekDouble cutoff = min(min(cutoff_a,cutoff_b),cutoff_c);
1856 for(i = 0; i < nmodes_a; ++i)
1858 for(j = 0; j < nmodes_b; ++j)
1860 for(k = 0; k < nmodes_c-i; ++k)
1862 if(j >= cutoff || i + k >= cutoff)
1864 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)))));
1872 OrthoExp.
BwdTrans(orthocoeffs,array);