49 StdHexExp::StdHexExp()
57 StdExpansion(Ba.GetNumModes()*Bb.GetNumModes()*Bc.GetNumModes(), 3,
145 ASSERTL1(
false,
"input dir is out of range");
194 "Basis[1] is not a general tensor type");
198 "Basis[2] is not a general tensor type");
201 &&
m_base[2]->Collocation())
206 inarray, 1, outarray, 1);
228 inarray,outarray,wsp,
true,
true,
true);
252 bool doCheckCollDir0,
253 bool doCheckCollDir1,
254 bool doCheckCollDir2)
256 int nquad0 =
m_base[0]->GetNumPoints();
257 int nquad1 =
m_base[1]->GetNumPoints();
258 int nquad2 =
m_base[2]->GetNumPoints();
259 int nmodes0 =
m_base[0]->GetNumModes();
260 int nmodes1 =
m_base[1]->GetNumModes();
261 int nmodes2 =
m_base[2]->GetNumModes();
264 bool colldir0 = doCheckCollDir0?(
m_base[0]->Collocation()):
false;
265 bool colldir1 = doCheckCollDir1?(
m_base[1]->Collocation()):
false;
266 bool colldir2 = doCheckCollDir2?(
m_base[2]->Collocation()):
false;
270 if(colldir0 && colldir1 && colldir2)
277 ASSERTL1(wsp.num_elements()>=nquad0*nmodes2*(nmodes1+nquad1),
278 "Workspace size is not sufficient");
284 Blas::Dgemm(
'T',
'T', nmodes1*nmodes2, nquad0, nmodes0,
285 1.0, &inarray[0], nmodes0,
287 0.0, &wsp[0], nmodes1*nmodes2);
288 Blas::Dgemm(
'T',
'T', nquad0*nmodes2, nquad1, nmodes1,
289 1.0, &wsp[0], nmodes1,
291 0.0, &wsp2[0], nquad0*nmodes2);
292 Blas::Dgemm(
'T',
'T', nquad0*nquad1, nquad2, nmodes2,
293 1.0, &wsp2[0], nmodes2,
295 0.0, &outarray[0], nquad0*nquad1);
315 if( (
m_base[0]->Collocation())
316 &&(
m_base[1]->Collocation())
317 &&(
m_base[2]->Collocation()) )
374 if(
m_base[0]->Collocation() &&
375 m_base[1]->Collocation() &&
396 Blas::Dgemv(
'N',
m_ncoeffs,nq,1.0,iprodmat->GetPtr().get(),
397 m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
406 bool multiplybyweights)
408 int nquad0 =
m_base[0]->GetNumPoints();
409 int nquad1 =
m_base[1]->GetNumPoints();
410 int nquad2 =
m_base[2]->GetNumPoints();
411 int order0 =
m_base[0]->GetNumModes();
412 int order1 =
m_base[1]->GetNumModes();
415 order0*order1*nquad2);
417 if(multiplybyweights)
425 tmp,outarray,wsp,
true,
true,
true);
432 inarray,outarray,wsp,
true,
true,
true);
447 bool doCheckCollDir0,
448 bool doCheckCollDir1,
449 bool doCheckCollDir2)
451 int nquad0 =
m_base[0]->GetNumPoints();
452 int nquad1 =
m_base[1]->GetNumPoints();
453 int nquad2 =
m_base[2]->GetNumPoints();
454 int nmodes0 =
m_base[0]->GetNumModes();
455 int nmodes1 =
m_base[1]->GetNumModes();
456 int nmodes2 =
m_base[2]->GetNumModes();
458 bool colldir0 = doCheckCollDir0?(
m_base[0]->Collocation()):
false;
459 bool colldir1 = doCheckCollDir1?(
m_base[1]->Collocation()):
false;
460 bool colldir2 = doCheckCollDir2?(
m_base[2]->Collocation()):
false;
462 if(colldir0 && colldir1 && colldir2)
468 ASSERTL1(wsp.num_elements() >= nmodes0*nquad2*(nquad1+nmodes1),
469 "Insufficient workspace size");
478 for(
int n = 0; n < nmodes0; ++n)
481 tmp0.get()+nquad1*nquad2*n,1);
486 Blas::Dgemm(
'T',
'N', nquad1*nquad2, nmodes0, nquad0,
487 1.0, inarray.get(), nquad0,
489 0.0, tmp0.get(), nquad1*nquad2);
495 for(
int n = 0; n < nmodes1; ++n)
498 tmp1.get()+nquad2*nmodes0*n,1);
503 Blas::Dgemm(
'T',
'N', nquad2*nmodes0, nmodes1, nquad1,
504 1.0, tmp0.get(), nquad1,
506 0.0, tmp1.get(), nquad2*nmodes0);
512 for(
int n = 0; n < nmodes2; ++n)
515 outarray.get()+nmodes0*nmodes1*n,1);
520 Blas::Dgemm(
'T',
'N', nmodes0*nmodes1, nmodes2, nquad2,
521 1.0, tmp1.get(), nquad2,
523 0.0, outarray.get(), nmodes0*nmodes1);
540 ASSERTL0((dir==0)||(dir==1)||(dir==2),
"input dir is out of range");
561 Blas::Dgemv(
'N',
m_ncoeffs,nq,1.0,iprodmat->GetPtr().get(),
562 m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
570 ASSERTL0((dir==0)||(dir==1)||(dir==2),
"input dir is out of range");
572 int nquad1 =
m_base[1]->GetNumPoints();
573 int nquad2 =
m_base[2]->GetNumPoints();
574 int order0 =
m_base[0]->GetNumModes();
575 int order1 =
m_base[1]->GetNumModes();
579 if (outarray.num_elements() < inarray.num_elements())
632 int nquad0 =
m_base[0]->GetNumPoints();
633 int nquad1 =
m_base[1]->GetNumPoints();
634 int nquad2 =
m_base[2]->GetNumPoints();
640 int btmp0 =
m_base[0]->GetNumModes();
641 int btmp1 =
m_base[1]->GetNumModes();
642 int mode2 = mode/(btmp0*btmp1);
643 int mode1 = (mode-mode2*btmp0*btmp1)/btmp0;
644 int mode0 = (mode-mode2*btmp0*btmp1)%btmp0;
646 ASSERTL2(mode2 == (
int)floor((1.0*mode)/(btmp0*btmp1)),
647 "Integer Truncation not Equiv to Floor");
648 ASSERTL2(mode1 == (
int)floor((1.0*mode-mode2*btmp0*btmp1)
650 "Integer Truncation not Equiv to Floor");
652 "calling argument mode is larger than total expansion "
655 for(i = 0; i < nquad1*nquad2; ++i)
658 &outarray[0]+i*nquad0, 1);
661 for(j = 0; j < nquad2; ++j)
663 for(i = 0; i < nquad0; ++i)
666 &outarray[0]+i+j*nquad0*nquad1, nquad0,
667 &outarray[0]+i+j*nquad0*nquad1, nquad0);
671 for(i = 0; i < nquad2; i++)
673 Blas::Dscal(nquad0*nquad1,base2[mode2*nquad2+i],
674 &outarray[0]+i*nquad0*nquad1,1);
707 "BasisType is not a boundary interior form");
710 "BasisType is not a boundary interior form");
713 "BasisType is not a boundary interior form");
715 int nmodes0 =
m_base[0]->GetNumModes();
716 int nmodes1 =
m_base[1]->GetNumModes();
717 int nmodes2 =
m_base[2]->GetNumModes();
719 return ( 2*( nmodes0*nmodes1 + nmodes0*nmodes2
721 - 4*( nmodes0 + nmodes1 + nmodes2 ) + 8 );
728 "BasisType is not a boundary interior form");
731 "BasisType is not a boundary interior form");
734 "BasisType is not a boundary interior form");
736 int nmodes0 =
m_base[0]->GetNumModes();
737 int nmodes1 =
m_base[1]->GetNumModes();
738 int nmodes2 =
m_base[2]->GetNumModes();
740 return 2*( nmodes0*nmodes1 + nmodes0*nmodes2
746 ASSERTL2((i >= 0)&&(i <= 11),
"edge id is out of range");
748 if((i == 0)||(i == 2)||(i == 8)||(i == 10))
752 else if((i == 1)||(i == 3)||(i == 9)||(i == 11))
770 ASSERTL2((i >= 0) && (i <= 5),
"face id is out of range");
771 if((i == 0) || (i == 5))
775 else if((i == 1) || (i == 3))
788 ASSERTL2((i >= 0) && (i <= 5),
"face id is out of range");
789 if((i == 0) || (i == 5))
793 else if((i == 1) || (i == 3))
813 ASSERTL2(i >= 0 && i <= 5,
"face id is out of range");
815 if (i == 0 || i == 5)
817 return m_base[0]->GetNumPoints()*
818 m_base[1]->GetNumPoints();
820 else if (i == 1 || i == 3)
822 return m_base[0]->GetNumPoints()*
823 m_base[2]->GetNumPoints();
827 return m_base[1]->GetNumPoints()*
828 m_base[2]->GetNumPoints();
833 const int i,
const int j)
const
835 ASSERTL2(i >= 0 && i <= 5,
"face id is out of range");
836 ASSERTL2(j == 0 || j == 1,
"face direction is out of range");
838 if (i == 0 || i == 5)
840 return m_base[j]->GetPointsKey();
842 else if (i == 1 || i == 3)
844 return m_base[2*j]->GetPointsKey();
848 return m_base[j+1]->GetPointsKey();
854 int nmodes = nummodes[modes_offset]*nummodes[modes_offset+1]*nummodes[modes_offset+2];
862 const int i,
const int k)
const
864 ASSERTL2(i >= 0 && i <= 5,
"face id is out of range");
865 ASSERTL2(k >= 0 && k <= 1,
"basis key id is out of range");
887 m_base[dir]->GetNumModes());
892 ASSERTL2((i >= 0)&&(i <= 11),
"edge id is out of range");
894 if((i == 0)||(i == 2)||(i==8)||(i==10))
898 else if((i == 1)||(i == 3)||(i == 9)||(i == 11))
921 for(
int k = 0; k < Qz; ++k ) {
922 for(
int j = 0; j < Qy; ++j ) {
923 for(
int i = 0; i < Qx; ++i ) {
924 int s = i + Qx*(j + Qy*k);
940 int nummodes [3] = {
m_base[0]->GetNumModes(),
942 m_base[2]->GetNumModes()};
948 numModes0 = nummodes[0];
949 numModes1 = nummodes[1];
955 numModes0 = nummodes[0];
956 numModes1 = nummodes[2];
962 numModes0 = nummodes[1];
963 numModes1 = nummodes[2];
973 if ( faceOrient >= 9 )
975 std::swap(numModes0, numModes1);
991 int nummodesA=0, nummodesB=0;
995 "Method only implemented if BasisType is indentical in "
999 "Method only implemented for Modified_A or GLL_Lagrange BasisType");
1001 const int nummodes0 =
m_base[0]->GetNumModes();
1002 const int nummodes1 =
m_base[1]->GetNumModes();
1003 const int nummodes2 =
m_base[2]->GetNumModes();
1009 nummodesA = nummodes0;
1010 nummodesB = nummodes1;
1014 nummodesA = nummodes0;
1015 nummodesB = nummodes2;
1019 nummodesA = nummodes1;
1020 nummodesB = nummodes2;
1024 bool CheckForZeroedModes =
false;
1032 if((P != nummodesA)||(Q != nummodesB))
1034 CheckForZeroedModes =
true;
1038 int nFaceCoeffs = P*Q;
1040 if(maparray.num_elements() != nFaceCoeffs)
1045 if(signarray.num_elements() != nFaceCoeffs)
1051 fill( signarray.get() , signarray.get()+nFaceCoeffs, 1 );
1056 for(i = 0; i < Q; i++)
1058 for(j = 0; j <
P; j++)
1060 if( faceOrient < 9 )
1062 arrayindx[i*P+j] = i*P+j;
1066 arrayindx[i*P+j] = j*Q+i;
1081 offset = nummodes0*nummodes1;
1085 offset = (nummodes2-1)*nummodes0*nummodes1;
1102 offset = nummodes0*(nummodes1-1);
1103 jump1 = nummodes0*nummodes1;
1108 jump1 = nummodes0*nummodes1;
1119 offset = nummodes0-1;
1120 jump1 = nummodes0*nummodes1;
1127 jump1 = nummodes0*nummodes1;
1132 ASSERTL0(
false,
"fid must be between 0 and 5");
1135 for(i = 0; i < Q; i++)
1137 for(j = 0; j <
P; j++)
1139 maparray[ arrayindx[i*P+j] ]
1140 = i*jump1 + j*jump2 + offset;
1145 if(CheckForZeroedModes)
1151 for(i = 0; i < nummodesB; i++)
1153 for(j = nummodesA; j <
P; j++)
1155 signarray[arrayindx[i*P+j]] = 0.0;
1156 maparray[arrayindx[i*P+j]] = maparray[0];
1160 for(i = nummodesB; i < Q; i++)
1162 for(j = 0; j <
P; j++)
1164 signarray[arrayindx[i*P+j]] = 0.0;
1165 maparray[arrayindx[i*P+j]] = maparray[0];
1171 ASSERTL0(
false,
"Different trace space face dimention and element face dimention not possible for GLL-Lagrange bases");
1175 if( (faceOrient==6) || (faceOrient==8) ||
1176 (faceOrient==11) || (faceOrient==12) )
1182 for(i = 3; i < Q; i+=2)
1184 for(j = 0; j <
P; j++)
1186 signarray[ arrayindx[i*P+j] ] *= -1;
1190 for(i = 0; i <
P; i++)
1192 swap( maparray[i] , maparray[i+P] );
1193 swap( signarray[i] , signarray[i+P] );
1199 for(i = 0; i <
P; i++)
1201 for(j = 0; j < Q/2; j++)
1203 swap( maparray[i + j*P],
1206 swap( signarray[i + j*P],
1217 for(i = 0; i < Q; i++)
1219 for(j = 3; j <
P; j+=2)
1221 signarray[ arrayindx[i*P+j] ] *= -1;
1225 for(i = 0; i < Q; i++)
1227 swap( maparray[i] , maparray[i+Q] );
1228 swap( signarray[i] , signarray[i+Q] );
1234 for(i = 0; i <
P; i++)
1236 for(j = 0; j < Q/2; j++)
1238 swap( maparray[i*Q + j],
1239 maparray[i*Q + Q -1 -j]);
1240 swap( signarray[i*Q + j],
1241 signarray[i*Q + Q -1 -j]);
1248 if( (faceOrient==7) || (faceOrient==8) ||
1249 (faceOrient==10) || (faceOrient==12) )
1255 for(i = 0; i < Q; i++)
1257 for(j = 3; j <
P; j+=2)
1259 signarray[ arrayindx[i*P+j] ] *= -1;
1263 for(i = 0; i < Q; i++)
1265 swap( maparray[i*P],
1267 swap( signarray[i*P],
1273 for(i = 0; i < Q; i++)
1275 for(j = 0; j < P/2; j++)
1277 swap( maparray[i*P + j],
1278 maparray[i*P + P -1 -j]);
1279 swap( signarray[i*P + j],
1280 signarray[i*P + P -1 -j]);
1292 for(i = 3; i < Q; i+=2)
1294 for(j = 0; j <
P; j++)
1296 signarray[ arrayindx[i*P+j] ] *= -1;
1300 for(i = 0; i <
P; i++)
1302 swap( maparray[i*Q],
1304 swap( signarray[i*Q],
1310 for(i = 0; i < Q; i++)
1312 for(j = 0; j < P/2; j++)
1314 swap( maparray[i + j*Q] ,
1315 maparray[i+P*Q - Q -j*Q] );
1316 swap( signarray[i + j*Q] ,
1317 signarray[i+P*Q - Q -j*Q] );
1338 "BasisType is not a boundary interior form");
1341 "BasisType is not a boundary interior form");
1344 "BasisType is not a boundary interior form");
1346 ASSERTL1((localVertexId>=0)&&(localVertexId<8),
1347 "local vertex id must be between 0 and 7");
1354 int nummodes [3] = {
m_base[0]->GetNumModes(),
1355 m_base[1]->GetNumModes(),
1356 m_base[2]->GetNumModes()};
1358 if(useCoeffPacking ==
true)
1360 if(localVertexId > 3)
1372 switch(localVertexId % 4)
1419 if( (localVertexId % 4) % 3 > 0 )
1432 if( localVertexId % 4 > 1 )
1445 if( localVertexId > 3)
1458 return r*nummodes[0]*nummodes[1] + q*nummodes[0] +
p;
1475 "BasisType is not a boundary interior form");
1478 "BasisType is not a boundary interior form");
1481 "BasisType is not a boundary interior form");
1484 "local edge id must be between 0 and 11");
1488 if(maparray.num_elements()!=nEdgeIntCoeffs)
1493 if(signarray.num_elements() != nEdgeIntCoeffs)
1499 fill( signarray.get() , signarray.get()+nEdgeIntCoeffs, 1 );
1502 int nummodes [3] = {
m_base[0]->GetNumModes(),
1503 m_base[1]->GetNumModes(),
1504 m_base[2]->GetNumModes()};
1510 bool reverseOrdering =
false;
1511 bool signChange =
false;
1513 int IdxRange [3][2] = {{0,0},{0,0},{0,0}};
1533 IdxRange[2][0] = nummodes[2] - 1;
1534 IdxRange[2][1] = nummodes[2];
1551 IdxRange[2][1] = nummodes[2] - 1;
1555 reverseOrdering =
true;
1561 IdxRange[2][1] = nummodes[2];
1590 IdxRange[1][0] = nummodes[1] - 1;
1591 IdxRange[1][1] = nummodes[1];
1606 IdxRange[1][1] = nummodes[1] - 1;
1610 reverseOrdering =
true;
1616 IdxRange[1][1] = nummodes[1];
1631 IdxRange[1][1] = nummodes[1] - 1;
1635 reverseOrdering =
true;
1641 IdxRange[1][1] = nummodes[1];
1670 IdxRange[0][0] = nummodes[0] - 1;
1671 IdxRange[0][1] = nummodes[0];
1686 IdxRange[0][1] = nummodes[0] - 1;
1690 reverseOrdering =
true;
1696 IdxRange[0][1] = nummodes[0];
1711 IdxRange[0][1] = nummodes[0] - 1;
1715 reverseOrdering =
true;
1721 IdxRange[0][1] = nummodes[0];
1735 for(r = IdxRange[2][0]; r < IdxRange[2][1]; r++)
1737 for(q = IdxRange[1][0]; q < IdxRange[1][1]; q++)
1739 for(p = IdxRange[0][0]; p < IdxRange[0][1]; p++)
1742 = r*nummodes[0]*nummodes[1] + q*nummodes[0] +
p;
1747 if( reverseOrdering )
1749 reverse( maparray.get() , maparray.get()+nEdgeIntCoeffs );
1754 for(p = 1; p < nEdgeIntCoeffs; p+=2)
1773 "BasisType is not a boundary interior form");
1776 "BasisType is not a boundary interior form");
1779 "BasisType is not a boundary interior form");
1782 "local face id must be between 0 and 5");
1786 if(maparray.num_elements()!=nFaceIntCoeffs)
1791 if(signarray.num_elements() != nFaceIntCoeffs)
1797 fill( signarray.get() , signarray.get()+nFaceIntCoeffs, 1 );
1800 int nummodes [3] = {
m_base[0]->GetNumModes(),
1801 m_base[1]->GetNumModes(),
1802 m_base[2]->GetNumModes()};
1818 nummodesA = nummodes[0];
1819 nummodesB = nummodes[1];
1825 nummodesA = nummodes[0];
1826 nummodesB = nummodes[2];
1832 nummodesA = nummodes[1];
1833 nummodesB = nummodes[2];
1842 for(i = 0; i < (nummodesB-2); i++)
1844 for(j = 0; j < (nummodesA-2); j++)
1846 if( faceOrient < 9 )
1848 arrayindx[i*(nummodesA-2)+j] = i*(nummodesA-2)+j;
1852 arrayindx[i*(nummodesA-2)+j] = j*(nummodesB-2)+i;
1857 int IdxRange [3][2];
1879 IdxRange[2][0] = nummodes[2] - 1;
1880 IdxRange[2][1] = nummodes[2];
1896 if( (((
int) faceOrient)-5) % 2 )
1898 IdxRange[2][0] = nummodes[2] - 2;
1906 IdxRange[2][1] = nummodes[2] - 1;
1913 IdxRange[2][1] = nummodes[2];
1916 if( (((
int) faceOrient)-5) % 2 )
1918 for(i = 3; i < nummodes[2]; i+=2)
1942 IdxRange[1][0] = nummodes[1] - 1;
1943 IdxRange[1][1] = nummodes[1];
1959 if( (((
int) faceOrient)-5) % 2 )
1961 IdxRange[1][0] = nummodes[1] - 2;
1969 IdxRange[1][1] = nummodes[1] - 1;
1976 IdxRange[1][1] = nummodes[1];
1979 if( (((
int) faceOrient)-5) % 2 )
1981 for(i = 3; i < nummodes[1]; i+=2)
1993 if( (((
int) faceOrient)-5) % 4 > 1 )
1995 IdxRange[1][0] = nummodes[1] - 2;
2003 IdxRange[1][1] = nummodes[1] - 1;
2010 IdxRange[1][1] = nummodes[1];
2013 if( (((
int) faceOrient)-5) % 4 > 1 )
2015 for(i = 3; i < nummodes[1]; i+=2)
2037 IdxRange[0][0] = nummodes[0] - 1;
2038 IdxRange[0][1] = nummodes[0];
2053 if( (((
int) faceOrient)-5) % 4 > 1 )
2055 IdxRange[0][0] = nummodes[0] - 2;
2063 IdxRange[0][1] = nummodes[0] - 1;
2070 IdxRange[0][1] = nummodes[0];
2073 if( (((
int) faceOrient)-5) % 4 > 1 )
2075 for(i = 3; i < nummodes[0]; i+=2)
2087 for(r = IdxRange[2][0]; r != IdxRange[2][1]; r+=Incr[2])
2089 for(q = IdxRange[1][0]; q != IdxRange[1][1]; q+=Incr[1])
2091 for(p = IdxRange[0][0]; p != IdxRange[0][1]; p+=Incr[0])
2093 maparray [ arrayindx[cnt ] ]
2094 = r*nummodes[0]*nummodes[1] + q*nummodes[0] +
p;
2095 signarray[ arrayindx[cnt++] ]
2096 = sign0[
p] * sign1[q] * sign2[r];
2110 "BasisType is not a boundary interior form");
2113 "BasisType is not a boundary interior form");
2116 "BasisType is not a boundary interior form");
2119 int nummodes [3] = {
m_base[0]->GetNumModes(),
2120 m_base[1]->GetNumModes(),
2121 m_base[2]->GetNumModes()};
2125 if(outarray.num_elements() != nIntCoeffs)
2139 for(i = 0; i < 3; i++)
2144 IntIdx[i][1] = nummodes[i];
2149 IntIdx[i][1] = nummodes[i]-1;
2153 for(r = IntIdx[2][0]; r < IntIdx[2][1]; r++)
2155 for( q = IntIdx[1][0]; q < IntIdx[1][1]; q++)
2157 for( p = IntIdx[0][0]; p < IntIdx[0][1]; p++)
2159 outarray[cnt++] = r*nummodes[0]*nummodes[1] +
2174 "BasisType is not a boundary interior form");
2177 "BasisType is not a boundary interior form");
2180 "BasisType is not a boundary interior form");
2183 int nummodes [3] = {
m_base[0]->GetNumModes(),
2184 m_base[1]->GetNumModes(),
2185 m_base[2]->GetNumModes()};
2189 if(outarray.num_elements()!=nBndCoeffs)
2204 for(i = 0; i < 3; i++)
2212 IntIdx[i][1] = nummodes[i];
2216 BndIdx[i][1] = nummodes[i]-1;
2218 IntIdx[i][1] = nummodes[i]-1;
2223 for(i = 0; i < 2; i++)
2226 for( q = 0; q < nummodes[1]; q++)
2228 for( p = 0; p < nummodes[0]; p++)
2230 outarray[cnt++] = r*nummodes[0]*nummodes[1]+q*nummodes[0] +
p;
2235 for(r = IntIdx[2][0]; r < IntIdx[2][1]; r++)
2237 for( i = 0; i < 2; i++)
2240 for( p = 0; p < nummodes[0]; p++)
2242 outarray[cnt++] = r*nummodes[0]*nummodes[1] +
2247 for( q = IntIdx[1][0]; q < IntIdx[1][1]; q++)
2249 for( i = 0; i < 2; i++)
2252 outarray[cnt++] = r*nummodes[0]*nummodes[1] +
2258 sort(outarray.get(), outarray.get() + nBndCoeffs);
2326 if(inarray.get() == outarray.get())
2332 m_ncoeffs, tmp.get(), 1, 0.0, outarray.get(), 1);
2337 m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
2346 int nquad0 =
m_base[0]->GetNumPoints();
2347 int nquad1 =
m_base[1]->GetNumPoints();
2348 int nquad2 =
m_base[2]->GetNumPoints();
2349 int nq01 = nquad0*nquad1;
2350 int nq12 = nquad1*nquad2;
2356 for(i = 0; i < nq12; ++i)
2359 w0.get(), 1, outarray.get()+i*nquad0,1);
2362 for(i = 0; i < nq12; ++i)
2364 Vmath::Smul(nquad0, w1[i%nquad1], outarray.get()+i*nquad0, 1,
2365 outarray.get()+i*nquad0, 1);
2368 for(i = 0; i < nquad2; ++i)
2370 Vmath::Smul(nq01, w2[i], outarray.get()+i*nq01, 1,
2371 outarray.get()+i*nq01, 1);
2379 int qa =
m_base[0]->GetNumPoints();
2380 int qb =
m_base[1]->GetNumPoints();
2381 int qc =
m_base[2]->GetNumPoints();
2382 int nmodes_a =
m_base[0]->GetNumModes();
2383 int nmodes_b =
m_base[1]->GetNumModes();
2384 int nmodes_c =
m_base[2]->GetNumModes();
2402 OrthoExp.
FwdTrans(array,orthocoeffs);
2406 int nmodes = max(nmodes_a,nmodes_b);
2407 nmodes = max(nmodes,nmodes_c);
2410 for(j = cutoff; j < nmodes; ++j)
2412 fac[j] = fabs((j-nmodes)/((
NekDouble) (j-cutoff+1.0)));
2416 for(i = 0; i < nmodes_a; ++i)
2418 for(j = 0; j < nmodes_b; ++j)
2420 for(k = 0; k < nmodes_c; ++k)
2422 if((i >= cutoff)||(j >= cutoff)||(k >= cutoff))
2424 orthocoeffs[i*nmodes_a*nmodes_b + j*nmodes_c + k] *= (SvvDiffCoeff*exp( -(fac[i]+fac[j]+fac[k]) ));
2428 orthocoeffs[i*nmodes_a*nmodes_b + j*nmodes_c + k] *= 0.0;
2435 OrthoExp.
BwdTrans(orthocoeffs,array);
virtual void v_GetInteriorMap(Array< OneD, unsigned int > &outarray)
virtual LibUtilities::PointsKey v_GetFacePointsKey(const int i, const int j) const
virtual void v_LocCoordToLocCollapsed(const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta)
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
virtual int v_GetEdgeNcoeffs(const int i) const
virtual DNekMatSharedPtr v_GenMatrix(const StdMatrixKey &mkey)
NekDouble GetConstFactor(const ConstFactorType &factor) const
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_x, Array< OneD, NekDouble > &coords_y, Array< OneD, NekDouble > &coords_z)
#define ASSERTL0(condition, msg)
virtual void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual int v_NumBndryCoeffs() const
virtual void v_IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Principle Modified Functions .
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_LaplacianMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
int GetBasisNumModes(const int dir) const
This function returns the number of expansion modes in the dir direction.
void IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual int v_GetNedges() const
void MultiplyByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual LibUtilities::BasisType v_GetEdgeBasisType(const int i) const
virtual const LibUtilities::BasisKey v_DetFaceBasisKey(const int i, const int k) const
void IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
this function calculates the inner product of a given function f with the different modes of the expa...
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void LaplacianMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual void v_FillMode(const int mode, Array< OneD, NekDouble > &outarray)
int GetNumPoints(const int dir) const
This function returns the number of quadrature points in the dir direction.
virtual void v_GetBoundaryMap(Array< OneD, unsigned int > &outarray)
Principle Modified Functions .
virtual int v_CalcNumberOfCoefficients(const std::vector< unsigned int > &nummodes, int &modes_offset)
virtual void v_FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_GetFaceNumModes(const int fid, const Orientation faceOrient, int &numModes0, int &numModes1)
virtual int v_GetFaceNcoeffs(const int i) const
virtual void v_MassMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual void v_WeakDerivMatrixOp(const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
int GetEdgeNcoeffs(const int i) const
This function returns the number of expansion coefficients belonging to the i-th edge.
virtual bool v_IsBoundaryInteriorExpansion()
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)
boost::shared_ptr< DNekMat > DNekMatSharedPtr
virtual void v_GeneralMatrixOp_MatOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void PhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
virtual int v_GetNfaces() const
DNekMatSharedPtr GetStdMatrix(const StdMatrixKey &mkey)
Principle Orthogonal Functions .
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
virtual int v_GetFaceNumPoints(const int i) const
int NumBndryCoeffs(void) const
LibUtilities::BasisType GetEdgeBasisType(const int i) const
This function returns the type of expansion basis on the i-th edge.
virtual void v_IProductWRTDerivBase_MatOp(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
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 void v_MultiplyByStdQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_GetEdgeInteriorMap(const int eid, const Orientation edgeOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray)
The base class for all shapes.
virtual int v_GetTotalEdgeIntNcoeffs() const
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)
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
int GetFaceIntNcoeffs(const int i) const
LibUtilities::BasisKey EvaluateQuadFaceBasisKey(const int facedir, const LibUtilities::BasisType faceDirBasisType, const int numpoints, const int nummodes)
virtual void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
Principle Modified Functions .
Class representing a hexehedral element in reference space.
void WeakDerivMatrixOp_MatFree(const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
Principle Orthogonal Functions .
virtual void v_IProductWRTBase_MatOp(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.
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)
virtual void v_BwdTrans_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual int v_GetVertexMap(int localVertexId, bool useCoeffPacking=false)
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
virtual void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdMatrixKey &mkey)
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_GetTotalFaceIntNcoeffs() const
virtual void v_BwdTrans(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)
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
void MassMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
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 LibUtilities::ShapeType v_DetShapeType() const
int GetNcoeffs(void) const
This function returns the total number of coefficients used in the expansion.
LibUtilities::NekManager< StdMatrixKey, DNekMat, StdMatrixKey::opLess > m_stdMatrixManager
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)
Differentiation Methods.
virtual int v_GetFaceIntNcoeffs(const int i) const
virtual void v_GetFaceInteriorMap(const int fid, const Orientation faceOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray)
LibUtilities::PointsType GetPointsType(const int dir) const
This function returns the type of quadrature points used in the dir direction.
virtual void v_HelmholtzMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Array< OneD, LibUtilities::BasisSharedPtr > m_base
virtual DNekMatSharedPtr v_CreateStdMatrix(const StdMatrixKey &mkey)
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
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)
virtual int v_GetNverts() const
virtual void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multbyweights=true)
Describes the specification for a Basis.
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.
void BwdTrans_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function performs the Forward transformation from physical space to coefficient space...
virtual int v_NumDGBndryCoeffs() const