39#include <boost/test/tools/floating_point_comparison.hpp>
40#include <boost/test/unit_test.hpp>
149 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
153 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
154 for (
int i = 0; i < nelmts; ++i)
156 CollExp.push_back(Exp);
170 for (
int i = 0; i < nelmts; ++i)
172 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
173 tmp = phys1 + i * Exp->GetTotPoints());
177 double epsilon = 1.0e-8;
178 for (
int i = 0; i < phys1.size(); ++i)
180 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
228 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
232 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
233 for (
int i = 0; i < nelmts; ++i)
235 CollExp.push_back(Exp);
250 for (
int i = 0; i < nelmts; ++i)
252 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
253 tmp = phys1 + i * Exp->GetTotPoints());
257 double epsilon = 1.0e-8;
258 for (
int i = 0; i < phys1.size(); ++i)
260 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
308 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
312 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
313 for (
int i = 0; i < nelmts; ++i)
315 CollExp.push_back(Exp);
330 for (
int i = 0; i < nelmts; ++i)
332 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
333 tmp = phys1 + i * Exp->GetTotPoints());
337 double epsilon = 1.0e-8;
338 for (
int i = 0; i < phys1.size(); ++i)
340 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
388 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
392 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
393 for (
int i = 0; i < nelmts; ++i)
395 CollExp.push_back(Exp);
410 for (
int i = 0; i < nelmts; ++i)
412 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
413 tmp = phys1 + i * Exp->GetTotPoints());
417 double epsilon = 1.0e-8;
418 for (
int i = 0; i < phys1.size(); ++i)
420 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
442 unsigned int numQuadPoints = 5;
443 unsigned int numModes = 4;
464 Nektar::LibUtilities::eGaussRadauMAlpha1Beta0;
474 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
476 unsigned int nelmts = 2;
478 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
479 for (
unsigned int i = 0; i < nelmts; ++i)
481 CollExp.push_back(Exp);
499 for (
unsigned int i = 0; i < nelmts; ++i)
501 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
502 tmp = physRef + i * Exp->GetTotPoints());
506 double epsilon = 1.0e-8;
507 for (
unsigned int i = 0; i < physRef.size(); ++i)
509 BOOST_CHECK_CLOSE(physRef[i], phys[i], epsilon);
531 unsigned int numQuadPoints = 8;
532 unsigned int numModes = 4;
553 Nektar::LibUtilities::eGaussRadauMAlpha1Beta0;
563 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
565 unsigned int nelmts = 2;
567 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
568 for (
unsigned int i = 0; i < nelmts; ++i)
570 CollExp.push_back(Exp);
588 for (
unsigned int i = 0; i < nelmts; ++i)
590 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
591 tmp = physRef + i * Exp->GetTotPoints());
595 double epsilon = 1.0e-8;
596 for (
unsigned int i = 0; i < physRef.size(); ++i)
598 BOOST_CHECK_CLOSE(physRef[i], phys[i], epsilon);
646 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
650 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
651 for (
int i = 0; i < nelmts; ++i)
653 CollExp.push_back(Exp);
668 for (
int i = 0; i < nelmts; ++i)
670 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
671 tmp = phys1 + i * Exp->GetTotPoints());
675 double epsilon = 1.0e-8;
676 for (
int i = 0; i < phys1.size(); ++i)
678 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
725 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
729 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
730 for (
int i = 0; i < nelmts; ++i)
732 CollExp.push_back(Exp);
747 for (
int i = 0; i < nelmts; ++i)
749 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
750 tmp = phys1 + i * Exp->GetTotPoints());
754 double epsilon = 1.0e-8;
755 for (
int i = 0; i < phys1.size(); ++i)
757 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
805 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
809 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
810 for (
int i = 0; i < nelmts; ++i)
812 CollExp.push_back(Exp);
822 const int nq = Exp->GetTotPoints();
829 Exp->GetCoords(xc, yc, zc);
831 for (
int i = 0; i < nq; ++i)
833 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
835 Exp->IProductWRTBase(phys, coeffs1);
837 for (
int i = 1; i < nelmts; ++i)
840 Exp->IProductWRTBase(phys + i * nq,
841 tmp = coeffs1 + i * Exp->GetNcoeffs());
846 double epsilon = 1.0e-8;
847 for (
int i = 0; i < coeffs1.size(); ++i)
850 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
851 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
852 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
900 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
904 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
905 for (
int i = 0; i < nelmts; ++i)
907 CollExp.push_back(Exp);
917 const int nq = Exp->GetTotPoints();
924 Exp->GetCoords(xc, yc, zc);
926 for (
int i = 0; i < nq; ++i)
928 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
930 Exp->IProductWRTBase(phys, coeffs1);
932 for (
int i = 1; i < nelmts; ++i)
935 Exp->IProductWRTBase(phys + i * nq,
936 tmp = coeffs1 + i * Exp->GetNcoeffs());
941 double epsilon = 1.0e-8;
942 for (
int i = 0; i < coeffs1.size(); ++i)
945 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
946 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
947 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
995 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
999 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1000 for (
int i = 0; i < nelmts; ++i)
1002 CollExp.push_back(Exp);
1012 const int nq = Exp->GetTotPoints();
1019 Exp->GetCoords(xc, yc, zc);
1021 for (
int i = 0; i < nq; ++i)
1023 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
1025 Exp->IProductWRTBase(phys, coeffs1);
1027 for (
int i = 1; i < nelmts; ++i)
1030 Exp->IProductWRTBase(phys + i * nq,
1031 tmp = coeffs1 + i * Exp->GetNcoeffs());
1036 double epsilon = 1.0e-8;
1037 for (
int i = 0; i < coeffs1.size(); ++i)
1040 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
1041 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
1042 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1047 TestPrismIProductWRTBase_MatrixFree_UniformP_Undeformed_MultiElmt)
1065 unsigned int numQuadPoints = 5;
1066 unsigned int numModes = 4;
1087 Nektar::LibUtilities::eGaussRadauMAlpha1Beta0;
1097 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
1099 unsigned int nelmts = 2;
1101 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1102 for (
unsigned int i = 0; i < nelmts; ++i)
1104 CollExp.push_back(Exp);
1117 const int nq = Exp->GetTotPoints();
1124 Exp->GetCoords(xc, yc, zc);
1126 for (
int i = 0; i < nq; ++i)
1128 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
1130 Exp->IProductWRTBase(phys, coeffsRef);
1132 for (
int i = 1; i < nelmts; ++i)
1135 Exp->IProductWRTBase(phys + i * nq,
1136 tmp = coeffsRef + i * Exp->GetNcoeffs());
1141 double epsilon = 1.0e-8;
1142 for (
int i = 0; i < coeffsRef.size(); ++i)
1145 coeffsRef[i] = (
std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
1146 coeffs[i] = (
std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
1147 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
1152 TestPrismIProductWRTBase_MatrixFree_UniformP_Deformed_MultiElmt)
1170 unsigned int numQuadPoints = 5;
1171 unsigned int numModes = 4;
1192 Nektar::LibUtilities::eGaussRadauMAlpha1Beta0;
1202 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
1204 unsigned int nelmts = 2;
1206 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1207 for (
unsigned int i = 0; i < nelmts; ++i)
1209 CollExp.push_back(Exp);
1222 const int nq = Exp->GetTotPoints();
1229 Exp->GetCoords(xc, yc, zc);
1231 for (
int i = 0; i < nq; ++i)
1233 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
1235 Exp->IProductWRTBase(phys, coeffsRef);
1237 for (
int i = 1; i < nelmts; ++i)
1240 Exp->IProductWRTBase(phys + i * nq,
1241 tmp = coeffsRef + i * Exp->GetNcoeffs());
1246 double epsilon = 1.0e-8;
1247 for (
int i = 0; i < coeffsRef.size(); ++i)
1250 coeffsRef[i] = (
std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
1251 coeffs[i] = (
std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
1252 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
1257 TestPrismIProductWRTBase_MatrixFree_UniformP_Deformed_OverInt_MultiElmt)
1275 unsigned int numQuadPoints = 8;
1276 unsigned int numModes = 4;
1297 Nektar::LibUtilities::eGaussRadauMAlpha1Beta0;
1307 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
1309 unsigned int nelmts = 2;
1311 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1312 for (
unsigned int i = 0; i < nelmts; ++i)
1314 CollExp.push_back(Exp);
1327 const int nq = Exp->GetTotPoints();
1334 Exp->GetCoords(xc, yc, zc);
1336 for (
int i = 0; i < nq; ++i)
1338 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
1340 Exp->IProductWRTBase(phys, coeffsRef);
1342 for (
int i = 1; i < nelmts; ++i)
1345 Exp->IProductWRTBase(phys + i * nq,
1346 tmp = coeffsRef + i * Exp->GetNcoeffs());
1351 double epsilon = 1.0e-8;
1352 for (
int i = 0; i < coeffsRef.size(); ++i)
1355 coeffsRef[i] = (
std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
1356 coeffs[i] = (
std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
1357 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
1405 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
1409 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1410 for (
int i = 0; i < nelmts; ++i)
1412 CollExp.push_back(Exp);
1422 const int nq = Exp->GetTotPoints();
1429 Exp->GetCoords(xc, yc, zc);
1431 for (
int i = 0; i < nq; ++i)
1433 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
1435 Exp->IProductWRTBase(phys, coeffs1);
1437 for (
int i = 1; i < nelmts; ++i)
1440 Exp->IProductWRTBase(phys + i * nq,
1441 tmp = coeffs1 + i * Exp->GetNcoeffs());
1446 double epsilon = 1.0e-8;
1447 for (
int i = 0; i < coeffs1.size(); ++i)
1450 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
1451 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
1452 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1500 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
1504 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1505 for (
int i = 0; i < nelmts; ++i)
1507 CollExp.push_back(Exp);
1517 const int nq = Exp->GetTotPoints();
1524 Exp->GetCoords(xc, yc, zc);
1526 for (
int i = 0; i < nq; ++i)
1528 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
1530 Exp->IProductWRTBase(phys, coeffs1);
1532 for (
int i = 1; i < nelmts; ++i)
1535 Exp->IProductWRTBase(phys + i * nq,
1536 tmp = coeffs1 + i * Exp->GetNcoeffs());
1541 double epsilon = 1.0e-8;
1542 for (
int i = 0; i < coeffs1.size(); ++i)
1545 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
1546 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
1547 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1595 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
1599 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1600 for (
int i = 0; i < nelmts; ++i)
1602 CollExp.push_back(Exp);
1612 const int nq = Exp->GetTotPoints();
1619 Exp->GetCoords(xc, yc, zc);
1621 for (
int i = 0; i < nq; ++i)
1623 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
1625 Exp->IProductWRTBase(phys, coeffs1);
1627 for (
int i = 1; i < nelmts; ++i)
1630 Exp->IProductWRTBase(phys + i * nq,
1631 tmp = coeffs1 + i * Exp->GetNcoeffs());
1636 double epsilon = 1.0e-8;
1637 for (
int i = 0; i < coeffs1.size(); ++i)
1640 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
1641 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
1642 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1681 Nektar::LibUtilities::eGaussRadauMAlpha1Beta0;
1690 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
1694 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1695 for (
int i = 0; i < nelmts; ++i)
1697 CollExp.push_back(Exp);
1707 const int nq = Exp->GetTotPoints();
1713 Exp->GetCoords(xc, yc, zc);
1715 for (
int i = 0; i < nq; ++i)
1717 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
1719 Exp->PhysDeriv(phys, diff1, tmp1 = diff1 + (nelmts)*nq,
1720 tmp2 = diff1 + (2 * nelmts) * nq);
1722 for (
int i = 1; i < nelmts; ++i)
1725 Exp->PhysDeriv(phys, tmp = diff1 + i * nq,
1726 tmp1 = diff1 + (nelmts + i) * nq,
1727 tmp2 = diff1 + (2 * nelmts + i) * nq);
1731 tmp = diff2 + nelmts * nq, tmp2 = diff2 + 2 * nelmts * nq);
1733 double epsilon = 1.0e-8;
1734 for (
int i = 0; i < diff1.size(); ++i)
1736 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
1775 Nektar::LibUtilities::eGaussRadauMAlpha1Beta0;
1784 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
1788 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1789 for (
int i = 0; i < nelmts; ++i)
1791 CollExp.push_back(Exp);
1801 const int nq = Exp->GetTotPoints();
1807 Exp->GetCoords(xc, yc, zc);
1809 for (
int i = 0; i < nq; ++i)
1811 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
1813 Exp->PhysDeriv(phys, diff1, tmp1 = diff1 + (nelmts)*nq,
1814 tmp2 = diff1 + (2 * nelmts) * nq);
1816 for (
int i = 1; i < nelmts; ++i)
1819 Exp->PhysDeriv(phys, tmp = diff1 + i * nq,
1820 tmp1 = diff1 + (nelmts + i) * nq,
1821 tmp2 = diff1 + (2 * nelmts + i) * nq);
1825 tmp = diff2 + nelmts * nq, tmp2 = diff2 + 2 * nelmts * nq);
1827 double epsilon = 1.0e-8;
1828 for (
int i = 0; i < diff1.size(); ++i)
1831 diff1[i] = (fabs(diff1[i]) < 1e-14) ? 0.0 : diff1[i];
1832 diff2[i] = (fabs(diff2[i]) < 1e-14) ? 0.0 : diff2[i];
1833 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
1872 Nektar::LibUtilities::eGaussRadauMAlpha1Beta0;
1881 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
1885 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1886 for (
int i = 0; i < nelmts; ++i)
1888 CollExp.push_back(Exp);
1898 const int nq = Exp->GetTotPoints();
1904 Exp->GetCoords(xc, yc, zc);
1906 for (
int i = 0; i < nq; ++i)
1908 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
1910 Exp->PhysDeriv(phys, diff1, tmp1 = diff1 + (nelmts)*nq,
1911 tmp2 = diff1 + (2 * nelmts) * nq);
1913 for (
int i = 1; i < nelmts; ++i)
1916 Exp->PhysDeriv(phys, tmp = diff1 + i * nq,
1917 tmp1 = diff1 + (nelmts + i) * nq,
1918 tmp2 = diff1 + (2 * nelmts + i) * nq);
1922 tmp = diff2 + nelmts * nq, tmp2 = diff2 + 2 * nelmts * nq);
1924 double epsilon = 1.0e-8;
1925 for (
int i = 0; i < diff1.size(); ++i)
1927 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
1966 Nektar::LibUtilities::eGaussRadauMAlpha1Beta0;
1975 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
1979 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1980 for (
int i = 0; i < nelmts; ++i)
1982 CollExp.push_back(Exp);
1992 const int nq = Exp->GetTotPoints();
1998 Exp->GetCoords(xc, yc, zc);
2000 for (
int i = 0; i < nq; ++i)
2002 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
2004 Exp->PhysDeriv(phys, diff1, tmp1 = diff1 + (nelmts)*nq,
2005 tmp2 = diff1 + (2 * nelmts) * nq);
2007 for (
int i = 1; i < nelmts; ++i)
2010 Exp->PhysDeriv(phys, tmp = diff1 + i * nq,
2011 tmp1 = diff1 + (nelmts + i) * nq,
2012 tmp2 = diff1 + (2 * nelmts + i) * nq);
2016 tmp = diff2 + nelmts * nq, tmp2 = diff2 + 2 * nelmts * nq);
2018 double epsilon = 1.0e-8;
2019 for (
int i = 0; i < diff1.size(); ++i)
2022 diff1[i] = (fabs(diff1[i]) < 1e-14) ? 0.0 : diff1[i];
2023 diff2[i] = (fabs(diff2[i]) < 1e-14) ? 0.0 : diff2[i];
2024 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
2063 Nektar::LibUtilities::eGaussRadauMAlpha1Beta0;
2072 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
2076 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2077 for (
int i = 0; i < nelmts; ++i)
2079 CollExp.push_back(Exp);
2089 const int nq = Exp->GetTotPoints();
2095 Exp->GetCoords(xc, yc, zc);
2097 for (
int i = 0; i < nq; ++i)
2099 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
2101 Exp->PhysDeriv(phys, tmp = diff1, tmp1 = diff1 + (nelmts)*nq,
2102 tmp2 = diff1 + (2 * nelmts) * nq);
2103 for (
int i = 1; i < nelmts; ++i)
2106 Exp->PhysDeriv(phys, tmp = diff1 + i * nq,
2107 tmp1 = diff1 + (nelmts + i) * nq,
2108 tmp2 = diff1 + (2 * nelmts + i) * nq);
2112 tmp = diff2 + nelmts * nq, tmp2 = diff2 + 2 * nelmts * nq);
2114 double epsilon = 1.0e-8;
2115 for (
int i = 0; i < diff1.size(); ++i)
2117 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
2139 unsigned int numQuadPoints = 5;
2140 unsigned int numModes = 2;
2161 Nektar::LibUtilities::eGaussRadauMAlpha1Beta0;
2171 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
2175 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2176 for (
int i = 0; i < nelmts; ++i)
2178 CollExp.push_back(Exp);
2191 const int nq = Exp->GetTotPoints();
2197 Exp->GetCoords(xc, yc, zc);
2199 for (
int i = 0; i < nq; ++i)
2201 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
2203 Exp->PhysDeriv(phys, diffRef, tmp1 = diffRef + (nelmts)*nq,
2204 tmp2 = diffRef + (2 * nelmts) * nq);
2206 for (
int i = 1; i < nelmts; ++i)
2209 Exp->PhysDeriv(phys, tmp = diffRef + i * nq,
2210 tmp1 = diffRef + (nelmts + i) * nq,
2211 tmp2 = diffRef + (2 * nelmts + i) * nq);
2215 tmp = diff + nelmts * nq, tmp2 = diff + 2 * nelmts * nq);
2217 double epsilon = 1.0e-8;
2218 for (
int i = 0; i < diffRef.size(); ++i)
2220 diffRef[i] = (
std::abs(diffRef[i]) < 1e-14) ? 0.0 : diffRef[i];
2221 diff[i] = (
std::abs(diff[i]) < 1e-14) ? 0.0 : diff[i];
2222 BOOST_CHECK_CLOSE(diffRef[i], diff[i], epsilon);
2227 TestPrismIProductWRTDerivBase_IterPerExp_UniformP_MultiElmt)
2262 Nektar::LibUtilities::eGaussRadauMAlpha1Beta0;
2271 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
2275 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2276 for (
int i = 0; i < nelmts; ++i)
2278 CollExp.push_back(Exp);
2288 const int nq = Exp->GetTotPoints();
2289 const int nm = Exp->GetNcoeffs();
2298 Exp->GetCoords(xc, yc, zc);
2300 for (
int i = 0; i < nq; ++i)
2302 phys1[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
2303 phys2[i] = cos(xc[i]) * sin(yc[i]) * cos(zc[i]);
2304 phys3[i] = cos(xc[i]) * sin(yc[i]) * sin(zc[i]);
2306 for (
int i = 1; i < nelmts; ++i)
2314 for (
int i = 0; i < nelmts; ++i)
2316 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
2317 Exp->IProductWRTDerivBase(1, phys2 + i * nq, tmp = coeffs2 + i * nm);
2318 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2319 tmp = coeffs1 + i * nm, 1);
2320 Exp->IProductWRTDerivBase(2, phys3 + i * nq, tmp = coeffs2 + i * nm);
2321 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2322 tmp = coeffs1 + i * nm, 1);
2328 double epsilon = 1.0e-8;
2329 for (
int i = 0; i < coeffs1.size(); ++i)
2331 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
2332 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
2333 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
2372 Nektar::LibUtilities::eGaussRadauMAlpha1Beta0;
2381 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
2385 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2386 for (
int i = 0; i < nelmts; ++i)
2388 CollExp.push_back(Exp);
2398 const int nq = Exp->GetTotPoints();
2399 const int nm = Exp->GetNcoeffs();
2408 Exp->GetCoords(xc, yc, zc);
2410 for (
int i = 0; i < nq; ++i)
2412 phys1[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
2413 phys2[i] = cos(xc[i]) * sin(yc[i]) * cos(zc[i]);
2414 phys3[i] = cos(xc[i]) * sin(yc[i]) * sin(zc[i]);
2416 for (
int i = 1; i < nelmts; ++i)
2424 for (
int i = 0; i < nelmts; ++i)
2426 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
2427 Exp->IProductWRTDerivBase(1, phys2 + i * nq, tmp = coeffs2 + i * nm);
2428 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2429 tmp = coeffs1 + i * nm, 1);
2430 Exp->IProductWRTDerivBase(2, phys3 + i * nq, tmp = coeffs2 + i * nm);
2431 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2432 tmp = coeffs1 + i * nm, 1);
2438 double epsilon = 1.0e-8;
2439 for (
int i = 0; i < coeffs1.size(); ++i)
2441 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
2442 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
2443 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
2482 Nektar::LibUtilities::eGaussRadauMAlpha1Beta0;
2491 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
2495 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2496 for (
int i = 0; i < nelmts; ++i)
2498 CollExp.push_back(Exp);
2508 const int nq = Exp->GetTotPoints();
2509 const int nm = Exp->GetNcoeffs();
2518 Exp->GetCoords(xc, yc, zc);
2520 for (
int i = 0; i < nq; ++i)
2522 phys1[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
2523 phys2[i] = cos(xc[i]) * sin(yc[i]) * cos(zc[i]);
2524 phys3[i] = cos(xc[i]) * sin(yc[i]) * sin(zc[i]);
2526 for (
int i = 1; i < nelmts; ++i)
2534 for (
int i = 0; i < nelmts; ++i)
2536 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
2537 Exp->IProductWRTDerivBase(1, phys2 + i * nq, tmp = coeffs2 + i * nm);
2538 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2539 tmp = coeffs1 + i * nm, 1);
2540 Exp->IProductWRTDerivBase(2, phys3 + i * nq, tmp = coeffs2 + i * nm);
2541 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2542 tmp = coeffs1 + i * nm, 1);
2548 double epsilon = 1.0e-8;
2549 for (
int i = 0; i < coeffs1.size(); ++i)
2551 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
2552 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
2553 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
2558 TestPrismIProductWRTDerivBase_IterPerExp_VariableP_MultiElmt)
2593 Nektar::LibUtilities::eGaussRadauMAlpha1Beta0;
2602 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
2606 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2607 for (
int i = 0; i < nelmts; ++i)
2609 CollExp.push_back(Exp);
2619 const int nq = Exp->GetTotPoints();
2620 const int nm = Exp->GetNcoeffs();
2629 Exp->GetCoords(xc, yc, zc);
2631 for (
int i = 0; i < nq; ++i)
2633 phys1[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
2634 phys2[i] = cos(xc[i]) * sin(yc[i]) * cos(zc[i]);
2635 phys3[i] = cos(xc[i]) * sin(yc[i]) * sin(zc[i]);
2637 for (
int i = 1; i < nelmts; ++i)
2645 for (
int i = 0; i < nelmts; ++i)
2647 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
2648 Exp->IProductWRTDerivBase(1, phys2 + i * nq, tmp = coeffs2 + i * nm);
2649 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2650 tmp = coeffs1 + i * nm, 1);
2651 Exp->IProductWRTDerivBase(2, phys3 + i * nq, tmp = coeffs2 + i * nm);
2652 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2653 tmp = coeffs1 + i * nm, 1);
2659 double epsilon = 1.0e-8;
2660 for (
int i = 0; i < coeffs1.size(); ++i)
2662 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
2663 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
2664 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
2703 Nektar::LibUtilities::eGaussRadauMAlpha1Beta0;
2712 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
2716 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2717 for (
int i = 0; i < nelmts; ++i)
2719 CollExp.push_back(Exp);
2729 const int nq = Exp->GetTotPoints();
2730 const int nm = Exp->GetNcoeffs();
2739 Exp->GetCoords(xc, yc, zc);
2741 for (
int i = 0; i < nq; ++i)
2743 phys1[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
2744 phys2[i] = cos(xc[i]) * sin(yc[i]) * cos(zc[i]);
2745 phys3[i] = cos(xc[i]) * sin(yc[i]) * sin(zc[i]);
2747 for (
int i = 1; i < nelmts; ++i)
2755 for (
int i = 0; i < nelmts; ++i)
2757 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
2758 Exp->IProductWRTDerivBase(1, phys2 + i * nq, tmp = coeffs2 + i * nm);
2759 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2760 tmp = coeffs1 + i * nm, 1);
2761 Exp->IProductWRTDerivBase(2, phys3 + i * nq, tmp = coeffs2 + i * nm);
2762 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2763 tmp = coeffs1 + i * nm, 1);
2769 double epsilon = 1.0e-8;
2770 for (
int i = 0; i < coeffs1.size(); ++i)
2772 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
2773 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
2774 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
2813 Nektar::LibUtilities::eGaussRadauMAlpha1Beta0;
2822 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
2826 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2827 for (
int i = 0; i < nelmts; ++i)
2829 CollExp.push_back(Exp);
2839 const int nq = Exp->GetTotPoints();
2840 const int nm = Exp->GetNcoeffs();
2849 Exp->GetCoords(xc, yc, zc);
2851 for (
int i = 0; i < nq; ++i)
2853 phys1[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
2854 phys2[i] = cos(xc[i]) * sin(yc[i]) * cos(zc[i]);
2855 phys3[i] = cos(xc[i]) * sin(yc[i]) * sin(zc[i]);
2857 for (
int i = 1; i < nelmts; ++i)
2865 for (
int i = 0; i < nelmts; ++i)
2867 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
2868 Exp->IProductWRTDerivBase(1, phys2 + i * nq, tmp = coeffs2 + i * nm);
2869 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2870 tmp = coeffs1 + i * nm, 1);
2871 Exp->IProductWRTDerivBase(2, phys3 + i * nq, tmp = coeffs2 + i * nm);
2872 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2873 tmp = coeffs1 + i * nm, 1);
2879 double epsilon = 1.0e-8;
2880 for (
int i = 0; i < coeffs1.size(); ++i)
2882 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
2883 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
2884 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
2889 TestPrismIProductWRTDerivBase_MatriFree_UniformP_Undeformed_MultiElmt)
2907 unsigned int numQuadPoints = 7;
2908 unsigned int numModes = 6;
2929 Nektar::LibUtilities::eGaussRadauMAlpha1Beta0;
2939 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
2941 unsigned int nelmts = 1;
2943 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2944 for (
unsigned int i = 0; i < nelmts; ++i)
2946 CollExp.push_back(Exp);
2959 const int nq = Exp->GetTotPoints();
2960 const int nm = Exp->GetNcoeffs();
2969 Exp->GetCoords(xc, yc, zc);
2971 for (
int i = 0; i < nq; ++i)
2973 phys1[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
2974 phys2[i] = cos(xc[i]) * sin(yc[i]) * cos(zc[i]);
2975 phys3[i] = cos(xc[i]) * sin(yc[i]) * sin(zc[i]);
2977 for (
int i = 1; i < nelmts; ++i)
2985 for (
int i = 0; i < nelmts; ++i)
2987 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffsRef + i * nm);
2988 Exp->IProductWRTDerivBase(1, phys2 + i * nq, tmp = coeffs + i * nm);
2989 Vmath::Vadd(nm, coeffsRef + i * nm, 1, coeffs + i * nm, 1,
2990 tmp = coeffsRef + i * nm, 1);
2991 Exp->IProductWRTDerivBase(2, phys3 + i * nq, tmp = coeffs + i * nm);
2992 Vmath::Vadd(nm, coeffsRef + i * nm, 1, coeffs + i * nm, 1,
2993 tmp = coeffsRef + i * nm, 1);
2999 double epsilon = 1.0e-8;
3000 for (
int i = 0; i < coeffsRef.size(); ++i)
3002 coeffsRef[i] = (
std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
3003 coeffs[i] = (
std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
3004 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
3009 TestPrismIProductWRTDerivBase_MatriFree_UniformP_Deformed_MultiElmt)
3027 unsigned int numQuadPoints = 7;
3028 unsigned int numModes = 6;
3049 Nektar::LibUtilities::eGaussRadauMAlpha1Beta0;
3059 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
3061 unsigned int nelmts = 1;
3063 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
3064 for (
unsigned int i = 0; i < nelmts; ++i)
3066 CollExp.push_back(Exp);
3079 const int nq = Exp->GetTotPoints();
3080 const int nm = Exp->GetNcoeffs();
3089 Exp->GetCoords(xc, yc, zc);
3091 for (
int i = 0; i < nq; ++i)
3093 phys1[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
3094 phys2[i] = cos(xc[i]) * sin(yc[i]) * cos(zc[i]);
3095 phys3[i] = cos(xc[i]) * sin(yc[i]) * sin(zc[i]);
3097 for (
int i = 1; i < nelmts; ++i)
3105 for (
int i = 0; i < nelmts; ++i)
3107 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffsRef + i * nm);
3108 Exp->IProductWRTDerivBase(1, phys2 + i * nq, tmp = coeffs + i * nm);
3109 Vmath::Vadd(nm, coeffsRef + i * nm, 1, coeffs + i * nm, 1,
3110 tmp = coeffsRef + i * nm, 1);
3111 Exp->IProductWRTDerivBase(2, phys3 + i * nq, tmp = coeffs + i * nm);
3112 Vmath::Vadd(nm, coeffsRef + i * nm, 1, coeffs + i * nm, 1,
3113 tmp = coeffsRef + i * nm, 1);
3119 double epsilon = 1.0e-8;
3120 for (
int i = 0; i < coeffsRef.size(); ++i)
3122 coeffsRef[i] = (
std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
3123 coeffs[i] = (
std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
3124 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
3129 TestPrismIProductWRTDerivBase_MatriFree_UniformP_Deformed_OverInt_MultiElmt)
3147 unsigned int numQuadPoints = 12;
3148 unsigned int numModes = 6;
3169 Nektar::LibUtilities::eGaussRadauMAlpha1Beta0;
3179 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
3181 unsigned int nelmts = 1;
3183 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
3184 for (
unsigned int i = 0; i < nelmts; ++i)
3186 CollExp.push_back(Exp);
3199 const int nq = Exp->GetTotPoints();
3200 const int nm = Exp->GetNcoeffs();
3209 Exp->GetCoords(xc, yc, zc);
3211 for (
int i = 0; i < nq; ++i)
3213 phys1[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
3214 phys2[i] = cos(xc[i]) * sin(yc[i]) * cos(zc[i]);
3215 phys3[i] = cos(xc[i]) * sin(yc[i]) * sin(zc[i]);
3217 for (
int i = 1; i < nelmts; ++i)
3225 for (
int i = 0; i < nelmts; ++i)
3227 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffsRef + i * nm);
3228 Exp->IProductWRTDerivBase(1, phys2 + i * nq, tmp = coeffs + i * nm);
3229 Vmath::Vadd(nm, coeffsRef + i * nm, 1, coeffs + i * nm, 1,
3230 tmp = coeffsRef + i * nm, 1);
3231 Exp->IProductWRTDerivBase(2, phys3 + i * nq, tmp = coeffs + i * nm);
3232 Vmath::Vadd(nm, coeffsRef + i * nm, 1, coeffs + i * nm, 1,
3233 tmp = coeffsRef + i * nm, 1);
3239 double epsilon = 1.0e-8;
3240 for (
int i = 0; i < coeffsRef.size(); ++i)
3242 coeffsRef[i] = (
std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
3243 coeffs[i] = (
std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
3244 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
3266 unsigned int numQuadPoints = 7;
3267 unsigned int numModes = 6;
3288 Nektar::LibUtilities::eGaussRadauMAlpha1Beta0;
3298 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
3302 basisKeyDir1, basisKeyDir1, basisKeyDir1);
3306 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
3307 for (
int i = 0; i < nelmts; ++i)
3309 CollExp.push_back(Exp);
3328 const int nm = Exp->GetNcoeffs();
3333 for (
int i = 0; i < nm; ++i)
3338 for (
int i = 1; i < nelmts; ++i)
3340 Vmath::Vcopy(nm, coeffsIn, 1, tmp = coeffsIn + i * nm, 1);
3346 for (
int i = 0; i < nelmts; ++i)
3349 Exp->GeneralMatrixOp(coeffsIn + i * nm, tmp = coeffsRef + i * nm, mkey);
3354 double epsilon = 1.0e-8;
3355 for (
int i = 0; i < coeffsRef.size(); ++i)
3357 coeffsRef[i] = (
std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
3358 coeffs[i] = (
std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
3359 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
3381 unsigned int numQuadPoints = 7;
3382 unsigned int numModes = 6;
3403 Nektar::LibUtilities::eGaussRadauMAlpha1Beta0;
3413 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
3417 basisKeyDir1, basisKeyDir1, basisKeyDir1);
3421 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
3422 for (
int i = 0; i < nelmts; ++i)
3424 CollExp.push_back(Exp);
3437 const int nm = Exp->GetNcoeffs();
3442 for (
int i = 0; i < nm; ++i)
3447 for (
int i = 1; i < nelmts; ++i)
3449 Vmath::Vcopy(nm, coeffsIn, 1, tmp = coeffsIn + i * nm, 1);
3455 for (
int i = 0; i < nelmts; ++i)
3458 Exp->GeneralMatrixOp(coeffsIn + i * nm, tmp = coeffsRef + i * nm, mkey);
3463 double epsilon = 1.0e-8;
3464 for (
int i = 0; i < coeffsRef.size(); ++i)
3466 coeffsRef[i] = (
std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
3467 coeffs[i] = (
std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
3468 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
3490 unsigned int numQuadPoints = 10;
3491 unsigned int numModes = 6;
3512 Nektar::LibUtilities::eGaussRadauMAlpha1Beta0;
3522 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
3526 basisKeyDir1, basisKeyDir1, basisKeyDir1);
3530 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
3531 for (
int i = 0; i < nelmts; ++i)
3533 CollExp.push_back(Exp);
3546 const int nm = Exp->GetNcoeffs();
3551 for (
int i = 0; i < nm; ++i)
3556 for (
int i = 1; i < nelmts; ++i)
3558 Vmath::Vcopy(nm, coeffsIn, 1, tmp = coeffsIn + i * nm, 1);
3564 for (
int i = 0; i < nelmts; ++i)
3567 Exp->GeneralMatrixOp(coeffsIn + i * nm, tmp = coeffsRef + i * nm, mkey);
3572 double epsilon = 1.0e-8;
3573 for (
int i = 0; i < coeffsRef.size(); ++i)
3575 coeffsRef[i] = (
std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
3576 coeffs[i] = (
std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
3577 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
3599 unsigned int numQuadPoints = 7;
3600 unsigned int numModes = 6;
3621 Nektar::LibUtilities::eGaussRadauMAlpha1Beta0;
3631 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
3635 basisKeyDir1, basisKeyDir1, basisKeyDir1);
3639 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
3640 for (
int i = 0; i < nelmts; ++i)
3642 CollExp.push_back(Exp);
3661 const int nm = Exp->GetNcoeffs();
3666 for (
int i = 0; i < nm; ++i)
3671 for (
int i = 1; i < nelmts; ++i)
3673 Vmath::Vcopy(nm, coeffsIn, 1, tmp = coeffsIn + i * nm, 1);
3679 for (
int i = 0; i < nelmts; ++i)
3682 Exp->GeneralMatrixOp(coeffsIn + i * nm, tmp = coeffsRef + i * nm, mkey);
3687 double epsilon = 1.0e-8;
3688 for (
int i = 0; i < coeffsRef.size(); ++i)
3690 coeffsRef[i] = (
std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
3691 coeffs[i] = (
std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
3692 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
3714 unsigned int numQuadPoints = 7;
3715 unsigned int numModes = 6;
3736 Nektar::LibUtilities::eGaussRadauMAlpha1Beta0;
3746 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
3750 basisKeyDir1, basisKeyDir1, basisKeyDir1);
3752 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
3753 CollExp.push_back(Exp);
3764 const int nq = Exp->GetTotPoints();
3769 Exp->GetCoords(xc, yc, zc);
3771 for (
int i = 0; i < nq; ++i)
3773 phys[i] = pow(xc[i], 3) + pow(yc[i], 3) + pow(zc[i], 3);
3787 double epsilon = 2.0e-8;
3788 for (
int i = 0; i < nq1; ++i)
3790 NekDouble exact = pow(xc1[i], 3) + pow(yc1[i], 3) + pow(zc1[i], 3);
3791 phys1[i] = (fabs(phys1[i]) < 1e-14) ? 0.0 : phys1[i];
3792 exact = (fabs(exact) < 1e-14) ? 0.0 : exact;
3793 BOOST_CHECK_CLOSE(phys1[i], exact, epsilon);
3815 unsigned int numQuadPoints = 7;
3816 unsigned int numModes = 6;
3837 Nektar::LibUtilities::eGaussRadauMAlpha1Beta0;
3847 basisKeyDir1, basisKeyDir2, basisKeyDir3, prismGeom);
3851 basisKeyDir1, basisKeyDir1, basisKeyDir1);
3853 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
3854 CollExp.push_back(Exp);
3865 const int nq = Exp->GetTotPoints();
3870 Exp->GetCoords(xc, yc, zc);
3872 for (
int i = 0; i < nq; ++i)
3874 phys[i] = pow(xc[i], 3) + pow(yc[i], 3) + pow(zc[i], 3);
3888 double epsilon = 1.0e-8;
3889 for (
int i = 0; i < nq1; ++i)
3891 NekDouble exact = pow(xc1[i], 3) + pow(yc1[i], 3) + pow(zc1[i], 3);
3892 phys1[i] = (fabs(phys1[i]) < 1e-14) ? 0.0 : phys1[i];
3893 exact = (fabs(exact) < 1e-14) ? 0.0 : exact;
3894 BOOST_CHECK_CLOSE(phys1[i], exact, epsilon);
COLLECTIONS_EXPORT void Initialise(const OperatorType opType, StdRegions::FactorMap factors=StdRegions::NullFactorMap)
void ApplyOperator(const OperatorType &op, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &output)
int GetOutputSize(const OperatorType &op, bool defaultOut=true)
COLLECTIONS_EXPORT OperatorImpMap GetOperatorImpMap(StdRegions::StdExpansionSharedPtr pExp)
Get Operator Implementation Map from XMl or using default;.
Describes the specification for a Basis.
Defines a specification for a set of points.
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
static const int kNedges
Get the orientation of face1.
std::map< OperatorType, ImplementationType > OperatorImpMap
std::shared_ptr< SessionReader > SessionReaderSharedPtr
@ eGaussLobattoLegendre
1D Gauss-Lobatto-Legendre quadrature points
@ eModified_B
Principle Modified Functions .
@ eModified_A
Principle Modified Functions .
std::shared_ptr< PrismExp > PrismExpSharedPtr
SpatialDomains::PrismGeomSharedPtr CreatePrism(SpatialDomains::PointGeomSharedPtr v0, SpatialDomains::PointGeomSharedPtr v1, SpatialDomains::PointGeomSharedPtr v2, SpatialDomains::PointGeomSharedPtr v3, SpatialDomains::PointGeomSharedPtr v4, SpatialDomains::PointGeomSharedPtr v5)
BOOST_AUTO_TEST_CASE(TestPrismBwdTrans_IterPerExp_UniformP_MultiElmt)
SpatialDomains::SegGeomSharedPtr CreateSegGeom(unsigned int id, SpatialDomains::PointGeomSharedPtr v0, SpatialDomains::PointGeomSharedPtr v1)
std::shared_ptr< QuadGeom > QuadGeomSharedPtr
std::shared_ptr< PrismGeom > PrismGeomSharedPtr
std::shared_ptr< SegGeom > SegGeomSharedPtr
std::shared_ptr< PointGeom > PointGeomSharedPtr
std::shared_ptr< Geometry2D > Geometry2DSharedPtr
std::shared_ptr< TriGeom > TriGeomSharedPtr
std::shared_ptr< StdPrismExp > StdPrismExpSharedPtr
std::map< ConstFactorType, NekDouble > ConstFactorMap
StdRegions::ConstFactorMap factors
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 Vcopy(int n, const T *x, const int incx, T *y, const int incy)
scalarT< T > abs(scalarT< T > in)