47 StdTetExp::StdTetExp()
67 "order in 'a' direction is higher than order "
70 "order in 'a' direction is higher than order "
73 "order in 'b' direction is higher than order "
114 int Q0 =
m_base[0]->GetNumPoints();
115 int Q1 =
m_base[1]->GetNumPoints();
116 int Q2 =
m_base[2]->GetNumPoints();
124 bool Do_2 = (out_dxi2.num_elements() > 0)?
true:
false;
125 bool Do_1 = (out_dxi1.num_elements() > 0)?
true:
false;
142 eta_0 =
m_base[0]->GetZ();
143 eta_1 =
m_base[1]->GetZ();
144 eta_2 =
m_base[2]->GetZ();
150 for(
int k=0; k< Q2; ++k)
152 for(
int j=0; j<Q1; ++j,dEta0+=Q0)
154 Vmath::Smul(Q0,2.0/(1.0-eta_1[j]),dEta0,1,dEta0,1);
156 fac = 1.0/(1.0-eta_2[k]);
157 Vmath::Smul(Q0*Q1,fac,&out_dEta0[0]+k*Q0*Q1,1,&out_dEta0[0]+k*Q0*Q1,1);
160 if (out_dxi0.num_elements() > 0)
173 for(
int k = 0; k < Q1*Q2; ++k)
175 Vmath::Vmul(Q0,&Fac0[0],1,&out_dEta0[0]+k*Q0,1,&out_dEta0[0]+k*Q0,1);
178 for(
int k = 0; k < Q2; ++k)
180 Vmath::Smul(Q0*Q1,2.0/(1.0-eta_2[k]),&out_dEta1[0]+k*Q0*Q1,1,
181 &out_dEta1[0]+k*Q0*Q1,1);
188 Vmath::Vadd(Qtot,out_dEta0,1,out_dEta1,1,out_dxi1,1);
196 for(
int k=0; k< Q2; ++k)
198 for(
int j=0; j<Q1; ++j,dEta1+=Q0)
200 Vmath::Smul(Q0,(1.0+eta_1[j])/2.0,dEta1,1,dEta1,1);
207 Vmath::Vadd(Qtot,out_dEta0,1,out_dEta1,1,out_dxi2,1);
208 Vmath::Vadd(Qtot,out_dEta2,1,out_dxi2 ,1,out_dxi2,1);
247 ASSERTL1(
false,
"input dir is out of range");
301 "Basis[1] is not a general tensor type");
305 "Basis[2] is not a general tensor type");
308 &&
m_base[2]->Collocation())
313 inarray, 1, outarray, 1);
329 int nquad1 =
m_base[1]->GetNumPoints();
330 int nquad2 =
m_base[2]->GetNumPoints();
331 int order0 =
m_base[0]->GetNumModes();
332 int order1 =
m_base[1]->GetNumModes();
335 nquad2*nquad1*order0);
340 inarray,outarray,wsp,
365 bool doCheckCollDir0,
366 bool doCheckCollDir1,
367 bool doCheckCollDir2)
369 int nquad0 =
m_base[0]->GetNumPoints();
370 int nquad1 =
m_base[1]->GetNumPoints();
371 int nquad2 =
m_base[2]->GetNumPoints();
373 int order0 =
m_base[0]->GetNumModes();
374 int order1 =
m_base[1]->GetNumModes();
375 int order2 =
m_base[2]->GetNumModes();
380 int i, j, mode, mode1, cnt;
383 mode = mode1 = cnt = 0;
384 for(i = 0; i < order0; ++i)
386 for(j = 0; j < order1-i; ++j, ++cnt)
388 Blas::Dgemv(
'N', nquad2, order2-i-j,
389 1.0, base2.get()+mode*nquad2, nquad2,
390 inarray.get()+mode1, 1,
391 0.0, tmp.get()+cnt*nquad2, 1);
396 for(j = order1-i; j < order2-i; ++j)
408 Blas::Daxpy(nquad2,inarray[1],base2.get()+nquad2,1,
412 Blas::Daxpy(nquad2,inarray[1],base2.get()+nquad2,1,
413 &tmp[0]+order1*nquad2,1);
418 for(i = 0; i < order0; ++i)
420 Blas::Dgemm(
'N',
'T', nquad1, nquad2, order1-i,
421 1.0, base1.get()+mode*nquad1, nquad1,
422 tmp.get()+mode*nquad2, nquad2,
423 0.0, tmp1.get()+i*nquad1*nquad2, nquad1);
434 for(i = 0; i < nquad2; ++i)
436 Blas::Daxpy(nquad1,tmp[nquad2+i], base1.get()+nquad1,1,
437 &tmp1[nquad1*nquad2]+i*nquad1,1);
442 Blas::Dgemm(
'N',
'T', nquad0, nquad1*nquad2, order0,
443 1.0, base0.get(), nquad0,
444 tmp1.get(), nquad1*nquad2,
445 0.0, outarray.get(), nquad0);
511 "Basis[1] is not a general tensor type");
515 "Basis[2] is not a general tensor type");
517 if(
m_base[0]->Collocation() &&
m_base[1]->Collocation())
536 Blas::Dgemv(
'N',
m_ncoeffs,nq,1.0,iprodmat->GetPtr().get(),
537 m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
550 bool multiplybyweights)
552 int nquad0 =
m_base[0]->GetNumPoints();
553 int nquad1 =
m_base[1]->GetNumPoints();
554 int nquad2 =
m_base[2]->GetNumPoints();
555 int order0 =
m_base[0]->GetNumModes();
556 int order1 =
m_base[1]->GetNumModes();
559 nquad2*order0*(2*order1-order0+1)/2);
561 if(multiplybyweights)
570 tmp, outarray, wsp,
true,
true,
true);
578 inarray, outarray, wsp,
true,
true,
true);
590 bool doCheckCollDir0,
591 bool doCheckCollDir1,
592 bool doCheckCollDir2)
594 int nquad0 =
m_base[0]->GetNumPoints();
595 int nquad1 =
m_base[1]->GetNumPoints();
596 int nquad2 =
m_base[2]->GetNumPoints();
598 int order0 =
m_base[0]->GetNumModes();
599 int order1 =
m_base[1]->GetNumModes();
600 int order2 =
m_base[2]->GetNumModes();
605 int i,j, mode,mode1, cnt;
608 Blas::Dgemm(
'T',
'N', nquad1*nquad2, order0, nquad0,
609 1.0, inarray.get(), nquad0,
611 0.0, tmp1.get(), nquad1*nquad2);
614 for(mode=i=0; i < order0; ++i)
616 Blas::Dgemm(
'T',
'N', nquad2, order1-i, nquad1,
617 1.0, tmp1.get()+i*nquad1*nquad2, nquad1,
618 base1.get()+mode*nquad1, nquad1,
619 0.0, tmp2.get()+mode*nquad2, nquad2);
628 Blas::Dgemv(
'T', nquad1, nquad2,
629 1.0, tmp1.get()+nquad1*nquad2, nquad1,
630 base1.get()+nquad1, 1,
631 1.0, tmp2.get()+nquad2, 1);
635 mode = mode1 = cnt = 0;
636 for(i = 0; i < order0; ++i)
638 for(j = 0; j < order1-i; ++j, ++cnt)
640 Blas::Dgemv(
'T', nquad2, order2-i-j,
641 1.0, base2.get()+mode*nquad2, nquad2,
642 tmp2.get()+cnt*nquad2, 1,
643 0.0, outarray.get()+mode1, 1);
648 for(j = order1-i; j < order2-i; ++j)
659 outarray[1] +=
Blas::Ddot(nquad2,base2.get()+nquad2,1,
663 outarray[1] +=
Blas::Ddot(nquad2,base2.get()+nquad2,1,
664 &tmp2[nquad2*order1],1);
683 ASSERTL0((dir==0)||(dir==1)||(dir==2),
"input dir is out of range");
704 Blas::Dgemv(
'N',
m_ncoeffs,nq,1.0,iprodmat->GetPtr().get(),
705 m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
721 int nquad0 =
m_base[0]->GetNumPoints();
722 int nquad1 =
m_base[1]->GetNumPoints();
723 int nquad2 =
m_base[2]->GetNumPoints();
724 int nqtot = nquad0*nquad1*nquad2;
725 int nmodes0 =
m_base[0]->GetNumModes();
726 int nmodes1 =
m_base[1]->GetNumModes();
727 int wspsize = nquad0 + nquad1 + nquad2 + max(nqtot,
m_ncoeffs)
728 + nquad1*nquad2*nmodes0 + nquad2*nmodes0*(2*nmodes1-nmodes0+1)/2;
741 for(i = 0; i < nquad0; ++i)
743 gfac0[i] = 0.5*(1+z0[i]);
747 for(i = 0; i < nquad1; ++i)
749 gfac1[i] = 2.0/(1-z1[i]);
753 for(i = 0; i < nquad2; ++i)
755 gfac2[i] = 2.0/(1-z2[i]);
759 for(i = 0; i < nquad1*nquad2; ++i)
761 Vmath::Smul(nquad0,gfac1[i%nquad1],&inarray[0]+i*nquad0,1,&tmp0[0]+i*nquad0,1);
763 for(i = 0; i < nquad2; ++i)
765 Vmath::Smul(nquad0*nquad1,gfac2[i],&tmp0[0]+i*nquad0*nquad1,1,&tmp0[0]+i*nquad0*nquad1,1);
785 for(i = 0; i < nquad1*nquad2; ++i)
787 Vmath::Vmul(nquad0,&gfac0[0],1,&tmp0[0]+i*nquad0,1,&tmp0[0]+i*nquad0,1);
796 for(i = 0; i < nquad2; ++i)
798 Vmath::Smul(nquad0*nquad1,gfac2[i],&inarray[0]+i*nquad0*nquad1,1,&tmp0[0]+i*nquad0*nquad1,1);
813 for(i = 0; i < nquad1; ++i)
815 gfac1[i] = (1+z1[i])/2;
818 for(i = 0; i < nquad1*nquad2; ++i)
820 Vmath::Vmul(nquad0,&gfac0[0],1,&tmp0[0]+i*nquad0,1,&tmp0[0]+i*nquad0,1);
828 for(i = 0; i < nquad2; ++i)
830 Vmath::Smul(nquad0*nquad1,gfac2[i],&inarray[0]+i*nquad0*nquad1,1,&tmp0[0]+i*nquad0*nquad1,1);
832 for(i = 0; i < nquad1*nquad2; ++i)
834 Vmath::Smul(nquad0,gfac1[i%nquad1],&tmp0[0]+i*nquad0,1,&tmp0[0]+i*nquad0,1);
856 ASSERTL1(
false,
"input dir is out of range");
893 eta[0] = 2.0*(1.0+xi[0])/(-xi[1]-xi[2]) - 1.0;
895 eta[1] = 2.0*(1.0+xi[1])/(1.0-xi[2]) - 1.0;
915 int nummodes [3] = {
m_base[0]->GetNumModes(),
917 m_base[2]->GetNumModes()};
922 numModes0 = nummodes[0];
923 numModes1 = nummodes[1];
928 numModes0 = nummodes[0];
929 numModes1 = nummodes[2];
935 numModes0 = nummodes[1];
936 numModes1 = nummodes[2];
970 "BasisType is not a boundary interior form");
973 "BasisType is not a boundary interior form");
976 "BasisType is not a boundary interior form");
978 int P =
m_base[0]->GetNumModes();
979 int Q =
m_base[1]->GetNumModes();
980 int R =
m_base[2]->GetNumModes();
990 "BasisType is not a boundary interior form");
993 "BasisType is not a boundary interior form");
996 "BasisType is not a boundary interior form");
998 int P =
m_base[0]->GetNumModes()-1;
999 int Q =
m_base[1]->GetNumModes()-1;
1000 int R =
m_base[2]->GetNumModes()-1;
1003 return (Q+1) + P*(1 + 2*Q -
P)/2
1004 + (R+1) + P*(1 + 2*R -
P)/2
1005 + 2*(R+1) + Q*(1 + 2*R - Q);
1010 ASSERTL2((i >= 0) && (i <= 5),
"edge id is out of range");
1011 int P =
m_base[0]->GetNumModes();
1012 int Q =
m_base[1]->GetNumModes();
1013 int R =
m_base[2]->GetNumModes();
1019 else if (i == 1 || i == 2)
1031 int P =
m_base[0]->GetNumModes()-2;
1032 int Q =
m_base[1]->GetNumModes()-2;
1033 int R =
m_base[2]->GetNumModes()-2;
1040 ASSERTL2((i >= 0) && (i <= 3),
"face id is out of range");
1041 int nFaceCoeffs = 0;
1042 int nummodesA, nummodesB,
P, Q;
1048 else if ((i == 1) || (i == 2))
1060 nFaceCoeffs = Q+1 + (P*(1 + 2*Q -
P))/2;
1066 ASSERTL2((i >= 0) && (i <= 3),
"face id is out of range");
1067 int Pi =
m_base[0]->GetNumModes() - 2;
1068 int Qi =
m_base[1]->GetNumModes() - 2;
1069 int Ri =
m_base[2]->GetNumModes() - 2;
1073 return Pi * (2*Qi - Pi - 1) / 2;
1077 return Pi * (2*Ri - Pi - 1) / 2;
1081 return Qi * (2*Ri - Qi - 1) / 2;
1087 int Pi =
m_base[0]->GetNumModes() - 2;
1088 int Qi =
m_base[1]->GetNumModes() - 2;
1089 int Ri =
m_base[2]->GetNumModes() - 2;
1091 return Pi * (2*Qi - Pi - 1) / 2 +
1092 Pi * (2*Ri - Pi - 1) / 2 +
1093 Qi * (2*Ri - Qi - 1);
1098 ASSERTL2(i >= 0 && i <= 3,
"face id is out of range");
1102 return m_base[0]->GetNumPoints()*
1103 m_base[1]->GetNumPoints();
1107 return m_base[0]->GetNumPoints()*
1108 m_base[2]->GetNumPoints();
1112 return m_base[1]->GetNumPoints()*
1113 m_base[2]->GetNumPoints();
1118 const int i,
const int j)
const
1120 ASSERTL2(i >= 0 && i <= 3,
"face id is out of range");
1121 ASSERTL2(j == 0 || j == 1,
"face direction is out of range");
1125 return m_base[j]->GetPointsKey();
1129 return m_base[2*j]->GetPointsKey();
1133 return m_base[j+1]->GetPointsKey();
1138 const std::vector<unsigned int>& nummodes,
1142 nummodes[modes_offset],
1143 nummodes[modes_offset+1],
1144 nummodes[modes_offset+2]);
1151 const int i,
const int k)
const
1153 ASSERTL2(i >= 0 && i <= 4,
"face id is out of range");
1154 ASSERTL2(k == 0 || k == 1,
"face direction out of range");
1174 m_base[dir]->GetNumModes());
1182 ASSERTL2(i >= 0 && i <= 5,
"edge id is out of range");
1188 else if (i == 1 || i == 2)
1212 for(
int k = 0; k < Qz; ++k ) {
1213 for(
int j = 0; j < Qy; ++j ) {
1214 for(
int i = 0; i < Qx; ++i ) {
1215 int s = i + Qx*(j + Qy*k);
1216 xi_x[s] = (eta_x[i] + 1.0) * (1.0 - eta_y[j]) * (1.0 - eta_z[k]) / 4 - 1.0;
1217 xi_y[s] = (eta_y[j] + 1.0) * (1.0 - eta_z[k]) / 2 - 1.0;
1248 int nummodesA=0,nummodesB=0, i, j, k, idx;
1251 "Method only implemented for Modified_A BasisType (x "
1252 "direction), Modified_B BasisType (y direction), and "
1253 "Modified_C BasisType(z direction)");
1255 int nFaceCoeffs = 0;
1260 nummodesA =
m_base[0]->GetNumModes();
1261 nummodesB =
m_base[1]->GetNumModes();
1264 nummodesA =
m_base[0]->GetNumModes();
1265 nummodesB =
m_base[2]->GetNumModes();
1269 nummodesA =
m_base[1]->GetNumModes();
1270 nummodesB =
m_base[2]->GetNumModes();
1274 bool CheckForZeroedModes =
false;
1282 CheckForZeroedModes =
true;
1285 nFaceCoeffs = P*(2*Q-P+1)/2;
1288 if(maparray.num_elements() != nFaceCoeffs)
1293 if(signarray.num_elements() != nFaceCoeffs)
1299 fill(signarray.get(),signarray.get()+nFaceCoeffs, 1 );
1306 for (i = 0; i <
P; ++i)
1308 for (j = 0; j < Q-i; ++j)
1310 if ((
int)faceOrient == 7 && i > 1)
1312 signarray[idx] = (i%2 ? -1 : 1);
1314 maparray[idx++] =
GetMode(i,j,0);
1320 for (i = 0; i <
P; ++i)
1322 for (k = 0; k < Q-i; ++k)
1324 if ((
int)faceOrient == 7 && i > 1)
1326 signarray[idx] = (i%2 ? -1: 1);
1328 maparray[idx++] =
GetMode(i,0,k);
1334 for (j = 0; j < P-1; ++j)
1336 for (k = 0; k < Q-1-j; ++k)
1338 if ((
int)faceOrient == 7 && j > 1)
1340 signarray[idx] = ((j+1)%2 ? -1: 1);
1342 maparray[idx++] =
GetMode(1,j,k);
1344 if (j == 0 && k == 0)
1346 maparray[idx++] =
GetMode(0,0,1);
1348 if (j == 0 && k == Q-2)
1350 for (
int r = 0; r < Q-1; ++r)
1352 maparray[idx++] =
GetMode(0,1,r);
1360 for (j = 0; j <
P; ++j)
1362 for (k = 0; k < Q-j; ++k)
1364 if ((
int)faceOrient == 7 && j > 1)
1366 signarray[idx] = (j%2 ? -1: 1);
1368 maparray[idx++] =
GetMode(0,j,k);
1373 ASSERTL0(
false,
"Element map not available.");
1376 if ((
int)faceOrient == 7)
1378 swap(maparray[0], maparray[Q]);
1380 for (i = 1; i < Q-1; ++i)
1382 swap(maparray[i+1], maparray[Q+i]);
1386 if(CheckForZeroedModes)
1391 for (j = 0; j < nummodesA; ++j)
1394 for (k = nummodesB-j; k < Q-j; ++k)
1396 signarray[idx] = 0.0;
1397 maparray[idx++] = maparray[0];
1401 for (j = nummodesA; j <
P; ++j)
1403 for (k = 0; k < Q-j; ++k)
1405 signarray[idx] = 0.0;
1406 maparray[idx++] = maparray[0];
1417 "Mapping not defined for this type of basis");
1420 if(useCoeffPacking ==
true)
1422 switch(localVertexId)
1446 ASSERTL0(
false,
"Vertex ID must be between 0 and 3");
1453 switch(localVertexId)
1477 ASSERTL0(
false,
"Vertex ID must be between 0 and 3");
1497 const int P =
m_base[0]->GetNumModes();
1498 const int Q =
m_base[1]->GetNumModes();
1499 const int R =
m_base[2]->GetNumModes();
1503 if(maparray.num_elements() != nEdgeIntCoeffs)
1509 fill( maparray.get(), maparray.get() + nEdgeIntCoeffs, 0);
1512 if(signarray.num_elements() != nEdgeIntCoeffs)
1518 fill( signarray.get() , signarray.get()+nEdgeIntCoeffs, 1 );
1524 for (i = 0; i < P-2; ++i)
1526 maparray[i] =
GetMode(i+2, 0, 0);
1530 for(i = 1; i < nEdgeIntCoeffs; i+=2)
1537 for (i = 0; i < Q-2; ++i)
1539 maparray[i] =
GetMode(1, i+1, 0);
1543 for(i = 1; i < nEdgeIntCoeffs; i+=2)
1550 for (i = 0; i < Q-2; ++i)
1552 maparray[i] =
GetMode(0, i+2, 0);
1556 for(i = 1; i < nEdgeIntCoeffs; i+=2)
1563 for (i = 0; i < R-2; ++i)
1565 maparray[i] =
GetMode(0, 0, i+2);
1569 for(i = 1; i < nEdgeIntCoeffs; i+=2)
1576 for (i = 0; i < R - 2; ++i)
1578 maparray[i] =
GetMode(1, 0, i+1);
1582 for(i = 1; i < nEdgeIntCoeffs; i+=2)
1589 for (i = 0; i < R-2; ++i)
1591 maparray[i] =
GetMode(0, 1, i+1);
1595 for(i = 1; i < nEdgeIntCoeffs; i+=2)
1602 ASSERTL0(
false,
"Edge not defined.");
1614 const int P =
m_base[0]->GetNumModes();
1615 const int Q =
m_base[1]->GetNumModes();
1616 const int R =
m_base[2]->GetNumModes();
1620 if(maparray.num_elements() != nFaceIntCoeffs)
1625 if(signarray.num_elements() != nFaceIntCoeffs)
1631 fill( signarray.get() , signarray.get()+nFaceIntCoeffs, 1 );
1638 for (i = 2; i < P-1; ++i)
1640 for (j = 1; j < Q-i; ++j)
1642 if ((
int)faceOrient == 7)
1644 signarray[idx] = (i%2 ? -1 : 1);
1646 maparray[idx++] =
GetMode(i,j,0);
1652 for (i = 2; i <
P; ++i)
1654 for (k = 1; k < R-i; ++k)
1656 if ((
int)faceOrient == 7)
1658 signarray[idx] = (i%2 ? -1: 1);
1660 maparray[idx++] =
GetMode(i,0,k);
1666 for (j = 1; j < Q-2; ++j)
1668 for (k = 1; k < R-1-j; ++k)
1670 if ((
int)faceOrient == 7)
1672 signarray[idx] = ((j+1)%2 ? -1: 1);
1674 maparray[idx++] =
GetMode(1,j,k);
1680 for (j = 2; j < Q-1; ++j)
1682 for (k = 1; k < R-j; ++k)
1684 if ((
int)faceOrient == 7)
1686 signarray[idx] = (j%2 ? -1: 1);
1688 maparray[idx++] =
GetMode(0,j,k);
1693 ASSERTL0(
false,
"Face interior map not available.");
1705 "BasisType is not a boundary interior form");
1708 "BasisType is not a boundary interior form");
1711 "BasisType is not a boundary interior form");
1713 int P =
m_base[0]->GetNumModes();
1714 int Q =
m_base[1]->GetNumModes();
1715 int R =
m_base[2]->GetNumModes();
1719 if(outarray.num_elements() != nIntCoeffs)
1725 for (
int i = 2; i < P-2; ++i)
1727 for (
int j = 1; j < Q-i-1; ++j)
1729 for (
int k = 1; k < R-i-j; ++k)
1731 outarray[idx++] =
GetMode(i,j,k);
1744 "BasisType is not a boundary interior form");
1747 "BasisType is not a boundary interior form");
1750 "BasisType is not a boundary interior form");
1752 int P =
m_base[0]->GetNumModes();
1753 int Q =
m_base[1]->GetNumModes();
1754 int R =
m_base[2]->GetNumModes();
1761 if (outarray.num_elements() != nBnd)
1766 for (i = 0; i <
P; ++i)
1771 for (j = 0; j < Q-i; j++)
1773 for (k = 0; k < R-i-j; ++k)
1775 outarray[idx++] =
GetMode(i,j,k);
1783 for (k = 0; k < R-i; ++k)
1785 outarray[idx++] =
GetMode(i,0,k);
1787 for (j = 1; j < Q-i; ++j)
1789 outarray[idx++] =
GetMode(i,j,0);
1810 int nq0 =
m_base[0]->GetNumPoints();
1811 int nq1 =
m_base[1]->GetNumPoints();
1812 int nq2 =
m_base[2]->GetNumPoints();
1822 nq = max(nq0,max(nq1,nq2));
1836 for(
int i = 0; i < nq; ++i)
1838 for(
int j = 0; j < nq-i; ++j)
1840 for(
int k = 0; k < nq-i-j; ++k,++cnt)
1843 coords[cnt][0] = -1.0 + 2*k/(
NekDouble)(nq-1);
1844 coords[cnt][1] = -1.0 + 2*j/(
NekDouble)(nq-1);
1845 coords[cnt][2] = -1.0 + 2*i/(
NekDouble)(nq-1);
1850 for(
int i = 0; i < neq; ++i)
1854 I[0] =
m_base[0]->GetI(coll);
1855 I[1] =
m_base[1]->GetI(coll+1);
1856 I[2] =
m_base[2]->GetI(coll+2);
1860 for(
int k = 0; k < nq2; ++k)
1862 for (
int j = 0; j < nq1; ++j)
1865 fac = (I[1]->GetPtr())[j]*(I[2]->GetPtr())[k];
1920 const int Q =
m_base[1]->GetNumModes();
1921 const int R =
m_base[2]->GetNumModes();
1923 int i,j,q_hat,k_hat;
1927 for (i = 0; i < I; ++i)
1932 k_hat = max(R-Q-i,0);
1933 cnt += q_hat*(q_hat+1)/2 + k_hat*Q;
1938 for (j = 0; j < J; ++j)
1956 int nquad0 =
m_base[0]->GetNumPoints();
1957 int nquad1 =
m_base[1]->GetNumPoints();
1958 int nquad2 =
m_base[2]->GetNumPoints();
1968 for(i = 0; i < nquad1*nquad2; ++i)
1971 w0.get(),1, &outarray[0]+i*nquad0,1);
1978 for(j = 0; j < nquad2; ++j)
1980 for(i = 0; i < nquad1; ++i)
1982 Blas::Dscal(nquad0,0.5*w1[i], &outarray[0]+i*nquad0+
1989 for(j = 0; j < nquad2; ++j)
1991 for(i = 0; i < nquad1; ++i)
1994 0.5*(1-z1[i])*w1[i],
1995 &outarray[0]+i*nquad0 + j*nquad0*nquad1,
2006 for(i = 0; i < nquad2; ++i)
2008 Blas::Dscal(nquad0*nquad1, 0.25*w2[i],
2009 &outarray[0]+i*nquad0*nquad1, 1);
2014 for(i = 0; i < nquad2; ++i)
2016 Blas::Dscal(nquad0*nquad1, 0.25*(1-z2[i])*w2[i],
2017 &outarray[0]+i*nquad0*nquad1, 1);
2021 for(i = 0; i < nquad2; ++i)
2023 Blas::Dscal(nquad0*nquad1,0.25*(1-z2[i])*(1-z2[i])*w2[i],
2024 &outarray[0]+i*nquad0*nquad1,1);
2041 int qa =
m_base[0]->GetNumPoints();
2042 int qb =
m_base[1]->GetNumPoints();
2043 int qc =
m_base[2]->GetNumPoints();
2044 int nmodes_a =
m_base[0]->GetNumModes();
2045 int nmodes_b =
m_base[1]->GetNumModes();
2046 int nmodes_c =
m_base[2]->GetNumModes();
2071 int cutoff_a = (int) (SVVCutOff*nmodes_a);
2072 int cutoff_b = (int) (SVVCutOff*nmodes_b);
2073 int cutoff_c = (int) (SVVCutOff*nmodes_c);
2074 int nmodes = min(min(nmodes_a,nmodes_b),nmodes_c);
2075 NekDouble cutoff = min(min(cutoff_a,cutoff_b),cutoff_c);
2079 OrthoExp.
FwdTrans(array,orthocoeffs);
2082 for(i = 0; i < nmodes_a; ++i)
2084 for(j = 0; j < nmodes_b-i; ++j)
2086 for(k = 0; k < nmodes_c-i-j; ++k)
2088 if(i + j + k >= cutoff)
2090 orthocoeffs[cnt] *= ((SvvDiffCoeff)*exp(-(i+j+k-nmodes)*(i+j+k-nmodes)/((
NekDouble)((i+j+k-cutoff+epsilon)*(i+j+k-cutoff+epsilon)))));
2094 orthocoeffs[cnt] *= 0.0;
2101 OrthoExp.
BwdTrans(orthocoeffs,array);
2110 int nquad0 =
m_base[0]->GetNumPoints();
2111 int nquad1 =
m_base[1]->GetNumPoints();
2112 int nquad2 =
m_base[2]->GetNumPoints();
2113 int nqtot = nquad0 * nquad1 * nquad2;
2114 int nmodes0 =
m_base[0]->GetNumModes();
2115 int nmodes1 =
m_base[1]->GetNumModes();
2116 int nmodes2 =
m_base[2]->GetNumModes();
2117 int numMax = nmodes0;
2145 OrthoTetExp->FwdTrans(phys_tmp, coeff);
2151 for (
int u = 0; u < numMin; ++u)
2153 for (
int i = 0; i < numMin-u; ++i)
2156 tmp2 = coeff_tmp1 + cnt, 1);
2157 cnt += numMax - u - i;
2159 for (
int i = numMin; i < numMax-u; ++i)
2161 cnt += numMax - u - i;
2165 OrthoTetExp->BwdTrans(coeff_tmp1,phys_tmp);
2174 int np0 =
m_base[0]->GetNumPoints();
2175 int np1 =
m_base[1]->GetNumPoints();
2176 int np2 =
m_base[2]->GetNumPoints();
2177 int np = max(np0,max(np1,np2));
2189 for(
int i = 0; i < np-1; ++i)
2191 planep1 += (np-i)*(np-i+1)/2;
2196 for(
int j = 0; j < np-i-1; ++j)
2200 for(
int k = 0; k < np-i-j-2; ++k)
2202 conn[cnt++] = plane + row +k+1;
2203 conn[cnt++] = plane + row +k;
2204 conn[cnt++] = plane + rowp1 +k;
2205 conn[cnt++] = planep1 + row1 +k;
2207 conn[cnt++] = plane + row +k+1;
2208 conn[cnt++] = plane + rowp1 +k+1;
2209 conn[cnt++] = planep1 + row1 +k+1;
2210 conn[cnt++] = planep1 + row1 +k;
2212 conn[cnt++] = plane + rowp1 +k+1;
2213 conn[cnt++] = plane + row +k+1;
2214 conn[cnt++] = plane + rowp1 +k;
2215 conn[cnt++] = planep1 + row1 +k;
2217 conn[cnt++] = planep1 + row1 +k;
2218 conn[cnt++] = planep1 + row1p1+k;
2219 conn[cnt++] = plane + rowp1 +k;
2220 conn[cnt++] = plane + rowp1 +k+1;
2222 conn[cnt++] = planep1 + row1 +k;
2223 conn[cnt++] = planep1 + row1p1+k;
2224 conn[cnt++] = planep1 + row1 +k+1;
2225 conn[cnt++] = plane + rowp1 +k+1;
2229 conn[cnt++] = plane + rowp1 +k+1;
2230 conn[cnt++] = planep1 + row1p1 +k+1;
2231 conn[cnt++] = planep1 + row1 +k+1;
2232 conn[cnt++] = planep1 + row1p1 +k;
2236 conn[cnt++] = plane + row + np-i-j-1;
2237 conn[cnt++] = plane + row + np-i-j-2;
2238 conn[cnt++] = plane + rowp1 + np-i-j-2;
2239 conn[cnt++] = planep1 + row1 + np-i-j-2;
2244 plane += (np-i)*(np-i+1)/2;
int GetMode(const int i, const int j, const int k)
Compute the mode number in the expansion for a particular tensorial combination.
NekDouble GetConstFactor(const ConstFactorType &factor) const
#define ASSERTL0(condition, msg)
virtual int v_NumBndryCoeffs() const
virtual DNekMatSharedPtr v_GenMatrix(const StdMatrixKey &mkey)
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)
Principle Modified Functions .
MatrixType GetMatrixType() const
virtual void v_GetSimplexEquiSpacedConnectivity(Array< OneD, int > &conn, bool standard=true)
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)
virtual LibUtilities::BasisType v_GetEdgeBasisType(const int i) const
static Array< OneD, NekDouble > NullNekDouble1DArray
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.
void MultiplyByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual int v_GetEdgeNcoeffs(const int i) const
int GetNumPoints(const int dir) const
This function returns the number of quadrature points in the dir direction.
LibUtilities::BasisKey EvaluateTriFaceBasisKey(const int facedir, const LibUtilities::BasisType faceDirBasisType, const int numpoints, const int nummodes)
Principle Modified Functions .
virtual void v_LocCoordToLocCollapsed(const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta)
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_x, Array< OneD, NekDouble > &coords_y, Array< OneD, NekDouble > &coords_z)
virtual void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
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_PhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_dx, Array< OneD, NekDouble > &out_dy, Array< OneD, NekDouble > &out_dz)
Calculate the derivative of the physical points.
virtual int v_GetNverts() const
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)
int getNumberOfCoefficients(int Na, int Nb, int Nc)
virtual int v_CalcNumberOfCoefficients(const std::vector< unsigned int > &nummodes, int &modes_offset)
boost::shared_ptr< DNekMat > DNekMatSharedPtr
virtual int v_NumDGBndryCoeffs() const
virtual void v_GetEdgeInteriorMap(const int eid, const Orientation edgeOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray)
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)
virtual void v_FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
DNekMatSharedPtr GetStdMatrix(const StdMatrixKey &mkey)
virtual int v_GetFaceIntNcoeffs(const int i) const
LibUtilities::ShapeType DetShapeType() const
Gauss Radau pinned at x=-1, .
virtual LibUtilities::ShapeType v_DetShapeType() const
virtual int v_GetTotalFaceIntNcoeffs() const
Principle Orthogonal Functions .
bool ConstFactorExists(const ConstFactorType &factor) const
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
virtual void v_FillMode(const int mode, Array< OneD, NekDouble > &outarray)
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...
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
virtual LibUtilities::PointsKey v_GetFacePointsKey(const int i, const int j) const
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_GetTotalEdgeIntNcoeffs() const
virtual void v_BwdTrans_SumFac(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_GetBoundaryMap(Array< OneD, unsigned int > &outarray)
Principle Modified Functions .
virtual void v_GetFaceNumModes(const int fid, const Orientation faceOrient, int &numModes0, int &numModes1)
virtual void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual DNekMatSharedPtr v_CreateStdMatrix(const StdMatrixKey &mkey)
virtual void v_GetInteriorMap(Array< OneD, unsigned int > &outarray)
Principle Orthogonal Functions .
virtual void v_MultiplyByStdQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
DNekMatSharedPtr CreateGeneralMatrix(const StdMatrixKey &mkey)
this function generates the mass matrix
Principle Orthogonal Functions .
Defines a specification for a set of points.
void Sadd(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Add vector y = alpha + x.
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)
virtual void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdMatrixKey &mkey)
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_GetFaceInteriorMap(const int fid, const Orientation faceOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray)
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
virtual bool v_IsBoundaryInteriorExpansion()
virtual int v_GetNfaces() const
virtual void v_IProductWRTDerivBase_MatOp(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_IProductWRTBase_MatOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
virtual int v_GetFaceNcoeffs(const int i) const
Gauss Radau pinned at x=-1, .
virtual const LibUtilities::BasisKey v_DetFaceBasisKey(const int i, const int k) const
virtual int v_GetVertexMap(int localVertexId, bool useCoeffPacking=false)
virtual void v_BwdTrans(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...
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 int v_GetFaceNumPoints(const int i) const
boost::shared_ptr< StdTetExp > StdTetExpSharedPtr
int GetNumModes() const
Returns the order of the basis.
void Zero(int n, T *x, const int incx)
Zero vector.
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...
Array< OneD, LibUtilities::BasisSharedPtr > m_base
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
virtual int v_GetNedges() const
virtual void v_ReduceOrderCoeffs(int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Describes the specification for a Basis.
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
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.
int getNumberOfBndCoefficients(int Na, int Nb, int Nc)
void FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function performs the Forward transformation from physical space to coefficient space...