49 StdHexExp::StdHexExp()
57 StdExpansion(Ba.GetNumModes()*Bb.GetNumModes()*Bc.GetNumModes(), 3,
141 ASSERTL1(
false,
"input dir is out of range");
190 "Basis[1] is not a general tensor type");
194 "Basis[2] is not a general tensor type");
197 &&
m_base[2]->Collocation())
202 inarray, 1, outarray, 1);
224 inarray,outarray,wsp,
true,
true,
true);
248 bool doCheckCollDir0,
249 bool doCheckCollDir1,
250 bool doCheckCollDir2)
252 int nquad0 =
m_base[0]->GetNumPoints();
253 int nquad1 =
m_base[1]->GetNumPoints();
254 int nquad2 =
m_base[2]->GetNumPoints();
255 int nmodes0 =
m_base[0]->GetNumModes();
256 int nmodes1 =
m_base[1]->GetNumModes();
257 int nmodes2 =
m_base[2]->GetNumModes();
260 bool colldir0 = doCheckCollDir0?(
m_base[0]->Collocation()):
false;
261 bool colldir1 = doCheckCollDir1?(
m_base[1]->Collocation()):
false;
262 bool colldir2 = doCheckCollDir2?(
m_base[2]->Collocation()):
false;
266 if(colldir0 && colldir1 && colldir2)
273 ASSERTL1(wsp.num_elements()>=nquad0*nmodes2*(nmodes1+nquad1),
274 "Workspace size is not sufficient");
280 Blas::Dgemm(
'T',
'T', nmodes1*nmodes2, nquad0, nmodes0,
281 1.0, &inarray[0], nmodes0,
283 0.0, &wsp[0], nmodes1*nmodes2);
284 Blas::Dgemm(
'T',
'T', nquad0*nmodes2, nquad1, nmodes1,
285 1.0, &wsp[0], nmodes1,
287 0.0, &wsp2[0], nquad0*nmodes2);
288 Blas::Dgemm(
'T',
'T', nquad0*nquad1, nquad2, nmodes2,
289 1.0, &wsp2[0], nmodes2,
291 0.0, &outarray[0], nquad0*nquad1);
311 if( (
m_base[0]->Collocation())
312 &&(
m_base[1]->Collocation())
313 &&(
m_base[2]->Collocation()) )
370 if(
m_base[0]->Collocation() &&
371 m_base[1]->Collocation() &&
392 Blas::Dgemv(
'N',
m_ncoeffs,nq,1.0,iprodmat->GetPtr().get(),
393 m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
402 bool multiplybyweights)
404 int nquad0 =
m_base[0]->GetNumPoints();
405 int nquad1 =
m_base[1]->GetNumPoints();
406 int nquad2 =
m_base[2]->GetNumPoints();
407 int order0 =
m_base[0]->GetNumModes();
408 int order1 =
m_base[1]->GetNumModes();
411 order0*order1*nquad2);
413 if(multiplybyweights)
421 tmp,outarray,wsp,
true,
true,
true);
428 inarray,outarray,wsp,
true,
true,
true);
443 bool doCheckCollDir0,
444 bool doCheckCollDir1,
445 bool doCheckCollDir2)
447 int nquad0 =
m_base[0]->GetNumPoints();
448 int nquad1 =
m_base[1]->GetNumPoints();
449 int nquad2 =
m_base[2]->GetNumPoints();
450 int nmodes0 =
m_base[0]->GetNumModes();
451 int nmodes1 =
m_base[1]->GetNumModes();
452 int nmodes2 =
m_base[2]->GetNumModes();
454 bool colldir0 = doCheckCollDir0?(
m_base[0]->Collocation()):
false;
455 bool colldir1 = doCheckCollDir1?(
m_base[1]->Collocation()):
false;
456 bool colldir2 = doCheckCollDir2?(
m_base[2]->Collocation()):
false;
458 if(colldir0 && colldir1 && colldir2)
464 ASSERTL1(wsp.num_elements() >= nmodes0*nquad2*(nquad1+nmodes1),
465 "Insufficient workspace size");
474 for(
int n = 0; n < nmodes0; ++n)
477 tmp0.get()+nquad1*nquad2*n,1);
482 Blas::Dgemm(
'T',
'N', nquad1*nquad2, nmodes0, nquad0,
483 1.0, inarray.get(), nquad0,
485 0.0, tmp0.get(), nquad1*nquad2);
491 for(
int n = 0; n < nmodes1; ++n)
494 tmp1.get()+nquad2*nmodes0*n,1);
499 Blas::Dgemm(
'T',
'N', nquad2*nmodes0, nmodes1, nquad1,
500 1.0, tmp0.get(), nquad1,
502 0.0, tmp1.get(), nquad2*nmodes0);
508 for(
int n = 0; n < nmodes2; ++n)
511 outarray.get()+nmodes0*nmodes1*n,1);
516 Blas::Dgemm(
'T',
'N', nmodes0*nmodes1, nmodes2, nquad2,
517 1.0, tmp1.get(), nquad2,
519 0.0, outarray.get(), nmodes0*nmodes1);
536 ASSERTL0((dir==0)||(dir==1)||(dir==2),
"input dir is out of range");
557 Blas::Dgemv(
'N',
m_ncoeffs,nq,1.0,iprodmat->GetPtr().get(),
558 m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
566 ASSERTL0((dir==0)||(dir==1)||(dir==2),
"input dir is out of range");
568 int nquad1 =
m_base[1]->GetNumPoints();
569 int nquad2 =
m_base[2]->GetNumPoints();
570 int order0 =
m_base[0]->GetNumModes();
571 int order1 =
m_base[1]->GetNumModes();
575 if (outarray.num_elements() < inarray.num_elements())
628 int nquad0 =
m_base[0]->GetNumPoints();
629 int nquad1 =
m_base[1]->GetNumPoints();
630 int nquad2 =
m_base[2]->GetNumPoints();
636 int btmp0 =
m_base[0]->GetNumModes();
637 int btmp1 =
m_base[1]->GetNumModes();
638 int mode2 = mode/(btmp0*btmp1);
639 int mode1 = (mode-mode2*btmp0*btmp1)/btmp0;
640 int mode0 = (mode-mode2*btmp0*btmp1)%btmp0;
642 ASSERTL2(mode2 == (
int)floor((1.0*mode)/(btmp0*btmp1)),
643 "Integer Truncation not Equiv to Floor");
644 ASSERTL2(mode1 == (
int)floor((1.0*mode-mode2*btmp0*btmp1)
646 "Integer Truncation not Equiv to Floor");
648 "calling argument mode is larger than total expansion "
651 for(i = 0; i < nquad1*nquad2; ++i)
654 &outarray[0]+i*nquad0, 1);
657 for(j = 0; j < nquad2; ++j)
659 for(i = 0; i < nquad0; ++i)
662 &outarray[0]+i+j*nquad0*nquad1, nquad0,
663 &outarray[0]+i+j*nquad0*nquad1, nquad0);
667 for(i = 0; i < nquad2; i++)
669 Blas::Dscal(nquad0*nquad1,base2[mode2*nquad2+i],
670 &outarray[0]+i*nquad0*nquad1,1);
703 "BasisType is not a boundary interior form");
706 "BasisType is not a boundary interior form");
709 "BasisType is not a boundary interior form");
711 int nmodes0 =
m_base[0]->GetNumModes();
712 int nmodes1 =
m_base[1]->GetNumModes();
713 int nmodes2 =
m_base[2]->GetNumModes();
715 return ( 2*( nmodes0*nmodes1 + nmodes0*nmodes2
717 - 4*( nmodes0 + nmodes1 + nmodes2 ) + 8 );
724 "BasisType is not a boundary interior form");
727 "BasisType is not a boundary interior form");
730 "BasisType is not a boundary interior form");
732 int nmodes0 =
m_base[0]->GetNumModes();
733 int nmodes1 =
m_base[1]->GetNumModes();
734 int nmodes2 =
m_base[2]->GetNumModes();
736 return 2*( nmodes0*nmodes1 + nmodes0*nmodes2
742 ASSERTL2((i >= 0)&&(i <= 11),
"edge id is out of range");
744 if((i == 0)||(i == 2)||(i == 8)||(i == 10))
748 else if((i == 1)||(i == 3)||(i == 9)||(i == 11))
766 ASSERTL2((i >= 0) && (i <= 5),
"face id is out of range");
767 if((i == 0) || (i == 5))
771 else if((i == 1) || (i == 3))
784 ASSERTL2((i >= 0) && (i <= 5),
"face id is out of range");
785 if((i == 0) || (i == 5))
789 else if((i == 1) || (i == 3))
809 ASSERTL2(i >= 0 && i <= 5,
"face id is out of range");
811 if (i == 0 || i == 5)
813 return m_base[0]->GetNumPoints()*
814 m_base[1]->GetNumPoints();
816 else if (i == 1 || i == 3)
818 return m_base[0]->GetNumPoints()*
819 m_base[2]->GetNumPoints();
823 return m_base[1]->GetNumPoints()*
824 m_base[2]->GetNumPoints();
829 const int i,
const int j)
const
831 ASSERTL2(i >= 0 && i <= 5,
"face id is out of range");
832 ASSERTL2(j == 0 || j == 1,
"face direction is out of range");
834 if (i == 0 || i == 5)
836 return m_base[j]->GetPointsKey();
838 else if (i == 1 || i == 3)
840 return m_base[2*j]->GetPointsKey();
844 return m_base[j+1]->GetPointsKey();
850 int nmodes = nummodes[modes_offset]*nummodes[modes_offset+1]*nummodes[modes_offset+2];
858 const int i,
const int k)
const
860 ASSERTL2(i >= 0 && i <= 5,
"face id is out of range");
861 ASSERTL2(k >= 0 && k <= 1,
"basis key id is out of range");
883 m_base[dir]->GetNumModes());
888 ASSERTL2((i >= 0)&&(i <= 11),
"edge id is out of range");
890 if((i == 0)||(i == 2)||(i==8)||(i==10))
894 else if((i == 1)||(i == 3)||(i == 9)||(i == 11))
917 for(
int k = 0; k < Qz; ++k ) {
918 for(
int j = 0; j < Qy; ++j ) {
919 for(
int i = 0; i < Qx; ++i ) {
920 int s = i + Qx*(j + Qy*k);
936 int nummodes [3] = {
m_base[0]->GetNumModes(),
938 m_base[2]->GetNumModes()};
944 numModes0 = nummodes[0];
945 numModes1 = nummodes[1];
951 numModes0 = nummodes[0];
952 numModes1 = nummodes[2];
958 numModes0 = nummodes[1];
959 numModes1 = nummodes[2];
969 if ( faceOrient >= 9 )
971 std::swap(numModes0, numModes1);
987 int nummodesA=0, nummodesB=0;
991 "Method only implemented if BasisType is indentical in "
995 "Method only implemented for Modified_A or GLL_Lagrange BasisType");
997 const int nummodes0 =
m_base[0]->GetNumModes();
998 const int nummodes1 =
m_base[1]->GetNumModes();
999 const int nummodes2 =
m_base[2]->GetNumModes();
1005 nummodesA = nummodes0;
1006 nummodesB = nummodes1;
1010 nummodesA = nummodes0;
1011 nummodesB = nummodes2;
1015 nummodesA = nummodes1;
1016 nummodesB = nummodes2;
1020 bool CheckForZeroedModes =
false;
1028 if((P != nummodesA)||(Q != nummodesB))
1030 CheckForZeroedModes =
true;
1034 int nFaceCoeffs = P*Q;
1036 if(maparray.num_elements() != nFaceCoeffs)
1041 if(signarray.num_elements() != nFaceCoeffs)
1047 fill( signarray.get() , signarray.get()+nFaceCoeffs, 1 );
1052 for(i = 0; i < Q; i++)
1054 for(j = 0; j <
P; j++)
1056 if( faceOrient < 9 )
1058 arrayindx[i*P+j] = i*P+j;
1062 arrayindx[i*P+j] = j*Q+i;
1077 offset = nummodes0*nummodes1;
1081 offset = (nummodes2-1)*nummodes0*nummodes1;
1098 offset = nummodes0*(nummodes1-1);
1099 jump1 = nummodes0*nummodes1;
1104 jump1 = nummodes0*nummodes1;
1115 offset = nummodes0-1;
1116 jump1 = nummodes0*nummodes1;
1123 jump1 = nummodes0*nummodes1;
1128 ASSERTL0(
false,
"fid must be between 0 and 5");
1131 for(i = 0; i < Q; i++)
1133 for(j = 0; j <
P; j++)
1135 maparray[ arrayindx[i*P+j] ]
1136 = i*jump1 + j*jump2 + offset;
1141 if(CheckForZeroedModes)
1147 for(i = 0; i < nummodesB; i++)
1149 for(j = nummodesA; j <
P; j++)
1151 signarray[arrayindx[i*P+j]] = 0.0;
1152 maparray[arrayindx[i*P+j]] = maparray[0];
1156 for(i = nummodesB; i < Q; i++)
1158 for(j = 0; j <
P; j++)
1160 signarray[arrayindx[i*P+j]] = 0.0;
1161 maparray[arrayindx[i*P+j]] = maparray[0];
1167 ASSERTL0(
false,
"Different trace space face dimention and element face dimention not possible for GLL-Lagrange bases");
1171 if( (faceOrient==6) || (faceOrient==8) ||
1172 (faceOrient==11) || (faceOrient==12) )
1178 for(i = 3; i < Q; i+=2)
1180 for(j = 0; j <
P; j++)
1182 signarray[ arrayindx[i*P+j] ] *= -1;
1186 for(i = 0; i <
P; i++)
1188 swap( maparray[i] , maparray[i+P] );
1189 swap( signarray[i] , signarray[i+P] );
1195 for(i = 0; i <
P; i++)
1197 for(j = 0; j < Q/2; j++)
1199 swap( maparray[i + j*P],
1202 swap( signarray[i + j*P],
1213 for(i = 0; i < Q; i++)
1215 for(j = 3; j <
P; j+=2)
1217 signarray[ arrayindx[i*P+j] ] *= -1;
1221 for(i = 0; i < Q; i++)
1223 swap( maparray[i] , maparray[i+Q] );
1224 swap( signarray[i] , signarray[i+Q] );
1230 for(i = 0; i <
P; i++)
1232 for(j = 0; j < Q/2; j++)
1234 swap( maparray[i*Q + j],
1235 maparray[i*Q + Q -1 -j]);
1236 swap( signarray[i*Q + j],
1237 signarray[i*Q + Q -1 -j]);
1244 if( (faceOrient==7) || (faceOrient==8) ||
1245 (faceOrient==10) || (faceOrient==12) )
1251 for(i = 0; i < Q; i++)
1253 for(j = 3; j <
P; j+=2)
1255 signarray[ arrayindx[i*P+j] ] *= -1;
1259 for(i = 0; i < Q; i++)
1261 swap( maparray[i*P],
1263 swap( signarray[i*P],
1269 for(i = 0; i < Q; i++)
1271 for(j = 0; j < P/2; j++)
1273 swap( maparray[i*P + j],
1274 maparray[i*P + P -1 -j]);
1275 swap( signarray[i*P + j],
1276 signarray[i*P + P -1 -j]);
1288 for(i = 3; i < Q; i+=2)
1290 for(j = 0; j <
P; j++)
1292 signarray[ arrayindx[i*P+j] ] *= -1;
1296 for(i = 0; i <
P; i++)
1298 swap( maparray[i*Q],
1300 swap( signarray[i*Q],
1306 for(i = 0; i < Q; i++)
1308 for(j = 0; j < P/2; j++)
1310 swap( maparray[i + j*Q] ,
1311 maparray[i+P*Q - Q -j*Q] );
1312 swap( signarray[i + j*Q] ,
1313 signarray[i+P*Q - Q -j*Q] );
1334 "BasisType is not a boundary interior form");
1337 "BasisType is not a boundary interior form");
1340 "BasisType is not a boundary interior form");
1342 ASSERTL1((localVertexId>=0)&&(localVertexId<8),
1343 "local vertex id must be between 0 and 7");
1350 int nummodes [3] = {
m_base[0]->GetNumModes(),
1351 m_base[1]->GetNumModes(),
1352 m_base[2]->GetNumModes()};
1354 if(useCoeffPacking ==
true)
1356 if(localVertexId > 3)
1368 switch(localVertexId % 4)
1415 if( (localVertexId % 4) % 3 > 0 )
1428 if( localVertexId % 4 > 1 )
1441 if( localVertexId > 3)
1454 return r*nummodes[0]*nummodes[1] + q*nummodes[0] +
p;
1471 "BasisType is not a boundary interior form");
1474 "BasisType is not a boundary interior form");
1477 "BasisType is not a boundary interior form");
1480 "local edge id must be between 0 and 11");
1484 if(maparray.num_elements()!=nEdgeIntCoeffs)
1489 if(signarray.num_elements() != nEdgeIntCoeffs)
1495 fill( signarray.get() , signarray.get()+nEdgeIntCoeffs, 1 );
1498 int nummodes [3] = {
m_base[0]->GetNumModes(),
1499 m_base[1]->GetNumModes(),
1500 m_base[2]->GetNumModes()};
1506 bool reverseOrdering =
false;
1507 bool signChange =
false;
1509 int IdxRange [3][2] = {{0,0},{0,0},{0,0}};
1529 IdxRange[2][0] = nummodes[2] - 1;
1530 IdxRange[2][1] = nummodes[2];
1547 IdxRange[2][1] = nummodes[2] - 1;
1551 reverseOrdering =
true;
1557 IdxRange[2][1] = nummodes[2];
1586 IdxRange[1][0] = nummodes[1] - 1;
1587 IdxRange[1][1] = nummodes[1];
1602 IdxRange[1][1] = nummodes[1] - 1;
1606 reverseOrdering =
true;
1612 IdxRange[1][1] = nummodes[1];
1627 IdxRange[1][1] = nummodes[1] - 1;
1631 reverseOrdering =
true;
1637 IdxRange[1][1] = nummodes[1];
1666 IdxRange[0][0] = nummodes[0] - 1;
1667 IdxRange[0][1] = nummodes[0];
1682 IdxRange[0][1] = nummodes[0] - 1;
1686 reverseOrdering =
true;
1692 IdxRange[0][1] = nummodes[0];
1707 IdxRange[0][1] = nummodes[0] - 1;
1711 reverseOrdering =
true;
1717 IdxRange[0][1] = nummodes[0];
1731 for(r = IdxRange[2][0]; r < IdxRange[2][1]; r++)
1733 for(q = IdxRange[1][0]; q < IdxRange[1][1]; q++)
1735 for(p = IdxRange[0][0]; p < IdxRange[0][1]; p++)
1738 = r*nummodes[0]*nummodes[1] + q*nummodes[0] +
p;
1743 if( reverseOrdering )
1745 reverse( maparray.get() , maparray.get()+nEdgeIntCoeffs );
1750 for(p = 1; p < nEdgeIntCoeffs; p+=2)
1769 "BasisType is not a boundary interior form");
1772 "BasisType is not a boundary interior form");
1775 "BasisType is not a boundary interior form");
1778 "local face id must be between 0 and 5");
1782 if(maparray.num_elements()!=nFaceIntCoeffs)
1787 if(signarray.num_elements() != nFaceIntCoeffs)
1793 fill( signarray.get() , signarray.get()+nFaceIntCoeffs, 1 );
1796 int nummodes [3] = {
m_base[0]->GetNumModes(),
1797 m_base[1]->GetNumModes(),
1798 m_base[2]->GetNumModes()};
1814 nummodesA = nummodes[0];
1815 nummodesB = nummodes[1];
1821 nummodesA = nummodes[0];
1822 nummodesB = nummodes[2];
1828 nummodesA = nummodes[1];
1829 nummodesB = nummodes[2];
1838 for(i = 0; i < (nummodesB-2); i++)
1840 for(j = 0; j < (nummodesA-2); j++)
1842 if( faceOrient < 9 )
1844 arrayindx[i*(nummodesA-2)+j] = i*(nummodesA-2)+j;
1848 arrayindx[i*(nummodesA-2)+j] = j*(nummodesB-2)+i;
1853 int IdxRange [3][2];
1875 IdxRange[2][0] = nummodes[2] - 1;
1876 IdxRange[2][1] = nummodes[2];
1892 if( (((
int) faceOrient)-5) % 2 )
1894 IdxRange[2][0] = nummodes[2] - 2;
1902 IdxRange[2][1] = nummodes[2] - 1;
1909 IdxRange[2][1] = nummodes[2];
1912 if( (((
int) faceOrient)-5) % 2 )
1914 for(i = 3; i < nummodes[2]; i+=2)
1938 IdxRange[1][0] = nummodes[1] - 1;
1939 IdxRange[1][1] = nummodes[1];
1955 if( (((
int) faceOrient)-5) % 2 )
1957 IdxRange[1][0] = nummodes[1] - 2;
1965 IdxRange[1][1] = nummodes[1] - 1;
1972 IdxRange[1][1] = nummodes[1];
1975 if( (((
int) faceOrient)-5) % 2 )
1977 for(i = 3; i < nummodes[1]; i+=2)
1989 if( (((
int) faceOrient)-5) % 4 > 1 )
1991 IdxRange[1][0] = nummodes[1] - 2;
1999 IdxRange[1][1] = nummodes[1] - 1;
2006 IdxRange[1][1] = nummodes[1];
2009 if( (((
int) faceOrient)-5) % 4 > 1 )
2011 for(i = 3; i < nummodes[1]; i+=2)
2033 IdxRange[0][0] = nummodes[0] - 1;
2034 IdxRange[0][1] = nummodes[0];
2049 if( (((
int) faceOrient)-5) % 4 > 1 )
2051 IdxRange[0][0] = nummodes[0] - 2;
2059 IdxRange[0][1] = nummodes[0] - 1;
2066 IdxRange[0][1] = nummodes[0];
2069 if( (((
int) faceOrient)-5) % 4 > 1 )
2071 for(i = 3; i < nummodes[0]; i+=2)
2083 for(r = IdxRange[2][0]; r != IdxRange[2][1]; r+=Incr[2])
2085 for(q = IdxRange[1][0]; q != IdxRange[1][1]; q+=Incr[1])
2087 for(p = IdxRange[0][0]; p != IdxRange[0][1]; p+=Incr[0])
2089 maparray [ arrayindx[cnt ] ]
2090 = r*nummodes[0]*nummodes[1] + q*nummodes[0] +
p;
2091 signarray[ arrayindx[cnt++] ]
2092 = sign0[
p] * sign1[q] * sign2[r];
2106 "BasisType is not a boundary interior form");
2109 "BasisType is not a boundary interior form");
2112 "BasisType is not a boundary interior form");
2115 int nummodes [3] = {
m_base[0]->GetNumModes(),
2116 m_base[1]->GetNumModes(),
2117 m_base[2]->GetNumModes()};
2121 if(outarray.num_elements() != nIntCoeffs)
2135 for(i = 0; i < 3; i++)
2140 IntIdx[i][1] = nummodes[i];
2145 IntIdx[i][1] = nummodes[i]-1;
2149 for(r = IntIdx[2][0]; r < IntIdx[2][1]; r++)
2151 for( q = IntIdx[1][0]; q < IntIdx[1][1]; q++)
2153 for( p = IntIdx[0][0]; p < IntIdx[0][1]; p++)
2155 outarray[cnt++] = r*nummodes[0]*nummodes[1] +
2170 "BasisType is not a boundary interior form");
2173 "BasisType is not a boundary interior form");
2176 "BasisType is not a boundary interior form");
2179 int nummodes [3] = {
m_base[0]->GetNumModes(),
2180 m_base[1]->GetNumModes(),
2181 m_base[2]->GetNumModes()};
2185 if(outarray.num_elements()!=nBndCoeffs)
2200 for(i = 0; i < 3; i++)
2208 IntIdx[i][1] = nummodes[i];
2212 BndIdx[i][1] = nummodes[i]-1;
2214 IntIdx[i][1] = nummodes[i]-1;
2219 for(i = 0; i < 2; i++)
2222 for( q = 0; q < nummodes[1]; q++)
2224 for( p = 0; p < nummodes[0]; p++)
2226 outarray[cnt++] = r*nummodes[0]*nummodes[1]+q*nummodes[0] +
p;
2231 for(r = IntIdx[2][0]; r < IntIdx[2][1]; r++)
2233 for( i = 0; i < 2; i++)
2236 for( p = 0; p < nummodes[0]; p++)
2238 outarray[cnt++] = r*nummodes[0]*nummodes[1] +
2243 for( q = IntIdx[1][0]; q < IntIdx[1][1]; q++)
2245 for( i = 0; i < 2; i++)
2248 outarray[cnt++] = r*nummodes[0]*nummodes[1] +
2254 sort(outarray.get(), outarray.get() + nBndCoeffs);
2322 if(inarray.get() == outarray.get())
2328 m_ncoeffs, tmp.get(), 1, 0.0, outarray.get(), 1);
2333 m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
2342 int nquad0 =
m_base[0]->GetNumPoints();
2343 int nquad1 =
m_base[1]->GetNumPoints();
2344 int nquad2 =
m_base[2]->GetNumPoints();
2345 int nq01 = nquad0*nquad1;
2346 int nq12 = nquad1*nquad2;
2352 for(i = 0; i < nq12; ++i)
2355 w0.get(), 1, outarray.get()+i*nquad0,1);
2358 for(i = 0; i < nq12; ++i)
2360 Vmath::Smul(nquad0, w1[i%nquad1], outarray.get()+i*nquad0, 1,
2361 outarray.get()+i*nquad0, 1);
2364 for(i = 0; i < nquad2; ++i)
2366 Vmath::Smul(nq01, w2[i], outarray.get()+i*nq01, 1,
2367 outarray.get()+i*nq01, 1);
2375 int qa =
m_base[0]->GetNumPoints();
2376 int qb =
m_base[1]->GetNumPoints();
2377 int qc =
m_base[2]->GetNumPoints();
2378 int nmodes_a =
m_base[0]->GetNumModes();
2379 int nmodes_b =
m_base[1]->GetNumModes();
2380 int nmodes_c =
m_base[2]->GetNumModes();
2398 OrthoExp.
FwdTrans(array,orthocoeffs);
2402 int nmodes = max(nmodes_a,nmodes_b);
2403 nmodes = max(nmodes,nmodes_c);
2406 for(j = cutoff; j < nmodes; ++j)
2408 fac[j] = fabs((j-nmodes)/((
NekDouble) (j-cutoff+1.0)));
2412 for(i = 0; i < nmodes_a; ++i)
2414 for(j = 0; j < nmodes_b; ++j)
2416 for(k = 0; k < nmodes_c; ++k)
2418 if((i >= cutoff)||(j >= cutoff)||(k >= cutoff))
2420 orthocoeffs[i*nmodes_a*nmodes_b + j*nmodes_c + k] *= (SvvDiffCoeff*exp( -(fac[i]+fac[j]+fac[k]) ));
2424 orthocoeffs[i*nmodes_a*nmodes_b + j*nmodes_c + k] *= 0.0;
2431 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