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");
870 m_base[dir]->GetNumModes());
875 ASSERTL2((i >= 0)&&(i <= 11),
"edge id is out of range");
877 if((i == 0)||(i == 2)||(i==8)||(i==10))
881 else if((i == 1)||(i == 3)||(i == 9)||(i == 11))
892 Array<OneD, NekDouble> & xi_y,
893 Array<OneD, NekDouble> & xi_z)
895 Array<OneD, const NekDouble> eta_x =
m_base[0]->GetZ();
896 Array<OneD, const NekDouble> eta_y =
m_base[1]->GetZ();
897 Array<OneD, const NekDouble> eta_z =
m_base[2]->GetZ();
904 for(
int k = 0; k < Qz; ++k ) {
905 for(
int j = 0; j < Qy; ++j ) {
906 for(
int i = 0; i < Qx; ++i ) {
907 int s = i + Qx*(j + Qy*k);
924 Array<OneD, unsigned int> &maparray,
925 Array<OneD, int> &signarray,
930 const int nummodes0 =
m_base[0]->GetNumModes();
931 const int nummodes1 =
m_base[1]->GetNumModes();
932 const int nummodes2 =
m_base[2]->GetNumModes();
936 "Method only implemented if BasisType is indentical in "
940 "Method only implemented for Modified_A or GLL_Lagrange BasisType");
948 nummodesA = nummodes0;
949 nummodesB = nummodes1;
953 nummodesA = nummodes0;
954 nummodesB = nummodes2;
958 nummodesA = nummodes1;
959 nummodesB = nummodes2;
966 int nFaceCoeffs = nummodesA*nummodesB;
968 if(maparray.num_elements() != nFaceCoeffs)
970 maparray = Array<OneD, unsigned int>(nFaceCoeffs);
973 if(signarray.num_elements() != nFaceCoeffs)
975 signarray = Array<OneD, int>(nFaceCoeffs,1);
979 fill( signarray.get() , signarray.get()+nFaceCoeffs, 1 );
982 Array<OneD, int> arrayindx(nFaceCoeffs);
984 for(i = 0; i < nummodesB; i++)
986 for(j = 0; j < nummodesA; j++)
990 arrayindx[i*nummodesA+j] = i*nummodesA+j;
994 arrayindx[i*nummodesA+j] = j*nummodesB+i;
1009 offset = nummodes0*nummodes1;
1013 offset = (nummodes2-1)*nummodes0*nummodes1;
1030 offset = nummodes0*(nummodes1-1);
1031 jump1 = nummodes0*nummodes1;
1036 jump1 = nummodes0*nummodes1;
1047 offset = nummodes0-1;
1048 jump1 = nummodes0*nummodes1;
1055 jump1 = nummodes0*nummodes1;
1060 ASSERTL0(
false,
"fid must be between 0 and 5");
1063 for(i = 0; i < nummodesB; i++)
1065 for(j = 0; j < nummodesA; j++)
1067 maparray[ arrayindx[i*nummodesA+j] ]
1068 = i*jump1 + j*jump2 + offset;
1074 if( (faceOrient==6) || (faceOrient==8) ||
1075 (faceOrient==11) || (faceOrient==12) )
1081 for(i = 3; i < nummodesB; i+=2)
1083 for(j = 0; j < nummodesA; j++)
1085 signarray[ arrayindx[i*nummodesA+j] ] *= -1;
1089 for(i = 0; i < nummodesA; i++)
1091 swap( maparray[i] , maparray[i+nummodesA] );
1092 swap( signarray[i] , signarray[i+nummodesA] );
1098 for(i = 0; i < nummodesA; i++)
1100 for(j = 0; j < nummodesB/2; j++)
1102 swap( maparray[i + j*nummodesA],
1103 maparray[i+nummodesA*nummodesB
1104 -nummodesA -j*nummodesA] );
1105 swap( signarray[i + j*nummodesA],
1106 signarray[i+nummodesA*nummodesB
1107 -nummodesA -j*nummodesA]);
1116 for(i = 0; i < nummodesB; i++)
1118 for(j = 3; j < nummodesA; j+=2)
1120 signarray[ arrayindx[i*nummodesA+j] ] *= -1;
1124 for(i = 0; i < nummodesB; i++)
1126 swap( maparray[i] , maparray[i+nummodesB] );
1127 swap( signarray[i] , signarray[i+nummodesB] );
1133 for(i = 0; i < nummodesA; i++)
1135 for(j = 0; j < nummodesB/2; j++)
1137 swap( maparray[i*nummodesB + j],
1138 maparray[i*nummodesB + nummodesB -1 -j]);
1139 swap( signarray[i*nummodesB + j],
1140 signarray[i*nummodesB + nummodesB -1 -j]);
1147 if( (faceOrient==7) || (faceOrient==8) ||
1148 (faceOrient==10) || (faceOrient==12) )
1154 for(i = 0; i < nummodesB; i++)
1156 for(j = 3; j < nummodesA; j+=2)
1158 signarray[ arrayindx[i*nummodesA+j] ] *= -1;
1162 for(i = 0; i < nummodesB; i++)
1164 swap( maparray[i*nummodesA],
1165 maparray[i*nummodesA+1]);
1166 swap( signarray[i*nummodesA],
1167 signarray[i*nummodesA+1]);
1172 for(i = 0; i < nummodesB; i++)
1174 for(j = 0; j < nummodesA/2; j++)
1176 swap( maparray[i*nummodesA + j],
1177 maparray[i*nummodesA + nummodesA -1 -j]);
1178 swap( signarray[i*nummodesA + j],
1179 signarray[i*nummodesA + nummodesA -1 -j]);
1191 for(i = 3; i < nummodesB; i+=2)
1193 for(j = 0; j < nummodesA; j++)
1195 signarray[ arrayindx[i*nummodesA+j] ] *= -1;
1199 for(i = 0; i < nummodesA; i++)
1201 swap( maparray[i*nummodesB],
1202 maparray[i*nummodesB+1]);
1203 swap( signarray[i*nummodesB],
1204 signarray[i*nummodesB+1]);
1209 for(i = 0; i < nummodesB; i++)
1211 for(j = 0; j < nummodesA/2; j++)
1213 swap( maparray[i + j*nummodesB] ,
1214 maparray[i+nummodesA*nummodesB -
1215 nummodesB -j*nummodesB] );
1216 swap( signarray[i + j*nummodesB] ,
1217 signarray[i+nummodesA*nummodesB -
1218 nummodesB -j*nummodesB] );
1241 "BasisType is not a boundary interior form");
1244 "BasisType is not a boundary interior form");
1247 "BasisType is not a boundary interior form");
1249 ASSERTL1((localVertexId>=0)&&(localVertexId<8),
1250 "local vertex id must be between 0 and 7");
1257 int nummodes [3] = {
m_base[0]->GetNumModes(),
1258 m_base[1]->GetNumModes(),
1259 m_base[2]->GetNumModes()};
1261 if(useCoeffPacking ==
true)
1263 if(localVertexId > 3)
1275 switch(localVertexId % 4)
1322 if( (localVertexId % 4) % 3 > 0 )
1335 if( localVertexId % 4 > 1 )
1348 if( localVertexId > 3)
1361 return r*nummodes[0]*nummodes[1] + q*nummodes[0] + p;
1373 Array<OneD, unsigned int> &maparray,
1374 Array<OneD, int> &signarray)
1378 "BasisType is not a boundary interior form");
1381 "BasisType is not a boundary interior form");
1384 "BasisType is not a boundary interior form");
1387 "local edge id must be between 0 and 11");
1391 if(maparray.num_elements()!=nEdgeIntCoeffs)
1393 maparray = Array<OneD, unsigned int>(nEdgeIntCoeffs);
1396 if(signarray.num_elements() != nEdgeIntCoeffs)
1398 signarray = Array<OneD, int>(nEdgeIntCoeffs,1);
1402 fill( signarray.get() , signarray.get()+nEdgeIntCoeffs, 1 );
1405 int nummodes [3] = {
m_base[0]->GetNumModes(),
1406 m_base[1]->GetNumModes(),
1407 m_base[2]->GetNumModes()};
1413 bool reverseOrdering =
false;
1414 bool signChange =
false;
1416 int IdxRange [3][2] = {{0,0},{0,0},{0,0}};
1436 IdxRange[2][0] = nummodes[2] - 1;
1437 IdxRange[2][1] = nummodes[2];
1454 IdxRange[2][1] = nummodes[2] - 1;
1458 reverseOrdering =
true;
1464 IdxRange[2][1] = nummodes[2];
1493 IdxRange[1][0] = nummodes[1] - 1;
1494 IdxRange[1][1] = nummodes[1];
1509 IdxRange[1][1] = nummodes[1] - 1;
1513 reverseOrdering =
true;
1519 IdxRange[1][1] = nummodes[1];
1534 IdxRange[1][1] = nummodes[1] - 1;
1538 reverseOrdering =
true;
1544 IdxRange[1][1] = nummodes[1];
1573 IdxRange[0][0] = nummodes[0] - 1;
1574 IdxRange[0][1] = nummodes[0];
1589 IdxRange[0][1] = nummodes[0] - 1;
1593 reverseOrdering =
true;
1599 IdxRange[0][1] = nummodes[0];
1614 IdxRange[0][1] = nummodes[0] - 1;
1618 reverseOrdering =
true;
1624 IdxRange[0][1] = nummodes[0];
1638 for(r = IdxRange[2][0]; r < IdxRange[2][1]; r++)
1640 for(q = IdxRange[1][0]; q < IdxRange[1][1]; q++)
1642 for(p = IdxRange[0][0]; p < IdxRange[0][1]; p++)
1645 = r*nummodes[0]*nummodes[1] + q*nummodes[0] + p;
1650 if( reverseOrdering )
1652 reverse( maparray.get() , maparray.get()+nEdgeIntCoeffs );
1657 for(p = 1; p < nEdgeIntCoeffs; p+=2)
1671 Array<OneD, unsigned int> &maparray,
1672 Array<OneD, int>& signarray)
1676 "BasisType is not a boundary interior form");
1679 "BasisType is not a boundary interior form");
1682 "BasisType is not a boundary interior form");
1685 "local face id must be between 0 and 5");
1689 if(maparray.num_elements()!=nFaceIntCoeffs)
1691 maparray = Array<OneD, unsigned int>(nFaceIntCoeffs);
1694 if(signarray.num_elements() != nFaceIntCoeffs)
1696 signarray = Array<OneD, int>(nFaceIntCoeffs,1);
1700 fill( signarray.get() , signarray.get()+nFaceIntCoeffs, 1 );
1703 int nummodes [3] = {
m_base[0]->GetNumModes(),
1704 m_base[1]->GetNumModes(),
1705 m_base[2]->GetNumModes()};
1721 nummodesA = nummodes[0];
1722 nummodesB = nummodes[1];
1728 nummodesA = nummodes[0];
1729 nummodesB = nummodes[2];
1735 nummodesA = nummodes[1];
1736 nummodesB = nummodes[2];
1741 Array<OneD, int> arrayindx(nFaceIntCoeffs);
1745 for(i = 0; i < (nummodesB-2); i++)
1747 for(j = 0; j < (nummodesA-2); j++)
1749 if( faceOrient < 9 )
1751 arrayindx[i*(nummodesA-2)+j] = i*(nummodesA-2)+j;
1755 arrayindx[i*(nummodesA-2)+j] = j*(nummodesB-2)+i;
1760 int IdxRange [3][2];
1763 Array<OneD, int> sign0(nummodes[0], 1);
1764 Array<OneD, int> sign1(nummodes[1], 1);
1765 Array<OneD, int> sign2(nummodes[2], 1);
1782 IdxRange[2][0] = nummodes[2] - 1;
1783 IdxRange[2][1] = nummodes[2];
1799 if( (((
int) faceOrient)-5) % 2 )
1801 IdxRange[2][0] = nummodes[2] - 2;
1809 IdxRange[2][1] = nummodes[2] - 1;
1816 IdxRange[2][1] = nummodes[2];
1819 if( (((
int) faceOrient)-5) % 2 )
1821 for(i = 3; i < nummodes[2]; i+=2)
1845 IdxRange[1][0] = nummodes[1] - 1;
1846 IdxRange[1][1] = nummodes[1];
1862 if( (((
int) faceOrient)-5) % 2 )
1864 IdxRange[1][0] = nummodes[1] - 2;
1872 IdxRange[1][1] = nummodes[1] - 1;
1879 IdxRange[1][1] = nummodes[1];
1882 if( (((
int) faceOrient)-5) % 2 )
1884 for(i = 3; i < nummodes[1]; i+=2)
1896 if( (((
int) faceOrient)-5) % 4 > 1 )
1898 IdxRange[1][0] = nummodes[1] - 2;
1906 IdxRange[1][1] = nummodes[1] - 1;
1913 IdxRange[1][1] = nummodes[1];
1916 if( (((
int) faceOrient)-5) % 4 > 1 )
1918 for(i = 3; i < nummodes[1]; i+=2)
1940 IdxRange[0][0] = nummodes[0] - 1;
1941 IdxRange[0][1] = nummodes[0];
1956 if( (((
int) faceOrient)-5) % 4 > 1 )
1958 IdxRange[0][0] = nummodes[0] - 2;
1966 IdxRange[0][1] = nummodes[0] - 1;
1973 IdxRange[0][1] = nummodes[0];
1976 if( (((
int) faceOrient)-5) % 4 > 1 )
1978 for(i = 3; i < nummodes[0]; i+=2)
1990 for(r = IdxRange[2][0]; r != IdxRange[2][1]; r+=Incr[2])
1992 for(q = IdxRange[1][0]; q != IdxRange[1][1]; q+=Incr[1])
1994 for(p = IdxRange[0][0]; p != IdxRange[0][1]; p+=Incr[0])
1996 maparray [ arrayindx[cnt ] ]
1997 = r*nummodes[0]*nummodes[1] + q*nummodes[0] + p;
1998 signarray[ arrayindx[cnt++] ]
1999 = sign0[p] * sign1[q] * sign2[r];
2013 "BasisType is not a boundary interior form");
2016 "BasisType is not a boundary interior form");
2019 "BasisType is not a boundary interior form");
2022 int nummodes [3] = {
m_base[0]->GetNumModes(),
2023 m_base[1]->GetNumModes(),
2024 m_base[2]->GetNumModes()};
2028 if(outarray.num_elements() != nIntCoeffs)
2030 outarray = Array<OneD, unsigned int>(nIntCoeffs);
2042 for(i = 0; i < 3; i++)
2047 IntIdx[i][1] = nummodes[i];
2052 IntIdx[i][1] = nummodes[i]-1;
2056 for(r = IntIdx[2][0]; r < IntIdx[2][1]; r++)
2058 for( q = IntIdx[1][0]; q < IntIdx[1][1]; q++)
2060 for( p = IntIdx[0][0]; p < IntIdx[0][1]; p++)
2062 outarray[cnt++] = r*nummodes[0]*nummodes[1] +
2077 "BasisType is not a boundary interior form");
2080 "BasisType is not a boundary interior form");
2083 "BasisType is not a boundary interior form");
2086 int nummodes [3] = {
m_base[0]->GetNumModes(),
2087 m_base[1]->GetNumModes(),
2088 m_base[2]->GetNumModes()};
2092 if(outarray.num_elements()!=nBndCoeffs)
2094 outarray = Array<OneD, unsigned int>(nBndCoeffs);
2107 for(i = 0; i < 3; i++)
2115 IntIdx[i][1] = nummodes[i];
2119 BndIdx[i][1] = nummodes[i]-1;
2121 IntIdx[i][1] = nummodes[i]-1;
2126 for(i = 0; i < 2; i++)
2129 for( q = 0; q < nummodes[1]; q++)
2131 for( p = 0; p < nummodes[0]; p++)
2133 outarray[cnt++] = r*nummodes[0]*nummodes[1]+q*nummodes[0] + p;
2138 for(r = IntIdx[2][0]; r < IntIdx[2][1]; r++)
2140 for( i = 0; i < 2; i++)
2143 for( p = 0; p < nummodes[0]; p++)
2145 outarray[cnt++] = r*nummodes[0]*nummodes[1] +
2150 for( q = IntIdx[1][0]; q < IntIdx[1][1]; q++)
2152 for( i = 0; i < 2; i++)
2155 outarray[cnt++] = r*nummodes[0]*nummodes[1] +
2161 sort(outarray.get(), outarray.get() + nBndCoeffs);
2177 const Array<OneD, const NekDouble> &inarray,
2178 Array<OneD,NekDouble> &outarray,
2186 const Array<OneD, const NekDouble> &inarray,
2187 Array<OneD,NekDouble> &outarray,
2195 const Array<OneD, const NekDouble> &inarray,
2196 Array<OneD,NekDouble> &outarray,
2205 const Array<OneD, const NekDouble> &inarray,
2206 Array<OneD,NekDouble> &outarray,
2214 const Array<OneD, const NekDouble> &inarray,
2215 Array<OneD,NekDouble> &outarray,
2223 const Array<OneD, const NekDouble> &inarray,
2224 Array<OneD,NekDouble> &outarray,
2229 if(inarray.get() == outarray.get())
2235 m_ncoeffs, tmp.get(), 1, 0.0, outarray.get(), 1);
2240 m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
2246 Array<OneD, NekDouble> &outarray)
2249 int nquad0 =
m_base[0]->GetNumPoints();
2250 int nquad1 =
m_base[1]->GetNumPoints();
2251 int nquad2 =
m_base[2]->GetNumPoints();
2252 int nq01 = nquad0*nquad1;
2253 int nq12 = nquad1*nquad2;
2255 const Array<OneD, const NekDouble>& w0 =
m_base[0]->GetW();
2256 const Array<OneD, const NekDouble>& w1 =
m_base[1]->GetW();
2257 const Array<OneD, const NekDouble>& w2 =
m_base[2]->GetW();
2259 for(i = 0; i < nq12; ++i)
2262 w0.get(), 1, outarray.get()+i*nquad0,1);
2265 for(i = 0; i < nq12; ++i)
2267 Vmath::Smul(nquad0, w1[i%nquad1], outarray.get()+i*nquad0, 1,
2268 outarray.get()+i*nquad0, 1);
2271 for(i = 0; i < nquad2; ++i)
2273 Vmath::Smul(nq01, w2[i], outarray.get()+i*nq01, 1,
2274 outarray.get()+i*nq01, 1);
2282 int qa =
m_base[0]->GetNumPoints();
2283 int qb =
m_base[1]->GetNumPoints();
2284 int qc =
m_base[2]->GetNumPoints();
2285 int nmodes_a =
m_base[0]->GetNumModes();
2286 int nmodes_b =
m_base[1]->GetNumModes();
2287 int nmodes_c =
m_base[2]->GetNumModes();
2298 Array<OneD, NekDouble> orthocoeffs(OrthoExp.
GetNcoeffs());
2305 OrthoExp.
FwdTrans(array,orthocoeffs);
2309 int nmodes = max(nmodes_a,nmodes_b);
2310 nmodes = max(nmodes,nmodes_c);
2312 Array<OneD, NekDouble> fac(nmodes,1.0);
2313 for(j = cutoff; j < nmodes; ++j)
2315 fac[j] = fabs((j-nmodes)/((
NekDouble) (j-cutoff+1.0)));
2319 for(i = 0; i < nmodes_a; ++i)
2321 for(j = 0; j < nmodes_b; ++j)
2323 for(k = 0; k < nmodes_c; ++k)
2325 if((i >= cutoff)||(j >= cutoff)||(k >= cutoff))
2327 orthocoeffs[i*nmodes_a*nmodes_b + j*nmodes_c + k] *= (1.0+SvvDiffCoeff*exp(-fac[i]+fac[j]+fac[k]));
2334 OrthoExp.
BwdTrans(orthocoeffs,array);