46 StdPrismExp::StdPrismExp()
65 "order in 'a' direction is higher than order in 'c' direction");
103 int Qx =
m_base[0]->GetNumPoints();
104 int Qy =
m_base[1]->GetNumPoints();
105 int Qz =
m_base[2]->GetNumPoints();
111 eta_x =
m_base[0]->GetZ();
112 eta_z =
m_base[2]->GetZ();
116 bool Do_1 = (out_dxi1.num_elements() > 0)?
true:
false;
117 bool Do_3 = (out_dxi3.num_elements() > 0)?
true:
false;
136 for (k = 0; k < Qz; ++k)
138 Vmath::Smul(Qx*Qy,2.0/(1.0-eta_z[k]),&dEta_bar1[0] + k*Qx*Qy,1,
139 &out_dxi1[0] + k*Qx*Qy,1);
146 for (k = 0; k < Qz; ++k)
148 Vmath::Smul(Qx*Qy, 1.0/(1.0-eta_z[k]),&dEta_bar1[0]+k*Qx*Qy,1,
149 &dEta_bar1[0]+k*Qx*Qy,1);
153 for (i = 0; i < Qx; ++i)
156 &out_dxi3[0]+i,Qx,&out_dxi3[0]+i,Qx);
191 ASSERTL1(
false,
"input dir is out of range");
247 "Basis[1] is not a general tensor type");
251 "Basis[2] is not a general tensor type");
253 if(
m_base[0]->Collocation() &&
254 m_base[1]->Collocation() &&
260 inarray, 1, outarray, 1);
271 int nquad1 =
m_base[1]->GetNumPoints();
272 int nquad2 =
m_base[2]->GetNumPoints();
273 int order0 =
m_base[0]->GetNumModes();
274 int order1 =
m_base[1]->GetNumModes();
277 nquad1*nquad2*order0);
282 inarray,outarray,wsp,
true,
true,
true);
293 bool doCheckCollDir0,
294 bool doCheckCollDir1,
295 bool doCheckCollDir2)
298 int nquad0 =
m_base[0]->GetNumPoints();
299 int nquad1 =
m_base[1]->GetNumPoints();
300 int nquad2 =
m_base[2]->GetNumPoints();
301 int nummodes0 =
m_base[0]->GetNumModes();
302 int nummodes1 =
m_base[1]->GetNumModes();
303 int nummodes2 =
m_base[2]->GetNumModes();
307 for (i = mode = 0; i < nummodes0; ++i)
309 Blas::Dgemm(
'N',
'N', nquad2, nummodes1, nummodes2-i,
310 1.0, base2.get() + mode*nquad2, nquad2,
311 inarray.get() + mode*nummodes1, nummodes2-i,
312 0.0, tmp0.get() + i*nquad2*nummodes1, nquad2);
318 for(i = 0; i < nummodes1; i++)
320 Blas::Daxpy(nquad2,inarray[1+i*nummodes2],base2.get()+nquad2,1,
321 tmp0.get()+nquad2*(nummodes1+i),1);
325 for (i = 0; i < nummodes0; i++)
327 Blas::Dgemm(
'N',
'T', nquad1, nquad2, nummodes1,
328 1.0, base1.get(), nquad1,
329 tmp0.get() + i*nquad2*nummodes1, nquad2,
330 0.0, tmp1.get() + i*nquad2*nquad1, nquad1);
333 Blas::Dgemm(
'N',
'T', nquad0, nquad2*nquad1, nummodes0,
334 1.0, base0.get(), nquad0,
335 tmp1.get(), nquad2*nquad1,
336 0.0, outarray.get(), nquad0);
403 "Basis[1] is not a general tensor type");
407 "Basis[2] is not a general tensor type");
409 if(
m_base[0]->Collocation() &&
m_base[1]->Collocation())
430 Blas::Dgemv(
'N',
m_ncoeffs,nq,1.0,iprodmat->GetPtr().get(),
431 m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
437 bool multiplybyweights)
439 int nquad1 =
m_base[1]->GetNumPoints();
440 int nquad2 =
m_base[2]->GetNumPoints();
441 int order0 =
m_base[0]->GetNumModes();
442 int order1 =
m_base[1]->GetNumModes();
446 if(multiplybyweights)
462 inarray,outarray,wsp,
474 bool doCheckCollDir0,
475 bool doCheckCollDir1,
476 bool doCheckCollDir2)
480 const int nquad0 =
m_base[0]->GetNumPoints();
481 const int nquad1 =
m_base[1]->GetNumPoints();
482 const int nquad2 =
m_base[2]->GetNumPoints();
483 const int order0 =
m_base[0]->GetNumModes ();
484 const int order1 =
m_base[1]->GetNumModes ();
485 const int order2 =
m_base[2]->GetNumModes ();
489 ASSERTL1(wsp.num_elements() >= nquad1*nquad2*order0 +
490 nquad2*order0*order1,
491 "Insufficient workspace size");
497 Blas::Dgemm(
'T',
'N', nquad1*nquad2, order0, nquad0,
498 1.0, inarray.get(), nquad0,
500 0.0, tmp0.get(), nquad1*nquad2);
503 Blas::Dgemm(
'T',
'N', nquad2*order0, order1, nquad1,
504 1.0, tmp0.get(), nquad1,
506 0.0, tmp1.get(), nquad2*order0);
509 for (mode=i=0; i < order0; ++i)
511 Blas::Dgemm(
'T',
'N', order2-i, order1, nquad2,
512 1.0, base2.get() + mode*nquad2, nquad2,
513 tmp1.get() + i*nquad2, nquad2*order0,
514 0.0, outarray.get()+mode*order1, order2-i);
522 for (i = 0; i < order1; ++i)
526 nquad2, base2.get()+nquad2, 1,
527 tmp1.get()+i*order0*nquad2+nquad2, 1);
549 ASSERTL0(dir >= 0 && dir <= 2,
"input dir is out of range");
570 Blas::Dgemv(
'N',
m_ncoeffs,nq,1.0,iprodmat->GetPtr().get(),
571 m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
579 ASSERTL0(dir >= 0 && dir <= 2,
"input dir is out of range");
582 int order0 =
m_base[0]->GetNumModes ();
583 int order1 =
m_base[1]->GetNumModes ();
584 int nquad0 =
m_base[0]->GetNumPoints();
585 int nquad1 =
m_base[1]->GetNumPoints();
586 int nquad2 =
m_base[2]->GetNumPoints();
596 for (i = 0; i < nquad0; ++i)
598 gfac0[i] = 0.5*(1+z0[i]);
602 for (i = 0; i < nquad2; ++i)
604 gfac2[i] = 2.0/(1-z2[i]);
610 for (i = 0; i < nquad2; ++i)
613 &inarray[0]+i*nquad0*nquad1,1,
614 &tmp0 [0]+i*nquad0*nquad1,1);
647 for(i = 0; i < nquad1*nquad2; ++i)
649 Vmath::Vmul(nquad0,&gfac0[0],1,&tmp0[0]+i*nquad0,1,&tmp0[0]+i*nquad0,1);
696 eta[0] = 2.0*(1.0 + xi[0])/(1.0 - xi[2]) - 1.0;
712 for (
int k = 0; k < Qz; ++k) {
713 for (
int j = 0; j < Qy; ++j) {
714 for (
int i = 0; i < Qx; ++i) {
715 int s = i + Qx*(j + Qy*k);
716 xi_x[s] = (1.0 - eta_z[k])*(1.0 + etaBar_x[i]) / 2.0 - 1.0;
764 "BasisType is not a boundary interior form");
767 "BasisType is not a boundary interior form");
770 "BasisType is not a boundary interior form");
772 int P =
m_base[0]->GetNumModes();
773 int Q =
m_base[1]->GetNumModes();
774 int R =
m_base[2]->GetNumModes();
784 "BasisType is not a boundary interior form");
787 "BasisType is not a boundary interior form");
790 "BasisType is not a boundary interior form");
792 int P =
m_base[0]->GetNumModes()-1;
793 int Q =
m_base[1]->GetNumModes()-1;
794 int R =
m_base[2]->GetNumModes()-1;
798 + 2*(R+1) + P*(1 + 2*R - P);
803 ASSERTL2(i >= 0 && i <= 8,
"edge id is out of range");
805 if (i == 0 || i == 2)
809 else if (i == 1 || i == 3 || i == 8)
830 ASSERTL2(i >= 0 && i <= 4,
"face id is out of range");
835 else if (i == 1 || i == 3)
838 return Q+1 + (P*(1 + 2*Q - P))/2;
848 ASSERTL2(i >= 0 && i <= 4,
"face id is out of range");
858 else if (i == 1 || i == 3)
860 return Pi * (2*Ri - Pi - 1) / 2;
875 Pi * (2*Ri - Pi - 1) +
881 ASSERTL2(i >= 0 && i <= 4,
"face id is out of range");
885 return m_base[0]->GetNumPoints()*
886 m_base[1]->GetNumPoints();
888 else if (i == 1 || i == 3)
890 return m_base[0]->GetNumPoints()*
891 m_base[2]->GetNumPoints();
895 return m_base[1]->GetNumPoints()*
896 m_base[2]->GetNumPoints();
901 const int i,
const int j)
const
903 ASSERTL2(i >= 0 && i <= 4,
"face id is out of range");
904 ASSERTL2(j == 0 || j == 1,
"face direction is out of range");
908 return m_base[j]->GetPointsKey();
910 else if (i == 1 || i == 3)
912 return m_base[2*j]->GetPointsKey();
916 return m_base[j+1]->GetPointsKey();
921 const int i,
const int k)
const
923 ASSERTL2(i >= 0 && i <= 4,
"face id is out of range");
924 ASSERTL2(k >= 0 && k <= 1,
"basis key id is out of range");
933 m_base[k]->GetNumModes());
941 m_base[k+1]->GetNumModes());
949 m_base[2*k]->GetNumModes());
963 nummodes[modes_offset],
964 nummodes[modes_offset+1],
965 nummodes[modes_offset+2]);
973 ASSERTL2(i >= 0 && i <= 8,
"edge id is out of range");
974 if (i == 0 || i == 2)
978 else if (i == 1 || i == 3 || i == 8)
1009 "Method only implemented if BasisType is identical"
1010 "in x and y directions");
1013 "Method only implemented for Modified_A BasisType"
1014 "(x and y direction) and Modified_B BasisType (z "
1017 int i, j, k, p, q, r, nFaceCoeffs, idx = 0;
1018 int nummodesA, nummodesB;
1023 nummodesA =
m_base[0]->GetNumModes();
1024 nummodesB =
m_base[1]->GetNumModes();
1028 nummodesA =
m_base[0]->GetNumModes();
1029 nummodesB =
m_base[2]->GetNumModes();
1033 nummodesA =
m_base[1]->GetNumModes();
1034 nummodesB =
m_base[2]->GetNumModes();
1038 bool CheckForZeroedModes =
false;
1046 else if (fid == 1 || fid == 3)
1048 nFaceCoeffs = P*(2*Q-P+1)/2;
1049 CheckForZeroedModes =
true;
1054 CheckForZeroedModes =
true;
1058 if (maparray.num_elements() != nFaceCoeffs)
1063 if (signarray.num_elements() != nFaceCoeffs)
1069 fill(signarray.get(), signarray.get() + nFaceCoeffs, 1);
1076 if (fid != 1 && fid != 3)
1078 for (i = 0; i < Q; i++)
1080 for (j = 0; j < P; j++)
1084 arrayindx[i*P+j] = i*P+j;
1088 arrayindx[i*P+j] = j*Q+i;
1099 for (q = 0; q < Q; ++q)
1101 for (p = 0; p < P; ++p)
1103 maparray[arrayindx[q*P+p]] =
GetMode(p,q,0);
1109 for (p = 0; p < P; ++p)
1111 for (r = 0; r < Q-p; ++r)
1113 if ((
int)faceOrient == 7 && p > 1)
1115 signarray[idx] = p % 2 ? -1 : 1;
1117 maparray[idx++] =
GetMode(p,0,r);
1123 for (q = 0; q < P; ++q)
1125 maparray[arrayindx[q]] =
GetMode(1,q,0);
1127 for (q = 0; q < P; ++q)
1129 maparray[arrayindx[P+q]] =
GetMode(0,q,1);
1131 for (r = 1; r < Q-1; ++r)
1133 for (q = 0; q < P; ++q)
1135 maparray[arrayindx[(r+1)*P+q]] =
GetMode(1,q,r);
1141 for (p = 0; p < P; ++p)
1143 for (r = 0; r < Q-p; ++r)
1145 if ((
int)faceOrient == 7 && p > 1)
1147 signarray[idx] = p % 2 ? -1 : 1;
1149 maparray[idx++] =
GetMode(p, 1, r);
1155 for (r = 0; r < Q; ++r)
1157 for (q = 0; q < P; ++q)
1159 maparray[arrayindx[r*P+q]] =
GetMode(0, q, r);
1165 ASSERTL0(
false,
"Face to element map unavailable.");
1168 if (fid == 1 || fid == 3)
1170 if(CheckForZeroedModes)
1175 for (j = 0; j < nummodesA; ++j)
1178 for (k = nummodesB-j; k < Q-j; ++k)
1180 signarray[idx] = 0.0;
1181 maparray[idx++] = maparray[0];
1185 for (j = nummodesA; j < P; ++j)
1187 for (k = 0; k < Q-j; ++k)
1189 signarray[idx] = 0.0;
1190 maparray[idx++] = maparray[0];
1198 if ((
int)faceOrient == 7)
1200 swap(maparray[0], maparray[P]);
1201 for (i = 1; i < P-1; ++i)
1203 swap(maparray[i+1], maparray[P+i]);
1210 if(CheckForZeroedModes)
1214 for (j = 0; j < nummodesA; ++j)
1216 for (k = nummodesB; k < Q; ++k)
1218 signarray[arrayindx[j+k*P]] = 0.0;
1219 maparray[arrayindx[j+k*P]] = maparray[0];
1223 for (j = nummodesA; j < P; ++j)
1225 for (k = 0; k < Q; ++k)
1227 signarray[arrayindx[j+k*P]] = 0.0;
1228 maparray[arrayindx[j+k*P]] = maparray[0];
1237 if (faceOrient == 6 || faceOrient == 8 ||
1238 faceOrient == 11 || faceOrient == 12)
1242 for (i = 3; i < Q; i += 2)
1244 for (j = 0; j < P; j++)
1246 signarray[arrayindx[i*P+j]] *= -1;
1250 for (i = 0; i < P; i++)
1252 swap(maparray [i], maparray [i+P]);
1253 swap(signarray[i], signarray[i+P]);
1258 for (i = 0; i < Q; i++)
1260 for (j = 3; j < P; j += 2)
1262 signarray[arrayindx[i*P+j]] *= -1;
1266 for (i = 0; i < Q; i++)
1268 swap (maparray [i], maparray [i+Q]);
1269 swap (signarray[i], signarray[i+Q]);
1274 if (faceOrient == 7 || faceOrient == 8 ||
1275 faceOrient == 10 || faceOrient == 12)
1279 for (i = 0; i < Q; i++)
1281 for (j = 3; j < P; j += 2)
1283 signarray[arrayindx[i*P+j]] *= -1;
1287 for(i = 0; i < Q; i++)
1289 swap(maparray [i*P], maparray [i*P+1]);
1290 swap(signarray[i*P], signarray[i*P+1]);
1295 for (i = 3; i < Q; i += 2)
1297 for (j = 0; j < P; j++)
1299 signarray[arrayindx[i*P+j]] *= -1;
1303 for (i = 0; i < P; i++)
1305 swap(maparray [i*Q], maparray [i*Q+1]);
1306 swap(signarray[i*Q], signarray[i*Q+1]);
1318 "Mapping not defined for this type of basis");
1322 if(useCoeffPacking ==
true)
1345 ASSERTL0(
false,
"local vertex id must be between 0 and 5");
1371 ASSERTL0(
false,
"local vertex id must be between 0 and 5");
1386 const int P =
m_base[0]->GetNumModes() - 1;
1387 const int Q =
m_base[1]->GetNumModes() - 1;
1388 const int R =
m_base[2]->GetNumModes() - 1;
1391 if (maparray.num_elements() != nEdgeIntCoeffs)
1396 if(signarray.num_elements() != nEdgeIntCoeffs)
1402 fill(signarray.get(), signarray.get()+nEdgeIntCoeffs, 1);
1412 for (i = 2; i <= P; ++i)
1414 maparray[i-2] =
GetMode(i,0,0);
1419 for (i = 2; i <= Q; ++i)
1421 maparray[i-2] =
GetMode(1,i,0);
1428 for (i = 2; i <= P; ++i)
1430 maparray[i-2] =
GetMode(i,1,0);
1437 for (i = 2; i <= Q; ++i)
1439 maparray[i-2] =
GetMode(0,i,0);
1444 for (i = 2; i <= R; ++i)
1446 maparray[i-2] =
GetMode(0,0,i);
1451 for (i = 1; i <= R-1; ++i)
1453 maparray[i-1] =
GetMode(1,0,i);
1458 for (i = 1; i <= R-1; ++i)
1460 maparray[i-1] =
GetMode(1,1,i);
1465 for (i = 2; i <= R; ++i)
1467 maparray[i-2] =
GetMode(0,1,i);
1472 for (i = 2; i <= Q; ++i)
1474 maparray[i-2] =
GetMode(0,i,1);
1479 ASSERTL0(
false,
"Edge not defined.");
1485 for (i = 1; i < nEdgeIntCoeffs; i += 2)
1498 const int P =
m_base[0]->GetNumModes() - 1;
1499 const int Q =
m_base[1]->GetNumModes() - 1;
1500 const int R =
m_base[2]->GetNumModes() - 1;
1502 int p, q, r, idx = 0;
1508 if (maparray.num_elements() != nFaceIntCoeffs)
1513 if (signarray.num_elements() != nFaceIntCoeffs)
1519 fill(signarray.get(), signarray.get()+nFaceIntCoeffs, 1);
1525 if (fid != 1 && fid != 3)
1538 for (i = 0; i < nummodesB; i++)
1540 for (j = 0; j < nummodesA; j++)
1544 arrayindx[i*nummodesA+j] = i*nummodesA+j;
1548 arrayindx[i*nummodesA+j] = j*nummodesB+i;
1557 for (q = 2; q <= Q; ++q)
1559 for (p = 2; p <= P; ++p)
1561 maparray[arrayindx[(q-2)*nummodesA+(p-2)]] =
GetMode(p,q,0);
1567 for (p = 2; p <= P; ++p)
1569 for (r = 1; r <= R-p; ++r)
1571 if ((
int)faceOrient == 7)
1573 signarray[idx] = p % 2 ? -1 : 1;
1575 maparray[idx++] =
GetMode(p,0,r);
1581 for (r = 1; r <= R-1; ++r)
1583 for (q = 2; q <= Q; ++q)
1585 maparray[arrayindx[(r-1)*nummodesA+(q-2)]] =
GetMode(1, q, r);
1591 for (p = 2; p <= P; ++p)
1593 for (r = 1; r <= R-p; ++r)
1595 if ((
int)faceOrient == 7)
1597 signarray[idx] = p % 2 ? -1 : 1;
1599 maparray[idx++] =
GetMode(p, 1, r);
1605 for (r = 2; r <= R; ++r)
1607 for (q = 2; q <= Q; ++q)
1609 maparray[arrayindx[(r-2)*nummodesA+(q-2)]] =
GetMode(0, q, r);
1615 ASSERTL0(
false,
"Face interior map not available.");
1620 if (fid == 1 || fid == 3)
1623 if (faceOrient == 6 || faceOrient == 8 ||
1624 faceOrient == 11 || faceOrient == 12)
1628 for (i = 1; i < nummodesB; i += 2)
1630 for (j = 0; j < nummodesA; j++)
1632 signarray[arrayindx[i*nummodesA+j]] *= -1;
1638 for (i = 0; i < nummodesB; i++)
1640 for (j = 1; j < nummodesA; j += 2)
1642 signarray[arrayindx[i*nummodesA+j]] *= -1;
1648 if (faceOrient == 7 || faceOrient == 8 ||
1649 faceOrient == 10 || faceOrient == 12)
1653 for (i = 0; i < nummodesB; i++)
1655 for (j = 1; j < nummodesA; j += 2)
1657 signarray[arrayindx[i*nummodesA+j]] *= -1;
1663 for (i = 1; i < nummodesB; i += 2)
1665 for (j = 0; j < nummodesA; j++)
1667 signarray[arrayindx[i*nummodesA+j]] *= -1;
1678 "BasisType is not a boundary interior form");
1681 "BasisType is not a boundary interior form");
1684 "BasisType is not a boundary interior form");
1686 int P =
m_base[0]->GetNumModes() - 1, p;
1687 int Q =
m_base[1]->GetNumModes() - 1, q;
1688 int R =
m_base[2]->GetNumModes() - 1, r;
1692 if(outarray.num_elements()!=nIntCoeffs)
1700 for (p = 2; p <= P; ++p)
1702 for (q = 2; q <= Q; ++q)
1704 for (r = 1; r <= R-p; ++r)
1706 outarray[idx++] =
GetMode(p,q,r);
1716 "BasisType is not a boundary interior form");
1719 "BasisType is not a boundary interior form");
1722 "BasisType is not a boundary interior form");
1724 int P =
m_base[0]->GetNumModes() - 1, p;
1725 int Q =
m_base[1]->GetNumModes() - 1, q;
1726 int R =
m_base[2]->GetNumModes() - 1, r;
1731 if (maparray.num_elements() != nBnd)
1737 for (p = 0; p <= P; ++p)
1742 for (q = 0; q <= Q; ++q)
1744 for (r = 0; r <= R-p; ++r)
1746 maparray[idx++] =
GetMode(p,q,r);
1754 for (q = 0; q <= Q; ++q)
1758 for (r = 0; r <= R-p; ++r)
1760 maparray[idx++] =
GetMode(p,q,r);
1765 maparray[idx++] =
GetMode(p,q,0);
1789 int nq0 =
m_base[0]->GetNumPoints();
1790 int nq1 =
m_base[1]->GetNumPoints();
1791 int nq2 =
m_base[2]->GetNumPoints();
1801 nq = max(nq0,max(nq1,nq2));
1814 for(
int i = 0; i < nq; ++i)
1816 for(
int j = 0; j < nq; ++j)
1818 for(
int k = 0; k < nq-i; ++k,++cnt)
1821 coords[cnt][0] = -1.0 + 2*k/(
NekDouble)(nq-1);
1822 coords[cnt][1] = -1.0 + 2*j/(
NekDouble)(nq-1);
1823 coords[cnt][2] = -1.0 + 2*i/(
NekDouble)(nq-1);
1828 for(
int i = 0; i < neq; ++i)
1832 I[0] =
m_base[0]->GetI(coll );
1833 I[1] =
m_base[1]->GetI(coll+1);
1834 I[2] =
m_base[2]->GetI(coll+2);
1838 for(
int k = 0; k < nq2; ++k)
1840 for (
int j = 0; j < nq1; ++j)
1843 fac = (I[1]->GetPtr())[j]*(I[2]->GetPtr())[k];
1848 k * nq0 * nq1 * neq +
1893 int Q =
m_base[1]->GetNumModes() - 1;
1894 int R =
m_base[2]->GetNumModes() - 1;
1898 (Q+1)*(p*R + 1-(p-2)*(p-1)/2);
1906 int nquad0 =
m_base[0]->GetNumPoints();
1907 int nquad1 =
m_base[1]->GetNumPoints();
1908 int nquad2 =
m_base[2]->GetNumPoints();
1917 for(i = 0; i < nquad1*nquad2; ++i)
1920 w0.get(), 1, outarray.get()+i*nquad0,1);
1924 for(j = 0; j < nquad2; ++j)
1926 for(i = 0; i < nquad1; ++i)
1928 Blas::Dscal(nquad0,w1[i], &outarray[0]+i*nquad0 +
1940 for(i = 0; i < nquad2; ++i)
1942 Blas::Dscal(nquad0*nquad1, 0.5*w2[i],
1943 &outarray[0]+i*nquad0*nquad1, 1);
1948 for(i = 0; i < nquad2; ++i)
1950 Blas::Dscal(nquad0*nquad1,0.25*(1-z2[i])*w2[i],
1951 &outarray[0]+i*nquad0*nquad1,1);
1962 int qa =
m_base[0]->GetNumPoints();
1963 int qb =
m_base[1]->GetNumPoints();
1964 int qc =
m_base[2]->GetNumPoints();
1965 int nmodes_a =
m_base[0]->GetNumModes();
1966 int nmodes_b =
m_base[1]->GetNumModes();
1967 int nmodes_c =
m_base[2]->GetNumModes();
1988 int cutoff_a = (int) (SVVCutOff*nmodes_a);
1989 int cutoff_b = (int) (SVVCutOff*nmodes_b);
1990 int cutoff_c = (int) (SVVCutOff*nmodes_c);
1995 OrthoExp.
FwdTrans(array,orthocoeffs);
1996 int nmodes = min(min(nmodes_a,nmodes_b),nmodes_c);
1997 NekDouble cutoff = min(min(cutoff_a,cutoff_b),cutoff_c);
2000 for(i = 0; i < nmodes_a; ++i)
2002 for(j = 0; j < nmodes_b; ++j)
2004 for(k = 0; k < nmodes_c-i; ++k)
2006 if(j >= cutoff || i + k >= cutoff)
2008 orthocoeffs[cnt] *= (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)))));
2012 orthocoeffs[cnt] *= 0.0;
2020 OrthoExp.
BwdTrans(orthocoeffs,array);
2030 int nquad0 =
m_base[0]->GetNumPoints();
2031 int nquad1 =
m_base[1]->GetNumPoints();
2032 int nquad2 =
m_base[2]->GetNumPoints();
2033 int nqtot = nquad0*nquad1*nquad2;
2034 int nmodes0 =
m_base[0]->GetNumModes();
2035 int nmodes1 =
m_base[1]->GetNumModes();
2036 int nmodes2 =
m_base[2]->GetNumModes();
2037 int numMax = nmodes0;
2065 OrthoPrismExp->FwdTrans(phys_tmp, coeff);
2068 for (u = 0; u < numMin; ++u)
2070 for (i = 0; i < numMin; ++i)
2073 tmp2 = coeff_tmp1 + cnt, 1);
2077 for (i = numMin; i < numMax; ++i)
2083 OrthoPrismExp->BwdTrans(coeff_tmp1, phys_tmp);
virtual void v_GetEdgeInteriorMap(const int eid, const Orientation edgeOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray)
void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdMatrixKey &mkey)
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
NekDouble GetConstFactor(const ConstFactorType &factor) const
#define ASSERTL0(condition, msg)
int getNumberOfCoefficients(int Na, int Nb, int Nc)
virtual int v_GetNedges() const
Principle Modified Functions .
virtual void v_FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Forward transform from physical quadrature space stored in inarray and evaluate the expansion coeffic...
MatrixType GetMatrixType() const
void BwdTrans_SumFacKernel(const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2)
static Array< OneD, NekDouble > NullNekDouble1DArray
virtual void v_FillMode(const int mode, Array< OneD, NekDouble > &outarray)
virtual void v_BwdTrans_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual int v_GetFaceIntNcoeffs(const int i) const
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
int GetBasisNumModes(const int dir) const
This function returns the number of expansion modes in the dir direction.
virtual void v_StdPhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2)
void MultiplyByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual int v_GetTotalEdgeIntNcoeffs() const
virtual void v_GetCoords(Array< OneD, NekDouble > &xi_x, Array< OneD, NekDouble > &xi_y, Array< OneD, NekDouble > &xi_z)
boost::shared_ptr< StdPrismExp > StdPrismExpSharedPtr
virtual void v_ReduceOrderCoeffs(int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Inner product of inarray over region with respect to the object's default expansion basis; output in ...
int GetNumPoints(const int dir) const
This function returns the number of quadrature points in the dir direction.
virtual LibUtilities::PointsKey v_GetFacePointsKey(const int i, const int j) const
void Svtvp(int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
svtvp (scalar times vector plus vector): z = alpha*x + y
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Calculate the inner product of inarray with respect to the basis B=base0*base1*base2 and put into out...
LibUtilities::BasisKey EvaluateTriFaceBasisKey(const int facedir, const LibUtilities::BasisType faceDirBasisType, const int numpoints, const int nummodes)
virtual int v_GetTotalFaceIntNcoeffs() const
Principle Modified Functions .
void LocCoordToLocCollapsed(const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta)
Convert local cartesian coordinate xi into local collapsed coordinates eta.
virtual void v_GetInteriorMap(Array< OneD, unsigned int > &outarray)
virtual void v_BwdTrans_SumFacKernel(const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2)
boost::shared_ptr< DNekMat > DNekMatSharedPtr
virtual void v_PhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2)
Calculate the derivative of the physical points.
virtual void v_LocCoordToLocCollapsed(const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta)
DNekMatSharedPtr GetStdMatrix(const StdMatrixKey &mkey)
Gauss Radau pinned at x=-1, .
virtual int v_NumBndryCoeffs() const
Principle Orthogonal Functions .
bool ConstFactorExists(const ConstFactorType &factor) const
virtual void v_GetFaceToElementMap(const int fid, const Orientation faceOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, int P=-1, int Q=-1)
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
int NumBndryCoeffs(void) const
LibUtilities::BasisType GetEdgeBasisType(const int i) const
This function returns the type of expansion basis on the i-th edge.
void PhysTensorDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray_d1, Array< OneD, NekDouble > &outarray_d2, Array< OneD, NekDouble > &outarray_d3)
Calculate the 3D derivative in the local tensor/collapsed coordinate at the physical points...
virtual DNekMatSharedPtr v_GenMatrix(const StdMatrixKey &mkey)
The base class for all shapes.
void IProductWRTBase_SumFacKernel(const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2)
static const NekDouble kNekZeroTol
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
int getNumberOfCoefficients(int Na)
virtual int v_GetFaceNumPoints(const int i) const
LibUtilities::BasisKey EvaluateQuadFaceBasisKey(const int facedir, const LibUtilities::BasisType faceDirBasisType, const int numpoints, const int nummodes)
Principle Modified Functions .
virtual void v_IProductWRTBase_SumFacKernel(const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2)
Class representing a prismatic element in reference space.
Principle Orthogonal Functions .
virtual int v_GetNverts() const
DNekMatSharedPtr CreateGeneralMatrix(const StdMatrixKey &mkey)
this function generates the mass matrix
Principle Orthogonal Functions .
virtual void v_GetFaceInteriorMap(const int fid, const Orientation faceOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray)
Defines a specification for a set of points.
virtual int v_NumDGBndryCoeffs() const
T Ddot(int n, const Array< OneD, const T > &w, const int incw, const Array< OneD, const T > &x, const int incx, const Array< OneD, const int > &y, const int incy)
virtual void v_GetBoundaryMap(Array< OneD, unsigned int > &outarray)
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
virtual void v_BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
int GetFaceNcoeffs(const int i) const
This function returns the number of expansion coefficients belonging to the i-th face.
int getNumberOfBndCoefficients(int Na, int Nb, int Nc)
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
virtual void v_IProductWRTBase_MatOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_MultiplyByStdQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_IProductWRTDerivBase_MatOp(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function performs the Backward transformation from coefficient space to physical space...
virtual int v_GetNfaces() const
virtual const LibUtilities::BasisKey v_DetFaceBasisKey(const int i, const int k) const
virtual int v_GetEdgeNcoeffs(const int i) const
static const BasisKey NullBasisKey(eNoBasisType, 0, NullPointsKey)
Defines a null basis with no type or points.
int GetNcoeffs(void) const
This function returns the total number of coefficients used in the expansion.
virtual DNekMatSharedPtr v_CreateStdMatrix(const StdMatrixKey &mkey)
int GetMode(int I, int J, int K)
Compute the local mode number in the expansion for a particular tensorial combination.
virtual LibUtilities::ShapeType v_DetShapeType() const
Return Shape of region, using ShapeType enum list; i.e. prism.
int GetNumModes() const
Returns the order of the basis.
virtual LibUtilities::BasisType v_GetEdgeBasisType(const int i) const
LibUtilities::PointsType GetPointsType(const int dir) const
This function returns the type of quadrature points used in the dir direction.
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
virtual void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
Array< OneD, LibUtilities::BasisSharedPtr > m_base
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Describes the specification for a Basis.
virtual int v_GetVertexMap(int localVertexId, bool useCoeffPacking=false)
virtual int v_CalcNumberOfCoefficients(const std::vector< unsigned int > &nummodes, int &modes_offset)
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
virtual int v_GetFaceNcoeffs(const int i) const
virtual bool v_IsBoundaryInteriorExpansion()
void FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function performs the Forward transformation from physical space to coefficient space...