65 "order in 'a' direction is higher than order "
68 "order in 'a' direction is higher than order "
71 "order in 'b' direction is higher than order "
112 int Q0 =
m_base[0]->GetNumPoints();
113 int Q1 =
m_base[1]->GetNumPoints();
114 int Q2 =
m_base[2]->GetNumPoints();
122 bool Do_2 = (out_dxi2.num_elements() > 0)?
true:
false;
123 bool Do_1 = (out_dxi1.num_elements() > 0)?
true:
false;
140 eta_0 =
m_base[0]->GetZ();
141 eta_1 =
m_base[1]->GetZ();
142 eta_2 =
m_base[2]->GetZ();
148 for(
int k=0; k< Q2; ++k)
150 for(
int j=0; j<Q1; ++j,dEta0+=Q0)
152 Vmath::Smul(Q0,2.0/(1.0-eta_1[j]),dEta0,1,dEta0,1);
154 fac = 1.0/(1.0-eta_2[k]);
155 Vmath::Smul(Q0*Q1,fac,&out_dEta0[0]+k*Q0*Q1,1,&out_dEta0[0]+k*Q0*Q1,1);
158 if (out_dxi0.num_elements() > 0)
171 for(
int k = 0; k < Q1*Q2; ++k)
173 Vmath::Vmul(Q0,&Fac0[0],1,&out_dEta0[0]+k*Q0,1,&out_dEta0[0]+k*Q0,1);
176 for(
int k = 0; k < Q2; ++k)
178 Vmath::Smul(Q0*Q1,2.0/(1.0-eta_2[k]),&out_dEta1[0]+k*Q0*Q1,1,
179 &out_dEta1[0]+k*Q0*Q1,1);
186 Vmath::Vadd(Qtot,out_dEta0,1,out_dEta1,1,out_dxi1,1);
194 for(
int k=0; k< Q2; ++k)
196 for(
int j=0; j<Q1; ++j,dEta1+=Q0)
198 Vmath::Smul(Q0,(1.0+eta_1[j])/2.0,dEta1,1,dEta1,1);
205 Vmath::Vadd(Qtot,out_dEta0,1,out_dEta1,1,out_dxi2,1);
206 Vmath::Vadd(Qtot,out_dEta2,1,out_dxi2 ,1,out_dxi2,1);
245 ASSERTL1(
false,
"input dir is out of range");
299 "Basis[1] is not a general tensor type");
303 "Basis[2] is not a general tensor type");
306 &&
m_base[2]->Collocation())
311 inarray, 1, outarray, 1);
327 int nquad1 =
m_base[1]->GetNumPoints();
328 int nquad2 =
m_base[2]->GetNumPoints();
329 int order0 =
m_base[0]->GetNumModes();
330 int order1 =
m_base[1]->GetNumModes();
333 nquad2*nquad1*order0);
338 inarray,outarray,wsp,
363 bool doCheckCollDir0,
364 bool doCheckCollDir1,
365 bool doCheckCollDir2)
367 int nquad0 =
m_base[0]->GetNumPoints();
368 int nquad1 =
m_base[1]->GetNumPoints();
369 int nquad2 =
m_base[2]->GetNumPoints();
371 int order0 =
m_base[0]->GetNumModes();
372 int order1 =
m_base[1]->GetNumModes();
373 int order2 =
m_base[2]->GetNumModes();
378 int i, j, mode, mode1, cnt;
381 mode = mode1 = cnt = 0;
382 for(i = 0; i < order0; ++i)
384 for(j = 0; j < order1-i; ++j, ++cnt)
386 Blas::Dgemv(
'N', nquad2, order2-i-j,
387 1.0, base2.get()+mode*nquad2, nquad2,
388 inarray.get()+mode1, 1,
389 0.0, tmp.get()+cnt*nquad2, 1);
394 for(j = order1-i; j < order2-i; ++j)
406 Blas::Daxpy(nquad2,inarray[1],base2.get()+nquad2,1,
410 Blas::Daxpy(nquad2,inarray[1],base2.get()+nquad2,1,
411 &tmp[0]+order1*nquad2,1);
416 for(i = 0; i < order0; ++i)
418 Blas::Dgemm(
'N',
'T', nquad1, nquad2, order1-i,
419 1.0, base1.get()+mode*nquad1, nquad1,
420 tmp.get()+mode*nquad2, nquad2,
421 0.0, tmp1.get()+i*nquad1*nquad2, nquad1);
432 for(i = 0; i < nquad2; ++i)
434 Blas::Daxpy(nquad1,tmp[nquad2+i], base1.get()+nquad1,1,
435 &tmp1[nquad1*nquad2]+i*nquad1,1);
440 Blas::Dgemm(
'N',
'T', nquad0, nquad1*nquad2, order0,
441 1.0, base0.get(), nquad0,
442 tmp1.get(), nquad1*nquad2,
443 0.0, outarray.get(), nquad0);
509 "Basis[1] is not a general tensor type");
513 "Basis[2] is not a general tensor type");
515 if(
m_base[0]->Collocation() &&
m_base[1]->Collocation())
534 Blas::Dgemv(
'N',
m_ncoeffs,nq,1.0,iprodmat->GetPtr().get(),
535 m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
548 bool multiplybyweights)
550 int nquad0 =
m_base[0]->GetNumPoints();
551 int nquad1 =
m_base[1]->GetNumPoints();
552 int nquad2 =
m_base[2]->GetNumPoints();
553 int order0 =
m_base[0]->GetNumModes();
554 int order1 =
m_base[1]->GetNumModes();
557 nquad2*order0*(2*order1-order0+1)/2);
559 if(multiplybyweights)
568 tmp, outarray, wsp,
true,
true,
true);
576 inarray, outarray, wsp,
true,
true,
true);
588 bool doCheckCollDir0,
589 bool doCheckCollDir1,
590 bool doCheckCollDir2)
592 int nquad0 =
m_base[0]->GetNumPoints();
593 int nquad1 =
m_base[1]->GetNumPoints();
594 int nquad2 =
m_base[2]->GetNumPoints();
596 int order0 =
m_base[0]->GetNumModes();
597 int order1 =
m_base[1]->GetNumModes();
598 int order2 =
m_base[2]->GetNumModes();
603 int i,j, mode,mode1, cnt;
606 Blas::Dgemm(
'T',
'N', nquad1*nquad2, order0, nquad0,
607 1.0, inarray.get(), nquad0,
609 0.0, tmp1.get(), nquad1*nquad2);
612 for(mode=i=0; i < order0; ++i)
614 Blas::Dgemm(
'T',
'N', nquad2, order1-i, nquad1,
615 1.0, tmp1.get()+i*nquad1*nquad2, nquad1,
616 base1.get()+mode*nquad1, nquad1,
617 0.0, tmp2.get()+mode*nquad2, nquad2);
626 Blas::Dgemv(
'T', nquad1, nquad2,
627 1.0, tmp1.get()+nquad1*nquad2, nquad1,
628 base1.get()+nquad1, 1,
629 1.0, tmp2.get()+nquad2, 1);
633 mode = mode1 = cnt = 0;
634 for(i = 0; i < order0; ++i)
636 for(j = 0; j < order1-i; ++j, ++cnt)
638 Blas::Dgemv(
'T', nquad2, order2-i-j,
639 1.0, base2.get()+mode*nquad2, nquad2,
640 tmp2.get()+cnt*nquad2, 1,
641 0.0, outarray.get()+mode1, 1);
646 for(j = order1-i; j < order2-i; ++j)
657 outarray[1] +=
Blas::Ddot(nquad2,base2.get()+nquad2,1,
661 outarray[1] +=
Blas::Ddot(nquad2,base2.get()+nquad2,1,
662 &tmp2[nquad2*order1],1);
681 ASSERTL0((dir==0)||(dir==1)||(dir==2),
"input dir is out of range");
702 Blas::Dgemv(
'N',
m_ncoeffs,nq,1.0,iprodmat->GetPtr().get(),
703 m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
719 int nquad0 =
m_base[0]->GetNumPoints();
720 int nquad1 =
m_base[1]->GetNumPoints();
721 int nquad2 =
m_base[2]->GetNumPoints();
722 int nqtot = nquad0*nquad1*nquad2;
723 int nmodes0 =
m_base[0]->GetNumModes();
724 int nmodes1 =
m_base[1]->GetNumModes();
725 int wspsize = nquad0 + nquad1 + nquad2 + max(nqtot,
m_ncoeffs)
726 + nquad1*nquad2*nmodes0 + nquad2*nmodes0*(2*nmodes1-nmodes0+1)/2;
739 for(i = 0; i < nquad0; ++i)
741 gfac0[i] = 0.5*(1+z0[i]);
745 for(i = 0; i < nquad1; ++i)
747 gfac1[i] = 2.0/(1-z1[i]);
751 for(i = 0; i < nquad2; ++i)
753 gfac2[i] = 2.0/(1-z2[i]);
757 for(i = 0; i < nquad1*nquad2; ++i)
759 Vmath::Smul(nquad0,gfac1[i%nquad1],&inarray[0]+i*nquad0,1,&tmp0[0]+i*nquad0,1);
761 for(i = 0; i < nquad2; ++i)
763 Vmath::Smul(nquad0*nquad1,gfac2[i],&tmp0[0]+i*nquad0*nquad1,1,&tmp0[0]+i*nquad0*nquad1,1);
783 for(i = 0; i < nquad1*nquad2; ++i)
785 Vmath::Vmul(nquad0,&gfac0[0],1,&tmp0[0]+i*nquad0,1,&tmp0[0]+i*nquad0,1);
794 for(i = 0; i < nquad2; ++i)
796 Vmath::Smul(nquad0*nquad1,gfac2[i],&inarray[0]+i*nquad0*nquad1,1,&tmp0[0]+i*nquad0*nquad1,1);
811 for(i = 0; i < nquad1; ++i)
813 gfac1[i] = (1+z1[i])/2;
816 for(i = 0; i < nquad1*nquad2; ++i)
818 Vmath::Vmul(nquad0,&gfac0[0],1,&tmp0[0]+i*nquad0,1,&tmp0[0]+i*nquad0,1);
826 for(i = 0; i < nquad2; ++i)
828 Vmath::Smul(nquad0*nquad1,gfac2[i],&inarray[0]+i*nquad0*nquad1,1,&tmp0[0]+i*nquad0*nquad1,1);
830 for(i = 0; i < nquad1*nquad2; ++i)
832 Vmath::Smul(nquad0,gfac1[i%nquad1],&tmp0[0]+i*nquad0,1,&tmp0[0]+i*nquad0,1);
854 ASSERTL1(
false,
"input dir is out of range");
891 eta[0] = 2.0*(1.0+xi[0])/(-xi[1]-xi[2]) - 1.0;
893 eta[1] = 2.0*(1.0+xi[1])/(1.0-xi[2]) - 1.0;
936 "BasisType is not a boundary interior form");
939 "BasisType is not a boundary interior form");
942 "BasisType is not a boundary interior form");
944 int P =
m_base[0]->GetNumModes();
945 int Q =
m_base[1]->GetNumModes();
946 int R =
m_base[2]->GetNumModes();
956 "BasisType is not a boundary interior form");
959 "BasisType is not a boundary interior form");
962 "BasisType is not a boundary interior form");
964 int P =
m_base[0]->GetNumModes()-1;
965 int Q =
m_base[1]->GetNumModes()-1;
966 int R =
m_base[2]->GetNumModes()-1;
969 return (Q+1) + P*(1 + 2*Q - P)/2
970 + (R+1) + P*(1 + 2*R - P)/2
971 + 2*(R+1) + Q*(1 + 2*R - Q);
976 ASSERTL2((i >= 0) && (i <= 5),
"edge id is out of range");
977 int P =
m_base[0]->GetNumModes();
978 int Q =
m_base[1]->GetNumModes();
979 int R =
m_base[2]->GetNumModes();
985 else if (i == 1 || i == 2)
997 int P =
m_base[0]->GetNumModes()-2;
998 int Q =
m_base[1]->GetNumModes()-2;
999 int R =
m_base[2]->GetNumModes()-2;
1006 ASSERTL2((i >= 0) && (i <= 3),
"face id is out of range");
1007 int nFaceCoeffs = 0;
1008 int nummodesA, nummodesB, P, Q;
1014 else if ((i == 1) || (i == 2))
1026 nFaceCoeffs = Q+1 + (P*(1 + 2*Q - P))/2;
1032 ASSERTL2((i >= 0) && (i <= 3),
"face id is out of range");
1033 int Pi =
m_base[0]->GetNumModes() - 2;
1034 int Qi =
m_base[1]->GetNumModes() - 2;
1035 int Ri =
m_base[2]->GetNumModes() - 2;
1039 return Pi * (2*Qi - Pi - 1) / 2;
1043 return Pi * (2*Ri - Pi - 1) / 2;
1047 return Qi * (2*Ri - Qi - 1) / 2;
1053 int Pi =
m_base[0]->GetNumModes() - 2;
1054 int Qi =
m_base[1]->GetNumModes() - 2;
1055 int Ri =
m_base[2]->GetNumModes() - 2;
1057 return Pi * (2*Qi - Pi - 1) / 2 +
1058 Pi * (2*Ri - Pi - 1) / 2 +
1059 Qi * (2*Ri - Qi - 1);
1064 ASSERTL2(i >= 0 && i <= 3,
"face id is out of range");
1068 return m_base[0]->GetNumPoints()*
1069 m_base[1]->GetNumPoints();
1073 return m_base[0]->GetNumPoints()*
1074 m_base[2]->GetNumPoints();
1078 return m_base[1]->GetNumPoints()*
1079 m_base[2]->GetNumPoints();
1084 const int i,
const int j)
const
1086 ASSERTL2(i >= 0 && i <= 3,
"face id is out of range");
1087 ASSERTL2(j == 0 || j == 1,
"face direction is out of range");
1091 return m_base[j]->GetPointsKey();
1095 return m_base[2*j]->GetPointsKey();
1099 return m_base[j+1]->GetPointsKey();
1104 const std::vector<unsigned int>& nummodes,
1108 nummodes[modes_offset],
1109 nummodes[modes_offset+1],
1110 nummodes[modes_offset+2]);
1117 const int i,
const int k)
const
1119 ASSERTL2(i >= 0 && i <= 4,
"face id is out of range");
1120 ASSERTL2(k == 0 || k == 1,
"face direction out of range");
1140 m_base[dir]->GetNumModes());
1148 ASSERTL2(i >= 0 && i <= 5,
"edge id is out of range");
1154 else if (i == 1 || i == 2)
1178 for(
int k = 0; k < Qz; ++k ) {
1179 for(
int j = 0; j < Qy; ++j ) {
1180 for(
int i = 0; i < Qx; ++i ) {
1181 int s = i + Qx*(j + Qy*k);
1182 xi_x[s] = (eta_x[i] + 1.0) * (1.0 - eta_y[j]) * (1.0 - eta_z[k]) / 4 - 1.0;
1183 xi_y[s] = (eta_y[j] + 1.0) * (1.0 - eta_z[k]) / 2 - 1.0;
1214 int P, Q, i, j, k, idx;
1217 "Method only implemented for Modified_A BasisType (x "
1218 "direction), Modified_B BasisType (y direction), and "
1219 "Modified_C BasisType(z direction)");
1221 int nFaceCoeffs = 0;
1223 if (nummodesA == -1)
1228 nummodesA =
m_base[0]->GetNumModes();
1229 nummodesB =
m_base[1]->GetNumModes();
1232 nummodesA =
m_base[0]->GetNumModes();
1233 nummodesB =
m_base[2]->GetNumModes();
1237 nummodesA =
m_base[1]->GetNumModes();
1238 nummodesB =
m_base[2]->GetNumModes();
1246 nFaceCoeffs = Q + ((P-1)*(1 + 2*(Q-1) - (P-1)))/2;
1249 if(maparray.num_elements() != nFaceCoeffs)
1254 if(signarray.num_elements() != nFaceCoeffs)
1260 fill( signarray.get() , signarray.get()+nFaceCoeffs, 1 );
1267 for (i = 0; i < P; ++i)
1269 for (j = 0; j < Q-i; ++j)
1271 if ((
int)faceOrient == 7 && i > 1)
1273 signarray[idx] = (i%2 ? -1 : 1);
1275 maparray[idx++] =
GetMode(i,j,0);
1281 for (i = 0; i < P; ++i)
1283 for (k = 0; k < Q-i; ++k)
1285 if ((
int)faceOrient == 7 && i > 1)
1287 signarray[idx] = (i%2 ? -1: 1);
1289 maparray[idx++] =
GetMode(i,0,k);
1295 for (j = 0; j < P-1; ++j)
1297 for (k = 0; k < Q-1-j; ++k)
1299 if ((
int)faceOrient == 7 && j > 1)
1301 signarray[idx] = ((j+1)%2 ? -1: 1);
1303 maparray[idx++] =
GetMode(1,j,k);
1305 if (j == 0 && k == 0) {
1306 maparray[idx++] =
GetMode(0,0,1);
1308 if (j == 0 && k == Q-2) {
1309 for (
int r = 0; r < Q-1; ++r) {
1310 maparray[idx++] =
GetMode(0,1,r);
1318 for (j = 0; j < P; ++j)
1320 for (k = 0; k < Q-j; ++k)
1322 if ((
int)faceOrient == 7 && j > 1)
1324 signarray[idx] = (j%2 ? -1: 1);
1326 maparray[idx++] =
GetMode(0,j,k);
1331 ASSERTL0(
false,
"Element map not available.");
1334 if ((
int)faceOrient == 7)
1336 swap(maparray[0], maparray[Q]);
1338 for (i = 1; i < Q-1; ++i)
1340 swap(maparray[i+1], maparray[Q+i]);
1350 "Mapping not defined for this type of basis");
1353 if(useCoeffPacking ==
true)
1355 switch(localVertexId)
1379 ASSERTL0(
false,
"Vertex ID must be between 0 and 3");
1386 switch(localVertexId)
1410 ASSERTL0(
false,
"Vertex ID must be between 0 and 3");
1430 const int P =
m_base[0]->GetNumModes();
1431 const int Q =
m_base[1]->GetNumModes();
1432 const int R =
m_base[2]->GetNumModes();
1436 if(maparray.num_elements() != nEdgeIntCoeffs)
1442 fill( maparray.get(), maparray.get() + nEdgeIntCoeffs, 0);
1445 if(signarray.num_elements() != nEdgeIntCoeffs)
1451 fill( signarray.get() , signarray.get()+nEdgeIntCoeffs, 1 );
1457 for (i = 0; i < P-2; ++i)
1459 maparray[i] =
GetMode(i+2, 0, 0);
1463 for(i = 1; i < nEdgeIntCoeffs; i+=2)
1470 for (i = 0; i < Q-2; ++i)
1472 maparray[i] =
GetMode(1, i+1, 0);
1476 for(i = 1; i < nEdgeIntCoeffs; i+=2)
1483 for (i = 0; i < Q-2; ++i)
1485 maparray[i] =
GetMode(0, i+2, 0);
1489 for(i = 1; i < nEdgeIntCoeffs; i+=2)
1496 for (i = 0; i < R-2; ++i)
1498 maparray[i] =
GetMode(0, 0, i+2);
1502 for(i = 1; i < nEdgeIntCoeffs; i+=2)
1509 for (i = 0; i < R - 2; ++i)
1511 maparray[i] =
GetMode(1, 0, i+1);
1515 for(i = 1; i < nEdgeIntCoeffs; i+=2)
1522 for (i = 0; i < R-2; ++i)
1524 maparray[i] =
GetMode(0, 1, i+1);
1528 for(i = 1; i < nEdgeIntCoeffs; i+=2)
1535 ASSERTL0(
false,
"Edge not defined.");
1547 const int P =
m_base[0]->GetNumModes();
1548 const int Q =
m_base[1]->GetNumModes();
1549 const int R =
m_base[2]->GetNumModes();
1553 if(maparray.num_elements() != nFaceIntCoeffs)
1558 if(signarray.num_elements() != nFaceIntCoeffs)
1564 fill( signarray.get() , signarray.get()+nFaceIntCoeffs, 1 );
1571 for (i = 2; i < P-1; ++i)
1573 for (j = 1; j < Q-i; ++j)
1575 if ((
int)faceOrient == 7)
1577 signarray[idx] = (i%2 ? -1 : 1);
1579 maparray[idx++] =
GetMode(i,j,0);
1585 for (i = 2; i < P; ++i)
1587 for (k = 1; k < R-i; ++k)
1589 if ((
int)faceOrient == 7)
1591 signarray[idx] = (i%2 ? -1: 1);
1593 maparray[idx++] =
GetMode(i,0,k);
1599 for (j = 1; j < Q-2; ++j)
1601 for (k = 1; k < R-1-j; ++k)
1603 if ((
int)faceOrient == 7)
1605 signarray[idx] = ((j+1)%2 ? -1: 1);
1607 maparray[idx++] =
GetMode(1,j,k);
1613 for (j = 2; j < Q-1; ++j)
1615 for (k = 1; k < R-j; ++k)
1617 if ((
int)faceOrient == 7)
1619 signarray[idx] = (j%2 ? -1: 1);
1621 maparray[idx++] =
GetMode(0,j,k);
1626 ASSERTL0(
false,
"Face interior map not available.");
1638 "BasisType is not a boundary interior form");
1641 "BasisType is not a boundary interior form");
1644 "BasisType is not a boundary interior form");
1646 int P =
m_base[0]->GetNumModes();
1647 int Q =
m_base[1]->GetNumModes();
1648 int R =
m_base[2]->GetNumModes();
1652 if(outarray.num_elements() != nIntCoeffs)
1658 for (
int i = 2; i < P-2; ++i)
1660 for (
int j = 1; j < Q-i-1; ++j)
1662 for (
int k = 1; k < R-i-j; ++k)
1664 outarray[idx++] =
GetMode(i,j,k);
1677 "BasisType is not a boundary interior form");
1680 "BasisType is not a boundary interior form");
1683 "BasisType is not a boundary interior form");
1685 int P =
m_base[0]->GetNumModes();
1686 int Q =
m_base[1]->GetNumModes();
1687 int R =
m_base[2]->GetNumModes();
1694 if (outarray.num_elements() != nBnd)
1699 for (i = 0; i < P; ++i)
1704 for (j = 0; j < Q-i; j++)
1706 for (k = 0; k < R-i-j; ++k)
1708 outarray[idx++] =
GetMode(i,j,k);
1716 for (k = 0; k < R-i; ++k)
1718 outarray[idx++] =
GetMode(i,0,k);
1720 for (j = 1; j < Q-i; ++j)
1722 outarray[idx++] =
GetMode(i,j,0);
1743 int nq0 =
m_base[0]->GetNumPoints();
1744 int nq1 =
m_base[1]->GetNumPoints();
1745 int nq2 =
m_base[2]->GetNumPoints();
1746 int nq = max(nq0,max(nq1,nq2));
1758 for(
int i = 0; i < nq; ++i)
1760 for(
int j = 0; j < nq-i; ++j)
1762 for(
int k = 0; k < nq-i-j; ++k,++cnt)
1765 coords[cnt][0] = -1.0 + 2*k/(
NekDouble)(nq-1);
1766 coords[cnt][1] = -1.0 + 2*j/(
NekDouble)(nq-1);
1767 coords[cnt][2] = -1.0 + 2*i/(
NekDouble)(nq-1);
1772 for(
int i = 0; i < neq; ++i)
1776 I[0] =
m_base[0]->GetI(coll);
1777 I[1] =
m_base[1]->GetI(coll+1);
1778 I[2] =
m_base[2]->GetI(coll+2);
1782 for(
int k = 0; k < nq2; ++k)
1784 for (
int j = 0; j < nq1; ++j)
1787 fac = (I[1]->GetPtr())[j]*(I[2]->GetPtr())[k];
1842 const int Q =
m_base[1]->GetNumModes();
1843 const int R =
m_base[2]->GetNumModes();
1845 int i,j,q_hat,k_hat;
1849 for (i = 0; i < I; ++i)
1854 k_hat = max(R-Q-i,0);
1855 cnt += q_hat*(q_hat+1)/2 + k_hat*Q;
1860 for (j = 0; j < J; ++j)
1878 int nquad0 =
m_base[0]->GetNumPoints();
1879 int nquad1 =
m_base[1]->GetNumPoints();
1880 int nquad2 =
m_base[2]->GetNumPoints();
1890 for(i = 0; i < nquad1*nquad2; ++i)
1893 w0.get(),1, &outarray[0]+i*nquad0,1);
1900 for(j = 0; j < nquad2; ++j)
1902 for(i = 0; i < nquad1; ++i)
1904 Blas::Dscal(nquad0,0.5*w1[i], &outarray[0]+i*nquad0+
1911 for(j = 0; j < nquad2; ++j)
1913 for(i = 0; i < nquad1; ++i)
1916 0.5*(1-z1[i])*w1[i],
1917 &outarray[0]+i*nquad0 + j*nquad0*nquad1,
1928 for(i = 0; i < nquad2; ++i)
1930 Blas::Dscal(nquad0*nquad1, 0.25*w2[i],
1931 &outarray[0]+i*nquad0*nquad1, 1);
1936 for(i = 0; i < nquad2; ++i)
1938 Blas::Dscal(nquad0*nquad1,0.25*(1-z2[i])*(1-z2[i])*w2[i],
1939 &outarray[0]+i*nquad0*nquad1,1);
1956 int qa =
m_base[0]->GetNumPoints();
1957 int qb =
m_base[1]->GetNumPoints();
1958 int qc =
m_base[2]->GetNumPoints();
1959 int nmodes_a =
m_base[0]->GetNumModes();
1960 int nmodes_b =
m_base[1]->GetNumModes();
1961 int nmodes_c =
m_base[2]->GetNumModes();
1986 int cutoff_a = (int) (SVVCutOff*nmodes_a);
1987 int cutoff_b = (int) (SVVCutOff*nmodes_b);
1988 int cutoff_c = (int) (SVVCutOff*nmodes_c);
1989 int nmodes = min(min(nmodes_a,nmodes_b),nmodes_c);
1990 NekDouble cutoff = min(min(cutoff_a,cutoff_b),cutoff_c);
1994 OrthoExp.
FwdTrans(array,orthocoeffs);
1997 for(i = 0; i < nmodes_a; ++i)
1999 for(j = 0; j < nmodes_b-i; ++j)
2001 for(k = 0; k < nmodes_c-i-j; ++k)
2003 if(i + j + k >= cutoff)
2005 orthocoeffs[cnt] *= ((SvvDiffCoeff)*exp(-(i+j+k-nmodes)*(i+j+k-nmodes)/((
NekDouble)((i+j+k-cutoff+epsilon)*(i+j+k-cutoff+epsilon)))));
2009 orthocoeffs[cnt] *= 0.0;
2016 OrthoExp.
BwdTrans(orthocoeffs,array);
2025 int nquad0 =
m_base[0]->GetNumPoints();
2026 int nquad1 =
m_base[1]->GetNumPoints();
2027 int nquad2 =
m_base[2]->GetNumPoints();
2028 int nqtot = nquad0 * nquad1 * nquad2;
2029 int nmodes0 =
m_base[0]->GetNumModes();
2030 int nmodes1 =
m_base[1]->GetNumModes();
2031 int nmodes2 =
m_base[2]->GetNumModes();
2032 int numMax = nmodes0;
2060 OrthoTetExp->FwdTrans(phys_tmp, coeff);
2066 for (
int u = 0; u < numMin; ++u)
2068 for (
int i = 0; i < numMin-u; ++i)
2071 tmp2 = coeff_tmp1 + cnt, 1);
2072 cnt += numMax - u - i;
2074 for (
int i = numMin; i < numMax-u; ++i)
2076 cnt += numMax - u - i;
2080 OrthoTetExp->BwdTrans(coeff_tmp1,phys_tmp);
2089 int np0 =
m_base[0]->GetNumPoints();
2090 int np1 =
m_base[1]->GetNumPoints();
2091 int np2 =
m_base[2]->GetNumPoints();
2092 int np = max(np0,max(np1,np2));
2104 for(
int i = 0; i < np-1; ++i)
2106 planep1 += (np-i)*(np-i+1)/2;
2111 for(
int j = 0; j < np-i-1; ++j)
2115 for(
int k = 0; k < np-i-j-2; ++k)
2117 conn[cnt++] = plane + row +k+1;
2118 conn[cnt++] = plane + row +k;
2119 conn[cnt++] = plane + rowp1 +k;
2120 conn[cnt++] = planep1 + row1 +k;
2122 conn[cnt++] = plane + row +k+1;
2123 conn[cnt++] = plane + rowp1 +k+1;
2124 conn[cnt++] = planep1 + row1 +k+1;
2125 conn[cnt++] = planep1 + row1 +k;
2127 conn[cnt++] = plane + rowp1 +k+1;
2128 conn[cnt++] = plane + row +k+1;
2129 conn[cnt++] = plane + rowp1 +k;
2130 conn[cnt++] = planep1 + row1 +k;
2132 conn[cnt++] = planep1 + row1 +k;
2133 conn[cnt++] = planep1 + row1p1+k;
2134 conn[cnt++] = plane + rowp1 +k;
2135 conn[cnt++] = plane + rowp1 +k+1;
2137 conn[cnt++] = planep1 + row1 +k;
2138 conn[cnt++] = planep1 + row1p1+k;
2139 conn[cnt++] = planep1 + row1 +k+1;
2140 conn[cnt++] = plane + rowp1 +k+1;
2144 conn[cnt++] = plane + rowp1 +k+1;
2145 conn[cnt++] = planep1 + row1p1 +k+1;
2146 conn[cnt++] = planep1 + row1 +k+1;
2147 conn[cnt++] = planep1 + row1p1 +k;
2151 conn[cnt++] = plane + row + np-i-j-1;
2152 conn[cnt++] = plane + row + np-i-j-2;
2153 conn[cnt++] = plane + rowp1 + np-i-j-2;
2154 conn[cnt++] = planep1 + row1 + np-i-j-2;
2159 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 void v_GetFaceToElementMap(const int fid, const Orientation faceOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, int nummodesA=-1, int nummodesB=-1)
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 .
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_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_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...