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 nummodesA,nummodesB, 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;
1226 nummodesA =
m_base[0]->GetNumModes();
1227 nummodesB =
m_base[1]->GetNumModes();
1230 nummodesA =
m_base[0]->GetNumModes();
1231 nummodesB =
m_base[2]->GetNumModes();
1235 nummodesA =
m_base[1]->GetNumModes();
1236 nummodesB =
m_base[2]->GetNumModes();
1240 bool CheckForZeroedModes =
false;
1248 CheckForZeroedModes =
true;
1251 nFaceCoeffs = P*(2*Q-P+1)/2;
1254 if(maparray.num_elements() != nFaceCoeffs)
1259 if(signarray.num_elements() != nFaceCoeffs)
1265 fill(signarray.get(),signarray.get()+nFaceCoeffs, 1 );
1272 for (i = 0; i < P; ++i)
1274 for (j = 0; j < Q-i; ++j)
1276 if ((
int)faceOrient == 7 && i > 1)
1278 signarray[idx] = (i%2 ? -1 : 1);
1280 maparray[idx++] =
GetMode(i,j,0);
1286 for (i = 0; i < P; ++i)
1288 for (k = 0; k < Q-i; ++k)
1290 if ((
int)faceOrient == 7 && i > 1)
1292 signarray[idx] = (i%2 ? -1: 1);
1294 maparray[idx++] =
GetMode(i,0,k);
1300 for (j = 0; j < P-1; ++j)
1302 for (k = 0; k < Q-1-j; ++k)
1304 if ((
int)faceOrient == 7 && j > 1)
1306 signarray[idx] = ((j+1)%2 ? -1: 1);
1308 maparray[idx++] =
GetMode(1,j,k);
1310 if (j == 0 && k == 0)
1312 maparray[idx++] =
GetMode(0,0,1);
1314 if (j == 0 && k == Q-2)
1316 for (
int r = 0; r < Q-1; ++r)
1318 maparray[idx++] =
GetMode(0,1,r);
1326 for (j = 0; j < P; ++j)
1328 for (k = 0; k < Q-j; ++k)
1330 if ((
int)faceOrient == 7 && j > 1)
1332 signarray[idx] = (j%2 ? -1: 1);
1334 maparray[idx++] =
GetMode(0,j,k);
1339 ASSERTL0(
false,
"Element map not available.");
1342 if ((
int)faceOrient == 7)
1344 swap(maparray[0], maparray[Q]);
1346 for (i = 1; i < Q-1; ++i)
1348 swap(maparray[i+1], maparray[Q+i]);
1352 if(CheckForZeroedModes)
1357 for (j = 0; j < nummodesA; ++j)
1360 for (k = nummodesB-j; k < Q-j; ++k)
1362 signarray[idx] = 0.0;
1363 maparray[idx++] = maparray[0];
1367 for (j = nummodesA; j < P; ++j)
1369 for (k = 0; k < Q-j; ++k)
1371 signarray[idx] = 0.0;
1372 maparray[idx++] = maparray[0];
1383 "Mapping not defined for this type of basis");
1386 if(useCoeffPacking ==
true)
1388 switch(localVertexId)
1412 ASSERTL0(
false,
"Vertex ID must be between 0 and 3");
1419 switch(localVertexId)
1443 ASSERTL0(
false,
"Vertex ID must be between 0 and 3");
1463 const int P =
m_base[0]->GetNumModes();
1464 const int Q =
m_base[1]->GetNumModes();
1465 const int R =
m_base[2]->GetNumModes();
1469 if(maparray.num_elements() != nEdgeIntCoeffs)
1475 fill( maparray.get(), maparray.get() + nEdgeIntCoeffs, 0);
1478 if(signarray.num_elements() != nEdgeIntCoeffs)
1484 fill( signarray.get() , signarray.get()+nEdgeIntCoeffs, 1 );
1490 for (i = 0; i < P-2; ++i)
1492 maparray[i] =
GetMode(i+2, 0, 0);
1496 for(i = 1; i < nEdgeIntCoeffs; i+=2)
1503 for (i = 0; i < Q-2; ++i)
1505 maparray[i] =
GetMode(1, i+1, 0);
1509 for(i = 1; i < nEdgeIntCoeffs; i+=2)
1516 for (i = 0; i < Q-2; ++i)
1518 maparray[i] =
GetMode(0, i+2, 0);
1522 for(i = 1; i < nEdgeIntCoeffs; i+=2)
1529 for (i = 0; i < R-2; ++i)
1531 maparray[i] =
GetMode(0, 0, i+2);
1535 for(i = 1; i < nEdgeIntCoeffs; i+=2)
1542 for (i = 0; i < R - 2; ++i)
1544 maparray[i] =
GetMode(1, 0, i+1);
1548 for(i = 1; i < nEdgeIntCoeffs; i+=2)
1555 for (i = 0; i < R-2; ++i)
1557 maparray[i] =
GetMode(0, 1, i+1);
1561 for(i = 1; i < nEdgeIntCoeffs; i+=2)
1568 ASSERTL0(
false,
"Edge not defined.");
1580 const int P =
m_base[0]->GetNumModes();
1581 const int Q =
m_base[1]->GetNumModes();
1582 const int R =
m_base[2]->GetNumModes();
1586 if(maparray.num_elements() != nFaceIntCoeffs)
1591 if(signarray.num_elements() != nFaceIntCoeffs)
1597 fill( signarray.get() , signarray.get()+nFaceIntCoeffs, 1 );
1604 for (i = 2; i < P-1; ++i)
1606 for (j = 1; j < Q-i; ++j)
1608 if ((
int)faceOrient == 7)
1610 signarray[idx] = (i%2 ? -1 : 1);
1612 maparray[idx++] =
GetMode(i,j,0);
1618 for (i = 2; i < P; ++i)
1620 for (k = 1; k < R-i; ++k)
1622 if ((
int)faceOrient == 7)
1624 signarray[idx] = (i%2 ? -1: 1);
1626 maparray[idx++] =
GetMode(i,0,k);
1632 for (j = 1; j < Q-2; ++j)
1634 for (k = 1; k < R-1-j; ++k)
1636 if ((
int)faceOrient == 7)
1638 signarray[idx] = ((j+1)%2 ? -1: 1);
1640 maparray[idx++] =
GetMode(1,j,k);
1646 for (j = 2; j < Q-1; ++j)
1648 for (k = 1; k < R-j; ++k)
1650 if ((
int)faceOrient == 7)
1652 signarray[idx] = (j%2 ? -1: 1);
1654 maparray[idx++] =
GetMode(0,j,k);
1659 ASSERTL0(
false,
"Face interior map not available.");
1671 "BasisType is not a boundary interior form");
1674 "BasisType is not a boundary interior form");
1677 "BasisType is not a boundary interior form");
1679 int P =
m_base[0]->GetNumModes();
1680 int Q =
m_base[1]->GetNumModes();
1681 int R =
m_base[2]->GetNumModes();
1685 if(outarray.num_elements() != nIntCoeffs)
1691 for (
int i = 2; i < P-2; ++i)
1693 for (
int j = 1; j < Q-i-1; ++j)
1695 for (
int k = 1; k < R-i-j; ++k)
1697 outarray[idx++] =
GetMode(i,j,k);
1710 "BasisType is not a boundary interior form");
1713 "BasisType is not a boundary interior form");
1716 "BasisType is not a boundary interior form");
1718 int P =
m_base[0]->GetNumModes();
1719 int Q =
m_base[1]->GetNumModes();
1720 int R =
m_base[2]->GetNumModes();
1727 if (outarray.num_elements() != nBnd)
1732 for (i = 0; i < P; ++i)
1737 for (j = 0; j < Q-i; j++)
1739 for (k = 0; k < R-i-j; ++k)
1741 outarray[idx++] =
GetMode(i,j,k);
1749 for (k = 0; k < R-i; ++k)
1751 outarray[idx++] =
GetMode(i,0,k);
1753 for (j = 1; j < Q-i; ++j)
1755 outarray[idx++] =
GetMode(i,j,0);
1776 int nq0 =
m_base[0]->GetNumPoints();
1777 int nq1 =
m_base[1]->GetNumPoints();
1778 int nq2 =
m_base[2]->GetNumPoints();
1788 nq = max(nq0,max(nq1,nq2));
1802 for(
int i = 0; i < nq; ++i)
1804 for(
int j = 0; j < nq-i; ++j)
1806 for(
int k = 0; k < nq-i-j; ++k,++cnt)
1809 coords[cnt][0] = -1.0 + 2*k/(
NekDouble)(nq-1);
1810 coords[cnt][1] = -1.0 + 2*j/(
NekDouble)(nq-1);
1811 coords[cnt][2] = -1.0 + 2*i/(
NekDouble)(nq-1);
1816 for(
int i = 0; i < neq; ++i)
1820 I[0] =
m_base[0]->GetI(coll);
1821 I[1] =
m_base[1]->GetI(coll+1);
1822 I[2] =
m_base[2]->GetI(coll+2);
1826 for(
int k = 0; k < nq2; ++k)
1828 for (
int j = 0; j < nq1; ++j)
1831 fac = (I[1]->GetPtr())[j]*(I[2]->GetPtr())[k];
1886 const int Q =
m_base[1]->GetNumModes();
1887 const int R =
m_base[2]->GetNumModes();
1889 int i,j,q_hat,k_hat;
1893 for (i = 0; i < I; ++i)
1898 k_hat = max(R-Q-i,0);
1899 cnt += q_hat*(q_hat+1)/2 + k_hat*Q;
1904 for (j = 0; j < J; ++j)
1922 int nquad0 =
m_base[0]->GetNumPoints();
1923 int nquad1 =
m_base[1]->GetNumPoints();
1924 int nquad2 =
m_base[2]->GetNumPoints();
1934 for(i = 0; i < nquad1*nquad2; ++i)
1937 w0.get(),1, &outarray[0]+i*nquad0,1);
1944 for(j = 0; j < nquad2; ++j)
1946 for(i = 0; i < nquad1; ++i)
1948 Blas::Dscal(nquad0,0.5*w1[i], &outarray[0]+i*nquad0+
1955 for(j = 0; j < nquad2; ++j)
1957 for(i = 0; i < nquad1; ++i)
1960 0.5*(1-z1[i])*w1[i],
1961 &outarray[0]+i*nquad0 + j*nquad0*nquad1,
1972 for(i = 0; i < nquad2; ++i)
1974 Blas::Dscal(nquad0*nquad1, 0.25*w2[i],
1975 &outarray[0]+i*nquad0*nquad1, 1);
1980 for(i = 0; i < nquad2; ++i)
1982 Blas::Dscal(nquad0*nquad1, 0.25*(1-z2[i])*w2[i],
1983 &outarray[0]+i*nquad0*nquad1, 1);
1987 for(i = 0; i < nquad2; ++i)
1989 Blas::Dscal(nquad0*nquad1,0.25*(1-z2[i])*(1-z2[i])*w2[i],
1990 &outarray[0]+i*nquad0*nquad1,1);
2007 int qa =
m_base[0]->GetNumPoints();
2008 int qb =
m_base[1]->GetNumPoints();
2009 int qc =
m_base[2]->GetNumPoints();
2010 int nmodes_a =
m_base[0]->GetNumModes();
2011 int nmodes_b =
m_base[1]->GetNumModes();
2012 int nmodes_c =
m_base[2]->GetNumModes();
2037 int cutoff_a = (int) (SVVCutOff*nmodes_a);
2038 int cutoff_b = (int) (SVVCutOff*nmodes_b);
2039 int cutoff_c = (int) (SVVCutOff*nmodes_c);
2040 int nmodes = min(min(nmodes_a,nmodes_b),nmodes_c);
2041 NekDouble cutoff = min(min(cutoff_a,cutoff_b),cutoff_c);
2045 OrthoExp.
FwdTrans(array,orthocoeffs);
2048 for(i = 0; i < nmodes_a; ++i)
2050 for(j = 0; j < nmodes_b-i; ++j)
2052 for(k = 0; k < nmodes_c-i-j; ++k)
2054 if(i + j + k >= cutoff)
2056 orthocoeffs[cnt] *= ((SvvDiffCoeff)*exp(-(i+j+k-nmodes)*(i+j+k-nmodes)/((
NekDouble)((i+j+k-cutoff+epsilon)*(i+j+k-cutoff+epsilon)))));
2060 orthocoeffs[cnt] *= 0.0;
2067 OrthoExp.
BwdTrans(orthocoeffs,array);
2076 int nquad0 =
m_base[0]->GetNumPoints();
2077 int nquad1 =
m_base[1]->GetNumPoints();
2078 int nquad2 =
m_base[2]->GetNumPoints();
2079 int nqtot = nquad0 * nquad1 * nquad2;
2080 int nmodes0 =
m_base[0]->GetNumModes();
2081 int nmodes1 =
m_base[1]->GetNumModes();
2082 int nmodes2 =
m_base[2]->GetNumModes();
2083 int numMax = nmodes0;
2111 OrthoTetExp->FwdTrans(phys_tmp, coeff);
2117 for (
int u = 0; u < numMin; ++u)
2119 for (
int i = 0; i < numMin-u; ++i)
2122 tmp2 = coeff_tmp1 + cnt, 1);
2123 cnt += numMax - u - i;
2125 for (
int i = numMin; i < numMax-u; ++i)
2127 cnt += numMax - u - i;
2131 OrthoTetExp->BwdTrans(coeff_tmp1,phys_tmp);
2140 int np0 =
m_base[0]->GetNumPoints();
2141 int np1 =
m_base[1]->GetNumPoints();
2142 int np2 =
m_base[2]->GetNumPoints();
2143 int np = max(np0,max(np1,np2));
2155 for(
int i = 0; i < np-1; ++i)
2157 planep1 += (np-i)*(np-i+1)/2;
2162 for(
int j = 0; j < np-i-1; ++j)
2166 for(
int k = 0; k < np-i-j-2; ++k)
2168 conn[cnt++] = plane + row +k+1;
2169 conn[cnt++] = plane + row +k;
2170 conn[cnt++] = plane + rowp1 +k;
2171 conn[cnt++] = planep1 + row1 +k;
2173 conn[cnt++] = plane + row +k+1;
2174 conn[cnt++] = plane + rowp1 +k+1;
2175 conn[cnt++] = planep1 + row1 +k+1;
2176 conn[cnt++] = planep1 + row1 +k;
2178 conn[cnt++] = plane + rowp1 +k+1;
2179 conn[cnt++] = plane + row +k+1;
2180 conn[cnt++] = plane + rowp1 +k;
2181 conn[cnt++] = planep1 + row1 +k;
2183 conn[cnt++] = planep1 + row1 +k;
2184 conn[cnt++] = planep1 + row1p1+k;
2185 conn[cnt++] = plane + rowp1 +k;
2186 conn[cnt++] = plane + rowp1 +k+1;
2188 conn[cnt++] = planep1 + row1 +k;
2189 conn[cnt++] = planep1 + row1p1+k;
2190 conn[cnt++] = planep1 + row1 +k+1;
2191 conn[cnt++] = plane + rowp1 +k+1;
2195 conn[cnt++] = plane + rowp1 +k+1;
2196 conn[cnt++] = planep1 + row1p1 +k+1;
2197 conn[cnt++] = planep1 + row1 +k+1;
2198 conn[cnt++] = planep1 + row1p1 +k;
2202 conn[cnt++] = plane + row + np-i-j-1;
2203 conn[cnt++] = plane + row + np-i-j-2;
2204 conn[cnt++] = plane + rowp1 + np-i-j-2;
2205 conn[cnt++] = planep1 + row1 + np-i-j-2;
2210 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_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...