35#include <boost/core/ignore_unused.hpp>
54 Ba.GetNumModes(), Bb.GetNumModes(), Bc.GetNumModes()),
57 Ba.GetNumModes(), Bb.GetNumModes(), Bc.GetNumModes()),
61 std::bind(&
Expansion3D::CreateMatrix, this, std::placeholders::_1),
62 std::string(
"PrismExpMatrix")),
63 m_staticCondMatrixManager(std::bind(&
Expansion::CreateStaticCondMatrix,
64 this, std::placeholders::_1),
65 std::string(
"PrismExpStaticCondMatrix"))
70 : StdExpansion(T), StdExpansion3D(T), StdPrismExp(T),
Expansion(T),
72 m_staticCondMatrixManager(T.m_staticCondMatrixManager)
102 int nquad0 =
m_base[0]->GetNumPoints();
103 int nquad1 =
m_base[1]->GetNumPoints();
104 int nquad2 =
m_base[2]->GetNumPoints();
112 (
NekDouble *)&inarray[0], 1, &tmp[0], 1);
117 (
NekDouble *)&inarray[0], 1, &tmp[0], 1);
121 return StdPrismExp::v_Integral(tmp);
140 StdPrismExp::v_PhysDeriv(inarray, diff0, diff1, diff2);
146 Vmath::Vmul(nqtot, &df[0][0], 1, &diff0[0], 1, &out_d0[0], 1);
147 Vmath::Vvtvp(nqtot, &df[1][0], 1, &diff1[0], 1, &out_d0[0], 1,
149 Vmath::Vvtvp(nqtot, &df[2][0], 1, &diff2[0], 1, &out_d0[0], 1,
155 Vmath::Vmul(nqtot, &df[3][0], 1, &diff0[0], 1, &out_d1[0], 1);
156 Vmath::Vvtvp(nqtot, &df[4][0], 1, &diff1[0], 1, &out_d1[0], 1,
158 Vmath::Vvtvp(nqtot, &df[5][0], 1, &diff2[0], 1, &out_d1[0], 1,
164 Vmath::Vmul(nqtot, &df[6][0], 1, &diff0[0], 1, &out_d2[0], 1);
165 Vmath::Vvtvp(nqtot, &df[7][0], 1, &diff1[0], 1, &out_d2[0], 1,
167 Vmath::Vvtvp(nqtot, &df[8][0], 1, &diff2[0], 1, &out_d2[0], 1,
175 Vmath::Smul(nqtot, df[0][0], &diff0[0], 1, &out_d0[0], 1);
176 Blas::Daxpy(nqtot, df[1][0], &diff1[0], 1, &out_d0[0], 1);
177 Blas::Daxpy(nqtot, df[2][0], &diff2[0], 1, &out_d0[0], 1);
182 Vmath::Smul(nqtot, df[3][0], &diff0[0], 1, &out_d1[0], 1);
183 Blas::Daxpy(nqtot, df[4][0], &diff1[0], 1, &out_d1[0], 1);
184 Blas::Daxpy(nqtot, df[5][0], &diff2[0], 1, &out_d1[0], 1);
189 Vmath::Smul(nqtot, df[6][0], &diff0[0], 1, &out_d2[0], 1);
190 Blas::Daxpy(nqtot, df[7][0], &diff1[0], 1, &out_d2[0], 1);
191 Blas::Daxpy(nqtot, df[8][0], &diff2[0], 1, &out_d2[0], 1);
216 if (
m_base[0]->Collocation() &&
m_base[1]->Collocation() &&
233 out = (*matsys) * in;
275 const int nquad0 =
m_base[0]->GetNumPoints();
276 const int nquad1 =
m_base[1]->GetNumPoints();
277 const int nquad2 =
m_base[2]->GetNumPoints();
278 const int order0 =
m_base[0]->GetNumModes();
279 const int order1 =
m_base[1]->GetNumModes();
283 if (multiplybyweights)
291 tmp, outarray, wsp,
true,
true,
true);
297 inarray, outarray, wsp,
true,
true,
true);
342 const int nquad0 =
m_base[0]->GetNumPoints();
343 const int nquad1 =
m_base[1]->GetNumPoints();
344 const int nquad2 =
m_base[2]->GetNumPoints();
345 const int order0 =
m_base[0]->GetNumModes();
346 const int order1 =
m_base[1]->GetNumModes();
347 const int nqtot = nquad0 * nquad1 * nquad2;
366 m_base[2]->GetBdata(), tmp2, outarray, wsp,
370 m_base[2]->GetBdata(), tmp3, tmp6, wsp,
true,
376 m_base[2]->GetDbdata(), tmp4, tmp6, wsp,
true,
386 const int nquad0 =
m_base[0]->GetNumPoints();
387 const int nquad1 =
m_base[1]->GetNumPoints();
388 const int nquad2 =
m_base[2]->GetNumPoints();
389 const int order0 =
m_base[0]->GetNumModes();
390 const int order1 =
m_base[1]->GetNumModes();
391 const int nqtot = nquad0 * nquad1 * nquad2;
414 Vmath::Vmul(nqtot, &df[3 * dir][0], 1, tmp1.get(), 1, tmp2.get(), 1);
415 Vmath::Vmul(nqtot, &df[3 * dir + 1][0], 1, tmp1.get(), 1, tmp3.get(),
417 Vmath::Vmul(nqtot, &df[3 * dir + 2][0], 1, tmp1.get(), 1, tmp4.get(),
422 Vmath::Smul(nqtot, df[3 * dir][0], tmp1.get(), 1, tmp2.get(), 1);
423 Vmath::Smul(nqtot, df[3 * dir + 1][0], tmp1.get(), 1, tmp3.get(), 1);
424 Vmath::Smul(nqtot, df[3 * dir + 2][0], tmp1.get(), 1, tmp4.get(), 1);
428 for (
int i = 0; i < nquad0; ++i)
430 gfac0[i] = 0.5 * (1 + z0[i]);
434 for (
int i = 0; i < nquad2; ++i)
436 gfac2[i] = 2.0 / (1 - z2[i]);
439 const int nq01 = nquad0 * nquad1;
441 for (
int i = 0; i < nquad2; ++i)
443 Vmath::Smul(nq01, gfac2[i], &tmp2[0] + i * nq01, 1, &tmp2[0] + i * nq01,
445 Vmath::Smul(nq01, gfac2[i], &tmp4[0] + i * nq01, 1, &tmp5[0] + i * nq01,
449 for (
int i = 0; i < nquad1 * nquad2; ++i)
451 Vmath::Vmul(nquad0, &gfac0[0], 1, &tmp5[0] + i * nquad0, 1,
452 &tmp5[0] + i * nquad0, 1);
455 Vmath::Vadd(nqtot, &tmp2[0], 1, &tmp5[0], 1, &tmp2[0], 1);
466 m_base[2]->GetBasisKey());
472 m_base[0]->GetPointsKey());
474 m_base[1]->GetPointsKey());
476 m_base[2]->GetPointsKey());
479 bkey0, bkey1, bkey2);
491 ASSERTL1(Lcoords[0] <= -1.0 && Lcoords[0] >= 1.0 && Lcoords[1] <= -1.0 &&
492 Lcoords[1] >= 1.0 && Lcoords[2] <= -1.0 && Lcoords[2] >= 1.0,
493 "Local coordinates are not in region [-1,1]");
497 for (i = 0; i <
m_geom->GetCoordim(); ++i)
499 coords[i] =
m_geom->GetCoord(i, Lcoords);
520 return StdExpansion3D::v_PhysEvaluate(Lcoord, physvals);
530 m_geom->GetLocCoords(coord, Lcoord);
532 return StdExpansion3D::v_PhysEvaluate(Lcoord, physvals);
537 std::array<NekDouble, 3> &firstOrderDerivs)
541 m_geom->GetLocCoords(coord, Lcoord);
542 return StdPrismExp::v_PhysEvaluate(Lcoord, inarray, firstOrderDerivs);
550 const NekDouble *data,
const std::vector<unsigned int> &nummodes,
551 const int mode_offset,
NekDouble *coeffs,
552 std::vector<LibUtilities::BasisType> &fromType)
554 boost::ignore_unused(fromType);
556 int data_order0 = nummodes[mode_offset];
557 int fillorder0 = min(
m_base[0]->GetNumModes(), data_order0);
558 int data_order1 = nummodes[mode_offset + 1];
559 int order1 =
m_base[1]->GetNumModes();
560 int fillorder1 = min(order1, data_order1);
561 int data_order2 = nummodes[mode_offset + 2];
562 int order2 =
m_base[2]->GetNumModes();
563 int fillorder2 = min(order2, data_order2);
574 "Extraction routine not set up for this basis");
576 "Extraction routine not set up for this basis");
579 for (j = 0; j < fillorder0; ++j)
581 for (i = 0; i < fillorder1; ++i)
583 Vmath::Vcopy(fillorder2 - j, &data[cnt], 1, &coeffs[cnt1],
585 cnt += data_order2 - j;
590 for (i = fillorder1; i < data_order1; ++i)
592 cnt += data_order2 - j;
595 for (i = fillorder1; i < order1; ++i)
603 ASSERTL0(
false,
"basis is either not set up or not "
610 int nquad0 =
m_base[0]->GetNumPoints();
611 int nquad1 =
m_base[1]->GetNumPoints();
612 int nquad2 =
m_base[2]->GetNumPoints();
621 if (outarray.size() != nq0 * nq1)
627 for (
int i = 0; i < nquad0 * nquad1; ++i)
636 if (outarray.size() != nq0 * nq1)
642 for (
int k = 0; k < nquad2; k++)
644 for (
int i = 0; i < nquad0; ++i)
646 outarray[k * nquad0 + i] = (nquad0 * nquad1 * k) + i;
655 if (outarray.size() != nq0 * nq1)
661 for (
int j = 0; j < nquad1 * nquad2; ++j)
663 outarray[j] = nquad0 - 1 + j * nquad0;
669 if (outarray.size() != nq0 * nq1)
675 for (
int k = 0; k < nquad2; k++)
677 for (
int i = 0; i < nquad0; ++i)
679 outarray[k * nquad0 + i] =
680 nquad0 * (nquad1 - 1) + (nquad0 * nquad1 * k) + i;
688 if (outarray.size() != nq0 * nq1)
694 for (
int j = 0; j < nquad1 * nquad2; ++j)
696 outarray[j] = j * nquad0;
700 ASSERTL0(
false,
"face value (> 4) is out of range");
715 for (
int i = 0; i < ptsKeys.size(); ++i)
727 geomFactors->GetDerivFactors(ptsKeys);
730 int nq0 = ptsKeys[0].GetNumPoints();
731 int nq1 = ptsKeys[1].GetNumPoints();
732 int nq2 = ptsKeys[2].GetNumPoints();
733 int nq01 = nq0 * nq1;
747 for (i = 0; i < vCoordDim; ++i)
752 size_t nqb = nq_face;
767 for (i = 0; i < vCoordDim; ++i)
769 normal[i][0] = -df[3 * i + 2][0];
776 for (i = 0; i < vCoordDim; ++i)
778 normal[i][0] = -df[3 * i + 1][0];
784 for (i = 0; i < vCoordDim; ++i)
786 normal[i][0] = df[3 * i][0] + df[3 * i + 2][0];
792 for (i = 0; i < vCoordDim; ++i)
794 normal[i][0] = df[3 * i + 1][0];
800 for (i = 0; i < vCoordDim; ++i)
802 normal[i][0] = -df[3 * i][0];
807 ASSERTL0(
false,
"face is out of range (face < 4)");
812 for (i = 0; i < vCoordDim; ++i)
814 fac += normal[i][0] * normal[i][0];
816 fac = 1.0 /
sqrt(fac);
820 for (i = 0; i < vCoordDim; ++i)
822 Vmath::Fill(nq_face, fac * normal[i][0], normal[i], 1);
835 else if (face == 1 || face == 3)
857 for (j = 0; j < nq01; ++j)
859 normals[j] = -df[2][j] * jac[j];
860 normals[nqtot + j] = -df[5][j] * jac[j];
861 normals[2 * nqtot + j] = -df[8][j] * jac[j];
865 points0 = ptsKeys[0];
866 points1 = ptsKeys[1];
872 for (j = 0; j < nq0; ++j)
874 for (k = 0; k < nq2; ++k)
876 int tmp = j + nq01 * k;
877 normals[j + k * nq0] = -df[1][tmp] * jac[tmp];
878 normals[nqtot + j + k * nq0] = -df[4][tmp] * jac[tmp];
879 normals[2 * nqtot + j + k * nq0] =
880 -df[7][tmp] * jac[tmp];
881 faceJac[j + k * nq0] = jac[tmp];
885 points0 = ptsKeys[0];
886 points1 = ptsKeys[2];
892 for (j = 0; j < nq1; ++j)
894 for (k = 0; k < nq2; ++k)
896 int tmp = nq0 - 1 + nq0 * j + nq01 * k;
897 normals[j + k * nq1] =
898 (df[0][tmp] + df[2][tmp]) * jac[tmp];
899 normals[nqtot + j + k * nq1] =
900 (df[3][tmp] + df[5][tmp]) * jac[tmp];
901 normals[2 * nqtot + j + k * nq1] =
902 (df[6][tmp] + df[8][tmp]) * jac[tmp];
903 faceJac[j + k * nq1] = jac[tmp];
907 points0 = ptsKeys[1];
908 points1 = ptsKeys[2];
914 for (j = 0; j < nq0; ++j)
916 for (k = 0; k < nq2; ++k)
918 int tmp = nq0 * (nq1 - 1) + j + nq01 * k;
919 normals[j + k * nq0] = df[1][tmp] * jac[tmp];
920 normals[nqtot + j + k * nq0] = df[4][tmp] * jac[tmp];
921 normals[2 * nqtot + j + k * nq0] =
922 df[7][tmp] * jac[tmp];
923 faceJac[j + k * nq0] = jac[tmp];
927 points0 = ptsKeys[0];
928 points1 = ptsKeys[2];
934 for (j = 0; j < nq1; ++j)
936 for (k = 0; k < nq2; ++k)
938 int tmp = j * nq0 + nq01 * k;
939 normals[j + k * nq1] = -df[0][tmp] * jac[tmp];
940 normals[nqtot + j + k * nq1] = -df[3][tmp] * jac[tmp];
941 normals[2 * nqtot + j + k * nq1] =
942 -df[6][tmp] * jac[tmp];
943 faceJac[j + k * nq1] = jac[tmp];
947 points0 = ptsKeys[1];
948 points1 = ptsKeys[2];
953 ASSERTL0(
false,
"face is out of range (face < 4)");
961 Vmath::Sdiv(nq_face, 1.0, &work[0], 1, &work[0], 1);
964 for (i = 0; i < vCoordDim; ++i)
969 Vmath::Vmul(nq_face, work, 1, normal[i], 1, normal[i], 1);
976 Vmath::Vvtvp(nq_face, normal[i], 1, normal[i], 1, work, 1, work, 1);
986 Vmath::Vmul(nq_face, normal[i], 1, work, 1, normal[i], 1);
995 StdExpansion::MassMatrixOp_MatFree(inarray, outarray, mkey);
1010 StdExpansion::LaplacianMatrixOp_MatFree(k1, k2, inarray, outarray, mkey);
1041 StdPrismExp::v_SVVLaplacianFilter(array, mkey);
1067 returnval = StdPrismExp::v_GenMatrix(mkey);
1083 return tmp->GetStdMatrix(mkey);
1129 int nquad0 =
m_base[0]->GetNumPoints();
1130 int nquad1 =
m_base[1]->GetNumPoints();
1131 int nquad2 =
m_base[2]->GetNumPoints();
1132 int nqtot = nquad0 * nquad1 * nquad2;
1166 StdExpansion3D::PhysTensorDeriv(inarray, wsp1, wsp2, wsp3);
1175 for (i = 0; i < nquad2; ++i)
1178 &h0[0] + i * nquad0 * nquad1, 1);
1180 &h1[0] + i * nquad0 * nquad1, 1);
1182 for (i = 0; i < nquad0; i++)
1184 Blas::Dscal(nquad1 * nquad2, 0.5 * (1 + z0[i]), &h1[0] + i, nquad0);
1193 Vmath::Vvtvvtp(nqtot, &df[0][0], 1, &h0[0], 1, &df[2][0], 1, &h1[0], 1,
1196 Vmath::Vvtvvtp(nqtot, &df[3][0], 1, &h0[0], 1, &df[5][0], 1, &h1[0], 1,
1199 Vmath::Vvtvvtp(nqtot, &df[6][0], 1, &h0[0], 1, &df[8][0], 1, &h1[0], 1,
1203 Vmath::Vvtvvtp(nqtot, &wsp4[0], 1, &wsp4[0], 1, &wsp5[0], 1, &wsp5[0],
1205 Vmath::Vvtvp(nqtot, &wsp6[0], 1, &wsp6[0], 1, &g0[0], 1, &g0[0], 1);
1208 Vmath::Vvtvvtp(nqtot, &df[1][0], 1, &wsp4[0], 1, &df[4][0], 1, &wsp5[0],
1210 Vmath::Vvtvp(nqtot, &df[7][0], 1, &wsp6[0], 1, &g3[0], 1, &g3[0], 1);
1213 Vmath::Vvtvvtp(nqtot, &df[2][0], 1, &wsp4[0], 1, &df[5][0], 1, &wsp5[0],
1215 Vmath::Vvtvp(nqtot, &df[8][0], 1, &wsp6[0], 1, &g4[0], 1, &g4[0], 1);
1220 &df[4][0], 1, &g1[0], 1);
1221 Vmath::Vvtvp(nqtot, &df[7][0], 1, &df[7][0], 1, &g1[0], 1, &g1[0], 1);
1225 &df[5][0], 1, &g2[0], 1);
1226 Vmath::Vvtvp(nqtot, &df[8][0], 1, &df[8][0], 1, &g2[0], 1, &g2[0], 1);
1230 &df[5][0], 1, &g5[0], 1);
1231 Vmath::Vvtvp(nqtot, &df[7][0], 1, &df[8][0], 1, &g5[0], 1, &g5[0], 1);
1246 Vmath::Vvtvvtp(nqtot, &wsp4[0], 1, &wsp4[0], 1, &wsp5[0], 1, &wsp5[0],
1248 Vmath::Vvtvp(nqtot, &wsp6[0], 1, &wsp6[0], 1, &g0[0], 1, &g0[0], 1);
1251 Vmath::Svtsvtp(nqtot, df[1][0], &wsp4[0], 1, df[4][0], &wsp5[0], 1,
1253 Vmath::Svtvp(nqtot, df[7][0], &wsp6[0], 1, &g3[0], 1, &g3[0], 1);
1256 Vmath::Svtsvtp(nqtot, df[2][0], &wsp4[0], 1, df[5][0], &wsp5[0], 1,
1258 Vmath::Svtvp(nqtot, df[8][0], &wsp6[0], 1, &g4[0], 1, &g4[0], 1);
1263 df[1][0] * df[1][0] + df[4][0] * df[4][0] +
1264 df[7][0] * df[7][0],
1269 df[2][0] * df[2][0] + df[5][0] * df[5][0] +
1270 df[8][0] * df[8][0],
1275 df[1][0] * df[2][0] + df[4][0] * df[5][0] +
1276 df[7][0] * df[8][0],
1281 Vmath::Vvtvvtp(nqtot, &g0[0], 1, &wsp1[0], 1, &g3[0], 1, &wsp2[0], 1,
1283 Vmath::Vvtvp(nqtot, &g4[0], 1, &wsp3[0], 1, &wsp7[0], 1, &wsp7[0], 1);
1284 Vmath::Vvtvvtp(nqtot, &g1[0], 1, &wsp2[0], 1, &g3[0], 1, &wsp1[0], 1,
1286 Vmath::Vvtvp(nqtot, &g5[0], 1, &wsp3[0], 1, &wsp8[0], 1, &wsp8[0], 1);
1287 Vmath::Vvtvvtp(nqtot, &g2[0], 1, &wsp3[0], 1, &g4[0], 1, &wsp1[0], 1,
1289 Vmath::Vvtvp(nqtot, &g5[0], 1, &wsp2[0], 1, &wsp9[0], 1, &wsp9[0], 1);
1314 boost::ignore_unused(oldstandard);
1316 int np0 =
m_base[0]->GetNumPoints();
1317 int np1 =
m_base[1]->GetNumPoints();
1318 int np2 =
m_base[2]->GetNumPoints();
1319 int np = max(np0, max(np1, np2));
1321 bool standard =
true;
1323 int vid0 =
m_geom->GetVid(0);
1324 int vid1 =
m_geom->GetVid(1);
1325 int vid2 =
m_geom->GetVid(4);
1329 if ((vid2 < vid1) && (vid2 < vid0))
1337 else if ((vid1 < vid2) && (vid1 < vid0))
1345 else if ((vid0 < vid2) && (vid0 < vid1))
1366 rot[0] = (0 + rotate) % 3;
1367 rot[1] = (1 + rotate) % 3;
1368 rot[2] = (2 + rotate) % 3;
1371 for (
int i = 0; i < np - 1; ++i)
1373 planep1 += (np - i) * np;
1378 if (standard ==
false)
1380 for (
int j = 0; j < np - 1; ++j)
1383 row1p1 += np - i - 1;
1384 for (
int k = 0; k < np - i - 2; ++k)
1387 prismpt[rot[0]] = plane + row + k;
1388 prismpt[rot[1]] = plane + row + k + 1;
1389 prismpt[rot[2]] = planep1 + row1 + k;
1391 prismpt[3 + rot[0]] = plane + rowp1 + k;
1392 prismpt[3 + rot[1]] = plane + rowp1 + k + 1;
1393 prismpt[3 + rot[2]] = planep1 + row1p1 + k;
1395 conn[cnt++] = prismpt[0];
1396 conn[cnt++] = prismpt[1];
1397 conn[cnt++] = prismpt[3];
1398 conn[cnt++] = prismpt[2];
1400 conn[cnt++] = prismpt[5];
1401 conn[cnt++] = prismpt[2];
1402 conn[cnt++] = prismpt[3];
1403 conn[cnt++] = prismpt[4];
1405 conn[cnt++] = prismpt[3];
1406 conn[cnt++] = prismpt[1];
1407 conn[cnt++] = prismpt[4];
1408 conn[cnt++] = prismpt[2];
1411 prismpt[rot[0]] = planep1 + row1 + k + 1;
1412 prismpt[rot[1]] = planep1 + row1 + k;
1413 prismpt[rot[2]] = plane + row + k + 1;
1415 prismpt[3 + rot[0]] = planep1 + row1p1 + k + 1;
1416 prismpt[3 + rot[1]] = planep1 + row1p1 + k;
1417 prismpt[3 + rot[2]] = plane + rowp1 + k + 1;
1419 conn[cnt++] = prismpt[0];
1420 conn[cnt++] = prismpt[1];
1421 conn[cnt++] = prismpt[2];
1422 conn[cnt++] = prismpt[5];
1424 conn[cnt++] = prismpt[5];
1425 conn[cnt++] = prismpt[0];
1426 conn[cnt++] = prismpt[4];
1427 conn[cnt++] = prismpt[1];
1429 conn[cnt++] = prismpt[3];
1430 conn[cnt++] = prismpt[4];
1431 conn[cnt++] = prismpt[0];
1432 conn[cnt++] = prismpt[5];
1436 prismpt[rot[0]] = plane + row + np - i - 2;
1437 prismpt[rot[1]] = plane + row + np - i - 1;
1438 prismpt[rot[2]] = planep1 + row1 + np - i - 2;
1440 prismpt[3 + rot[0]] = plane + rowp1 + np - i - 2;
1441 prismpt[3 + rot[1]] = plane + rowp1 + np - i - 1;
1442 prismpt[3 + rot[2]] = planep1 + row1p1 + np - i - 2;
1444 conn[cnt++] = prismpt[0];
1445 conn[cnt++] = prismpt[1];
1446 conn[cnt++] = prismpt[3];
1447 conn[cnt++] = prismpt[2];
1449 conn[cnt++] = prismpt[5];
1450 conn[cnt++] = prismpt[2];
1451 conn[cnt++] = prismpt[3];
1452 conn[cnt++] = prismpt[4];
1454 conn[cnt++] = prismpt[3];
1455 conn[cnt++] = prismpt[1];
1456 conn[cnt++] = prismpt[4];
1457 conn[cnt++] = prismpt[2];
1465 for (
int j = 0; j < np - 1; ++j)
1468 row1p1 += np - i - 1;
1469 for (
int k = 0; k < np - i - 2; ++k)
1472 prismpt[rot[0]] = plane + row + k;
1473 prismpt[rot[1]] = plane + row + k + 1;
1474 prismpt[rot[2]] = planep1 + row1 + k;
1476 prismpt[3 + rot[0]] = plane + rowp1 + k;
1477 prismpt[3 + rot[1]] = plane + rowp1 + k + 1;
1478 prismpt[3 + rot[2]] = planep1 + row1p1 + k;
1480 conn[cnt++] = prismpt[0];
1481 conn[cnt++] = prismpt[1];
1482 conn[cnt++] = prismpt[4];
1483 conn[cnt++] = prismpt[2];
1485 conn[cnt++] = prismpt[4];
1486 conn[cnt++] = prismpt[3];
1487 conn[cnt++] = prismpt[0];
1488 conn[cnt++] = prismpt[2];
1490 conn[cnt++] = prismpt[3];
1491 conn[cnt++] = prismpt[4];
1492 conn[cnt++] = prismpt[5];
1493 conn[cnt++] = prismpt[2];
1496 prismpt[rot[0]] = planep1 + row1 + k + 1;
1497 prismpt[rot[1]] = planep1 + row1 + k;
1498 prismpt[rot[2]] = plane + row + k + 1;
1500 prismpt[3 + rot[0]] = planep1 + row1p1 + k + 1;
1501 prismpt[3 + rot[1]] = planep1 + row1p1 + k;
1502 prismpt[3 + rot[2]] = plane + rowp1 + k + 1;
1504 conn[cnt++] = prismpt[0];
1505 conn[cnt++] = prismpt[2];
1506 conn[cnt++] = prismpt[1];
1507 conn[cnt++] = prismpt[5];
1509 conn[cnt++] = prismpt[3];
1510 conn[cnt++] = prismpt[5];
1511 conn[cnt++] = prismpt[0];
1512 conn[cnt++] = prismpt[1];
1514 conn[cnt++] = prismpt[5];
1515 conn[cnt++] = prismpt[3];
1516 conn[cnt++] = prismpt[4];
1517 conn[cnt++] = prismpt[1];
1521 prismpt[rot[0]] = plane + row + np - i - 2;
1522 prismpt[rot[1]] = plane + row + np - i - 1;
1523 prismpt[rot[2]] = planep1 + row1 + np - i - 2;
1525 prismpt[3 + rot[0]] = plane + rowp1 + np - i - 2;
1526 prismpt[3 + rot[1]] = plane + rowp1 + np - i - 1;
1527 prismpt[3 + rot[2]] = planep1 + row1p1 + np - i - 2;
1529 conn[cnt++] = prismpt[0];
1530 conn[cnt++] = prismpt[1];
1531 conn[cnt++] = prismpt[4];
1532 conn[cnt++] = prismpt[2];
1534 conn[cnt++] = prismpt[4];
1535 conn[cnt++] = prismpt[3];
1536 conn[cnt++] = prismpt[0];
1537 conn[cnt++] = prismpt[2];
1539 conn[cnt++] = prismpt[3];
1540 conn[cnt++] = prismpt[4];
1541 conn[cnt++] = prismpt[5];
1542 conn[cnt++] = prismpt[2];
1548 plane += (np - i) * np;
1569 if (d0factors.size() != 5)
1576 if (d0factors[0].size() != nquad0 * nquad1)
1583 if (d0factors[1].size() != nquad0 * nquad2)
1593 if (d0factors[2].size() != nquad1 * nquad2)
1615 int ncoords = normal_0.size();
1621 for (
int i = 0; i < nquad0 * nquad1; ++i)
1623 d0factors[0][i] = df[0][i] * normal_0[0][i];
1624 d1factors[0][i] = df[1][i] * normal_0[0][i];
1625 d2factors[0][i] = df[2][i] * normal_0[0][i];
1628 for (
int n = 1; n < ncoords; ++n)
1630 for (
int i = 0; i < nquad0 * nquad1; ++i)
1632 d0factors[0][i] += df[3 * n][i] * normal_0[n][i];
1633 d1factors[0][i] += df[3 * n + 1][i] * normal_0[n][i];
1634 d2factors[0][i] += df[3 * n + 2][i] * normal_0[n][i];
1639 for (
int j = 0; j < nquad2; ++j)
1641 for (
int i = 0; i < nquad0; ++i)
1643 d0factors[1][j * nquad0 + i] = df[0][j * nquad0 * nquad1 + i] *
1644 normal_1[0][j * nquad0 + i];
1645 d1factors[1][j * nquad0 + i] = df[1][j * nquad0 * nquad1 + i] *
1646 normal_1[0][j * nquad0 + i];
1647 d2factors[1][j * nquad0 + i] = df[2][j * nquad0 * nquad1 + i] *
1648 normal_1[0][j * nquad0 + i];
1650 d0factors[3][j * nquad0 + i] =
1651 df[0][(j + 1) * nquad0 * nquad1 - nquad0 + i] *
1652 normal_3[0][j * nquad0 + i];
1653 d1factors[3][j * nquad0 + i] =
1654 df[1][(j + 1) * nquad0 * nquad1 - nquad0 + i] *
1655 normal_3[0][j * nquad0 + i];
1656 d2factors[3][j * nquad0 + i] =
1657 df[2][(j + 1) * nquad0 * nquad1 - nquad0 + i] *
1658 normal_3[0][j * nquad0 + i];
1662 for (
int n = 1; n < ncoords; ++n)
1664 for (
int j = 0; j < nquad2; ++j)
1666 for (
int i = 0; i < nquad0; ++i)
1668 d0factors[1][j * nquad0 + i] +=
1669 df[3 * n][j * nquad0 * nquad1 + i] *
1670 normal_1[n][j * nquad0 + i];
1671 d1factors[1][j * nquad0 + i] +=
1672 df[3 * n + 1][j * nquad0 * nquad1 + i] *
1673 normal_1[n][j * nquad0 + i];
1674 d2factors[1][j * nquad0 + i] +=
1675 df[3 * n + 2][j * nquad0 * nquad1 + i] *
1676 normal_1[n][j * nquad0 + i];
1678 d0factors[3][j * nquad0 + i] +=
1679 df[3 * n][(j + 1) * nquad0 * nquad1 - nquad0 + i] *
1680 normal_3[n][j * nquad0 + i];
1681 d1factors[3][j * nquad0 + i] +=
1682 df[3 * n + 1][(j + 1) * nquad0 * nquad1 - nquad0 + i] *
1683 normal_3[n][j * nquad0 + i];
1684 d2factors[3][j * nquad0 + i] +=
1685 df[3 * n + 2][(j + 1) * nquad0 * nquad1 - nquad0 + i] *
1686 normal_3[n][j * nquad0 + i];
1692 for (
int j = 0; j < nquad2; ++j)
1694 for (
int i = 0; i < nquad1; ++i)
1696 d0factors[2][j * nquad1 + i] =
1697 df[0][j * nquad0 * nquad1 + (i + 1) * nquad0 - 1] *
1698 normal_2[0][j * nquad1 + i];
1699 d1factors[2][j * nquad1 + i] =
1700 df[1][j * nquad0 * nquad1 + (i + 1) * nquad0 - 1] *
1701 normal_2[0][j * nquad1 + i];
1702 d2factors[2][j * nquad1 + i] =
1703 df[2][j * nquad0 * nquad1 + (i + 1) * nquad0 - 1] *
1704 normal_2[0][j * nquad1 + i];
1706 d0factors[4][j * nquad1 + i] =
1707 df[0][j * nquad0 * nquad1 + i * nquad0] *
1708 normal_4[0][j * nquad1 + i];
1709 d1factors[4][j * nquad1 + i] =
1710 df[1][j * nquad0 * nquad1 + i * nquad0] *
1711 normal_4[0][j * nquad1 + i];
1712 d2factors[4][j * nquad1 + i] =
1713 df[2][j * nquad0 * nquad1 + i * nquad0] *
1714 normal_4[0][j * nquad1 + i];
1718 for (
int n = 1; n < ncoords; ++n)
1720 for (
int j = 0; j < nquad2; ++j)
1722 for (
int i = 0; i < nquad1; ++i)
1724 d0factors[2][j * nquad1 + i] +=
1725 df[3 * n][j * nquad0 * nquad1 + (i + 1) * nquad0 - 1] *
1726 normal_2[n][j * nquad1 + i];
1727 d1factors[2][j * nquad1 + i] +=
1729 [j * nquad0 * nquad1 + (i + 1) * nquad0 - 1] *
1730 normal_2[n][j * nquad1 + i];
1731 d2factors[2][j * nquad1 + i] +=
1733 [j * nquad0 * nquad1 + (i + 1) * nquad0 - 1] *
1734 normal_2[n][j * nquad1 + i];
1736 d0factors[4][j * nquad1 + i] +=
1737 df[3 * n][j * nquad0 * nquad1 + i * nquad0] *
1738 normal_4[n][j * nquad1 + i];
1739 d1factors[4][j * nquad1 + i] +=
1740 df[3 * n + 1][j * nquad0 * nquad1 + i * nquad0] *
1741 normal_4[n][j * nquad1 + i];
1742 d2factors[4][j * nquad1 + i] +=
1743 df[3 * n + 2][j * nquad0 * nquad1 + i * nquad0] *
1744 normal_4[n][j * nquad1 + i];
1752 for (
int i = 0; i < nquad0 * nquad1; ++i)
1754 d0factors[0][i] = df[0][0] * normal_0[0][i];
1755 d1factors[0][i] = df[1][0] * normal_0[0][i];
1756 d2factors[0][i] = df[2][0] * normal_0[0][i];
1759 for (
int n = 1; n < ncoords; ++n)
1761 for (
int i = 0; i < nquad0 * nquad1; ++i)
1763 d0factors[0][i] += df[3 * n][0] * normal_0[n][i];
1764 d1factors[0][i] += df[3 * n + 1][0] * normal_0[n][i];
1765 d2factors[0][i] += df[3 * n + 2][0] * normal_0[n][i];
1770 for (
int i = 0; i < nquad0 * nquad2; ++i)
1772 d0factors[1][i] = df[0][0] * normal_1[0][i];
1773 d0factors[3][i] = df[0][0] * normal_3[0][i];
1775 d1factors[1][i] = df[1][0] * normal_1[0][i];
1776 d1factors[3][i] = df[1][0] * normal_3[0][i];
1778 d2factors[1][i] = df[2][0] * normal_1[0][i];
1779 d2factors[3][i] = df[2][0] * normal_3[0][i];
1782 for (
int n = 1; n < ncoords; ++n)
1784 for (
int i = 0; i < nquad0 * nquad2; ++i)
1786 d0factors[1][i] += df[3 * n][0] * normal_1[n][i];
1787 d0factors[3][i] += df[3 * n][0] * normal_3[n][i];
1789 d1factors[1][i] += df[3 * n + 1][0] * normal_1[n][i];
1790 d1factors[3][i] += df[3 * n + 1][0] * normal_3[n][i];
1792 d2factors[1][i] += df[3 * n + 2][0] * normal_1[n][i];
1793 d2factors[3][i] += df[3 * n + 2][0] * normal_3[n][i];
1798 for (
int i = 0; i < nquad1 * nquad2; ++i)
1800 d0factors[2][i] = df[0][0] * normal_2[0][i];
1801 d0factors[4][i] = df[0][0] * normal_4[0][i];
1803 d1factors[2][i] = df[1][0] * normal_2[0][i];
1804 d1factors[4][i] = df[1][0] * normal_4[0][i];
1806 d2factors[2][i] = df[2][0] * normal_2[0][i];
1807 d2factors[4][i] = df[2][0] * normal_4[0][i];
1810 for (
int n = 1; n < ncoords; ++n)
1812 for (
int i = 0; i < nquad1 * nquad2; ++i)
1814 d0factors[2][i] += df[3 * n][0] * normal_2[n][i];
1815 d0factors[4][i] += df[3 * n][0] * normal_4[n][i];
1817 d1factors[2][i] += df[3 * n + 1][0] * normal_2[n][i];
1818 d1factors[4][i] += df[3 * n + 1][0] * normal_4[n][i];
1820 d2factors[2][i] += df[3 * n + 2][0] * normal_2[n][i];
1821 d2factors[4][i] += df[3 * n + 2][0] * normal_4[n][i];
#define ASSERTL0(condition, msg)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Describes the specification for a Basis.
int GetNumPoints() const
Return points order at which basis is defined.
PointsKey GetPointsKey() const
Return distribution of points.
Defines a specification for a set of points.
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey) override
std::map< int, NormalVector > m_traceNormals
std::map< int, Array< OneD, NekDouble > > m_elmtBndNormDirElmtLen
the element length in each element boundary(Vertex, edge or face) normal direction calculated based o...
SpatialDomains::GeometrySharedPtr GetGeom() const
SpatialDomains::GeometrySharedPtr m_geom
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3) override
SpatialDomains::GeomFactorsSharedPtr m_metricinfo
const NormalVector & GetTraceNormal(const int id)
virtual DNekMatSharedPtr v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey) override
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey) override
virtual StdRegions::StdExpansionSharedPtr v_GetStdExp(void) const override
virtual void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
void v_DropLocStaticCondMatrix(const MatrixKey &mkey) override
virtual void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
virtual void v_GetSimplexEquiSpacedConnectivity(Array< OneD, int > &conn, bool standard=true) override
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Calculate the inner product of inarray with respect to the basis B=base0*base1*base2 and put into out...
virtual DNekScalMatSharedPtr v_GetLocMatrix(const MatrixKey &mkey) override
void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Calculates the inner product .
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) override
Calculate the derivative of the physical points.
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
virtual void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true) override
virtual void v_ExtractDataToCoeffs(const NekDouble *data, const std::vector< unsigned int > &nummodes, const int mode_offset, NekDouble *coeffs, std::vector< LibUtilities::BasisType > &fromType) override
virtual void v_GetCoord(const Array< OneD, const NekDouble > &Lcoords, Array< OneD, NekDouble > &coords) override
Get the coordinates #coords at the local coordinates #Lcoords.
virtual void v_NormalTraceDerivFactors(Array< OneD, Array< OneD, NekDouble > > &d0factors, Array< OneD, Array< OneD, NekDouble > > &d1factors, Array< OneD, Array< OneD, NekDouble > > &d2factors) override
: This method gets all of the factors which are required as part of the Gradient Jump Penalty stabili...
virtual void v_AlignVectorToCollapsedDir(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray) override
virtual StdRegions::StdExpansionSharedPtr v_GetLinStdExp(void) const override
void v_ComputeTraceNormal(const int face) override
Get the normals along specficied face Get the face normals interplated to a points0 x points 0 type d...
virtual void v_MassMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
virtual void v_LaplacianMatrixOp_MatFree_Kernel(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp) override
Calculate the Laplacian multiplication in a matrix-free manner.
void v_IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
virtual NekDouble v_StdPhysEvaluate(const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals) override
virtual void v_FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Forward transform from physical quadrature space stored in inarray and evaluate the expansion coeffic...
PrismExp(const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb, const LibUtilities::BasisKey &Bc, const SpatialDomains::PrismGeomSharedPtr &geom)
Constructor using BasisKey class for quadrature points and order definition.
virtual void v_GetTracePhysMap(const int face, Array< OneD, int > &outarray) override
void v_DropLocMatrix(const MatrixKey &mkey) override
virtual NekDouble v_PhysEvaluate(const Array< OneD, const NekDouble > &coord, const Array< OneD, const NekDouble > &physvals) override
This function evaluates the expansion at a single (arbitrary) point of the domain.
virtual void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdRegions::StdMatrixKey &mkey) override
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix(const MatrixKey &mkey) override
virtual NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray) override
Integrate the physical point list inarray over prismatic region and return the value.
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3) override
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
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)
virtual void v_HelmholtzMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
int GetNcoeffs(void) const
This function returns the total number of coefficients used in the expansion.
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
const LibUtilities::PointsKeyVector GetPointsKeys() const
const LibUtilities::BasisKey GetTraceBasisKey(const int i, int k=-1) const
This function returns the basis key belonging to the i-th trace.
void LaplacianMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
LibUtilities::PointsType GetPointsType(const int dir) const
This function returns the type of quadrature points used in the dir direction.
int GetNumPoints(const int dir) const
This function returns the number of quadrature points in the dir direction.
void MultiplyByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Array< OneD, LibUtilities::BasisSharedPtr > m_base
MatrixType GetMatrixType() const
static void Dscal(const int &n, const double &alpha, double *x, const int &incx)
BLAS level 1: x = alpha x.
static void Daxpy(const int &n, const double &alpha, const double *x, const int &incx, const double *y, const int &incy)
BLAS level 1: y = alpha x plus y.
int getNumberOfCoefficients(int Na)
void Interp2D(const BasisKey &fbasis0, const BasisKey &fbasis1, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, const BasisKey &tbasis1, Array< OneD, NekDouble > &to)
this function interpolates a 2D function evaluated at the quadrature points of the 2D basis,...
std::vector< PointsKey > PointsKeyVector
@ eModified_B
Principle Modified Functions .
@ eModified_A
Principle Modified Functions .
std::shared_ptr< GeomFactors > GeomFactorsSharedPtr
Pointer to a GeomFactors object.
std::shared_ptr< PrismGeom > PrismGeomSharedPtr
GeomType
Indicates the type of element geometry.
@ eRegular
Geometry is straight-sided with constant geometric factors.
@ eMovingRegular
Currently unused.
@ eDeformed
Geometry is curved or has non-constant factors.
std::shared_ptr< StdPrismExp > StdPrismExpSharedPtr
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
@ eInvLaplacianWithUnityMean
The above copyright notice and this permission notice shall be included.
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
std::shared_ptr< DNekMat > DNekMatSharedPtr
void Vsqrt(int n, const T *x, const int incx, T *y, const int incy)
sqrt y = sqrt(x)
void Svtsvtp(int n, const T alpha, const T *x, int incx, const T beta, const T *y, int incy, T *z, int incz)
svtvvtp (scalar times vector plus scalar times vector):
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 Svtvp(int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
svtvp (scalar times vector plus vector): z = alpha*x + y
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
void Sdiv(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha/x.
void Vdiv(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 Zero(int n, T *x, const int incx)
Zero vector.
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
void Vvtvvtp(int n, const T *v, int incv, const T *w, int incw, const T *x, int incx, const T *y, int incy, T *z, int incz)
vvtvvtp (vector times vector plus vector times vector):
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
scalarT< T > sqrt(scalarT< T > in)