39#include <boost/test/tools/floating_point_comparison.hpp>
40#include <boost/test/unit_test.hpp>
44namespace QuadCollectionTests
92 unsigned int numQuadPoints = 6;
100 basisKeyDir1, basisKeyDir1, quadGeom);
104 basisKeyDir1, basisKeyDir1);
106 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
107 CollExp.push_back(Exp);
120 Exp->BwdTrans(coeffs, phys1);
123 double epsilon = 1.0e-8;
124 for (
int i = 0; i < phys1.size(); ++i)
126 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
158 basisKeyDir1, basisKeyDir2, quadGeom);
162 basisKeyDir1, basisKeyDir2);
164 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
165 CollExp.push_back(Exp);
178 Exp->BwdTrans(coeffs, phys1);
181 double epsilon = 1.0e-8;
182 for (
int i = 0; i < phys1.size(); ++i)
184 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
216 basisKeyDir1, basisKeyDir2, quadGeom);
220 basisKeyDir1, basisKeyDir2);
222 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
224 for (
int i = 0; i < nelmts; ++i)
226 CollExp.push_back(Exp);
240 for (
int i = 0; i < nelmts; ++i)
242 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
243 tmp = phys1 + i * Exp->GetTotPoints());
247 double epsilon = 1.0e-8;
248 for (
int i = 0; i < phys1.size(); ++i)
250 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
271 unsigned int numQuadPoints = 6;
279 basisKeyDir1, basisKeyDir1, quadGeom);
283 basisKeyDir1, basisKeyDir1);
285 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
286 CollExp.push_back(Exp);
299 Exp->BwdTrans(coeffs, phys1);
302 double epsilon = 1.0e-8;
303 for (
int i = 0; i < phys1.size(); ++i)
305 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
337 basisKeyDir1, basisKeyDir2, quadGeom);
341 basisKeyDir1, basisKeyDir2);
343 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
344 CollExp.push_back(Exp);
357 Exp->BwdTrans(coeffs, phys1);
360 double epsilon = 1.0e-8;
361 for (
int i = 0; i < phys1.size(); ++i)
363 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
384 unsigned int numQuadPoints = 6;
385 unsigned int numModes = 4;
393 basisKeyDir1, basisKeyDir1, quadGeom);
397 basisKeyDir1, basisKeyDir1);
399 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
400 CollExp.push_back(Exp);
414 Exp->BwdTrans(coeffs, physRef);
417 double epsilon = 1.0e-8;
418 for (
int i = 0; i < physRef.size(); ++i)
420 BOOST_CHECK_CLOSE(physRef[i], phys[i], epsilon);
441 unsigned int numQuadPoints = 6;
449 basisKeyDir1, basisKeyDir1, quadGeom);
453 basisKeyDir1, basisKeyDir1);
455 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
458 for (
int i = 0; i < nelmts; ++i)
460 CollExp.push_back(Exp);
474 for (
int i = 0; i < nelmts; ++i)
476 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
477 tmp = phys1 + i * Exp->GetTotPoints());
481 double epsilon = 1.0e-8;
482 for (
int i = 0; i < phys1.size(); ++i)
484 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
505 unsigned int numQuadPoints = 6;
513 basisKeyDir1, basisKeyDir1, quadGeom);
517 basisKeyDir1, basisKeyDir1);
519 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
522 for (
int i = 0; i < nelmts; ++i)
524 CollExp.push_back(Exp);
538 for (
int i = 0; i < nelmts; ++i)
540 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
541 tmp = phys1 + i * Exp->GetTotPoints());
545 double epsilon = 1.0e-8;
546 for (
int i = 0; i < phys1.size(); ++i)
548 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
580 basisKeyDir1, basisKeyDir2, quadGeom);
584 basisKeyDir1, basisKeyDir2);
588 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
589 for (
int i = 0; i < nelmts; ++i)
591 CollExp.push_back(Exp);
605 for (
int i = 0; i < nelmts; ++i)
607 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
608 tmp = phys1 + i * Exp->GetTotPoints());
612 double epsilon = 1.0e-8;
613 for (
int i = 0; i < phys1.size(); ++i)
615 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
647 basisKeyDir1, basisKeyDir2, quadGeom);
651 basisKeyDir1, basisKeyDir2);
655 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
656 for (
int i = 0; i < nelmts; ++i)
658 CollExp.push_back(Exp);
672 for (
int i = 0; i < nelmts; ++i)
674 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
675 tmp = phys1 + i * Exp->GetTotPoints());
679 double epsilon = 1.0e-8;
680 for (
int i = 0; i < phys1.size(); ++i)
682 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
703 unsigned int numQuadPoints = 6;
711 basisKeyDir1, basisKeyDir1, quadGeom);
715 basisKeyDir1, basisKeyDir1);
717 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
718 CollExp.push_back(Exp);
727 const int nq = Exp->GetTotPoints();
734 Exp->GetCoords(xc, yc);
736 for (
int i = 0; i < nq; ++i)
738 phys[i] = sin(xc[i]) * cos(yc[i]);
741 Exp->IProductWRTBase(phys, coeffs1);
744 double epsilon = 1.0e-8;
745 for (
int i = 0; i < coeffs1.size(); ++i)
747 coeffs1[i] = (
std::abs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
748 coeffs2[i] = (
std::abs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
749 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
782 basisKeyDir1, basisKeyDir2, quadGeom);
786 basisKeyDir1, basisKeyDir2);
788 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
789 CollExp.push_back(Exp);
798 const int nq = Exp->GetTotPoints();
805 Exp->GetCoords(xc, yc);
807 for (
int i = 0; i < nq; ++i)
809 phys[i] = sin(xc[i]) * cos(yc[i]);
812 Exp->IProductWRTBase(phys, coeffs1);
815 double epsilon = 1.0e-8;
816 for (
int i = 0; i < coeffs1.size(); ++i)
818 coeffs1[i] = (
std::abs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
819 coeffs2[i] = (
std::abs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
820 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
853 basisKeyDir1, basisKeyDir2, quadGeom);
857 basisKeyDir1, basisKeyDir2);
861 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
862 for (
int i = 0; i < nelmts; ++i)
864 CollExp.push_back(Exp);
874 const int nq = Exp->GetTotPoints();
881 Exp->GetCoords(xc, yc);
883 for (
int i = 0; i < nq; ++i)
885 phys[i] = sin(xc[i]) * cos(yc[i]);
887 Exp->IProductWRTBase(phys, coeffs1);
889 for (
int i = 1; i < nelmts; ++i)
892 Exp->IProductWRTBase(phys + i * nq,
893 tmp = coeffs1 + i * Exp->GetNcoeffs());
897 double epsilon = 1.0e-8;
898 for (
int i = 0; i < coeffs1.size(); ++i)
900 coeffs1[i] = (
std::abs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
901 coeffs2[i] = (
std::abs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
902 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
923 unsigned int numQuadPoints = 6;
931 basisKeyDir1, basisKeyDir1, quadGeom);
935 basisKeyDir1, basisKeyDir1);
937 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
938 CollExp.push_back(Exp);
947 const int nq = Exp->GetTotPoints();
954 Exp->GetCoords(xc, yc);
956 for (
int i = 0; i < nq; ++i)
958 phys[i] = sin(xc[i]) * cos(yc[i]);
961 Exp->IProductWRTBase(phys, coeffs1);
964 double epsilon = 1.0e-8;
965 for (
int i = 0; i < coeffs1.size(); ++i)
967 coeffs1[i] = (
std::abs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
968 coeffs2[i] = (
std::abs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
969 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
990 unsigned int numQuadPoints = 6;
998 basisKeyDir1, basisKeyDir1, quadGeom);
1002 basisKeyDir1, basisKeyDir1);
1004 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1005 CollExp.push_back(Exp);
1014 const int nq = Exp->GetTotPoints();
1021 Exp->GetCoords(xc, yc);
1023 for (
int i = 0; i < nq; ++i)
1025 phys[i] = sin(xc[i]) * cos(yc[i]);
1028 Exp->IProductWRTBase(phys, coeffs1);
1031 double epsilon = 1.0e-8;
1032 for (
int i = 0; i < coeffs1.size(); ++i)
1034 coeffs1[i] = (
std::abs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
1035 coeffs2[i] = (
std::abs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
1036 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1058 quadPointsTypeDir1);
1060 quadPointsTypeDir1);
1068 basisKeyDir1, basisKeyDir2, quadGeom);
1072 basisKeyDir1, basisKeyDir2);
1074 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1075 CollExp.push_back(Exp);
1084 const int nq = Exp->GetTotPoints();
1091 Exp->GetCoords(xc, yc);
1093 for (
int i = 0; i < nq; ++i)
1095 phys[i] = sin(xc[i]) * cos(yc[i]);
1098 Exp->IProductWRTBase(phys, coeffs1);
1101 double epsilon = 1.0e-8;
1102 for (
int i = 0; i < coeffs1.size(); ++i)
1104 coeffs1[i] = (
std::abs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
1105 coeffs2[i] = (
std::abs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
1106 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1127 unsigned int numQuadPoints = 6;
1128 unsigned int numModes = 5;
1130 quadPointsTypeDir1);
1136 basisKeyDir1, basisKeyDir1, quadGeom);
1140 basisKeyDir1, basisKeyDir1);
1142 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1143 CollExp.push_back(Exp);
1152 const int nq = Exp->GetTotPoints();
1159 Exp->GetCoords(xc, yc);
1161 for (
int i = 0; i < nq; ++i)
1163 phys[i] = sin(xc[i]) * cos(yc[i]);
1166 Exp->IProductWRTBase(phys, coeffsRef);
1169 double epsilon = 1.0e-8;
1170 for (
int i = 0; i < coeffs.size(); ++i)
1172 coeffsRef[i] = (
std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
1173 coeffs[i] = (
std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
1174 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
1195 unsigned int numQuadPoints = 6;
1196 unsigned int numModes = 5;
1198 quadPointsTypeDir1);
1204 basisKeyDir1, basisKeyDir1, quadGeom);
1208 basisKeyDir1, basisKeyDir1);
1210 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1211 CollExp.push_back(Exp);
1220 const int nq = Exp->GetTotPoints();
1227 Exp->GetCoords(xc, yc);
1229 for (
int i = 0; i < nq; ++i)
1231 phys[i] = sin(xc[i]) * cos(yc[i]);
1234 Exp->IProductWRTBase(phys, coeffsRef);
1237 double epsilon = 1.0e-8;
1238 for (
int i = 0; i < coeffs.size(); ++i)
1240 coeffsRef[i] = (
std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
1241 coeffs[i] = (
std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
1242 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
1247 TestQuadIProductWRTBase_MatrixFree_UniformP_Deformed_OverInt)
1264 unsigned int numQuadPoints = 10;
1265 unsigned int numModes = 5;
1267 quadPointsTypeDir1);
1273 basisKeyDir1, basisKeyDir1, quadGeom);
1277 basisKeyDir1, basisKeyDir1);
1279 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1280 CollExp.push_back(Exp);
1289 const int nq = Exp->GetTotPoints();
1296 Exp->GetCoords(xc, yc);
1298 for (
int i = 0; i < nq; ++i)
1300 phys[i] = sin(xc[i]) * cos(yc[i]);
1303 Exp->IProductWRTBase(phys, coeffsRef);
1306 double epsilon = 1.0e-8;
1307 for (
int i = 0; i < coeffs.size(); ++i)
1309 coeffsRef[i] = (
std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
1310 coeffs[i] = (
std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
1311 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
1332 unsigned int numQuadPoints = 6;
1334 quadPointsTypeDir1);
1340 basisKeyDir1, basisKeyDir1, quadGeom);
1344 basisKeyDir1, basisKeyDir1);
1346 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1347 CollExp.push_back(Exp);
1356 const int nq = Exp->GetTotPoints();
1362 Exp->GetCoords(xc, yc);
1364 for (
int i = 0; i < nq; ++i)
1366 phys[i] = sin(xc[i]) * cos(yc[i]);
1369 Exp->PhysDeriv(phys, diff1, tmp = diff1 + nq);
1372 double epsilon = 1.0e-8;
1373 for (
int i = 0; i < diff1.size(); ++i)
1375 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
1397 quadPointsTypeDir1);
1399 quadPointsTypeDir1);
1407 basisKeyDir1, basisKeyDir2, quadGeom);
1411 basisKeyDir1, basisKeyDir2);
1414 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1415 for (
int i = 0; i < nelmts; ++i)
1417 CollExp.push_back(Exp);
1427 const int nq = Exp->GetTotPoints();
1433 Exp->GetCoords(xc, yc);
1435 for (
int i = 0; i < nq; ++i)
1437 phys[i] = sin(xc[i]) * cos(yc[i]);
1439 Exp->PhysDeriv(phys, diff1, tmp = diff1 + nelmts * nq);
1440 for (
int i = 1; i < nelmts; ++i)
1443 Exp->PhysDeriv(phys, tmp = diff1 + i * nq,
1444 tmp1 = diff1 + (nelmts + i) * nq);
1448 tmp = diff2 + nelmts * nq);
1450 double epsilon = 1.0e-8;
1451 for (
int i = 0; i < diff1.size(); ++i)
1453 diff1[i] = (
std::abs(diff1[i]) < 1e-14) ? 0.0 : diff1[i];
1454 diff2[i] = (
std::abs(diff2[i]) < 1e-14) ? 0.0 : diff2[i];
1455 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
1476 unsigned int numQuadPoints = 5;
1477 unsigned int numModes = 2;
1479 quadPointsTypeDir1);
1485 basisKeyDir1, basisKeyDir1, quadGeom);
1489 basisKeyDir1, basisKeyDir1);
1491 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1492 CollExp.push_back(Exp);
1501 const int nq = Exp->GetTotPoints();
1507 Exp->GetCoords(xc, yc);
1509 for (
int i = 0; i < nq; ++i)
1511 phys[i] = sin(xc[i]) * cos(yc[i]);
1514 Exp->PhysDeriv(phys, derivRef, tmp = derivRef + nq);
1517 double epsilon = 1.0e-8;
1518 for (
int i = 0; i < derivRef.size(); ++i)
1520 derivRef[i] = (
std::abs(derivRef[i]) < 1e-14) ? 0.0 : derivRef[i];
1521 deriv[i] = (
std::abs(deriv[i]) < 1e-14) ? 0.0 : deriv[i];
1522 BOOST_CHECK_CLOSE(derivRef[i], deriv[i], epsilon);
1543 unsigned int numQuadPoints = 4;
1544 unsigned int numModes = 2;
1546 quadPointsTypeDir1);
1552 basisKeyDir1, basisKeyDir1, quadGeom);
1556 basisKeyDir1, basisKeyDir1);
1558 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1559 CollExp.push_back(Exp);
1568 const int nq = Exp->GetTotPoints();
1574 Exp->GetCoords(xc, yc);
1576 for (
int i = 0; i < nq; ++i)
1578 phys[i] = sin(xc[i]) * cos(yc[i]);
1581 Exp->PhysDeriv(phys, derivRef, tmp = derivRef + nq);
1584 double epsilon = 1.0e-8;
1585 for (
int i = 0; i < derivRef.size(); ++i)
1587 derivRef[i] = (
std::abs(derivRef[i]) < 1e-14) ? 0.0 : derivRef[i];
1588 deriv[i] = (
std::abs(deriv[i]) < 1e-14) ? 0.0 : deriv[i];
1589 BOOST_CHECK_CLOSE(derivRef[i], deriv[i], epsilon);
1610 unsigned int numQuadPoints = 4;
1611 unsigned int numModes = 2;
1613 quadPointsTypeDir1);
1619 basisKeyDir1, basisKeyDir1, quadGeom);
1621 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1622 CollExp.push_back(Exp);
1631 const int nq = Exp->GetTotPoints();
1637 Exp->GetCoords(xc, yc, zc);
1639 for (
int i = 0; i < nq; ++i)
1641 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
1644 Exp->PhysDeriv(phys, derivRef, tmp = derivRef + nq,
1645 tmp1 = derivRef + 2 * nq);
1647 tmp1 = deriv + 2 * nq);
1649 double epsilon = 1.0e-8;
1650 for (
int i = 0; i < derivRef.size(); ++i)
1652 derivRef[i] = (
std::abs(derivRef[i]) < 1e-14) ? 0.0 : derivRef[i];
1653 deriv[i] = (
std::abs(deriv[i]) < 1e-14) ? 0.0 : deriv[i];
1654 BOOST_CHECK_CLOSE(derivRef[i], deriv[i], epsilon);
1659 TestQuadPhysDeriv_Directional_MatrixFree_UniformP_Undeformed)
1676 unsigned int numQuadPoints = 5;
1677 unsigned int numModes = 2;
1679 quadPointsTypeDir1);
1685 basisKeyDir1, basisKeyDir1, quadGeom);
1689 basisKeyDir1, basisKeyDir1);
1691 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1692 CollExp.push_back(Exp);
1701 const int nq = Exp->GetTotPoints();
1707 Exp->GetCoords(xc, yc);
1709 for (
int i = 0; i < nq; ++i)
1711 phys[i] = sin(xc[i]) * cos(yc[i]);
1714 Exp->PhysDeriv(0, phys, derivRef);
1715 Exp->PhysDeriv(1, phys, tmp = derivRef + nq);
1720 double epsilon = 1.0e-8;
1721 for (
int i = 0; i < derivRef.size(); ++i)
1723 derivRef[i] = (
std::abs(derivRef[i]) < 1e-14) ? 0.0 : derivRef[i];
1724 deriv[i] = (
std::abs(deriv[i]) < 1e-14) ? 0.0 : deriv[i];
1725 BOOST_CHECK_CLOSE(derivRef[i], deriv[i], epsilon);
1746 unsigned int numQuadPoints = 6;
1748 quadPointsTypeDir1);
1754 basisKeyDir1, basisKeyDir1, quadGeom);
1758 basisKeyDir1, basisKeyDir1);
1760 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1761 CollExp.push_back(Exp);
1770 const int nq = Exp->GetTotPoints();
1776 Exp->GetCoords(xc, yc);
1778 for (
int i = 0; i < nq; ++i)
1780 phys[i] = sin(xc[i]) * cos(yc[i]);
1783 Exp->PhysDeriv(phys, diff1, tmp = diff1 + nq);
1786 double epsilon = 1.0e-8;
1787 for (
int i = 0; i < diff1.size(); ++i)
1789 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
1811 quadPointsTypeDir1);
1813 quadPointsTypeDir1);
1821 basisKeyDir1, basisKeyDir2, quadGeom);
1825 basisKeyDir1, basisKeyDir2);
1829 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1830 for (
int i = 0; i < nelmts; ++i)
1832 CollExp.push_back(Exp);
1842 const int nq = Exp->GetTotPoints();
1848 Exp->GetCoords(xc, yc);
1850 for (
int i = 0; i < nq; ++i)
1852 phys[i] = sin(xc[i]) * cos(yc[i]);
1854 Exp->PhysDeriv(phys, diff1, tmp1 = diff1 + nelmts * nq);
1855 for (
int i = 1; i < nelmts; ++i)
1858 Exp->PhysDeriv(phys, tmp = diff1 + i * nq,
1859 tmp1 = diff1 + (nelmts + i) * nq);
1863 tmp = diff2 + nelmts * nq);
1865 double epsilon = 1.0e-8;
1866 for (
int i = 0; i < diff1.size(); ++i)
1868 diff1[i] = (
std::abs(diff1[i]) < 1e-14) ? 0.0 : diff1[i];
1869 diff2[i] = (
std::abs(diff2[i]) < 1e-14) ? 0.0 : diff2[i];
1870 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
1891 unsigned int numQuadPoints = 6;
1893 quadPointsTypeDir1);
1899 basisKeyDir1, basisKeyDir1, quadGeom);
1903 basisKeyDir1, basisKeyDir1);
1905 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1906 CollExp.push_back(Exp);
1915 const int nq = Exp->GetTotPoints();
1921 Exp->GetCoords(xc, yc);
1923 for (
int i = 0; i < nq; ++i)
1925 phys[i] = sin(xc[i]) * cos(yc[i]);
1928 Exp->PhysDeriv(phys, diff1, tmp = diff1 + nq);
1931 double epsilon = 1.0e-8;
1932 for (
int i = 0; i < diff1.size(); ++i)
1934 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
1956 quadPointsTypeDir1);
1958 quadPointsTypeDir1);
1966 basisKeyDir1, basisKeyDir2, quadGeom);
1970 basisKeyDir1, basisKeyDir2);
1974 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1975 for (
int i = 0; i < nelmts; ++i)
1977 CollExp.push_back(Exp);
1987 const int nq = Exp->GetTotPoints();
1993 Exp->GetCoords(xc, yc);
1995 for (
int i = 0; i < nq; ++i)
1997 phys[i] = sin(xc[i]) * cos(yc[i]);
1999 Exp->PhysDeriv(phys, diff1, tmp1 = diff1 + nelmts * nq);
2000 for (
int i = 1; i < nelmts; ++i)
2003 Exp->PhysDeriv(phys, tmp = diff1 + i * nq,
2004 tmp1 = diff1 + (nelmts + i) * nq);
2008 tmp = diff2 + nelmts * nq);
2010 double epsilon = 1.0e-8;
2011 for (
int i = 0; i < diff1.size(); ++i)
2013 diff1[i] = (
std::abs(diff1[i]) < 1e-14) ? 0.0 : diff1[i];
2014 diff2[i] = (
std::abs(diff2[i]) < 1e-14) ? 0.0 : diff2[i];
2015 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
2036 unsigned int numQuadPoints = 5;
2038 quadPointsTypeDir1);
2044 basisKeyDir1, basisKeyDir1, quadGeom);
2048 basisKeyDir1, basisKeyDir1);
2050 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2051 CollExp.push_back(Exp);
2060 const int nq = Exp->GetTotPoints();
2061 const int nm = Exp->GetNcoeffs();
2069 Exp->GetCoords(xc, yc);
2071 for (
int i = 0; i < nq; ++i)
2073 phys1[i] = sin(xc[i]) * cos(yc[i]);
2074 phys2[i] = cos(xc[i]) * sin(yc[i]);
2078 Exp->IProductWRTDerivBase(0, phys1, coeffs1);
2079 Exp->IProductWRTDerivBase(1, phys2, coeffs2);
2080 Vmath::Vadd(nm, coeffs1, 1, coeffs2, 1, coeffs1, 1);
2084 double epsilon = 1.0e-8;
2085 for (
int i = 0; i < coeffs1.size(); ++i)
2087 coeffs1[i] = (
std::abs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
2088 coeffs2[i] = (
std::abs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
2089 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
2094 TestQuadIProductWRTDerivBase_IterPerExp_VariableP_MultiElmt)
2112 quadPointsTypeDir1);
2114 quadPointsTypeDir1);
2122 basisKeyDir1, basisKeyDir2, quadGeom);
2126 basisKeyDir1, basisKeyDir2);
2130 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2131 for (
int i = 0; i < nelmts; ++i)
2133 CollExp.push_back(Exp);
2143 const int nq = Exp->GetTotPoints();
2144 const int nm = Exp->GetNcoeffs();
2151 Exp->GetCoords(xc, yc);
2153 for (
int i = 0; i < nq; ++i)
2155 phys1[i] = sin(xc[i]) * cos(yc[i]);
2156 phys2[i] = cos(xc[i]) * sin(yc[i]);
2158 for (
int i = 1; i < nelmts; ++i)
2164 for (
int i = 0; i < nelmts; ++i)
2167 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
2168 Exp->IProductWRTDerivBase(1, phys2 + i * nq, tmp1 = coeffs2 + i * nm);
2169 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2170 tmp = coeffs1 + i * nm, 1);
2175 double epsilon = 1.0e-8;
2176 for (
int i = 0; i < coeffs1.size(); ++i)
2178 coeffs1[i] = (
std::abs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
2179 coeffs2[i] = (
std::abs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
2180 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
2185 TestQuadIProductWRTDerivBase_MatrixFree_UniformP_Undeformed)
2202 unsigned int numQuadPoints = 6;
2203 unsigned int numModes = 5;
2205 quadPointsTypeDir1);
2211 basisKeyDir1, basisKeyDir1, quadGeom);
2215 basisKeyDir1, basisKeyDir1);
2217 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2218 CollExp.push_back(Exp);
2229 const int nq = Exp->GetTotPoints();
2230 const int nm = Exp->GetNcoeffs();
2238 Exp->GetCoords(xc, yc);
2240 for (
int i = 0; i < nq; ++i)
2242 phys1[i] = sin(xc[i]) * cos(yc[i]);
2243 phys2[i] = cos(xc[i]) * sin(yc[i]);
2247 Exp->IProductWRTDerivBase(0, phys1, coeffsRef);
2248 Exp->IProductWRTDerivBase(1, phys2, coeffs);
2249 Vmath::Vadd(nm, coeffsRef, 1, coeffs, 1, coeffsRef, 1);
2255 double epsilon = 1.0e-8;
2256 for (
int i = 0; i < coeffsRef.size(); ++i)
2258 coeffsRef[i] = (
std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
2259 coeffs[i] = (
std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
2260 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
2281 unsigned int numQuadPoints = 6;
2282 unsigned int numModes = 5;
2284 quadPointsTypeDir1);
2290 basisKeyDir1, basisKeyDir1, quadGeom);
2294 basisKeyDir1, basisKeyDir1);
2296 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2297 CollExp.push_back(Exp);
2308 const int nq = Exp->GetTotPoints();
2309 const int nm = Exp->GetNcoeffs();
2317 Exp->GetCoords(xc, yc);
2319 for (
int i = 0; i < nq; ++i)
2321 phys1[i] = sin(xc[i]) * cos(yc[i]);
2322 phys2[i] = cos(xc[i]) * sin(yc[i]);
2326 Exp->IProductWRTDerivBase(0, phys1, coeffsRef);
2327 Exp->IProductWRTDerivBase(1, phys2, coeffs);
2328 Vmath::Vadd(nm, coeffsRef, 1, coeffs, 1, coeffsRef, 1);
2334 double epsilon = 1.0e-8;
2335 for (
int i = 0; i < coeffsRef.size(); ++i)
2337 coeffsRef[i] = (
std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
2338 coeffs[i] = (
std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
2339 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
2344 TestQuadIProductWRTDerivBase_MatrixFree_UniformP_Deformed_ThreeD)
2361 unsigned int numQuadPoints = 6;
2362 unsigned int numModes = 5;
2364 quadPointsTypeDir1);
2370 basisKeyDir1, basisKeyDir1, quadGeom);
2374 basisKeyDir1, basisKeyDir1);
2377 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2378 for (
int i = 0; i < nelmts; ++i)
2380 CollExp.push_back(Exp);
2390 const int nq = Exp->GetTotPoints();
2391 const int nm = Exp->GetNcoeffs();
2400 Exp->GetCoords(xc, yc, zc);
2402 for (
int i = 0; i < nq; ++i)
2404 phys1[i] = sin(xc[i]) * cos(yc[i]);
2405 phys2[i] = cos(xc[i]) * sin(yc[i]);
2406 phys3[i] = cos(xc[i]) * sin(zc[i]);
2409 for (
int i = 1; i < nelmts; ++i)
2416 for (
int i = 0; i < nelmts; ++i)
2419 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffsRef + i * nm);
2420 Exp->IProductWRTDerivBase(1, phys2 + i * nq, tmp = coeffs + i * nm);
2421 Vmath::Vadd(nm, coeffsRef + i * nm, 1, coeffs + i * nm, 1,
2422 tmp = coeffsRef + i * nm, 1);
2423 Exp->IProductWRTDerivBase(2, phys3 + i * nq, tmp = coeffs + i * nm);
2424 Vmath::Vadd(nm, coeffsRef + i * nm, 1, coeffs + i * nm, 1,
2425 tmp = coeffsRef + i * nm, 1);
2431 double epsilon = 1.0e-8;
2432 for (
int i = 0; i < coeffsRef.size(); ++i)
2434 coeffsRef[i] = (
std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
2435 coeffs[i] = (
std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
2436 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
2441 TestQuadIProductWRTDerivBase_MatrixFree_UniformP_Deformed_OverInt)
2458 unsigned int numQuadPoints = 10;
2459 unsigned int numModes = 5;
2461 quadPointsTypeDir1);
2467 basisKeyDir1, basisKeyDir1, quadGeom);
2471 basisKeyDir1, basisKeyDir1);
2473 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2474 CollExp.push_back(Exp);
2485 const int nq = Exp->GetTotPoints();
2486 const int nm = Exp->GetNcoeffs();
2494 Exp->GetCoords(xc, yc);
2496 for (
int i = 0; i < nq; ++i)
2498 phys1[i] = sin(xc[i]) * cos(yc[i]);
2499 phys2[i] = cos(xc[i]) * sin(yc[i]);
2503 Exp->IProductWRTDerivBase(0, phys1, coeffsRef);
2504 Exp->IProductWRTDerivBase(1, phys2, coeffs);
2505 Vmath::Vadd(nm, coeffsRef, 1, coeffs, 1, coeffsRef, 1);
2511 double epsilon = 1.0e-8;
2512 for (
int i = 0; i < coeffsRef.size(); ++i)
2514 coeffsRef[i] = (
std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
2515 coeffs[i] = (
std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
2516 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
2537 unsigned int numQuadPoints = 6;
2539 quadPointsTypeDir1);
2545 basisKeyDir1, basisKeyDir1, quadGeom);
2549 basisKeyDir1, basisKeyDir1);
2551 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2552 CollExp.push_back(Exp);
2561 const int nq = Exp->GetTotPoints();
2562 const int nm = Exp->GetNcoeffs();
2570 Exp->GetCoords(xc, yc);
2572 for (
int i = 0; i < nq; ++i)
2574 phys1[i] = sin(xc[i]) * cos(yc[i]);
2575 phys2[i] = cos(xc[i]) * sin(yc[i]);
2579 Exp->IProductWRTDerivBase(0, phys1, coeffs1);
2580 Exp->IProductWRTDerivBase(1, phys2, coeffs2);
2581 Vmath::Vadd(nm, coeffs1, 1, coeffs2, 1, coeffs1, 1);
2585 double epsilon = 1.0e-8;
2586 for (
int i = 0; i < coeffs1.size(); ++i)
2588 coeffs1[i] = (
std::abs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
2589 coeffs2[i] = (
std::abs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
2590 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
2612 quadPointsTypeDir1);
2614 quadPointsTypeDir1);
2622 basisKeyDir1, basisKeyDir2, quadGeom);
2626 basisKeyDir1, basisKeyDir2);
2630 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2631 for (
int i = 0; i < nelmts; ++i)
2633 CollExp.push_back(Exp);
2643 const int nq = Exp->GetTotPoints();
2644 const int nm = Exp->GetNcoeffs();
2651 Exp->GetCoords(xc, yc);
2653 for (
int i = 0; i < nq; ++i)
2655 phys1[i] = sin(xc[i]) * cos(yc[i]);
2656 phys2[i] = cos(xc[i]) * sin(yc[i]);
2658 for (
int i = 1; i < nelmts; ++i)
2664 for (
int i = 0; i < nelmts; ++i)
2667 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
2668 Exp->IProductWRTDerivBase(1, phys2 + i * nq, tmp1 = coeffs2 + i * nm);
2669 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2670 tmp = coeffs1 + i * nm, 1);
2675 double epsilon = 1.0e-8;
2676 for (
int i = 0; i < coeffs1.size(); ++i)
2678 coeffs1[i] = (
std::abs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
2679 coeffs2[i] = (
std::abs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
2680 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
2701 unsigned int numQuadPoints = 5;
2703 quadPointsTypeDir1);
2709 basisKeyDir1, basisKeyDir1, quadGeom);
2713 basisKeyDir1, basisKeyDir1);
2715 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2716 CollExp.push_back(Exp);
2725 const int nq = Exp->GetTotPoints();
2726 const int nm = Exp->GetNcoeffs();
2734 Exp->GetCoords(xc, yc);
2736 for (
int i = 0; i < nq; ++i)
2738 phys1[i] = sin(xc[i]) * cos(yc[i]);
2739 phys2[i] = cos(xc[i]) * sin(yc[i]);
2743 Exp->IProductWRTDerivBase(0, phys1, coeffs1);
2744 Exp->IProductWRTDerivBase(1, phys2, coeffs2);
2745 Vmath::Vadd(nm, coeffs1, 1, coeffs2, 1, coeffs1, 1);
2749 double epsilon = 1.0e-8;
2750 for (
int i = 0; i < coeffs1.size(); ++i)
2752 coeffs1[i] = (
std::abs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
2753 coeffs2[i] = (
std::abs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
2754 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
2776 quadPointsTypeDir1);
2778 quadPointsTypeDir1);
2786 basisKeyDir1, basisKeyDir2, quadGeom);
2790 basisKeyDir1, basisKeyDir2);
2794 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2795 for (
int i = 0; i < nelmts; ++i)
2797 CollExp.push_back(Exp);
2807 const int nq = Exp->GetTotPoints();
2808 const int nm = Exp->GetNcoeffs();
2815 Exp->GetCoords(xc, yc);
2817 for (
int i = 0; i < nq; ++i)
2819 phys1[i] = sin(xc[i]) * cos(yc[i]);
2820 phys2[i] = cos(xc[i]) * sin(yc[i]);
2822 for (
int i = 1; i < nelmts; ++i)
2828 for (
int i = 0; i < nelmts; ++i)
2831 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
2832 Exp->IProductWRTDerivBase(1, phys2 + i * nq, tmp1 = coeffs2 + i * nm);
2833 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2834 tmp = coeffs1 + i * nm, 1);
2839 double epsilon = 1.0e-8;
2840 for (
int i = 0; i < coeffs1.size(); ++i)
2842 coeffs1[i] = (
std::abs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
2843 coeffs2[i] = (
std::abs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
2844 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
2849 TestQuadIProductWRTDerivBase_SumFac_VariableP_MultiElmt_threedim)
2867 quadPointsTypeDir1);
2869 quadPointsTypeDir1);
2877 basisKeyDir1, basisKeyDir2, quadGeom);
2881 basisKeyDir1, basisKeyDir2);
2885 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2886 for (
int i = 0; i < nelmts; ++i)
2888 CollExp.push_back(Exp);
2898 const int nq = Exp->GetTotPoints();
2899 const int nm = Exp->GetNcoeffs();
2907 Exp->GetCoords(xc, yc, zc);
2909 for (
int i = 0; i < nq; ++i)
2911 phys1[i] = sin(xc[i]) * cos(yc[i]);
2912 phys2[i] = cos(xc[i]) * sin(yc[i]);
2913 phys2[i] = cos(xc[i]) * sin(zc[i]);
2915 for (
int i = 1; i < nelmts; ++i)
2922 for (
int i = 0; i < nelmts; ++i)
2925 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
2926 Exp->IProductWRTDerivBase(1, phys2 + i * nq, tmp1 = coeffs2 + i * nm);
2927 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2928 tmp = coeffs1 + i * nm, 1);
2929 Exp->IProductWRTDerivBase(2, phys3 + i * nq, tmp1 = coeffs2 + i * nm);
2930 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2931 tmp = coeffs1 + i * nm, 1);
2937 double epsilon = 1.0e-8;
2938 for (
int i = 0; i < coeffs1.size(); ++i)
2940 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
2941 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
2942 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
2963 unsigned int numQuadPoints = 6;
2964 unsigned int numModes = 5;
2966 quadPointsTypeDir1);
2972 basisKeyDir1, basisKeyDir1, quadGeom);
2976 basisKeyDir1, basisKeyDir1);
2980 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2981 for (
int i = 0; i < nelmts; ++i)
2983 CollExp.push_back(Exp);
2999 const int nm = Exp->GetNcoeffs();
3004 for (
int i = 0; i < nm; ++i)
3009 for (
int i = 1; i < nelmts; ++i)
3011 Vmath::Vcopy(nm, coeffsIn, 1, tmp = coeffsIn + i * nm, 1);
3017 for (
int i = 0; i < nelmts; ++i)
3020 Exp->GeneralMatrixOp(coeffsIn + i * nm, tmp = coeffsRef + i * nm, mkey);
3025 double epsilon = 1.0e-8;
3026 for (
int i = 0; i < coeffsRef.size(); ++i)
3028 coeffsRef[i] = (
std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
3029 coeffs[i] = (
std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
3030 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
3051 unsigned int numQuadPoints = 6;
3052 unsigned int numModes = 5;
3054 quadPointsTypeDir1);
3060 basisKeyDir1, basisKeyDir1, quadGeom);
3064 basisKeyDir1, basisKeyDir1);
3068 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
3069 for (
int i = 0; i < nelmts; ++i)
3071 CollExp.push_back(Exp);
3084 const int nm = Exp->GetNcoeffs();
3089 for (
int i = 0; i < nm; ++i)
3094 for (
int i = 1; i < nelmts; ++i)
3096 Vmath::Vcopy(nm, coeffsIn, 1, tmp = coeffsIn + i * nm, 1);
3102 for (
int i = 0; i < nelmts; ++i)
3105 Exp->GeneralMatrixOp(coeffsIn + i * nm, tmp = coeffsRef + i * nm, mkey);
3110 double epsilon = 1.0e-8;
3111 for (
int i = 0; i < coeffsRef.size(); ++i)
3113 coeffsRef[i] = (
std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
3114 coeffs[i] = (
std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
3115 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
3136 unsigned int numQuadPoints = 6;
3137 unsigned int numModes = 5;
3139 quadPointsTypeDir1);
3145 basisKeyDir1, basisKeyDir1, quadGeom);
3149 basisKeyDir1, basisKeyDir1);
3153 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
3154 for (
int i = 0; i < nelmts; ++i)
3156 CollExp.push_back(Exp);
3169 const int nm = Exp->GetNcoeffs();
3174 for (
int i = 0; i < nm; ++i)
3179 for (
int i = 1; i < nelmts; ++i)
3181 Vmath::Vcopy(nm, coeffsIn, 1, tmp = coeffsIn + i * nm, 1);
3187 for (
int i = 0; i < nelmts; ++i)
3190 Exp->GeneralMatrixOp(coeffsIn + i * nm, tmp = coeffsRef + i * nm, mkey);
3195 double epsilon = 1.0e-8;
3196 for (
int i = 0; i < coeffsRef.size(); ++i)
3198 coeffsRef[i] = (
std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
3199 coeffs[i] = (
std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
3200 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
3221 unsigned int numQuadPoints = 6;
3222 unsigned int numModes = 5;
3224 quadPointsTypeDir1);
3230 basisKeyDir1, basisKeyDir1, quadGeom);
3234 basisKeyDir1, basisKeyDir1);
3238 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
3239 for (
int i = 0; i < nelmts; ++i)
3241 CollExp.push_back(Exp);
3257 const int nm = Exp->GetNcoeffs();
3262 for (
int i = 0; i < nm; ++i)
3267 for (
int i = 1; i < nelmts; ++i)
3269 Vmath::Vcopy(nm, coeffsIn, 1, tmp = coeffsIn + i * nm, 1);
3275 for (
int i = 0; i < nelmts; ++i)
3278 Exp->GeneralMatrixOp(coeffsIn + i * nm, tmp = coeffsRef + i * nm, mkey);
3283 double epsilon = 1.0e-8;
3284 for (
int i = 0; i < coeffsRef.size(); ++i)
3286 coeffsRef[i] = (
std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
3287 coeffs[i] = (
std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
3288 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], 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)
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.
std::map< OperatorType, ImplementationType > OperatorImpMap
std::shared_ptr< SessionReader > SessionReaderSharedPtr
@ eGaussLobattoLegendre
1D Gauss-Lobatto-Legendre quadrature points
@ eModified_A
Principle Modified Functions .
std::shared_ptr< QuadExp > QuadExpSharedPtr
BOOST_AUTO_TEST_CASE(TestQuadBwdTrans_StdMat_UniformP)
SpatialDomains::SegGeomSharedPtr CreateSegGeom(unsigned int id, SpatialDomains::PointGeomSharedPtr v0, SpatialDomains::PointGeomSharedPtr v1)
SpatialDomains::QuadGeomSharedPtr CreateQuad(SpatialDomains::PointGeomSharedPtr v0, SpatialDomains::PointGeomSharedPtr v1, SpatialDomains::PointGeomSharedPtr v2, SpatialDomains::PointGeomSharedPtr v3)
std::shared_ptr< QuadGeom > QuadGeomSharedPtr
std::shared_ptr< SegGeom > SegGeomSharedPtr
std::shared_ptr< PointGeom > PointGeomSharedPtr
std::shared_ptr< StdQuadExp > StdQuadExpSharedPtr
std::map< ConstFactorType, NekDouble > ConstFactorMap
StdRegions::ConstFactorMap factors
The above copyright notice and this permission notice shall be included.
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)