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;
962 const std::vector<unsigned int> &nummodes,
966 nummodes[modes_offset],
967 nummodes[modes_offset+1],
968 nummodes[modes_offset+2]);
976 ASSERTL2(i >= 0 && i <= 7,
"edge id is out of range");
977 if (i == 0 || i == 2)
981 else if (i == 1 || i == 3)
999 Array<OneD, unsigned int> &maparray,
1000 Array<OneD, int> &signarray,
1005 "Method only implemented if BasisType is identical"
1006 "in x and y directions");
1009 "Method only implemented for Modified_A BasisType"
1010 "(x and y direction) and Modified_C BasisType (z "
1013 int i, j, p, q, r, nFaceCoeffs;
1015 int order0 =
m_base[0]->GetNumModes();
1016 int order1 =
m_base[1]->GetNumModes();
1017 int order2 =
m_base[2]->GetNumModes();
1019 if (nummodesA == -1)
1024 nummodesA =
m_base[0]->GetNumModes();
1025 nummodesB =
m_base[1]->GetNumModes();
1029 nummodesA =
m_base[0]->GetNumModes();
1030 nummodesB =
m_base[2]->GetNumModes();
1034 nummodesA =
m_base[1]->GetNumModes();
1035 nummodesB =
m_base[2]->GetNumModes();
1042 nFaceCoeffs = nummodesB + (nummodesA-1)*(1+2*(nummodesB-1)-(nummodesA-1))/2;
1046 nFaceCoeffs = nummodesA*nummodesB;
1050 if (maparray.num_elements() != nFaceCoeffs)
1052 maparray = Array<OneD, unsigned int>(nFaceCoeffs);
1055 if (signarray.num_elements() != nFaceCoeffs)
1057 signarray = Array<OneD, int>(nFaceCoeffs,1);
1061 fill(signarray.get(), signarray.get() + nFaceCoeffs, 1);
1066 Array<OneD, int> arrayindx(nFaceCoeffs,-1);
1070 for (i = 0; i < nummodesB; i++)
1072 for (j = 0; j < nummodesA; j++)
1076 arrayindx[i*nummodesA+j] = i*nummodesA+j;
1080 arrayindx[i*nummodesA+j] = j*nummodesB+i;
1094 maparray[arrayindx[0]] = 0;
1095 maparray[arrayindx[1]] = 1;
1096 maparray[arrayindx[nummodesA+1]] = 2;
1097 maparray[arrayindx[nummodesA]] = 3;
1101 for (p = 2; p < nummodesA; ++p)
1103 maparray[arrayindx[p]] = p-2 + cnt;
1108 for (q = 2; q < nummodesB; ++q)
1110 maparray[arrayindx[q*nummodesA+1]] = q-2 + cnt;
1115 for (p = 2; p < nummodesA; ++p)
1117 maparray[arrayindx[nummodesA+p]] = p-2 + cnt;
1122 for (q = 2; q < nummodesB; ++q)
1124 maparray[arrayindx[q*nummodesA]] = q-2 + cnt;
1128 cnt += nummodesB-2 + 4*(nummodesA-2);
1129 for (q = 2; q < nummodesB; ++q)
1131 for (p = 2; p < nummodesA; ++p)
1133 maparray[arrayindx[q*nummodesA+p]] = cnt + (q-2)*nummodesA+(p-2);
1142 maparray[nummodesB] = 1;
1147 for (p = 2; p < nummodesA; q += nummodesB-p, ++p)
1149 maparray[q] = cnt++;
1150 if ((
int)faceOrient == 7)
1152 signarray[q] = p % 2 ? -1 : 1;
1157 cnt = 5 + 2*(order0-2) + 2*(order1-2) + (order2-2);
1158 for (q = 2; q < nummodesB; ++q)
1160 maparray[q] = cnt++;
1161 if ((
int)faceOrient == 7)
1163 signarray[q] = q % 2 ? -1 : 1;
1168 cnt = 5 + 2*(order0-2) + 2*(order1-2);
1169 for (q = 2; q < nummodesB; ++q)
1171 maparray[nummodesB+q-1] = cnt++;
1172 if ((
int)faceOrient == 7)
1174 signarray[nummodesB+q-1] = q % 2 ? -1 : 1;
1179 cnt = 5 + 2*(order0-2) + 2*(order1-2) + 4*(order2-2)
1181 cnt2 = 2*nummodesB + 1;
1182 for (p = 2; p < nummodesA; ++p)
1184 for (r = 2; r < nummodesB-p; ++r)
1186 maparray[cnt2] = cnt++;
1187 if ((
int)faceOrient == 7 && p > 1)
1189 signarray[cnt2++] = p % 2 ? -1 : 1;
1200 maparray[nummodesB] = 2;
1203 cnt = 5 + (order0-2);
1205 for (p = 2; p < nummodesA; q += nummodesB-p, ++p)
1207 maparray[q] = cnt++;
1208 if ((
int)faceOrient == 7)
1210 signarray[q] = p % 2 ? -1 : 1;
1215 cnt = 5 + 2*(order0-2) + 2*(order1-2) + 2*(order2-2);
1216 for (q = 2; q < nummodesB; ++q)
1218 maparray[q] = cnt++;
1219 if ((
int)faceOrient == 7)
1221 signarray[q] = q % 2 ? -1 : 1;
1226 cnt = 5 + 2*(order0-2) + 2*(order1-2) + (order2-2);
1227 for (q = 2; q < nummodesB; ++q)
1229 maparray[nummodesB+q-1] = cnt++;
1230 if ((
int)faceOrient == 7)
1232 signarray[nummodesB+q-1] = q % 2 ? -1 : 1;
1237 cnt = 5 + 2*(order0-2) + 2*(order1-2) + 4*(order2-2)
1239 cnt2 = 2*nummodesB + 1;
1240 for (p = 2; p < nummodesA; ++p)
1242 for (r = 2; r < nummodesB-p; ++r)
1244 maparray[cnt2] = cnt++;
1245 if ((
int)faceOrient == 7 && p > 1)
1247 signarray[cnt2++] = p % 2 ? -1 : 1;
1258 maparray[nummodesB] = 2;
1261 cnt = 5 + (order0-2) + (order1-2);
1263 for (p = 2; p < nummodesA; q += nummodesB-p, ++p)
1265 maparray[q] = cnt++;
1266 if ((
int)faceOrient == 7)
1268 signarray[q] = p % 2 ? -1 : 1;
1273 cnt = 5 + 2*(order0-2) + 2*(order1-2) + 2*(order2-2);
1274 for (q = 2; q < nummodesB; ++q)
1276 maparray[q] = cnt++;
1277 if ((
int)faceOrient == 7)
1279 signarray[q] = q % 2 ? -1 : 1;
1284 cnt = 5 + 2*(order0-2) + 2*(order1-2) + 3*(order2-2);
1285 for (q = 2; q < nummodesB; ++q)
1287 maparray[nummodesB+q-1] = cnt++;
1288 if ((
int)faceOrient == 7)
1290 signarray[nummodesB+q-1] = q % 2 ? -1 : 1;
1295 cnt = 5 + 2*(order0-2) + 2*(order1-2) + 4*(order2-2)
1298 cnt2 = 2*nummodesB + 1;
1299 for (p = 2; p < nummodesA; ++p)
1301 for (r = 2; r < nummodesB-p; ++r)
1303 maparray[cnt2] = cnt++;
1304 if ((
int)faceOrient == 7 && p > 1)
1306 signarray[cnt2++] = p % 2 ? -1 : 1;
1317 maparray[nummodesB] = 3;
1320 cnt = 5 + 2*(order0-2) + (order1-2);
1322 for (p = 2; p < nummodesA; q += nummodesB-p, ++p)
1324 maparray[q] = cnt++;
1325 if ((
int)faceOrient == 7)
1327 signarray[q] = p % 2 ? -1 : 1;
1332 cnt = 5 + 2*(order0-2) + 2*(order1-2) + 3*(order2-2);
1333 for (q = 2; q < nummodesB; ++q)
1335 maparray[q] = cnt++;
1336 if ((
int)faceOrient == 7)
1338 signarray[q] = q % 2 ? -1 : 1;
1343 cnt = 5 + 2*(order0-2) + 2*(order1-2);
1344 for (q = 2; q < nummodesB; ++q)
1346 maparray[nummodesB+q-1] = cnt++;
1347 if ((
int)faceOrient == 7)
1349 signarray[nummodesB+q-1] = q % 2 ? -1 : 1;
1354 cnt = 5 + 2*(order0-2) + 2*(order1-2) + 4*(order2-2)
1357 cnt2 = 2*nummodesB + 1;
1358 for (p = 2; p < nummodesA; ++p)
1360 for (r = 2; r < nummodesB-p; ++r)
1362 maparray[cnt2] = cnt++;
1363 if ((
int)faceOrient == 7 && p > 1)
1365 signarray[cnt2++] = p % 2 ? -1 : 1;
1373 ASSERTL0(
false,
"Face to element map unavailable.");
1380 if ((
int)faceOrient == 7)
1382 swap(maparray[0], maparray[nummodesA]);
1383 for (i = 1; i < nummodesA-1; ++i)
1385 swap(maparray[i+1], maparray[nummodesA+i]);
1395 if (faceOrient == 6 || faceOrient == 8 ||
1396 faceOrient == 11 || faceOrient == 12)
1400 for (i = 3; i < nummodesB; i += 2)
1402 for (j = 0; j < nummodesA; j++)
1404 signarray[arrayindx[i*nummodesA+j]] *= -1;
1408 for (i = 0; i < nummodesA; i++)
1410 swap(maparray [i], maparray [i+nummodesA]);
1411 swap(signarray[i], signarray[i+nummodesA]);
1416 for (i = 0; i < nummodesB; i++)
1418 for (j = 3; j < nummodesA; j += 2)
1420 signarray[arrayindx[i*nummodesA+j]] *= -1;
1424 for (i = 0; i < nummodesB; i++)
1426 swap (maparray [i], maparray [i+nummodesB]);
1427 swap (signarray[i], signarray[i+nummodesB]);
1432 if (faceOrient == 7 || faceOrient == 8 ||
1433 faceOrient == 10 || faceOrient == 12)
1437 for (i = 0; i < nummodesB; i++)
1439 for (j = 3; j < nummodesA; j += 2)
1441 signarray[arrayindx[i*nummodesA+j]] *= -1;
1445 for(i = 0; i < nummodesB; i++)
1447 swap(maparray [i*nummodesA], maparray [i*nummodesA+1]);
1448 swap(signarray[i*nummodesA], signarray[i*nummodesA+1]);
1453 for (i = 3; i < nummodesB; i += 2)
1455 for (j = 0; j < nummodesA; j++)
1457 signarray[arrayindx[i*nummodesA+j]] *= -1;
1461 for (i = 0; i < nummodesA; i++)
1463 swap(maparray [i*nummodesB], maparray [i*nummodesB+1]);
1464 swap(signarray[i*nummodesB], signarray[i*nummodesB+1]);
1476 "Mapping not defined for this type of basis");
1483 Array<OneD, unsigned int> &maparray,
1484 Array<OneD, int> &signarray)
1488 const int P =
m_base[0]->GetNumModes() - 2;
1489 const int Q =
m_base[1]->GetNumModes() - 2;
1490 const int R =
m_base[2]->GetNumModes() - 2;
1493 if (maparray.num_elements() != nEdgeIntCoeffs)
1495 maparray = Array<OneD, unsigned int>(nEdgeIntCoeffs);
1498 if(signarray.num_elements() != nEdgeIntCoeffs)
1500 signarray = Array<OneD, int>(nEdgeIntCoeffs,1);
1504 fill(signarray.get(), signarray.get()+nEdgeIntCoeffs, 1);
1530 offset += 2*(P+Q)+R;
1533 offset += 2*(P+Q+R);
1536 offset += 2*(P+Q)+3*R;
1539 ASSERTL0(
false,
"Edge not defined.");
1543 for (i = 0; i < nEdgeIntCoeffs; ++i)
1545 maparray[i] = offset + i;
1550 for (i = 1; i < nEdgeIntCoeffs; i += 2)
1560 Array<OneD, unsigned int> &maparray,
1561 Array<OneD, int> &signarray)
1563 const int P =
m_base[0]->GetNumModes() - 1;
1564 const int Q =
m_base[1]->GetNumModes() - 1;
1565 const int R =
m_base[2]->GetNumModes() - 1;
1567 int p, q, r, idx = 0;
1572 if (maparray.num_elements() != nFaceIntCoeffs)
1574 maparray = Array<OneD, unsigned int>(nFaceIntCoeffs);
1577 if (signarray.num_elements() != nFaceIntCoeffs)
1579 signarray = Array<OneD, int>(nFaceIntCoeffs, 1);
1583 fill(signarray.get(), signarray.get()+nFaceIntCoeffs, 1);
1588 Array<OneD, int> arrayindx(nFaceIntCoeffs);
1594 for (i = 0; i < nummodesB; i++)
1596 for (j = 0; j < nummodesA; j++)
1600 arrayindx[i*nummodesA+j] = i*nummodesA+j;
1604 arrayindx[i*nummodesA+j] = j*nummodesB+i;
1610 int offset = 5 + 2*(P-1) + 2*(Q-1) + 4*(R-1);
1612 for (i = 0; i < fid; ++i)
1620 for (q = 2; q <= Q; ++q)
1622 for (p = 2; p <= P; ++p)
1624 maparray[arrayindx[(q-2)*nummodesA+(p-2)]]
1625 = offset + (q-2)*nummodesA+(p-2);
1632 for (p = 2; p <= P; ++p)
1634 for (r = 1; r <= R-p; ++r, ++idx)
1636 if ((
int)faceOrient == 7)
1638 signarray[idx] = p % 2 ? -1 : 1;
1640 maparray[idx] = offset + idx;
1647 for (q = 2; q <= Q; ++q)
1649 for (r = 1; r <= R-q; ++r, ++idx)
1651 if ((
int)faceOrient == 7)
1653 signarray[idx] = q % 2 ? -1 : 1;
1655 maparray[idx] = offset + idx;
1661 ASSERTL0(
false,
"Face interior map not available.");
1671 if (faceOrient == 6 || faceOrient == 8 ||
1672 faceOrient == 11 || faceOrient == 12)
1676 for (i = 1; i < nummodesB; i += 2)
1678 for (j = 0; j < nummodesA; j++)
1680 signarray[arrayindx[i*nummodesA+j]] *= -1;
1686 for (i = 0; i < nummodesB; i++)
1688 for (j = 1; j < nummodesA; j += 2)
1690 signarray[arrayindx[i*nummodesA+j]] *= -1;
1696 if (faceOrient == 7 || faceOrient == 8 ||
1697 faceOrient == 10 || faceOrient == 12)
1701 for (i = 0; i < nummodesB; i++)
1703 for (j = 1; j < nummodesA; j += 2)
1705 signarray[arrayindx[i*nummodesA+j]] *= -1;
1711 for (i = 1; i < nummodesB; i += 2)
1713 for (j = 0; j < nummodesA; j++)
1715 signarray[arrayindx[i*nummodesA+j]] *= -1;
1726 "BasisType is not a boundary interior form");
1729 "BasisType is not a boundary interior form");
1732 "BasisType is not a boundary interior form");
1737 if (outarray.num_elements() != nIntCoeffs)
1739 outarray = Array<OneD, unsigned int>(nIntCoeffs);
1744 for (p = nBndCoeffs; p <
m_ncoeffs; ++p)
1746 outarray[idx++] = p;
1754 "BasisType is not a boundary interior form");
1757 "BasisType is not a boundary interior form");
1760 "BasisType is not a boundary interior form");
1764 for (idx = 0; idx < nBndry; ++idx)
1766 maparray[idx] = idx;
1791 const int R =
m_base[2]->GetNumModes();
1793 for (i = 0; i < I; ++i)
1795 cnt += (R-i)*(R-i+1)/2;
1799 for (j = 0; j < J; ++j)
1809 const Array<OneD, const NekDouble>& inarray,
1810 Array<OneD, NekDouble>& outarray)
1814 int nquad0 =
m_base[0]->GetNumPoints();
1815 int nquad1 =
m_base[1]->GetNumPoints();
1816 int nquad2 =
m_base[2]->GetNumPoints();
1818 const Array<OneD, const NekDouble>& w0 =
m_base[0]->GetW();
1819 const Array<OneD, const NekDouble>& w1 =
m_base[1]->GetW();
1820 const Array<OneD, const NekDouble>& w2 =
m_base[2]->GetW();
1822 const Array<OneD, const NekDouble>& z2 =
m_base[2]->GetZ();
1825 for(i = 0; i < nquad1*nquad2; ++i)
1828 w0.get(), 1, outarray.get()+i*nquad0,1);
1832 for(j = 0; j < nquad2; ++j)
1834 for(i = 0; i < nquad1; ++i)
1836 Blas::Dscal(nquad0,w1[i], &outarray[0]+i*nquad0 +
1848 for(i = 0; i < nquad2; ++i)
1850 Blas::Dscal(nquad0*nquad1, 0.25*w2[i],
1851 &outarray[0]+i*nquad0*nquad1, 1);
1856 for(i = 0; i < nquad2; ++i)
1858 Blas::Dscal(nquad0*nquad1,0.125*(1-z2[i])*(1-z2[i])*w2[i],
1859 &outarray[0]+i*nquad0*nquad1,1);