64 ASSERTL0(
false,
"order in 'a' direction is higher "
65 "than order in 'c' direction");
69 ASSERTL0(
false,
"order in 'b' direction is higher "
70 "than order in 'c' direction");
88 for (
int i = 2; i <= P; ++i)
94 for (
int i = 2; i <= Q; ++i)
100 for (
int i = 2; i <= P; ++i)
106 for (
int i = 2; i <= Q; ++i)
112 for (
int i = 2; i <= R; ++i)
118 for (
int i = 2; i <= R; ++i)
124 for (
int i = 2; i <= R; ++i)
130 for (
int i = 2; i <= R; ++i)
136 for (
int j = 2; j <= Q; ++j)
138 for (
int i = 2; i <= P; ++i)
145 for (
int i = 2; i <= P; ++i)
147 for (
int j = 1; j <= R-i; ++j)
154 for (
int i = 2; i <= Q; ++i)
156 for (
int j = 1; j <= R-i; ++j)
163 for (
int i = 2; i <= P; ++i)
165 for (
int j = 1; j <= R-i; ++j)
172 for (
int i = 2; i <= Q; ++i)
174 for (
int j = 1; j <= R-i; ++j)
181 for (
int i = 2; i <= P+1; ++i)
183 for (
int j = 1; j <= Q-i+1; ++j)
185 for (
int k = 1; k <= R-i-j+1; ++k)
195 "Duplicate coefficient entries in map");
198 for (it =
m_map.begin(); it !=
m_map.end(); ++it)
200 const int p = it->first.get<0>();
201 const int q = it->first.get<1>();
202 const int r = it->first.get<2>();
203 const int rp = it->first.get<3>();
206 m_idxMap[p] = map<int, map<int, pair<int, int> > >();
211 m_idxMap[p][q] = map<int, pair<int, int> >();
216 m_idxMap[p][q][r] = pair<int, int>(it->second, rp);
252 const Array<OneD, const NekDouble> &u_physical,
253 Array<OneD, NekDouble> &out_dxi1,
254 Array<OneD, NekDouble> &out_dxi2,
255 Array<OneD, NekDouble> &out_dxi3)
258 int Qx =
m_base[0]->GetNumPoints();
259 int Qy =
m_base[1]->GetNumPoints();
260 int Qz =
m_base[2]->GetNumPoints();
262 Array<OneD, NekDouble> dEta_bar1(Qx*Qy*Qz,0.0);
263 Array<OneD, NekDouble> dXi2 (Qx*Qy*Qz,0.0);
264 Array<OneD, NekDouble> dEta3 (Qx*Qy*Qz,0.0);
267 Array<OneD, const NekDouble> eta_x, eta_y, eta_z;
268 eta_x =
m_base[0]->GetZ();
269 eta_y =
m_base[1]->GetZ();
270 eta_z =
m_base[2]->GetZ();
274 for (k = 0, n = 0; k < Qz; ++k)
276 for (j = 0; j < Qy; ++j)
278 for (i = 0; i < Qx; ++i, ++n)
280 if (out_dxi1.num_elements() > 0)
281 out_dxi1[n] = 2.0/(1.0 - eta_z[k]) * dEta_bar1[n];
282 if (out_dxi2.num_elements() > 0)
283 out_dxi2[n] = 2.0/(1.0 - eta_z[k]) * dXi2[n];
284 if (out_dxi3.num_elements() > 0)
285 out_dxi3[n] = (1.0+eta_x[i])/(1.0-eta_z[k])*dEta_bar1[n] +
286 (1.0+eta_y[j])/(1.0-eta_z[k])*dXi2[n] + dEta3[n];
293 const Array<OneD, const NekDouble>& inarray,
294 Array<OneD, NekDouble>& outarray)
321 ASSERTL1(
false,
"input dir is out of range");
328 Array<OneD, NekDouble> &out_d0,
329 Array<OneD, NekDouble> &out_d1,
330 Array<OneD, NekDouble> &out_d2)
336 const Array<OneD, const NekDouble>& inarray,
337 Array<OneD, NekDouble>& outarray)
368 Array<OneD, NekDouble> &outarray)
370 if (
m_base[0]->Collocation() &&
371 m_base[1]->Collocation() &&
377 inarray, 1, outarray, 1);
389 const Array<OneD, const NekDouble>& inarray,
390 Array<OneD, NekDouble>& outarray)
392 Array<OneD, NekDouble> wsp;
396 inarray,outarray,wsp,
401 const Array<OneD, const NekDouble> &base0,
402 const Array<OneD, const NekDouble> &base1,
403 const Array<OneD, const NekDouble> &base2,
404 const Array<OneD, const NekDouble> &inarray,
405 Array<OneD, NekDouble> &outarray,
406 Array<OneD, NekDouble> &wsp,
407 bool doCheckCollDir0,
408 bool doCheckCollDir1,
409 bool doCheckCollDir2)
411 const int Qx =
m_base[0]->GetNumPoints();
412 const int Qy =
m_base[1]->GetNumPoints();
413 const int Qz =
m_base[2]->GetNumPoints();
420 map<int, map<int, map<int, pair<int, int> > > >
::iterator it_p;
421 map<int, map<int, pair<int, int> > >
::iterator it_q;
427 for (it_q = it_p->second.begin(); it_q != it_p->second.end(); ++it_q)
433 Array<OneD, NekDouble> fpq(pqcnt);
434 Array<OneD, NekDouble> fp (
m_base[0]->GetNumModes());
435 int i ,j, k, s = 0, cnt = 0, cnt2 = 0;
437 for (k = 0; k < Qz; ++k)
444 for (it_q = it_p->second.begin(); it_q != it_p->second.end(); ++it_q)
447 for (it_r = it_q->second.begin(); it_r != it_q->second.end(); ++it_r)
449 sum += inarray[it_r->second.first] * bz[k + Qz*it_r->second.second];
455 for (j = 0; j < Qy; ++j)
464 for (it_q = it_p->second.begin(); it_q != it_p->second.end(); ++it_q)
466 sum += by[j + Qy*it_q->first] * fpq[cnt++];
471 for (i = 0; i < Qx; ++i, ++s)
477 sum += bx[i + Qx*it_p->first] * fp[cnt2++];
479 sum += inarray[4]*(by1*(bx[i] + bx[i+Qx]) + by0*bx[i+Qx]);
500 Array<OneD, NekDouble> &outarray)
535 const Array<OneD, const NekDouble> &inarray,
536 Array<OneD, NekDouble> &outarray)
538 if (
m_base[0]->Collocation() &&
539 m_base[1]->Collocation() &&
551 const Array<OneD, const NekDouble>& inarray,
552 Array<OneD, NekDouble>& outarray)
554 Array<OneD, NekDouble> tmp(inarray.num_elements());
555 Array<OneD, NekDouble> wsp;
567 const Array<OneD, const NekDouble> &base0,
568 const Array<OneD, const NekDouble> &base1,
569 const Array<OneD, const NekDouble> &base2,
570 const Array<OneD, const NekDouble> &inarray,
571 Array<OneD, NekDouble> &outarray,
572 Array<OneD, NekDouble> &wsp,
573 bool doCheckCollDir0,
574 bool doCheckCollDir1,
575 bool doCheckCollDir2)
578 int Qx =
m_base[0]->GetNumPoints();
579 int Qy =
m_base[1]->GetNumPoints();
580 int Qz =
m_base[2]->GetNumPoints();
586 map<int, map<int, map<int, pair<int, int> > > >
::iterator it_p;
587 map<int, map<int, pair<int, int> > >
::iterator it_q;
590 Array<OneD, NekDouble> f (Qy*Qz);
591 Array<OneD, NekDouble> fb(Qz);
595 const int p = it_p->first;
597 for (k = 0; k < Qz; ++k)
599 for (j = 0; j < Qy; ++j)
602 for (i = 0; i < Qx; ++i, ++s)
604 sum += bx[i + Qx*p]*inarray[s];
610 for (it_q = it_p->second.begin(); it_q != it_p->second.end(); ++it_q)
612 const int q = it_q->first;
614 for (k = 0; k < Qz; ++k)
617 for (j = 0; j < Qy; ++j)
619 sum += by[j + Qy*q]*f[j+Qy*k];
624 for (it_r = it_q->second.begin(); it_r != it_q->second.end(); ++it_r)
626 const int rpqr = it_r->second.second;
628 for (k = 0; k < Qz; ++k)
630 sum += bz[k + Qz*rpqr]*fb[k];
633 outarray[it_r->second.first] = sum;
640 for (k = 0; k < Qz; ++k)
642 for (j = 0; j < Qy; ++j)
644 for (i = 0; i < Qx; ++i, ++s)
646 outarray[4] += inarray[s] * bz[k+Qz]*(
657 const Array<OneD, const NekDouble>& inarray,
658 Array<OneD, NekDouble>& outarray)
671 const Array<OneD, const NekDouble>& inarray,
672 Array<OneD, NekDouble>& outarray)
675 int nquad0 =
m_base[0]->GetNumPoints();
676 int nquad1 =
m_base[1]->GetNumPoints();
677 int nquad2 =
m_base[2]->GetNumPoints();
678 int nqtot = nquad0*nquad1*nquad2;
680 Array<OneD, NekDouble> gfac0(nquad0);
681 Array<OneD, NekDouble> gfac1(nquad1);
682 Array<OneD, NekDouble> gfac2(nquad2);
683 Array<OneD, NekDouble> tmp0 (nqtot);
684 Array<OneD, NekDouble> wsp;
686 const Array<OneD, const NekDouble>& z0 =
m_base[0]->GetZ();
687 const Array<OneD, const NekDouble>& z1 =
m_base[1]->GetZ();
688 const Array<OneD, const NekDouble>& z2 =
m_base[2]->GetZ();
691 for(i = 0; i < nquad0; ++i)
693 gfac0[i] = 0.5*(1+z0[i]);
697 for(i = 0; i < nquad1; ++i)
699 gfac1[i] = 0.5*(1+z1[i]);
703 for(i = 0; i < nquad2; ++i)
705 gfac2[i] = 2.0/(1-z2[i]);
709 const int nq01 = nquad0*nquad1;
710 for(i = 0; i < nquad2; ++i)
713 &inarray[0] + i*nq01, 1,
714 &tmp0 [0] + i*nq01, 1);
745 for(i = 0; i < nquad1*nquad2; ++i)
749 tmp0 .get() + i*nquad0, 1);
758 for(i = 0; i < nquad2; ++i)
761 &inarray[0] + i*nq01, 1,
762 &tmp0 [0] + i*nq01, 1);
764 for(i = 0; i < nquad1*nquad2; ++i)
767 &tmp0[0] + i*nquad0, 1,
768 &tmp0[0] + i*nquad0, 1);
791 ASSERTL1(
false,
"input dir is out of range");
802 const Array<OneD, const NekDouble>& xi,
803 Array<OneD, NekDouble>& eta)
816 eta[1] = 2.0*(1.0 + xi[1])/(1.0 - xi[2]) - 1.0;
817 eta[0] = 2.0*(1.0 + xi[0])/(1.0 - xi[2]) - 1.0;
822 Array<OneD, NekDouble> &xi_y,
823 Array<OneD, NekDouble> &xi_z)
825 Array<OneD, const NekDouble> etaBar_x =
m_base[0]->GetZ();
826 Array<OneD, const NekDouble> eta_y =
m_base[1]->GetZ();
827 Array<OneD, const NekDouble> eta_z =
m_base[2]->GetZ();
833 for (
int k = 0; k < Qz; ++k )
835 for (
int j = 0; j < Qy; ++j)
837 for (
int i = 0; i < Qx; ++i)
839 int s = i + Qx*(j + Qy*k);
842 xi_y[s] = (1.0 + eta_y[j]) * (1.0 - eta_z[k]) / 2.0 - 1.0;
843 xi_x[s] = (1.0 + etaBar_x[i]) * (1.0 - eta_z[k]) / 2.0 - 1.0;
851 Array<OneD, NekDouble> tmp(
m_ncoeffs, 0.0);
885 "BasisType is not a boundary interior form");
888 "BasisType is not a boundary interior form");
891 "BasisType is not a boundary interior form");
893 int P =
m_base[0]->GetNumModes();
894 int Q =
m_base[1]->GetNumModes();
895 int R =
m_base[2]->GetNumModes();
903 ASSERTL2(i >= 0 && i <= 7,
"edge id is out of range");
905 if (i == 0 || i == 2)
909 else if (i == 1 || i == 3)
921 ASSERTL2(i >= 0 && i <= 4,
"face id is out of range");
927 else if (i == 1 || i == 3)
930 return Q+1 + (P*(1 + 2*Q - P))/2;
935 return Q+1 + (P*(1 + 2*Q - P))/2;
941 ASSERTL2(i >= 0 && i <= 4,
"face id is out of range");
943 int P =
m_base[0]->GetNumModes()-1;
944 int Q =
m_base[1]->GetNumModes()-1;
945 int R =
m_base[2]->GetNumModes()-1;
951 else if (i == 1 || i == 3)
953 return (P-1) * (2*(R-1) - (P-1) - 1) / 2;
957 return (Q-1) * (2*(R-1) - (Q-1) - 1) / 2;
963 ASSERTL2(i >= 0 && i <= 4,
"face id is out of range");
967 return m_base[0]->GetNumPoints()*
968 m_base[1]->GetNumPoints();
970 else if (i == 1 || i == 3)
972 return m_base[0]->GetNumPoints()*
973 m_base[2]->GetNumPoints();
977 return m_base[1]->GetNumPoints()*
978 m_base[2]->GetNumPoints();
984 const int i,
const int k)
const
986 ASSERTL2(i >= 0 && i <= 4,
"face id is out of range");
987 ASSERTL2(k >= 0 && k <= 1,
"basis key id is out of range");
996 m_base[k]->GetNumModes());
1005 m_base[2*k]->GetNumModes());
1013 m_base[k+1]->GetNumModes());
1022 const std::vector<unsigned int> &nummodes,
1026 nummodes[modes_offset],
1027 nummodes[modes_offset+1],
1028 nummodes[modes_offset+2]);
1036 ASSERTL2(i >= 0 && i <= 7,
"edge id is out of range");
1037 if (i == 0 || i == 2)
1041 else if (i == 1 || i == 3)
1059 Array<OneD, unsigned int> &maparray,
1060 Array<OneD, int> &signarray,
1065 "Method only implemented if BasisType is identical"
1066 "in x and y directions");
1069 "Method only implemented for Modified_A BasisType"
1070 "(x and y direction) and Modified_C BasisType (z "
1073 int i, j, p, q, r, nFaceCoeffs;
1075 int order0 =
m_base[0]->GetNumModes();
1076 int order1 =
m_base[1]->GetNumModes();
1077 int order2 =
m_base[2]->GetNumModes();
1079 if (nummodesA == -1)
1084 nummodesA =
m_base[0]->GetNumModes();
1085 nummodesB =
m_base[1]->GetNumModes();
1089 nummodesA =
m_base[0]->GetNumModes();
1090 nummodesB =
m_base[2]->GetNumModes();
1094 nummodesA =
m_base[1]->GetNumModes();
1095 nummodesB =
m_base[2]->GetNumModes();
1102 nFaceCoeffs = nummodesB + (nummodesA-1)*(1+2*(nummodesB-1)-(nummodesA-1))/2;
1106 nFaceCoeffs = nummodesA*nummodesB;
1110 if (maparray.num_elements() != nFaceCoeffs)
1112 maparray = Array<OneD, unsigned int>(nFaceCoeffs);
1115 if (signarray.num_elements() != nFaceCoeffs)
1117 signarray = Array<OneD, int>(nFaceCoeffs,1);
1121 fill(signarray.get(), signarray.get() + nFaceCoeffs, 1);
1126 Array<OneD, int> arrayindx(nFaceCoeffs,-1);
1130 for (i = 0; i < nummodesB; i++)
1132 for (j = 0; j < nummodesA; j++)
1136 arrayindx[i*nummodesA+j] = i*nummodesA+j;
1140 arrayindx[i*nummodesA+j] = j*nummodesB+i;
1154 maparray[arrayindx[0]] = 0;
1155 maparray[arrayindx[1]] = 1;
1156 maparray[arrayindx[nummodesA+1]] = 2;
1157 maparray[arrayindx[nummodesA]] = 3;
1161 for (p = 2; p < nummodesA; ++p)
1163 maparray[arrayindx[p]] = p-2 + cnt;
1168 for (q = 2; q < nummodesB; ++q)
1170 maparray[arrayindx[q*nummodesA+1]] = q-2 + cnt;
1175 for (p = 2; p < nummodesA; ++p)
1177 maparray[arrayindx[nummodesA+p]] = p-2 + cnt;
1182 for (q = 2; q < nummodesB; ++q)
1184 maparray[arrayindx[q*nummodesA]] = q-2 + cnt;
1188 cnt += nummodesB-2 + 4*(nummodesA-2);
1189 for (q = 2; q < nummodesB; ++q)
1191 for (p = 2; p < nummodesA; ++p)
1193 maparray[arrayindx[q*nummodesA+p]] = cnt + (q-2)*nummodesA+(p-2);
1202 maparray[nummodesB] = 1;
1207 for (p = 2; p < nummodesA; q += nummodesB-p, ++p)
1209 maparray[q] = cnt++;
1210 if ((
int)faceOrient == 7)
1212 signarray[q] = p % 2 ? -1 : 1;
1217 cnt = 5 + 2*(order0-2) + 2*(order1-2) + (order2-2);
1218 for (q = 2; q < nummodesB; ++q)
1220 maparray[q] = cnt++;
1221 if ((
int)faceOrient == 7)
1223 signarray[q] = q % 2 ? -1 : 1;
1228 cnt = 5 + 2*(order0-2) + 2*(order1-2);
1229 for (q = 2; q < nummodesB; ++q)
1231 maparray[nummodesB+q-1] = cnt++;
1232 if ((
int)faceOrient == 7)
1234 signarray[nummodesB+q-1] = q % 2 ? -1 : 1;
1239 cnt = 5 + 2*(order0-2) + 2*(order1-2) + 4*(order2-2)
1241 cnt2 = 2*nummodesB + 1;
1242 for (p = 2; p < nummodesA; ++p)
1244 for (r = 2; r < nummodesB-p; ++r)
1246 maparray[cnt2] = cnt++;
1247 if ((
int)faceOrient == 7 && p > 1)
1249 signarray[cnt2++] = p % 2 ? -1 : 1;
1260 maparray[nummodesB] = 2;
1263 cnt = 5 + (order0-2);
1265 for (p = 2; p < nummodesA; q += nummodesB-p, ++p)
1267 maparray[q] = cnt++;
1268 if ((
int)faceOrient == 7)
1270 signarray[q] = p % 2 ? -1 : 1;
1275 cnt = 5 + 2*(order0-2) + 2*(order1-2) + 2*(order2-2);
1276 for (q = 2; q < nummodesB; ++q)
1278 maparray[q] = cnt++;
1279 if ((
int)faceOrient == 7)
1281 signarray[q] = q % 2 ? -1 : 1;
1286 cnt = 5 + 2*(order0-2) + 2*(order1-2) + (order2-2);
1287 for (q = 2; q < nummodesB; ++q)
1289 maparray[nummodesB+q-1] = cnt++;
1290 if ((
int)faceOrient == 7)
1292 signarray[nummodesB+q-1] = q % 2 ? -1 : 1;
1297 cnt = 5 + 2*(order0-2) + 2*(order1-2) + 4*(order2-2)
1299 cnt2 = 2*nummodesB + 1;
1300 for (p = 2; p < nummodesA; ++p)
1302 for (r = 2; r < nummodesB-p; ++r)
1304 maparray[cnt2] = cnt++;
1305 if ((
int)faceOrient == 7 && p > 1)
1307 signarray[cnt2++] = p % 2 ? -1 : 1;
1318 maparray[nummodesB] = 2;
1321 cnt = 5 + (order0-2) + (order1-2);
1323 for (p = 2; p < nummodesA; q += nummodesB-p, ++p)
1325 maparray[q] = cnt++;
1326 if ((
int)faceOrient == 7)
1328 signarray[q] = p % 2 ? -1 : 1;
1333 cnt = 5 + 2*(order0-2) + 2*(order1-2) + 2*(order2-2);
1334 for (q = 2; q < nummodesB; ++q)
1336 maparray[q] = cnt++;
1337 if ((
int)faceOrient == 7)
1339 signarray[q] = q % 2 ? -1 : 1;
1344 cnt = 5 + 2*(order0-2) + 2*(order1-2) + 3*(order2-2);
1345 for (q = 2; q < nummodesB; ++q)
1347 maparray[nummodesB+q-1] = cnt++;
1348 if ((
int)faceOrient == 7)
1350 signarray[nummodesB+q-1] = q % 2 ? -1 : 1;
1355 cnt = 5 + 2*(order0-2) + 2*(order1-2) + 4*(order2-2)
1358 cnt2 = 2*nummodesB + 1;
1359 for (p = 2; p < nummodesA; ++p)
1361 for (r = 2; r < nummodesB-p; ++r)
1363 maparray[cnt2] = cnt++;
1364 if ((
int)faceOrient == 7 && p > 1)
1366 signarray[cnt2++] = p % 2 ? -1 : 1;
1377 maparray[nummodesB] = 3;
1380 cnt = 5 + 2*(order0-2) + (order1-2);
1382 for (p = 2; p < nummodesA; q += nummodesB-p, ++p)
1384 maparray[q] = cnt++;
1385 if ((
int)faceOrient == 7)
1387 signarray[q] = p % 2 ? -1 : 1;
1392 cnt = 5 + 2*(order0-2) + 2*(order1-2) + 3*(order2-2);
1393 for (q = 2; q < nummodesB; ++q)
1395 maparray[q] = cnt++;
1396 if ((
int)faceOrient == 7)
1398 signarray[q] = q % 2 ? -1 : 1;
1403 cnt = 5 + 2*(order0-2) + 2*(order1-2);
1404 for (q = 2; q < nummodesB; ++q)
1406 maparray[nummodesB+q-1] = cnt++;
1407 if ((
int)faceOrient == 7)
1409 signarray[nummodesB+q-1] = q % 2 ? -1 : 1;
1414 cnt = 5 + 2*(order0-2) + 2*(order1-2) + 4*(order2-2)
1417 cnt2 = 2*nummodesB + 1;
1418 for (p = 2; p < nummodesA; ++p)
1420 for (r = 2; r < nummodesB-p; ++r)
1422 maparray[cnt2] = cnt++;
1423 if ((
int)faceOrient == 7 && p > 1)
1425 signarray[cnt2++] = p % 2 ? -1 : 1;
1433 ASSERTL0(
false,
"Face to element map unavailable.");
1440 if ((
int)faceOrient == 7)
1442 swap(maparray[0], maparray[nummodesA]);
1443 for (i = 1; i < nummodesA-1; ++i)
1445 swap(maparray[i+1], maparray[nummodesA+i]);
1455 if (faceOrient == 6 || faceOrient == 8 ||
1456 faceOrient == 11 || faceOrient == 12)
1460 for (i = 3; i < nummodesB; i += 2)
1462 for (j = 0; j < nummodesA; j++)
1464 signarray[arrayindx[i*nummodesA+j]] *= -1;
1468 for (i = 0; i < nummodesA; i++)
1470 swap(maparray [i], maparray [i+nummodesA]);
1471 swap(signarray[i], signarray[i+nummodesA]);
1476 for (i = 0; i < nummodesB; i++)
1478 for (j = 3; j < nummodesA; j += 2)
1480 signarray[arrayindx[i*nummodesA+j]] *= -1;
1484 for (i = 0; i < nummodesB; i++)
1486 swap (maparray [i], maparray [i+nummodesB]);
1487 swap (signarray[i], signarray[i+nummodesB]);
1492 if (faceOrient == 7 || faceOrient == 8 ||
1493 faceOrient == 10 || faceOrient == 12)
1497 for (i = 0; i < nummodesB; i++)
1499 for (j = 3; j < nummodesA; j += 2)
1501 signarray[arrayindx[i*nummodesA+j]] *= -1;
1505 for(i = 0; i < nummodesB; i++)
1507 swap(maparray [i*nummodesA], maparray [i*nummodesA+1]);
1508 swap(signarray[i*nummodesA], signarray[i*nummodesA+1]);
1513 for (i = 3; i < nummodesB; i += 2)
1515 for (j = 0; j < nummodesA; j++)
1517 signarray[arrayindx[i*nummodesA+j]] *= -1;
1521 for (i = 0; i < nummodesA; i++)
1523 swap(maparray [i*nummodesB], maparray [i*nummodesB+1]);
1524 swap(signarray[i*nummodesB], signarray[i*nummodesB+1]);
1536 "Mapping not defined for this type of basis");
1543 Array<OneD, unsigned int> &maparray,
1544 Array<OneD, int> &signarray)
1548 const int P =
m_base[0]->GetNumModes() - 2;
1549 const int Q =
m_base[1]->GetNumModes() - 2;
1550 const int R =
m_base[2]->GetNumModes() - 2;
1553 if (maparray.num_elements() != nEdgeIntCoeffs)
1555 maparray = Array<OneD, unsigned int>(nEdgeIntCoeffs);
1558 if(signarray.num_elements() != nEdgeIntCoeffs)
1560 signarray = Array<OneD, int>(nEdgeIntCoeffs,1);
1564 fill(signarray.get(), signarray.get()+nEdgeIntCoeffs, 1);
1590 offset += 2*(P+Q)+R;
1593 offset += 2*(P+Q+R);
1596 offset += 2*(P+Q)+3*R;
1599 ASSERTL0(
false,
"Edge not defined.");
1603 for (i = 0; i < nEdgeIntCoeffs; ++i)
1605 maparray[i] = offset + i;
1610 for (i = 1; i < nEdgeIntCoeffs; i += 2)
1620 Array<OneD, unsigned int> &maparray,
1621 Array<OneD, int> &signarray)
1623 const int P =
m_base[0]->GetNumModes() - 1;
1624 const int Q =
m_base[1]->GetNumModes() - 1;
1625 const int R =
m_base[2]->GetNumModes() - 1;
1627 int p, q, r, idx = 0;
1632 if (maparray.num_elements() != nFaceIntCoeffs)
1634 maparray = Array<OneD, unsigned int>(nFaceIntCoeffs);
1637 if (signarray.num_elements() != nFaceIntCoeffs)
1639 signarray = Array<OneD, int>(nFaceIntCoeffs, 1);
1643 fill(signarray.get(), signarray.get()+nFaceIntCoeffs, 1);
1648 Array<OneD, int> arrayindx(nFaceIntCoeffs);
1654 for (i = 0; i < nummodesB; i++)
1656 for (j = 0; j < nummodesA; j++)
1660 arrayindx[i*nummodesA+j] = i*nummodesA+j;
1664 arrayindx[i*nummodesA+j] = j*nummodesB+i;
1670 int offset = 5 + 2*(P-1) + 2*(Q-1) + 4*(R-1);
1672 for (i = 0; i < fid; ++i)
1680 for (q = 2; q <= Q; ++q)
1682 for (p = 2; p <= P; ++p)
1684 maparray[arrayindx[(q-2)*nummodesA+(p-2)]]
1685 = offset + (q-2)*nummodesA+(p-2);
1692 for (p = 2; p <= P; ++p)
1694 for (r = 1; r <= R-p; ++r, ++idx)
1696 if ((
int)faceOrient == 7)
1698 signarray[idx] = p % 2 ? -1 : 1;
1700 maparray[idx] = offset + idx;
1707 for (q = 2; q <= Q; ++q)
1709 for (r = 1; r <= R-q; ++r, ++idx)
1711 if ((
int)faceOrient == 7)
1713 signarray[idx] = q % 2 ? -1 : 1;
1715 maparray[idx] = offset + idx;
1721 ASSERTL0(
false,
"Face interior map not available.");
1731 if (faceOrient == 6 || faceOrient == 8 ||
1732 faceOrient == 11 || faceOrient == 12)
1736 for (i = 1; i < nummodesB; i += 2)
1738 for (j = 0; j < nummodesA; j++)
1740 signarray[arrayindx[i*nummodesA+j]] *= -1;
1746 for (i = 0; i < nummodesB; i++)
1748 for (j = 1; j < nummodesA; j += 2)
1750 signarray[arrayindx[i*nummodesA+j]] *= -1;
1756 if (faceOrient == 7 || faceOrient == 8 ||
1757 faceOrient == 10 || faceOrient == 12)
1761 for (i = 0; i < nummodesB; i++)
1763 for (j = 1; j < nummodesA; j += 2)
1765 signarray[arrayindx[i*nummodesA+j]] *= -1;
1771 for (i = 1; i < nummodesB; i += 2)
1773 for (j = 0; j < nummodesA; j++)
1775 signarray[arrayindx[i*nummodesA+j]] *= -1;
1786 "BasisType is not a boundary interior form");
1789 "BasisType is not a boundary interior form");
1792 "BasisType is not a boundary interior form");
1797 if (outarray.num_elements() != nIntCoeffs)
1799 outarray = Array<OneD, unsigned int>(nIntCoeffs);
1804 for (p = nBndCoeffs; p <
m_ncoeffs; ++p)
1806 outarray[idx++] = p;
1814 "BasisType is not a boundary interior form");
1817 "BasisType is not a boundary interior form");
1820 "BasisType is not a boundary interior form");
1824 for (idx = 0; idx < nBndry; ++idx)
1826 maparray[idx] = idx;
1851 const int R =
m_base[2]->GetNumModes();
1853 for (i = 0; i < I; ++i)
1855 cnt += (R-i)*(R-i+1)/2;
1859 for (j = 0; j < J; ++j)
1869 const Array<OneD, const NekDouble>& inarray,
1870 Array<OneD, NekDouble>& outarray)
1874 int nquad0 =
m_base[0]->GetNumPoints();
1875 int nquad1 =
m_base[1]->GetNumPoints();
1876 int nquad2 =
m_base[2]->GetNumPoints();
1878 const Array<OneD, const NekDouble>& w0 =
m_base[0]->GetW();
1879 const Array<OneD, const NekDouble>& w1 =
m_base[1]->GetW();
1880 const Array<OneD, const NekDouble>& w2 =
m_base[2]->GetW();
1882 const Array<OneD, const NekDouble>& z2 =
m_base[2]->GetZ();
1885 for(i = 0; i < nquad1*nquad2; ++i)
1888 w0.get(), 1, outarray.get()+i*nquad0,1);
1892 for(j = 0; j < nquad2; ++j)
1894 for(i = 0; i < nquad1; ++i)
1896 Blas::Dscal(nquad0,w1[i], &outarray[0]+i*nquad0 +
1908 for(i = 0; i < nquad2; ++i)
1910 Blas::Dscal(nquad0*nquad1, 0.25*w2[i],
1911 &outarray[0]+i*nquad0*nquad1, 1);
1916 for(i = 0; i < nquad2; ++i)
1918 Blas::Dscal(nquad0*nquad1,0.125*(1-z2[i])*(1-z2[i])*w2[i],
1919 &outarray[0]+i*nquad0*nquad1,1);