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;
737 int nummodes [3] = {
m_base[0]->GetNumModes(),
739 m_base[2]->GetNumModes()};
745 numModes0 = nummodes[0];
746 numModes1 = nummodes[1];
753 numModes0 = nummodes[1];
754 numModes1 = nummodes[2];
761 numModes0 = nummodes[0];
762 numModes1 = nummodes[2];
767 if ( faceOrient >= 9 )
769 std::swap(numModes0, numModes1);
805 "BasisType is not a boundary interior form");
808 "BasisType is not a boundary interior form");
811 "BasisType is not a boundary interior form");
813 int P =
m_base[0]->GetNumModes();
814 int Q =
m_base[1]->GetNumModes();
815 int R =
m_base[2]->GetNumModes();
825 "BasisType is not a boundary interior form");
828 "BasisType is not a boundary interior form");
831 "BasisType is not a boundary interior form");
833 int P =
m_base[0]->GetNumModes()-1;
834 int Q =
m_base[1]->GetNumModes()-1;
835 int R =
m_base[2]->GetNumModes()-1;
839 + 2*(R+1) + P*(1 + 2*R -
P);
844 ASSERTL2(i >= 0 && i <= 8,
"edge id is out of range");
846 if (i == 0 || i == 2)
850 else if (i == 1 || i == 3 || i == 8)
871 ASSERTL2(i >= 0 && i <= 4,
"face id is out of range");
876 else if (i == 1 || i == 3)
879 return Q+1 + (P*(1 + 2*Q -
P))/2;
889 ASSERTL2(i >= 0 && i <= 4,
"face id is out of range");
899 else if (i == 1 || i == 3)
901 return Pi * (2*Ri - Pi - 1) / 2;
916 Pi * (2*Ri - Pi - 1) +
922 ASSERTL2(i >= 0 && i <= 4,
"face id is out of range");
926 return m_base[0]->GetNumPoints()*
927 m_base[1]->GetNumPoints();
929 else if (i == 1 || i == 3)
931 return m_base[0]->GetNumPoints()*
932 m_base[2]->GetNumPoints();
936 return m_base[1]->GetNumPoints()*
937 m_base[2]->GetNumPoints();
942 const int i,
const int j)
const
944 ASSERTL2(i >= 0 && i <= 4,
"face id is out of range");
945 ASSERTL2(j == 0 || j == 1,
"face direction is out of range");
949 return m_base[j]->GetPointsKey();
951 else if (i == 1 || i == 3)
953 return m_base[2*j]->GetPointsKey();
957 return m_base[j+1]->GetPointsKey();
962 const int i,
const int k)
const
964 ASSERTL2(i >= 0 && i <= 4,
"face id is out of range");
965 ASSERTL2(k >= 0 && k <= 1,
"basis key id is out of range");
974 m_base[k]->GetNumModes());
982 m_base[k+1]->GetNumModes());
990 m_base[2*k]->GetNumModes());
1004 nummodes[modes_offset],
1005 nummodes[modes_offset+1],
1006 nummodes[modes_offset+2]);
1014 ASSERTL2(i >= 0 && i <= 8,
"edge id is out of range");
1015 if (i == 0 || i == 2)
1019 else if (i == 1 || i == 3 || i == 8)
1050 "Method only implemented if BasisType is identical"
1051 "in x and y directions");
1054 "Method only implemented for Modified_A BasisType"
1055 "(x and y direction) and Modified_B BasisType (z "
1058 int i, j, k,
p, q, r, nFaceCoeffs, idx = 0;
1059 int nummodesA=0, nummodesB=0;
1064 nummodesA =
m_base[0]->GetNumModes();
1065 nummodesB =
m_base[1]->GetNumModes();
1069 nummodesA =
m_base[0]->GetNumModes();
1070 nummodesB =
m_base[2]->GetNumModes();
1074 nummodesA =
m_base[1]->GetNumModes();
1075 nummodesB =
m_base[2]->GetNumModes();
1079 bool CheckForZeroedModes =
false;
1087 else if (fid == 1 || fid == 3)
1089 nFaceCoeffs = P*(2*Q-P+1)/2;
1090 CheckForZeroedModes =
true;
1095 CheckForZeroedModes =
true;
1099 if (maparray.num_elements() != nFaceCoeffs)
1104 if (signarray.num_elements() != nFaceCoeffs)
1110 fill(signarray.get(), signarray.get() + nFaceCoeffs, 1);
1117 if (fid != 1 && fid != 3)
1119 for (i = 0; i < Q; i++)
1121 for (j = 0; j <
P; j++)
1125 arrayindx[i*P+j] = i*P+j;
1129 arrayindx[i*P+j] = j*Q+i;
1140 for (q = 0; q < Q; ++q)
1142 for (p = 0; p <
P; ++
p)
1144 maparray[arrayindx[q*P+
p]] =
GetMode(p,q,0);
1150 for (p = 0; p <
P; ++
p)
1152 for (r = 0; r < Q-
p; ++r)
1154 if ((
int)faceOrient == 7 && p > 1)
1156 signarray[idx] = p % 2 ? -1 : 1;
1158 maparray[idx++] =
GetMode(p,0,r);
1164 for (q = 0; q <
P; ++q)
1166 maparray[arrayindx[q]] =
GetMode(1,q,0);
1168 for (q = 0; q <
P; ++q)
1170 maparray[arrayindx[P+q]] =
GetMode(0,q,1);
1172 for (r = 1; r < Q-1; ++r)
1174 for (q = 0; q <
P; ++q)
1176 maparray[arrayindx[(r+1)*P+q]] =
GetMode(1,q,r);
1182 for (p = 0; p <
P; ++
p)
1184 for (r = 0; r < Q-
p; ++r)
1186 if ((
int)faceOrient == 7 && p > 1)
1188 signarray[idx] = p % 2 ? -1 : 1;
1190 maparray[idx++] =
GetMode(p, 1, r);
1196 for (r = 0; r < Q; ++r)
1198 for (q = 0; q <
P; ++q)
1200 maparray[arrayindx[r*P+q]] =
GetMode(0, q, r);
1206 ASSERTL0(
false,
"Face to element map unavailable.");
1209 if (fid == 1 || fid == 3)
1211 if(CheckForZeroedModes)
1216 for (j = 0; j < nummodesA; ++j)
1219 for (k = nummodesB-j; k < Q-j; ++k)
1221 signarray[idx] = 0.0;
1222 maparray[idx++] = maparray[0];
1226 for (j = nummodesA; j <
P; ++j)
1228 for (k = 0; k < Q-j; ++k)
1230 signarray[idx] = 0.0;
1231 maparray[idx++] = maparray[0];
1239 if ((
int)faceOrient == 7)
1241 swap(maparray[0], maparray[P]);
1242 for (i = 1; i < P-1; ++i)
1244 swap(maparray[i+1], maparray[P+i]);
1251 if(CheckForZeroedModes)
1255 for (j = 0; j < nummodesA; ++j)
1257 for (k = nummodesB; k < Q; ++k)
1259 signarray[arrayindx[j+k*
P]] = 0.0;
1260 maparray[arrayindx[j+k*
P]] = maparray[0];
1264 for (j = nummodesA; j <
P; ++j)
1266 for (k = 0; k < Q; ++k)
1268 signarray[arrayindx[j+k*
P]] = 0.0;
1269 maparray[arrayindx[j+k*
P]] = maparray[0];
1278 if (faceOrient == 6 || faceOrient == 8 ||
1279 faceOrient == 11 || faceOrient == 12)
1283 for (i = 3; i < Q; i += 2)
1285 for (j = 0; j <
P; j++)
1287 signarray[arrayindx[i*P+j]] *= -1;
1291 for (i = 0; i <
P; i++)
1293 swap(maparray [i], maparray [i+P]);
1294 swap(signarray[i], signarray[i+P]);
1299 for (i = 0; i < Q; i++)
1301 for (j = 3; j <
P; j += 2)
1303 signarray[arrayindx[i*P+j]] *= -1;
1307 for (i = 0; i < Q; i++)
1309 swap (maparray [i], maparray [i+Q]);
1310 swap (signarray[i], signarray[i+Q]);
1315 if (faceOrient == 7 || faceOrient == 8 ||
1316 faceOrient == 10 || faceOrient == 12)
1320 for (i = 0; i < Q; i++)
1322 for (j = 3; j <
P; j += 2)
1324 signarray[arrayindx[i*P+j]] *= -1;
1328 for(i = 0; i < Q; i++)
1330 swap(maparray [i*P], maparray [i*P+1]);
1331 swap(signarray[i*P], signarray[i*P+1]);
1336 for (i = 3; i < Q; i += 2)
1338 for (j = 0; j <
P; j++)
1340 signarray[arrayindx[i*P+j]] *= -1;
1344 for (i = 0; i <
P; i++)
1346 swap(maparray [i*Q], maparray [i*Q+1]);
1347 swap(signarray[i*Q], signarray[i*Q+1]);
1359 "Mapping not defined for this type of basis");
1363 if(useCoeffPacking ==
true)
1386 ASSERTL0(
false,
"local vertex id must be between 0 and 5");
1412 ASSERTL0(
false,
"local vertex id must be between 0 and 5");
1427 const int P =
m_base[0]->GetNumModes() - 1;
1428 const int Q =
m_base[1]->GetNumModes() - 1;
1429 const int R =
m_base[2]->GetNumModes() - 1;
1432 if (maparray.num_elements() != nEdgeIntCoeffs)
1437 if(signarray.num_elements() != nEdgeIntCoeffs)
1443 fill(signarray.get(), signarray.get()+nEdgeIntCoeffs, 1);
1453 for (i = 2; i <=
P; ++i)
1455 maparray[i-2] =
GetMode(i,0,0);
1460 for (i = 2; i <= Q; ++i)
1462 maparray[i-2] =
GetMode(1,i,0);
1469 for (i = 2; i <=
P; ++i)
1471 maparray[i-2] =
GetMode(i,1,0);
1478 for (i = 2; i <= Q; ++i)
1480 maparray[i-2] =
GetMode(0,i,0);
1485 for (i = 2; i <= R; ++i)
1487 maparray[i-2] =
GetMode(0,0,i);
1492 for (i = 1; i <= R-1; ++i)
1494 maparray[i-1] =
GetMode(1,0,i);
1499 for (i = 1; i <= R-1; ++i)
1501 maparray[i-1] =
GetMode(1,1,i);
1506 for (i = 2; i <= R; ++i)
1508 maparray[i-2] =
GetMode(0,1,i);
1513 for (i = 2; i <= Q; ++i)
1515 maparray[i-2] =
GetMode(0,i,1);
1520 ASSERTL0(
false,
"Edge not defined.");
1526 for (i = 1; i < nEdgeIntCoeffs; i += 2)
1539 const int P =
m_base[0]->GetNumModes() - 1;
1540 const int Q =
m_base[1]->GetNumModes() - 1;
1541 const int R =
m_base[2]->GetNumModes() - 1;
1543 int p, q, r, idx = 0;
1549 if (maparray.num_elements() != nFaceIntCoeffs)
1554 if (signarray.num_elements() != nFaceIntCoeffs)
1560 fill(signarray.get(), signarray.get()+nFaceIntCoeffs, 1);
1566 if (fid != 1 && fid != 3)
1579 for (i = 0; i < nummodesB; i++)
1581 for (j = 0; j < nummodesA; j++)
1585 arrayindx[i*nummodesA+j] = i*nummodesA+j;
1589 arrayindx[i*nummodesA+j] = j*nummodesB+i;
1598 for (q = 2; q <= Q; ++q)
1600 for (p = 2; p <=
P; ++
p)
1602 maparray[arrayindx[(q-2)*nummodesA+(p-2)]] =
GetMode(p,q,0);
1608 for (p = 2; p <=
P; ++
p)
1610 for (r = 1; r <= R-
p; ++r)
1612 if ((
int)faceOrient == 7)
1614 signarray[idx] = p % 2 ? -1 : 1;
1616 maparray[idx++] =
GetMode(p,0,r);
1622 for (r = 1; r <= R-1; ++r)
1624 for (q = 2; q <= Q; ++q)
1626 maparray[arrayindx[(r-1)*nummodesA+(q-2)]] =
GetMode(1, q, r);
1632 for (p = 2; p <=
P; ++
p)
1634 for (r = 1; r <= R-
p; ++r)
1636 if ((
int)faceOrient == 7)
1638 signarray[idx] = p % 2 ? -1 : 1;
1640 maparray[idx++] =
GetMode(p, 1, r);
1646 for (r = 2; r <= R; ++r)
1648 for (q = 2; q <= Q; ++q)
1650 maparray[arrayindx[(r-2)*nummodesA+(q-2)]] =
GetMode(0, q, r);
1656 ASSERTL0(
false,
"Face interior map not available.");
1661 if (fid == 1 || fid == 3)
1664 if (faceOrient == 6 || faceOrient == 8 ||
1665 faceOrient == 11 || faceOrient == 12)
1669 for (i = 1; i < nummodesB; i += 2)
1671 for (j = 0; j < nummodesA; j++)
1673 signarray[arrayindx[i*nummodesA+j]] *= -1;
1679 for (i = 0; i < nummodesB; i++)
1681 for (j = 1; j < nummodesA; j += 2)
1683 signarray[arrayindx[i*nummodesA+j]] *= -1;
1689 if (faceOrient == 7 || faceOrient == 8 ||
1690 faceOrient == 10 || faceOrient == 12)
1694 for (i = 0; i < nummodesB; i++)
1696 for (j = 1; j < nummodesA; j += 2)
1698 signarray[arrayindx[i*nummodesA+j]] *= -1;
1704 for (i = 1; i < nummodesB; i += 2)
1706 for (j = 0; j < nummodesA; j++)
1708 signarray[arrayindx[i*nummodesA+j]] *= -1;
1719 "BasisType is not a boundary interior form");
1722 "BasisType is not a boundary interior form");
1725 "BasisType is not a boundary interior form");
1727 int P =
m_base[0]->GetNumModes() - 1,
p;
1728 int Q =
m_base[1]->GetNumModes() - 1, q;
1729 int R =
m_base[2]->GetNumModes() - 1, r;
1733 if(outarray.num_elements()!=nIntCoeffs)
1741 for (
p = 2;
p <=
P; ++
p)
1743 for (q = 2; q <= Q; ++q)
1745 for (r = 1; r <= R-
p; ++r)
1747 outarray[idx++] =
GetMode(p,q,r);
1757 "BasisType is not a boundary interior form");
1760 "BasisType is not a boundary interior form");
1763 "BasisType is not a boundary interior form");
1765 int P =
m_base[0]->GetNumModes() - 1,
p;
1766 int Q =
m_base[1]->GetNumModes() - 1, q;
1767 int R =
m_base[2]->GetNumModes() - 1, r;
1772 if (maparray.num_elements() != nBnd)
1778 for (
p = 0;
p <=
P; ++
p)
1783 for (q = 0; q <= Q; ++q)
1785 for (r = 0; r <= R-
p; ++r)
1787 maparray[idx++] =
GetMode(p,q,r);
1795 for (q = 0; q <= Q; ++q)
1799 for (r = 0; r <= R-
p; ++r)
1801 maparray[idx++] =
GetMode(p,q,r);
1830 int nq0 =
m_base[0]->GetNumPoints();
1831 int nq1 =
m_base[1]->GetNumPoints();
1832 int nq2 =
m_base[2]->GetNumPoints();
1842 nq = max(nq0,max(nq1,nq2));
1855 for(
int i = 0; i < nq; ++i)
1857 for(
int j = 0; j < nq; ++j)
1859 for(
int k = 0; k < nq-i; ++k,++cnt)
1862 coords[cnt][0] = -1.0 + 2*k/(
NekDouble)(nq-1);
1863 coords[cnt][1] = -1.0 + 2*j/(
NekDouble)(nq-1);
1864 coords[cnt][2] = -1.0 + 2*i/(
NekDouble)(nq-1);
1869 for(
int i = 0; i < neq; ++i)
1873 I[0] =
m_base[0]->GetI(coll );
1874 I[1] =
m_base[1]->GetI(coll+1);
1875 I[2] =
m_base[2]->GetI(coll+2);
1879 for(
int k = 0; k < nq2; ++k)
1881 for (
int j = 0; j < nq1; ++j)
1884 fac = (I[1]->GetPtr())[j]*(I[2]->GetPtr())[k];
1889 k * nq0 * nq1 * neq +
1934 int Q =
m_base[1]->GetNumModes() - 1;
1935 int R =
m_base[2]->GetNumModes() - 1;
1939 (Q+1)*(p*R + 1-(p-2)*(p-1)/2);
1947 int nquad0 =
m_base[0]->GetNumPoints();
1948 int nquad1 =
m_base[1]->GetNumPoints();
1949 int nquad2 =
m_base[2]->GetNumPoints();
1958 for(i = 0; i < nquad1*nquad2; ++i)
1961 w0.get(), 1, outarray.get()+i*nquad0,1);
1965 for(j = 0; j < nquad2; ++j)
1967 for(i = 0; i < nquad1; ++i)
1969 Blas::Dscal(nquad0,w1[i], &outarray[0]+i*nquad0 +
1981 for(i = 0; i < nquad2; ++i)
1983 Blas::Dscal(nquad0*nquad1, 0.5*w2[i],
1984 &outarray[0]+i*nquad0*nquad1, 1);
1989 for(i = 0; i < nquad2; ++i)
1991 Blas::Dscal(nquad0*nquad1,0.25*(1-z2[i])*w2[i],
1992 &outarray[0]+i*nquad0*nquad1,1);
2003 int qa =
m_base[0]->GetNumPoints();
2004 int qb =
m_base[1]->GetNumPoints();
2005 int qc =
m_base[2]->GetNumPoints();
2006 int nmodes_a =
m_base[0]->GetNumModes();
2007 int nmodes_b =
m_base[1]->GetNumModes();
2008 int nmodes_c =
m_base[2]->GetNumModes();
2029 int cutoff_a = (int) (SVVCutOff*nmodes_a);
2030 int cutoff_b = (int) (SVVCutOff*nmodes_b);
2031 int cutoff_c = (int) (SVVCutOff*nmodes_c);
2036 OrthoExp.
FwdTrans(array,orthocoeffs);
2037 int nmodes = min(min(nmodes_a,nmodes_b),nmodes_c);
2038 NekDouble cutoff = min(min(cutoff_a,cutoff_b),cutoff_c);
2041 for(i = 0; i < nmodes_a; ++i)
2043 for(j = 0; j < nmodes_b; ++j)
2045 for(k = 0; k < nmodes_c-i; ++k)
2047 if(j >= cutoff || i + k >= cutoff)
2049 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)))));
2053 orthocoeffs[cnt] *= 0.0;
2061 OrthoExp.
BwdTrans(orthocoeffs,array);
2071 int nquad0 =
m_base[0]->GetNumPoints();
2072 int nquad1 =
m_base[1]->GetNumPoints();
2073 int nquad2 =
m_base[2]->GetNumPoints();
2074 int nqtot = nquad0*nquad1*nquad2;
2075 int nmodes0 =
m_base[0]->GetNumModes();
2076 int nmodes1 =
m_base[1]->GetNumModes();
2077 int nmodes2 =
m_base[2]->GetNumModes();
2078 int numMax = nmodes0;
2106 OrthoPrismExp->FwdTrans(phys_tmp, coeff);
2109 for (u = 0; u < numMin; ++u)
2111 for (i = 0; i < numMin; ++i)
2114 tmp2 = coeff_tmp1 + cnt, 1);
2118 for (i = numMin; i < numMax; ++i)
2124 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 .
virtual void v_GetFaceNumModes(const int fid, const Orientation faceOrient, int &numModes0, int &numModes1)
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...