55 StdExpansion(Ba.GetNumModes()*Bb.GetNumModes()*Bc.GetNumModes(), 3,
99 Array<OneD, NekDouble> &out_d0,
100 Array<OneD, NekDouble> &out_d1,
101 Array<OneD, NekDouble> &out_d2)
114 const Array<OneD, const NekDouble>& inarray,
115 Array<OneD, NekDouble>& outarray)
139 ASSERTL1(
false,
"input dir is out of range");
146 const Array<OneD, const NekDouble> &inarray,
147 Array<OneD, NekDouble> &out_d0,
148 Array<OneD, NekDouble> &out_d1,
149 Array<OneD, NekDouble> &out_d2)
156 const Array<OneD, const NekDouble>& inarray,
157 Array<OneD, NekDouble>& outarray)
183 const Array<OneD, const NekDouble>& inarray,
184 Array<OneD, NekDouble> &outarray)
188 "Basis[1] is not a general tensor type");
192 "Basis[2] is not a general tensor type");
195 &&
m_base[2]->Collocation())
200 inarray, 1, outarray, 1);
213 Array<OneD, NekDouble> &outarray)
222 inarray,outarray,wsp,
true,
true,
true);
240 const Array<OneD, const NekDouble>& base0,
241 const Array<OneD, const NekDouble>& base1,
242 const Array<OneD, const NekDouble>& base2,
243 const Array<OneD, const NekDouble>& inarray,
244 Array<OneD, NekDouble> &outarray,
245 Array<OneD, NekDouble> &wsp,
246 bool doCheckCollDir0,
247 bool doCheckCollDir1,
248 bool doCheckCollDir2)
250 int nquad0 =
m_base[0]->GetNumPoints();
251 int nquad1 =
m_base[1]->GetNumPoints();
252 int nquad2 =
m_base[2]->GetNumPoints();
253 int nmodes0 =
m_base[0]->GetNumModes();
254 int nmodes1 =
m_base[1]->GetNumModes();
255 int nmodes2 =
m_base[2]->GetNumModes();
258 bool colldir0 = doCheckCollDir0?(
m_base[0]->Collocation()):
false;
259 bool colldir1 = doCheckCollDir1?(
m_base[1]->Collocation()):
false;
260 bool colldir2 = doCheckCollDir2?(
m_base[2]->Collocation()):
false;
264 if(colldir0 && colldir1 && colldir2)
271 ASSERTL1(wsp.num_elements()>=nquad0*nmodes2*(nmodes1+nquad1),
272 "Workspace size is not sufficient");
275 Array<OneD, NekDouble> wsp2 = wsp + nquad0*nmodes1*nmodes2;
278 Blas::Dgemm(
'T',
'T', nmodes1*nmodes2, nquad0, nmodes0,
279 1.0, &inarray[0], nmodes0,
281 0.0, &wsp[0], nmodes1*nmodes2);
282 Blas::Dgemm(
'T',
'T', nquad0*nmodes2, nquad1, nmodes1,
283 1.0, &wsp[0], nmodes1,
285 0.0, &wsp2[0], nquad0*nmodes2);
286 Blas::Dgemm(
'T',
'T', nquad0*nquad1, nquad2, nmodes2,
287 1.0, &wsp2[0], nmodes2,
289 0.0, &outarray[0], nquad0*nquad1);
304 const Array<OneD, const NekDouble>& inarray,
305 Array<OneD, NekDouble> &outarray)
309 if( (
m_base[0]->Collocation())
310 &&(
m_base[1]->Collocation())
311 &&(
m_base[2]->Collocation()) )
365 const Array<OneD, const NekDouble> &inarray,
366 Array<OneD, NekDouble> &outarray)
368 if(
m_base[0]->Collocation() &&
369 m_base[1]->Collocation() &&
384 Array<OneD, NekDouble> &outarray)
390 Blas::Dgemv(
'N',
m_ncoeffs,nq,1.0,iprodmat->GetPtr().get(),
391 m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
398 const Array<OneD, const NekDouble>& inarray,
399 Array<OneD, NekDouble> &outarray)
401 int nquad0 =
m_base[0]->GetNumPoints();
402 int nquad1 =
m_base[1]->GetNumPoints();
403 int nquad2 =
m_base[2]->GetNumPoints();
404 int order0 =
m_base[0]->GetNumModes();
405 int order1 =
m_base[1]->GetNumModes();
407 Array<OneD, NekDouble> tmp(inarray.num_elements());
408 Array<OneD, NekDouble> wsp(nquad0*nquad1*(nquad2+order0) +
409 order0*order1*nquad2);
416 tmp,outarray,wsp,
true,
true,
true);
425 const Array<OneD, const NekDouble>& base1,
426 const Array<OneD, const NekDouble>& base2,
427 const Array<OneD, const NekDouble>& inarray,
428 Array<OneD, NekDouble> &outarray,
429 Array<OneD, NekDouble> &wsp,
430 bool doCheckCollDir0,
431 bool doCheckCollDir1,
432 bool doCheckCollDir2)
434 int nquad0 =
m_base[0]->GetNumPoints();
435 int nquad1 =
m_base[1]->GetNumPoints();
436 int nquad2 =
m_base[2]->GetNumPoints();
437 int nmodes0 =
m_base[0]->GetNumModes();
438 int nmodes1 =
m_base[1]->GetNumModes();
439 int nmodes2 =
m_base[2]->GetNumModes();
441 bool colldir0 = doCheckCollDir0?(
m_base[0]->Collocation()):
false;
442 bool colldir1 = doCheckCollDir1?(
m_base[1]->Collocation()):
false;
443 bool colldir2 = doCheckCollDir2?(
m_base[2]->Collocation()):
false;
445 if(colldir0 && colldir1 && colldir2)
451 ASSERTL1(wsp.num_elements() >= nmodes0*nquad2*(nquad1+nmodes1),
452 "Insufficient workspace size");
454 Array<OneD, NekDouble> tmp0 = wsp;
455 Array<OneD, NekDouble> tmp1 = wsp + nmodes0*nquad1*nquad2;
461 for(
int n = 0; n < nmodes0; ++n)
464 tmp0.get()+nquad1*nquad2*n,1);
469 Blas::Dgemm(
'T',
'N', nquad1*nquad2, nmodes0, nquad0,
470 1.0, inarray.get(), nquad0,
472 0.0, tmp0.get(), nquad1*nquad2);
478 for(
int n = 0; n < nmodes1; ++n)
481 tmp1.get()+nquad2*nmodes0*n,1);
486 Blas::Dgemm(
'T',
'N', nquad2*nmodes0, nmodes1, nquad1,
487 1.0, tmp0.get(), nquad1,
489 0.0, tmp1.get(), nquad2*nmodes0);
495 for(
int n = 0; n < nmodes2; ++n)
498 outarray.get()+nmodes0*nmodes1*n,1);
503 Blas::Dgemm(
'T',
'N', nmodes0*nmodes1, nmodes2, nquad2,
504 1.0, tmp1.get(), nquad2,
506 0.0, outarray.get(), nmodes0*nmodes1);
512 const Array<OneD, const NekDouble>& inarray,
513 Array<OneD, NekDouble> & outarray)
520 const Array<OneD, const NekDouble>& inarray,
521 Array<OneD, NekDouble> &outarray)
523 ASSERTL0((dir==0)||(dir==1)||(dir==2),
"input dir is out of range");
544 Blas::Dgemv(
'N',
m_ncoeffs,nq,1.0,iprodmat->GetPtr().get(),
545 m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
550 const Array<OneD, const NekDouble>& inarray,
551 Array<OneD, NekDouble> &outarray)
553 ASSERTL0((dir==0)||(dir==1)||(dir==2),
"input dir is out of range");
555 int nquad1 =
m_base[1]->GetNumPoints();
556 int nquad2 =
m_base[2]->GetNumPoints();
557 int order0 =
m_base[0]->GetNumModes();
558 int order1 =
m_base[1]->GetNumModes();
561 Array<OneD, NekDouble> tmp = outarray;
562 if (outarray.num_elements() < inarray.num_elements())
564 tmp = Array<OneD, NekDouble>(inarray.num_elements());
568 Array<OneD, NekDouble> wsp(order0*nquad2*(nquad1+order1));
601 Array<OneD, NekDouble>& eta)
612 Array<OneD, NekDouble> &outarray)
615 int nquad0 =
m_base[0]->GetNumPoints();
616 int nquad1 =
m_base[1]->GetNumPoints();
617 int nquad2 =
m_base[2]->GetNumPoints();
619 Array<OneD, const NekDouble> base0 =
m_base[0]->GetBdata();
620 Array<OneD, const NekDouble> base1 =
m_base[1]->GetBdata();
621 Array<OneD, const NekDouble> base2 =
m_base[2]->GetBdata();
623 int btmp0 =
m_base[0]->GetNumModes();
624 int btmp1 =
m_base[1]->GetNumModes();
625 int mode2 = mode/(btmp0*btmp1);
626 int mode1 = (mode-mode2*btmp0*btmp1)/btmp0;
627 int mode0 = (mode-mode2*btmp0*btmp1)%btmp0;
629 ASSERTL2(mode2 == (
int)floor((1.0*mode)/(btmp0*btmp1)),
630 "Integer Truncation not Equiv to Floor");
631 ASSERTL2(mode1 == (
int)floor((1.0*mode-mode2*btmp0*btmp1)
633 "Integer Truncation not Equiv to Floor");
635 "calling argument mode is larger than total expansion "
638 for(i = 0; i < nquad1*nquad2; ++i)
641 &outarray[0]+i*nquad0, 1);
644 for(j = 0; j < nquad2; ++j)
646 for(i = 0; i < nquad0; ++i)
649 &outarray[0]+i+j*nquad0*nquad1, nquad0,
650 &outarray[0]+i+j*nquad0*nquad1, nquad0);
654 for(i = 0; i < nquad2; i++)
656 Blas::Dscal(nquad0*nquad1,base2[mode2*nquad2+i],
657 &outarray[0]+i*nquad0*nquad1,1);
690 "BasisType is not a boundary interior form");
693 "BasisType is not a boundary interior form");
696 "BasisType is not a boundary interior form");
698 int nmodes0 =
m_base[0]->GetNumModes();
699 int nmodes1 =
m_base[1]->GetNumModes();
700 int nmodes2 =
m_base[2]->GetNumModes();
702 return ( 2*( nmodes0*nmodes1 + nmodes0*nmodes2
704 - 4*( nmodes0 + nmodes1 + nmodes2 ) + 8 );
711 "BasisType is not a boundary interior form");
714 "BasisType is not a boundary interior form");
717 "BasisType is not a boundary interior form");
719 int nmodes0 =
m_base[0]->GetNumModes();
720 int nmodes1 =
m_base[1]->GetNumModes();
721 int nmodes2 =
m_base[2]->GetNumModes();
723 return 2*( nmodes0*nmodes1 + nmodes0*nmodes2
729 ASSERTL2((i >= 0)&&(i <= 11),
"edge id is out of range");
731 if((i == 0)||(i == 2)||(i == 8)||(i == 10))
735 else if((i == 1)||(i == 3)||(i == 9)||(i == 11))
753 ASSERTL2((i >= 0) && (i <= 5),
"face id is out of range");
754 if((i == 0) || (i == 5))
758 else if((i == 1) || (i == 3))
771 ASSERTL2((i >= 0) && (i <= 5),
"face id is out of range");
772 if((i == 0) || (i == 5))
776 else if((i == 1) || (i == 3))
796 ASSERTL2(i >= 0 && i <= 5,
"face id is out of range");
798 if (i == 0 || i == 5)
800 return m_base[0]->GetNumPoints()*
801 m_base[1]->GetNumPoints();
803 else if (i == 1 || i == 3)
805 return m_base[0]->GetNumPoints()*
806 m_base[2]->GetNumPoints();
810 return m_base[1]->GetNumPoints()*
811 m_base[2]->GetNumPoints();
816 const int i,
const int j)
const
818 ASSERTL2(i >= 0 && i <= 5,
"face id is out of range");
819 ASSERTL2(j == 0 || j == 1,
"face direction is out of range");
821 if (i == 0 || i == 5)
823 return m_base[j]->GetPointsKey();
825 else if (i == 1 || i == 3)
827 return m_base[2*j]->GetPointsKey();
831 return m_base[j+1]->GetPointsKey();
837 int nmodes = nummodes[modes_offset]*nummodes[modes_offset+1]*nummodes[modes_offset+2];
845 const int i,
const int k)
const
847 ASSERTL2(i >= 0 && i <= 5,
"face id is out of range");
848 ASSERTL2(k >= 0 && k <= 1,
"basis key id is out of range");
898 ASSERTL2((i >= 0)&&(i <= 11),
"edge id is out of range");
900 if((i == 0)||(i == 2)||(i==8)||(i==10))
904 else if((i == 1)||(i == 3)||(i == 9)||(i == 11))
915 Array<OneD, NekDouble> & xi_y,
916 Array<OneD, NekDouble> & xi_z)
918 Array<OneD, const NekDouble> eta_x =
m_base[0]->GetZ();
919 Array<OneD, const NekDouble> eta_y =
m_base[1]->GetZ();
920 Array<OneD, const NekDouble> eta_z =
m_base[2]->GetZ();
927 for(
int k = 0; k < Qz; ++k ) {
928 for(
int j = 0; j < Qy; ++j ) {
929 for(
int i = 0; i < Qx; ++i ) {
930 int s = i + Qx*(j + Qy*k);
947 Array<OneD, unsigned int> &maparray,
948 Array<OneD, int> &signarray,
953 const int nummodes0 =
m_base[0]->GetNumModes();
954 const int nummodes1 =
m_base[1]->GetNumModes();
955 const int nummodes2 =
m_base[2]->GetNumModes();
959 "Method only implemented if BasisType is indentical in "
963 "Method only implemented for Modified_A or GLL_Lagrange BasisType");
971 nummodesA = nummodes0;
972 nummodesB = nummodes1;
976 nummodesA = nummodes0;
977 nummodesB = nummodes2;
981 nummodesA = nummodes1;
982 nummodesB = nummodes2;
989 int nFaceCoeffs = nummodesA*nummodesB;
991 if(maparray.num_elements() != nFaceCoeffs)
993 maparray = Array<OneD, unsigned int>(nFaceCoeffs);
996 if(signarray.num_elements() != nFaceCoeffs)
998 signarray = Array<OneD, int>(nFaceCoeffs,1);
1002 fill( signarray.get() , signarray.get()+nFaceCoeffs, 1 );
1005 Array<OneD, int> arrayindx(nFaceCoeffs);
1007 for(i = 0; i < nummodesB; i++)
1009 for(j = 0; j < nummodesA; j++)
1011 if( faceOrient < 9 )
1013 arrayindx[i*nummodesA+j] = i*nummodesA+j;
1017 arrayindx[i*nummodesA+j] = j*nummodesB+i;
1032 offset = nummodes0*nummodes1;
1036 offset = (nummodes2-1)*nummodes0*nummodes1;
1053 offset = nummodes0*(nummodes1-1);
1054 jump1 = nummodes0*nummodes1;
1059 jump1 = nummodes0*nummodes1;
1070 offset = nummodes0-1;
1071 jump1 = nummodes0*nummodes1;
1078 jump1 = nummodes0*nummodes1;
1083 ASSERTL0(
false,
"fid must be between 0 and 5");
1086 for(i = 0; i < nummodesB; i++)
1088 for(j = 0; j < nummodesA; j++)
1090 maparray[ arrayindx[i*nummodesA+j] ]
1091 = i*jump1 + j*jump2 + offset;
1097 if( (faceOrient==6) || (faceOrient==8) ||
1098 (faceOrient==11) || (faceOrient==12) )
1104 for(i = 3; i < nummodesB; i+=2)
1106 for(j = 0; j < nummodesA; j++)
1108 signarray[ arrayindx[i*nummodesA+j] ] *= -1;
1112 for(i = 0; i < nummodesA; i++)
1114 swap( maparray[i] , maparray[i+nummodesA] );
1115 swap( signarray[i] , signarray[i+nummodesA] );
1121 for(i = 0; i < nummodesA; i++)
1123 for(j = 0; j < nummodesB/2; j++)
1125 swap( maparray[i + j*nummodesA],
1126 maparray[i+nummodesA*nummodesB
1127 -nummodesA -j*nummodesA] );
1128 swap( signarray[i + j*nummodesA],
1129 signarray[i+nummodesA*nummodesB
1130 -nummodesA -j*nummodesA]);
1139 for(i = 0; i < nummodesB; i++)
1141 for(j = 3; j < nummodesA; j+=2)
1143 signarray[ arrayindx[i*nummodesA+j] ] *= -1;
1147 for(i = 0; i < nummodesB; i++)
1149 swap( maparray[i] , maparray[i+nummodesB] );
1150 swap( signarray[i] , signarray[i+nummodesB] );
1156 for(i = 0; i < nummodesA; i++)
1158 for(j = 0; j < nummodesB/2; j++)
1160 swap( maparray[i*nummodesB + j],
1161 maparray[i*nummodesB + nummodesB -1 -j]);
1162 swap( signarray[i*nummodesB + j],
1163 signarray[i*nummodesB + nummodesB -1 -j]);
1170 if( (faceOrient==7) || (faceOrient==8) ||
1171 (faceOrient==10) || (faceOrient==12) )
1177 for(i = 0; i < nummodesB; i++)
1179 for(j = 3; j < nummodesA; j+=2)
1181 signarray[ arrayindx[i*nummodesA+j] ] *= -1;
1185 for(i = 0; i < nummodesB; i++)
1187 swap( maparray[i*nummodesA],
1188 maparray[i*nummodesA+1]);
1189 swap( signarray[i*nummodesA],
1190 signarray[i*nummodesA+1]);
1195 for(i = 0; i < nummodesB; i++)
1197 for(j = 0; j < nummodesA/2; j++)
1199 swap( maparray[i*nummodesA + j],
1200 maparray[i*nummodesA + nummodesA -1 -j]);
1201 swap( signarray[i*nummodesA + j],
1202 signarray[i*nummodesA + nummodesA -1 -j]);
1214 for(i = 3; i < nummodesB; i+=2)
1216 for(j = 0; j < nummodesA; j++)
1218 signarray[ arrayindx[i*nummodesA+j] ] *= -1;
1222 for(i = 0; i < nummodesA; i++)
1224 swap( maparray[i*nummodesB],
1225 maparray[i*nummodesB+1]);
1226 swap( signarray[i*nummodesB],
1227 signarray[i*nummodesB+1]);
1232 for(i = 0; i < nummodesB; i++)
1234 for(j = 0; j < nummodesA/2; j++)
1236 swap( maparray[i + j*nummodesB] ,
1237 maparray[i+nummodesA*nummodesB -
1238 nummodesB -j*nummodesB] );
1239 swap( signarray[i + j*nummodesB] ,
1240 signarray[i+nummodesA*nummodesB -
1241 nummodesB -j*nummodesB] );
1264 "BasisType is not a boundary interior form");
1267 "BasisType is not a boundary interior form");
1270 "BasisType is not a boundary interior form");
1272 ASSERTL1((localVertexId>=0)&&(localVertexId<8),
1273 "local vertex id must be between 0 and 7");
1280 int nummodes [3] = {
m_base[0]->GetNumModes(),
1281 m_base[1]->GetNumModes(),
1282 m_base[2]->GetNumModes()};
1284 if(useCoeffPacking ==
true)
1286 if(localVertexId > 3)
1298 switch(localVertexId % 4)
1345 if( (localVertexId % 4) % 3 > 0 )
1358 if( localVertexId % 4 > 1 )
1371 if( localVertexId > 3)
1384 return r*nummodes[0]*nummodes[1] + q*nummodes[0] + p;
1396 Array<OneD, unsigned int> &maparray,
1397 Array<OneD, int> &signarray)
1401 "BasisType is not a boundary interior form");
1404 "BasisType is not a boundary interior form");
1407 "BasisType is not a boundary interior form");
1410 "local edge id must be between 0 and 11");
1414 if(maparray.num_elements()!=nEdgeIntCoeffs)
1416 maparray = Array<OneD, unsigned int>(nEdgeIntCoeffs);
1419 if(signarray.num_elements() != nEdgeIntCoeffs)
1421 signarray = Array<OneD, int>(nEdgeIntCoeffs,1);
1425 fill( signarray.get() , signarray.get()+nEdgeIntCoeffs, 1 );
1428 int nummodes [3] = {
m_base[0]->GetNumModes(),
1429 m_base[1]->GetNumModes(),
1430 m_base[2]->GetNumModes()};
1436 bool reverseOrdering =
false;
1437 bool signChange =
false;
1439 int IdxRange [3][2] = {{0,0},{0,0},{0,0}};
1459 IdxRange[2][0] = nummodes[2] - 1;
1460 IdxRange[2][1] = nummodes[2];
1477 IdxRange[2][1] = nummodes[2] - 1;
1481 reverseOrdering =
true;
1487 IdxRange[2][1] = nummodes[2];
1516 IdxRange[1][0] = nummodes[1] - 1;
1517 IdxRange[1][1] = nummodes[1];
1532 IdxRange[1][1] = nummodes[1] - 1;
1536 reverseOrdering =
true;
1542 IdxRange[1][1] = nummodes[1];
1557 IdxRange[1][1] = nummodes[1] - 1;
1561 reverseOrdering =
true;
1567 IdxRange[1][1] = nummodes[1];
1596 IdxRange[0][0] = nummodes[0] - 1;
1597 IdxRange[0][1] = nummodes[0];
1612 IdxRange[0][1] = nummodes[0] - 1;
1616 reverseOrdering =
true;
1622 IdxRange[0][1] = nummodes[0];
1637 IdxRange[0][1] = nummodes[0] - 1;
1641 reverseOrdering =
true;
1647 IdxRange[0][1] = nummodes[0];
1661 for(r = IdxRange[2][0]; r < IdxRange[2][1]; r++)
1663 for(q = IdxRange[1][0]; q < IdxRange[1][1]; q++)
1665 for(p = IdxRange[0][0]; p < IdxRange[0][1]; p++)
1668 = r*nummodes[0]*nummodes[1] + q*nummodes[0] + p;
1673 if( reverseOrdering )
1675 reverse( maparray.get() , maparray.get()+nEdgeIntCoeffs );
1680 for(p = 1; p < nEdgeIntCoeffs; p+=2)
1694 Array<OneD, unsigned int> &maparray,
1695 Array<OneD, int>& signarray)
1699 "BasisType is not a boundary interior form");
1702 "BasisType is not a boundary interior form");
1705 "BasisType is not a boundary interior form");
1708 "local face id must be between 0 and 5");
1712 if(maparray.num_elements()!=nFaceIntCoeffs)
1714 maparray = Array<OneD, unsigned int>(nFaceIntCoeffs);
1717 if(signarray.num_elements() != nFaceIntCoeffs)
1719 signarray = Array<OneD, int>(nFaceIntCoeffs,1);
1723 fill( signarray.get() , signarray.get()+nFaceIntCoeffs, 1 );
1726 int nummodes [3] = {
m_base[0]->GetNumModes(),
1727 m_base[1]->GetNumModes(),
1728 m_base[2]->GetNumModes()};
1744 nummodesA = nummodes[0];
1745 nummodesB = nummodes[1];
1751 nummodesA = nummodes[0];
1752 nummodesB = nummodes[2];
1758 nummodesA = nummodes[1];
1759 nummodesB = nummodes[2];
1764 Array<OneD, int> arrayindx(nFaceIntCoeffs);
1768 for(i = 0; i < (nummodesB-2); i++)
1770 for(j = 0; j < (nummodesA-2); j++)
1772 if( faceOrient < 9 )
1774 arrayindx[i*(nummodesA-2)+j] = i*(nummodesA-2)+j;
1778 arrayindx[i*(nummodesA-2)+j] = j*(nummodesB-2)+i;
1783 int IdxRange [3][2];
1786 Array<OneD, int> sign0(nummodes[0], 1);
1787 Array<OneD, int> sign1(nummodes[1], 1);
1788 Array<OneD, int> sign2(nummodes[2], 1);
1805 IdxRange[2][0] = nummodes[2] - 1;
1806 IdxRange[2][1] = nummodes[2];
1822 if( (((
int) faceOrient)-5) % 2 )
1824 IdxRange[2][0] = nummodes[2] - 2;
1832 IdxRange[2][1] = nummodes[2] - 1;
1839 IdxRange[2][1] = nummodes[2];
1842 if( (((
int) faceOrient)-5) % 2 )
1844 for(i = 3; i < nummodes[2]; i+=2)
1868 IdxRange[1][0] = nummodes[1] - 1;
1869 IdxRange[1][1] = nummodes[1];
1885 if( (((
int) faceOrient)-5) % 2 )
1887 IdxRange[1][0] = nummodes[1] - 2;
1895 IdxRange[1][1] = nummodes[1] - 1;
1902 IdxRange[1][1] = nummodes[1];
1905 if( (((
int) faceOrient)-5) % 2 )
1907 for(i = 3; i < nummodes[1]; i+=2)
1919 if( (((
int) faceOrient)-5) % 4 > 1 )
1921 IdxRange[1][0] = nummodes[1] - 2;
1929 IdxRange[1][1] = nummodes[1] - 1;
1936 IdxRange[1][1] = nummodes[1];
1939 if( (((
int) faceOrient)-5) % 4 > 1 )
1941 for(i = 3; i < nummodes[1]; i+=2)
1963 IdxRange[0][0] = nummodes[0] - 1;
1964 IdxRange[0][1] = nummodes[0];
1979 if( (((
int) faceOrient)-5) % 4 > 1 )
1981 IdxRange[0][0] = nummodes[0] - 2;
1989 IdxRange[0][1] = nummodes[0] - 1;
1996 IdxRange[0][1] = nummodes[0];
1999 if( (((
int) faceOrient)-5) % 4 > 1 )
2001 for(i = 3; i < nummodes[0]; i+=2)
2013 for(r = IdxRange[2][0]; r != IdxRange[2][1]; r+=Incr[2])
2015 for(q = IdxRange[1][0]; q != IdxRange[1][1]; q+=Incr[1])
2017 for(p = IdxRange[0][0]; p != IdxRange[0][1]; p+=Incr[0])
2019 maparray [ arrayindx[cnt ] ]
2020 = r*nummodes[0]*nummodes[1] + q*nummodes[0] + p;
2021 signarray[ arrayindx[cnt++] ]
2022 = sign0[p] * sign1[q] * sign2[r];
2036 "BasisType is not a boundary interior form");
2039 "BasisType is not a boundary interior form");
2042 "BasisType is not a boundary interior form");
2045 int nummodes [3] = {
m_base[0]->GetNumModes(),
2046 m_base[1]->GetNumModes(),
2047 m_base[2]->GetNumModes()};
2051 if(outarray.num_elements() != nIntCoeffs)
2053 outarray = Array<OneD, unsigned int>(nIntCoeffs);
2065 for(i = 0; i < 3; i++)
2070 IntIdx[i][1] = nummodes[i];
2075 IntIdx[i][1] = nummodes[i]-1;
2079 for(r = IntIdx[2][0]; r < IntIdx[2][1]; r++)
2081 for( q = IntIdx[1][0]; q < IntIdx[1][1]; q++)
2083 for( p = IntIdx[0][0]; p < IntIdx[0][1]; p++)
2085 outarray[cnt++] = r*nummodes[0]*nummodes[1] +
2100 "BasisType is not a boundary interior form");
2103 "BasisType is not a boundary interior form");
2106 "BasisType is not a boundary interior form");
2109 int nummodes [3] = {
m_base[0]->GetNumModes(),
2110 m_base[1]->GetNumModes(),
2111 m_base[2]->GetNumModes()};
2115 if(outarray.num_elements()!=nBndCoeffs)
2117 outarray = Array<OneD, unsigned int>(nBndCoeffs);
2130 for(i = 0; i < 3; i++)
2138 IntIdx[i][1] = nummodes[i];
2142 BndIdx[i][1] = nummodes[i]-1;
2144 IntIdx[i][1] = nummodes[i]-1;
2149 for(i = 0; i < 2; i++)
2152 for( q = 0; q < nummodes[1]; q++)
2154 for( p = 0; p < nummodes[0]; p++)
2156 outarray[cnt++] = r*nummodes[0]*nummodes[1]+q*nummodes[0] + p;
2161 for(r = IntIdx[2][0]; r < IntIdx[2][1]; r++)
2163 for( i = 0; i < 2; i++)
2166 for( p = 0; p < nummodes[0]; p++)
2168 outarray[cnt++] = r*nummodes[0]*nummodes[1] +
2173 for( q = IntIdx[1][0]; q < IntIdx[1][1]; q++)
2175 for( i = 0; i < 2; i++)
2178 outarray[cnt++] = r*nummodes[0]*nummodes[1] +
2184 sort(outarray.get(), outarray.get() + nBndCoeffs);
2200 const Array<OneD, const NekDouble> &inarray,
2201 Array<OneD,NekDouble> &outarray,
2209 const Array<OneD, const NekDouble> &inarray,
2210 Array<OneD,NekDouble> &outarray,
2218 const Array<OneD, const NekDouble> &inarray,
2219 Array<OneD,NekDouble> &outarray,
2228 const Array<OneD, const NekDouble> &inarray,
2229 Array<OneD,NekDouble> &outarray,
2237 const Array<OneD, const NekDouble> &inarray,
2238 Array<OneD,NekDouble> &outarray,
2246 const Array<OneD, const NekDouble> &inarray,
2247 Array<OneD,NekDouble> &outarray,
2252 if(inarray.get() == outarray.get())
2258 m_ncoeffs, tmp.get(), 1, 0.0, outarray.get(), 1);
2263 m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
2269 Array<OneD, NekDouble> &outarray)
2272 int nquad0 =
m_base[0]->GetNumPoints();
2273 int nquad1 =
m_base[1]->GetNumPoints();
2274 int nquad2 =
m_base[2]->GetNumPoints();
2275 int nq01 = nquad0*nquad1;
2276 int nq12 = nquad1*nquad2;
2278 const Array<OneD, const NekDouble>& w0 =
m_base[0]->GetW();
2279 const Array<OneD, const NekDouble>& w1 =
m_base[1]->GetW();
2280 const Array<OneD, const NekDouble>& w2 =
m_base[2]->GetW();
2282 for(i = 0; i < nq12; ++i)
2285 w0.get(), 1, outarray.get()+i*nquad0,1);
2288 for(i = 0; i < nq12; ++i)
2290 Vmath::Smul(nquad0, w1[i%nquad1], outarray.get()+i*nquad0, 1,
2291 outarray.get()+i*nquad0, 1);
2294 for(i = 0; i < nquad2; ++i)
2296 Vmath::Smul(nq01, w2[i], outarray.get()+i*nq01, 1,
2297 outarray.get()+i*nq01, 1);
2305 int qa =
m_base[0]->GetNumPoints();
2306 int qb =
m_base[1]->GetNumPoints();
2307 int qc =
m_base[2]->GetNumPoints();
2308 int nmodes_a =
m_base[0]->GetNumModes();
2309 int nmodes_b =
m_base[1]->GetNumModes();
2310 int nmodes_c =
m_base[2]->GetNumModes();
2321 Array<OneD, NekDouble> orthocoeffs(OrthoExp.
GetNcoeffs());
2328 OrthoExp.
FwdTrans(array,orthocoeffs);
2332 int nmodes = max(nmodes_a,nmodes_b);
2333 nmodes = max(nmodes,nmodes_c);
2335 Array<OneD, NekDouble> fac(nmodes,1.0);
2336 for(j = cutoff; j < nmodes; ++j)
2338 fac[j] = fabs((j-nmodes)/((
NekDouble) (j-cutoff+1.0)));
2342 for(i = 0; i < nmodes_a; ++i)
2344 for(j = 0; j < nmodes_b; ++j)
2346 for(k = 0; k < nmodes_c; ++k)
2348 if((i >= cutoff)||(j >= cutoff)||(k >= cutoff))
2350 orthocoeffs[i*nmodes_a*nmodes_b + j*nmodes_c + k] *= (1.0+SvvDiffCoeff*exp(-fac[i]+fac[j]+fac[k]));
2357 OrthoExp.
BwdTrans(orthocoeffs,array);