39#include <boost/test/tools/floating_point_comparison.hpp>
40#include <boost/test/unit_test.hpp>
90 unsigned int numQuadPoints = 6;
98 basisKeyDir1, basisKeyDir1, quadGeom);
102 basisKeyDir1, basisKeyDir1);
104 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
105 CollExp.push_back(Exp);
118 Exp->BwdTrans(coeffs, phys1);
121 double epsilon = 1.0e-8;
122 for (
int i = 0; i < phys1.size(); ++i)
124 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
156 basisKeyDir1, basisKeyDir2, quadGeom);
160 basisKeyDir1, basisKeyDir2);
162 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
163 CollExp.push_back(Exp);
176 Exp->BwdTrans(coeffs, phys1);
179 double epsilon = 1.0e-8;
180 for (
int i = 0; i < phys1.size(); ++i)
182 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
214 basisKeyDir1, basisKeyDir2, quadGeom);
218 basisKeyDir1, basisKeyDir2);
220 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
222 for (
int i = 0; i < nelmts; ++i)
224 CollExp.push_back(Exp);
238 for (
int i = 0; i < nelmts; ++i)
240 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
241 tmp = phys1 + i * Exp->GetTotPoints());
245 double epsilon = 1.0e-8;
246 for (
int i = 0; i < phys1.size(); ++i)
248 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
269 unsigned int numQuadPoints = 6;
277 basisKeyDir1, basisKeyDir1, quadGeom);
281 basisKeyDir1, basisKeyDir1);
283 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
284 CollExp.push_back(Exp);
297 Exp->BwdTrans(coeffs, phys1);
300 double epsilon = 1.0e-8;
301 for (
int i = 0; i < phys1.size(); ++i)
303 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
335 basisKeyDir1, basisKeyDir2, quadGeom);
339 basisKeyDir1, basisKeyDir2);
341 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
342 CollExp.push_back(Exp);
355 Exp->BwdTrans(coeffs, phys1);
358 double epsilon = 1.0e-8;
359 for (
int i = 0; i < phys1.size(); ++i)
361 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
382 unsigned int numQuadPoints = 6;
383 unsigned int numModes = 4;
391 basisKeyDir1, basisKeyDir1, quadGeom);
395 basisKeyDir1, basisKeyDir1);
397 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
398 CollExp.push_back(Exp);
412 Exp->BwdTrans(coeffs, physRef);
415 double epsilon = 1.0e-8;
416 for (
int i = 0; i < physRef.size(); ++i)
418 BOOST_CHECK_CLOSE(physRef[i], phys[i], epsilon);
439 unsigned int numQuadPoints = 6;
447 basisKeyDir1, basisKeyDir1, quadGeom);
451 basisKeyDir1, basisKeyDir1);
453 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
456 for (
int i = 0; i < nelmts; ++i)
458 CollExp.push_back(Exp);
472 for (
int i = 0; i < nelmts; ++i)
474 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
475 tmp = phys1 + i * Exp->GetTotPoints());
479 double epsilon = 1.0e-8;
480 for (
int i = 0; i < phys1.size(); ++i)
482 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
503 unsigned int numQuadPoints = 6;
511 basisKeyDir1, basisKeyDir1, quadGeom);
515 basisKeyDir1, basisKeyDir1);
517 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
520 for (
int i = 0; i < nelmts; ++i)
522 CollExp.push_back(Exp);
536 for (
int i = 0; i < nelmts; ++i)
538 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
539 tmp = phys1 + i * Exp->GetTotPoints());
543 double epsilon = 1.0e-8;
544 for (
int i = 0; i < phys1.size(); ++i)
546 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
578 basisKeyDir1, basisKeyDir2, quadGeom);
582 basisKeyDir1, basisKeyDir2);
586 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
587 for (
int i = 0; i < nelmts; ++i)
589 CollExp.push_back(Exp);
603 for (
int i = 0; i < nelmts; ++i)
605 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
606 tmp = phys1 + i * Exp->GetTotPoints());
610 double epsilon = 1.0e-8;
611 for (
int i = 0; i < phys1.size(); ++i)
613 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
645 basisKeyDir1, basisKeyDir2, quadGeom);
649 basisKeyDir1, basisKeyDir2);
653 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
654 for (
int i = 0; i < nelmts; ++i)
656 CollExp.push_back(Exp);
670 for (
int i = 0; i < nelmts; ++i)
672 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
673 tmp = phys1 + i * Exp->GetTotPoints());
677 double epsilon = 1.0e-8;
678 for (
int i = 0; i < phys1.size(); ++i)
680 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
701 unsigned int numQuadPoints = 6;
709 basisKeyDir1, basisKeyDir1, quadGeom);
713 basisKeyDir1, basisKeyDir1);
715 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
716 CollExp.push_back(Exp);
725 const int nq = Exp->GetTotPoints();
732 Exp->GetCoords(xc, yc);
734 for (
int i = 0; i < nq; ++i)
736 phys[i] = sin(xc[i]) * cos(yc[i]);
739 Exp->IProductWRTBase(phys, coeffs1);
742 double epsilon = 1.0e-8;
743 for (
int i = 0; i < coeffs1.size(); ++i)
745 coeffs1[i] = (
std::abs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
746 coeffs2[i] = (
std::abs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
747 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
780 basisKeyDir1, basisKeyDir2, quadGeom);
784 basisKeyDir1, basisKeyDir2);
786 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
787 CollExp.push_back(Exp);
796 const int nq = Exp->GetTotPoints();
803 Exp->GetCoords(xc, yc);
805 for (
int i = 0; i < nq; ++i)
807 phys[i] = sin(xc[i]) * cos(yc[i]);
810 Exp->IProductWRTBase(phys, coeffs1);
813 double epsilon = 1.0e-8;
814 for (
int i = 0; i < coeffs1.size(); ++i)
816 coeffs1[i] = (
std::abs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
817 coeffs2[i] = (
std::abs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
818 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
851 basisKeyDir1, basisKeyDir2, quadGeom);
855 basisKeyDir1, basisKeyDir2);
859 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
860 for (
int i = 0; i < nelmts; ++i)
862 CollExp.push_back(Exp);
872 const int nq = Exp->GetTotPoints();
879 Exp->GetCoords(xc, yc);
881 for (
int i = 0; i < nq; ++i)
883 phys[i] = sin(xc[i]) * cos(yc[i]);
885 Exp->IProductWRTBase(phys, coeffs1);
887 for (
int i = 1; i < nelmts; ++i)
890 Exp->IProductWRTBase(phys + i * nq,
891 tmp = coeffs1 + i * Exp->GetNcoeffs());
895 double epsilon = 1.0e-8;
896 for (
int i = 0; i < coeffs1.size(); ++i)
898 coeffs1[i] = (
std::abs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
899 coeffs2[i] = (
std::abs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
900 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
921 unsigned int numQuadPoints = 6;
929 basisKeyDir1, basisKeyDir1, quadGeom);
933 basisKeyDir1, basisKeyDir1);
935 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
936 CollExp.push_back(Exp);
945 const int nq = Exp->GetTotPoints();
952 Exp->GetCoords(xc, yc);
954 for (
int i = 0; i < nq; ++i)
956 phys[i] = sin(xc[i]) * cos(yc[i]);
959 Exp->IProductWRTBase(phys, coeffs1);
962 double epsilon = 1.0e-8;
963 for (
int i = 0; i < coeffs1.size(); ++i)
965 coeffs1[i] = (
std::abs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
966 coeffs2[i] = (
std::abs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
967 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
988 unsigned int numQuadPoints = 6;
996 basisKeyDir1, basisKeyDir1, quadGeom);
1000 basisKeyDir1, basisKeyDir1);
1002 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1003 CollExp.push_back(Exp);
1012 const int nq = Exp->GetTotPoints();
1019 Exp->GetCoords(xc, yc);
1021 for (
int i = 0; i < nq; ++i)
1023 phys[i] = sin(xc[i]) * cos(yc[i]);
1026 Exp->IProductWRTBase(phys, coeffs1);
1029 double epsilon = 1.0e-8;
1030 for (
int i = 0; i < coeffs1.size(); ++i)
1032 coeffs1[i] = (
std::abs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
1033 coeffs2[i] = (
std::abs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
1034 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1056 quadPointsTypeDir1);
1058 quadPointsTypeDir1);
1066 basisKeyDir1, basisKeyDir2, quadGeom);
1070 basisKeyDir1, basisKeyDir2);
1072 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1073 CollExp.push_back(Exp);
1082 const int nq = Exp->GetTotPoints();
1089 Exp->GetCoords(xc, yc);
1091 for (
int i = 0; i < nq; ++i)
1093 phys[i] = sin(xc[i]) * cos(yc[i]);
1096 Exp->IProductWRTBase(phys, coeffs1);
1099 double epsilon = 1.0e-8;
1100 for (
int i = 0; i < coeffs1.size(); ++i)
1102 coeffs1[i] = (
std::abs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
1103 coeffs2[i] = (
std::abs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
1104 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1125 unsigned int numQuadPoints = 6;
1126 unsigned int numModes = 5;
1128 quadPointsTypeDir1);
1134 basisKeyDir1, basisKeyDir1, quadGeom);
1138 basisKeyDir1, basisKeyDir1);
1140 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1141 CollExp.push_back(Exp);
1150 const int nq = Exp->GetTotPoints();
1157 Exp->GetCoords(xc, yc);
1159 for (
int i = 0; i < nq; ++i)
1161 phys[i] = sin(xc[i]) * cos(yc[i]);
1164 Exp->IProductWRTBase(phys, coeffsRef);
1167 double epsilon = 1.0e-8;
1168 for (
int i = 0; i < coeffs.size(); ++i)
1170 coeffsRef[i] = (
std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
1171 coeffs[i] = (
std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
1172 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
1193 unsigned int numQuadPoints = 6;
1194 unsigned int numModes = 5;
1196 quadPointsTypeDir1);
1202 basisKeyDir1, basisKeyDir1, quadGeom);
1206 basisKeyDir1, basisKeyDir1);
1208 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1209 CollExp.push_back(Exp);
1218 const int nq = Exp->GetTotPoints();
1225 Exp->GetCoords(xc, yc);
1227 for (
int i = 0; i < nq; ++i)
1229 phys[i] = sin(xc[i]) * cos(yc[i]);
1232 Exp->IProductWRTBase(phys, coeffsRef);
1235 double epsilon = 1.0e-8;
1236 for (
int i = 0; i < coeffs.size(); ++i)
1238 coeffsRef[i] = (
std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
1239 coeffs[i] = (
std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
1240 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
1245 TestQuadIProductWRTBase_MatrixFree_UniformP_Deformed_OverInt)
1262 unsigned int numQuadPoints = 10;
1263 unsigned int numModes = 5;
1265 quadPointsTypeDir1);
1271 basisKeyDir1, basisKeyDir1, quadGeom);
1275 basisKeyDir1, basisKeyDir1);
1277 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1278 CollExp.push_back(Exp);
1287 const int nq = Exp->GetTotPoints();
1294 Exp->GetCoords(xc, yc);
1296 for (
int i = 0; i < nq; ++i)
1298 phys[i] = sin(xc[i]) * cos(yc[i]);
1301 Exp->IProductWRTBase(phys, coeffsRef);
1304 double epsilon = 1.0e-8;
1305 for (
int i = 0; i < coeffs.size(); ++i)
1307 coeffsRef[i] = (
std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
1308 coeffs[i] = (
std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
1309 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
1330 unsigned int numQuadPoints = 6;
1332 quadPointsTypeDir1);
1338 basisKeyDir1, basisKeyDir1, quadGeom);
1342 basisKeyDir1, basisKeyDir1);
1344 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1345 CollExp.push_back(Exp);
1354 const int nq = Exp->GetTotPoints();
1360 Exp->GetCoords(xc, yc);
1362 for (
int i = 0; i < nq; ++i)
1364 phys[i] = sin(xc[i]) * cos(yc[i]);
1367 Exp->PhysDeriv(phys, diff1, tmp = diff1 + nq);
1370 double epsilon = 1.0e-8;
1371 for (
int i = 0; i < diff1.size(); ++i)
1373 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
1395 quadPointsTypeDir1);
1397 quadPointsTypeDir1);
1405 basisKeyDir1, basisKeyDir2, quadGeom);
1409 basisKeyDir1, basisKeyDir2);
1412 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1413 for (
int i = 0; i < nelmts; ++i)
1415 CollExp.push_back(Exp);
1425 const int nq = Exp->GetTotPoints();
1431 Exp->GetCoords(xc, yc);
1433 for (
int i = 0; i < nq; ++i)
1435 phys[i] = sin(xc[i]) * cos(yc[i]);
1437 Exp->PhysDeriv(phys, diff1, tmp = diff1 + nelmts * nq);
1438 for (
int i = 1; i < nelmts; ++i)
1441 Exp->PhysDeriv(phys, tmp = diff1 + i * nq,
1442 tmp1 = diff1 + (nelmts + i) * nq);
1446 tmp = diff2 + nelmts * nq);
1448 double epsilon = 1.0e-8;
1449 for (
int i = 0; i < diff1.size(); ++i)
1451 diff1[i] = (
std::abs(diff1[i]) < 1e-14) ? 0.0 : diff1[i];
1452 diff2[i] = (
std::abs(diff2[i]) < 1e-14) ? 0.0 : diff2[i];
1453 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
1474 unsigned int numQuadPoints = 5;
1475 unsigned int numModes = 2;
1477 quadPointsTypeDir1);
1483 basisKeyDir1, basisKeyDir1, quadGeom);
1487 basisKeyDir1, basisKeyDir1);
1489 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1490 CollExp.push_back(Exp);
1499 const int nq = Exp->GetTotPoints();
1505 Exp->GetCoords(xc, yc);
1507 for (
int i = 0; i < nq; ++i)
1509 phys[i] = sin(xc[i]) * cos(yc[i]);
1512 Exp->PhysDeriv(phys, derivRef, tmp = derivRef + nq);
1515 double epsilon = 1.0e-8;
1516 for (
int i = 0; i < derivRef.size(); ++i)
1518 derivRef[i] = (
std::abs(derivRef[i]) < 1e-14) ? 0.0 : derivRef[i];
1519 deriv[i] = (
std::abs(deriv[i]) < 1e-14) ? 0.0 : deriv[i];
1520 BOOST_CHECK_CLOSE(derivRef[i], deriv[i], epsilon);
1541 unsigned int numQuadPoints = 4;
1542 unsigned int numModes = 2;
1544 quadPointsTypeDir1);
1550 basisKeyDir1, basisKeyDir1, quadGeom);
1554 basisKeyDir1, basisKeyDir1);
1556 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1557 CollExp.push_back(Exp);
1566 const int nq = Exp->GetTotPoints();
1572 Exp->GetCoords(xc, yc);
1574 for (
int i = 0; i < nq; ++i)
1576 phys[i] = sin(xc[i]) * cos(yc[i]);
1579 Exp->PhysDeriv(phys, derivRef, tmp = derivRef + nq);
1582 double epsilon = 1.0e-8;
1583 for (
int i = 0; i < derivRef.size(); ++i)
1585 derivRef[i] = (
std::abs(derivRef[i]) < 1e-14) ? 0.0 : derivRef[i];
1586 deriv[i] = (
std::abs(deriv[i]) < 1e-14) ? 0.0 : deriv[i];
1587 BOOST_CHECK_CLOSE(derivRef[i], deriv[i], epsilon);
1608 unsigned int numQuadPoints = 4;
1609 unsigned int numModes = 2;
1611 quadPointsTypeDir1);
1617 basisKeyDir1, basisKeyDir1, quadGeom);
1619 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1620 CollExp.push_back(Exp);
1629 const int nq = Exp->GetTotPoints();
1635 Exp->GetCoords(xc, yc, zc);
1637 for (
int i = 0; i < nq; ++i)
1639 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
1642 Exp->PhysDeriv(phys, derivRef, tmp = derivRef + nq,
1643 tmp1 = derivRef + 2 * nq);
1645 tmp1 = deriv + 2 * nq);
1647 double epsilon = 1.0e-8;
1648 for (
int i = 0; i < derivRef.size(); ++i)
1650 derivRef[i] = (
std::abs(derivRef[i]) < 1e-14) ? 0.0 : derivRef[i];
1651 deriv[i] = (
std::abs(deriv[i]) < 1e-14) ? 0.0 : deriv[i];
1652 BOOST_CHECK_CLOSE(derivRef[i], deriv[i], epsilon);
1657 TestQuadPhysDeriv_Directional_MatrixFree_UniformP_Undeformed)
1674 unsigned int numQuadPoints = 5;
1675 unsigned int numModes = 2;
1677 quadPointsTypeDir1);
1683 basisKeyDir1, basisKeyDir1, quadGeom);
1687 basisKeyDir1, basisKeyDir1);
1689 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1690 CollExp.push_back(Exp);
1699 const int nq = Exp->GetTotPoints();
1705 Exp->GetCoords(xc, yc);
1707 for (
int i = 0; i < nq; ++i)
1709 phys[i] = sin(xc[i]) * cos(yc[i]);
1712 Exp->PhysDeriv(0, phys, derivRef);
1713 Exp->PhysDeriv(1, phys, tmp = derivRef + nq);
1718 double epsilon = 1.0e-8;
1719 for (
int i = 0; i < derivRef.size(); ++i)
1721 derivRef[i] = (
std::abs(derivRef[i]) < 1e-14) ? 0.0 : derivRef[i];
1722 deriv[i] = (
std::abs(deriv[i]) < 1e-14) ? 0.0 : deriv[i];
1723 BOOST_CHECK_CLOSE(derivRef[i], deriv[i], epsilon);
1744 unsigned int numQuadPoints = 6;
1746 quadPointsTypeDir1);
1752 basisKeyDir1, basisKeyDir1, quadGeom);
1756 basisKeyDir1, basisKeyDir1);
1758 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1759 CollExp.push_back(Exp);
1768 const int nq = Exp->GetTotPoints();
1774 Exp->GetCoords(xc, yc);
1776 for (
int i = 0; i < nq; ++i)
1778 phys[i] = sin(xc[i]) * cos(yc[i]);
1781 Exp->PhysDeriv(phys, diff1, tmp = diff1 + nq);
1784 double epsilon = 1.0e-8;
1785 for (
int i = 0; i < diff1.size(); ++i)
1787 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
1809 quadPointsTypeDir1);
1811 quadPointsTypeDir1);
1819 basisKeyDir1, basisKeyDir2, quadGeom);
1823 basisKeyDir1, basisKeyDir2);
1827 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1828 for (
int i = 0; i < nelmts; ++i)
1830 CollExp.push_back(Exp);
1840 const int nq = Exp->GetTotPoints();
1846 Exp->GetCoords(xc, yc);
1848 for (
int i = 0; i < nq; ++i)
1850 phys[i] = sin(xc[i]) * cos(yc[i]);
1852 Exp->PhysDeriv(phys, diff1, tmp1 = diff1 + nelmts * nq);
1853 for (
int i = 1; i < nelmts; ++i)
1856 Exp->PhysDeriv(phys, tmp = diff1 + i * nq,
1857 tmp1 = diff1 + (nelmts + i) * nq);
1861 tmp = diff2 + nelmts * nq);
1863 double epsilon = 1.0e-8;
1864 for (
int i = 0; i < diff1.size(); ++i)
1866 diff1[i] = (
std::abs(diff1[i]) < 1e-14) ? 0.0 : diff1[i];
1867 diff2[i] = (
std::abs(diff2[i]) < 1e-14) ? 0.0 : diff2[i];
1868 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
1889 unsigned int numQuadPoints = 6;
1891 quadPointsTypeDir1);
1897 basisKeyDir1, basisKeyDir1, quadGeom);
1901 basisKeyDir1, basisKeyDir1);
1903 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1904 CollExp.push_back(Exp);
1913 const int nq = Exp->GetTotPoints();
1919 Exp->GetCoords(xc, yc);
1921 for (
int i = 0; i < nq; ++i)
1923 phys[i] = sin(xc[i]) * cos(yc[i]);
1926 Exp->PhysDeriv(phys, diff1, tmp = diff1 + nq);
1929 double epsilon = 1.0e-8;
1930 for (
int i = 0; i < diff1.size(); ++i)
1932 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
1954 quadPointsTypeDir1);
1956 quadPointsTypeDir1);
1964 basisKeyDir1, basisKeyDir2, quadGeom);
1968 basisKeyDir1, basisKeyDir2);
1972 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1973 for (
int i = 0; i < nelmts; ++i)
1975 CollExp.push_back(Exp);
1985 const int nq = Exp->GetTotPoints();
1991 Exp->GetCoords(xc, yc);
1993 for (
int i = 0; i < nq; ++i)
1995 phys[i] = sin(xc[i]) * cos(yc[i]);
1997 Exp->PhysDeriv(phys, diff1, tmp1 = diff1 + nelmts * nq);
1998 for (
int i = 1; i < nelmts; ++i)
2001 Exp->PhysDeriv(phys, tmp = diff1 + i * nq,
2002 tmp1 = diff1 + (nelmts + i) * nq);
2006 tmp = diff2 + nelmts * nq);
2008 double epsilon = 1.0e-8;
2009 for (
int i = 0; i < diff1.size(); ++i)
2011 diff1[i] = (
std::abs(diff1[i]) < 1e-14) ? 0.0 : diff1[i];
2012 diff2[i] = (
std::abs(diff2[i]) < 1e-14) ? 0.0 : diff2[i];
2013 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
2034 unsigned int numQuadPoints = 5;
2036 quadPointsTypeDir1);
2042 basisKeyDir1, basisKeyDir1, quadGeom);
2046 basisKeyDir1, basisKeyDir1);
2048 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2049 CollExp.push_back(Exp);
2058 const int nq = Exp->GetTotPoints();
2059 const int nm = Exp->GetNcoeffs();
2067 Exp->GetCoords(xc, yc);
2069 for (
int i = 0; i < nq; ++i)
2071 phys1[i] = sin(xc[i]) * cos(yc[i]);
2072 phys2[i] = cos(xc[i]) * sin(yc[i]);
2076 Exp->IProductWRTDerivBase(0, phys1, coeffs1);
2077 Exp->IProductWRTDerivBase(1, phys2, coeffs2);
2078 Vmath::Vadd(nm, coeffs1, 1, coeffs2, 1, coeffs1, 1);
2082 double epsilon = 1.0e-8;
2083 for (
int i = 0; i < coeffs1.size(); ++i)
2085 coeffs1[i] = (
std::abs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
2086 coeffs2[i] = (
std::abs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
2087 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
2092 TestQuadIProductWRTDerivBase_IterPerExp_VariableP_MultiElmt)
2110 quadPointsTypeDir1);
2112 quadPointsTypeDir1);
2120 basisKeyDir1, basisKeyDir2, quadGeom);
2124 basisKeyDir1, basisKeyDir2);
2128 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2129 for (
int i = 0; i < nelmts; ++i)
2131 CollExp.push_back(Exp);
2141 const int nq = Exp->GetTotPoints();
2142 const int nm = Exp->GetNcoeffs();
2149 Exp->GetCoords(xc, yc);
2151 for (
int i = 0; i < nq; ++i)
2153 phys1[i] = sin(xc[i]) * cos(yc[i]);
2154 phys2[i] = cos(xc[i]) * sin(yc[i]);
2156 for (
int i = 1; i < nelmts; ++i)
2162 for (
int i = 0; i < nelmts; ++i)
2165 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
2166 Exp->IProductWRTDerivBase(1, phys2 + i * nq, tmp1 = coeffs2 + i * nm);
2167 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2168 tmp = coeffs1 + i * nm, 1);
2173 double epsilon = 1.0e-8;
2174 for (
int i = 0; i < coeffs1.size(); ++i)
2176 coeffs1[i] = (
std::abs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
2177 coeffs2[i] = (
std::abs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
2178 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
2183 TestQuadIProductWRTDerivBase_MatrixFree_UniformP_Undeformed)
2200 unsigned int numQuadPoints = 6;
2201 unsigned int numModes = 5;
2203 quadPointsTypeDir1);
2209 basisKeyDir1, basisKeyDir1, quadGeom);
2213 basisKeyDir1, basisKeyDir1);
2215 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2216 CollExp.push_back(Exp);
2227 const int nq = Exp->GetTotPoints();
2228 const int nm = Exp->GetNcoeffs();
2236 Exp->GetCoords(xc, yc);
2238 for (
int i = 0; i < nq; ++i)
2240 phys1[i] = sin(xc[i]) * cos(yc[i]);
2241 phys2[i] = cos(xc[i]) * sin(yc[i]);
2245 Exp->IProductWRTDerivBase(0, phys1, coeffsRef);
2246 Exp->IProductWRTDerivBase(1, phys2, coeffs);
2247 Vmath::Vadd(nm, coeffsRef, 1, coeffs, 1, coeffsRef, 1);
2253 double epsilon = 1.0e-8;
2254 for (
int i = 0; i < coeffsRef.size(); ++i)
2256 coeffsRef[i] = (
std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
2257 coeffs[i] = (
std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
2258 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
2279 unsigned int numQuadPoints = 6;
2280 unsigned int numModes = 5;
2282 quadPointsTypeDir1);
2288 basisKeyDir1, basisKeyDir1, quadGeom);
2292 basisKeyDir1, basisKeyDir1);
2294 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2295 CollExp.push_back(Exp);
2306 const int nq = Exp->GetTotPoints();
2307 const int nm = Exp->GetNcoeffs();
2315 Exp->GetCoords(xc, yc);
2317 for (
int i = 0; i < nq; ++i)
2319 phys1[i] = sin(xc[i]) * cos(yc[i]);
2320 phys2[i] = cos(xc[i]) * sin(yc[i]);
2324 Exp->IProductWRTDerivBase(0, phys1, coeffsRef);
2325 Exp->IProductWRTDerivBase(1, phys2, coeffs);
2326 Vmath::Vadd(nm, coeffsRef, 1, coeffs, 1, coeffsRef, 1);
2332 double epsilon = 1.0e-8;
2333 for (
int i = 0; i < coeffsRef.size(); ++i)
2335 coeffsRef[i] = (
std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
2336 coeffs[i] = (
std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
2337 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
2342 TestQuadIProductWRTDerivBase_MatrixFree_UniformP_Deformed_ThreeD)
2359 unsigned int numQuadPoints = 6;
2360 unsigned int numModes = 5;
2362 quadPointsTypeDir1);
2368 basisKeyDir1, basisKeyDir1, quadGeom);
2372 basisKeyDir1, basisKeyDir1);
2375 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2376 for (
int i = 0; i < nelmts; ++i)
2378 CollExp.push_back(Exp);
2388 const int nq = Exp->GetTotPoints();
2389 const int nm = Exp->GetNcoeffs();
2398 Exp->GetCoords(xc, yc, zc);
2400 for (
int i = 0; i < nq; ++i)
2402 phys1[i] = sin(xc[i]) * cos(yc[i]);
2403 phys2[i] = cos(xc[i]) * sin(yc[i]);
2404 phys3[i] = cos(xc[i]) * sin(zc[i]);
2407 for (
int i = 1; i < nelmts; ++i)
2414 for (
int i = 0; i < nelmts; ++i)
2417 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffsRef + i * nm);
2418 Exp->IProductWRTDerivBase(1, phys2 + i * nq, tmp = coeffs + i * nm);
2419 Vmath::Vadd(nm, coeffsRef + i * nm, 1, coeffs + i * nm, 1,
2420 tmp = coeffsRef + i * nm, 1);
2421 Exp->IProductWRTDerivBase(2, phys3 + i * nq, tmp = coeffs + i * nm);
2422 Vmath::Vadd(nm, coeffsRef + i * nm, 1, coeffs + i * nm, 1,
2423 tmp = coeffsRef + i * nm, 1);
2429 double epsilon = 1.0e-8;
2430 for (
int i = 0; i < coeffsRef.size(); ++i)
2432 coeffsRef[i] = (
std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
2433 coeffs[i] = (
std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
2434 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
2439 TestQuadIProductWRTDerivBase_MatrixFree_UniformP_Deformed_OverInt)
2456 unsigned int numQuadPoints = 10;
2457 unsigned int numModes = 5;
2459 quadPointsTypeDir1);
2465 basisKeyDir1, basisKeyDir1, quadGeom);
2469 basisKeyDir1, basisKeyDir1);
2471 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2472 CollExp.push_back(Exp);
2483 const int nq = Exp->GetTotPoints();
2484 const int nm = Exp->GetNcoeffs();
2492 Exp->GetCoords(xc, yc);
2494 for (
int i = 0; i < nq; ++i)
2496 phys1[i] = sin(xc[i]) * cos(yc[i]);
2497 phys2[i] = cos(xc[i]) * sin(yc[i]);
2501 Exp->IProductWRTDerivBase(0, phys1, coeffsRef);
2502 Exp->IProductWRTDerivBase(1, phys2, coeffs);
2503 Vmath::Vadd(nm, coeffsRef, 1, coeffs, 1, coeffsRef, 1);
2509 double epsilon = 1.0e-8;
2510 for (
int i = 0; i < coeffsRef.size(); ++i)
2512 coeffsRef[i] = (
std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
2513 coeffs[i] = (
std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
2514 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
2535 unsigned int numQuadPoints = 6;
2537 quadPointsTypeDir1);
2543 basisKeyDir1, basisKeyDir1, quadGeom);
2547 basisKeyDir1, basisKeyDir1);
2549 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2550 CollExp.push_back(Exp);
2559 const int nq = Exp->GetTotPoints();
2560 const int nm = Exp->GetNcoeffs();
2568 Exp->GetCoords(xc, yc);
2570 for (
int i = 0; i < nq; ++i)
2572 phys1[i] = sin(xc[i]) * cos(yc[i]);
2573 phys2[i] = cos(xc[i]) * sin(yc[i]);
2577 Exp->IProductWRTDerivBase(0, phys1, coeffs1);
2578 Exp->IProductWRTDerivBase(1, phys2, coeffs2);
2579 Vmath::Vadd(nm, coeffs1, 1, coeffs2, 1, coeffs1, 1);
2583 double epsilon = 1.0e-8;
2584 for (
int i = 0; i < coeffs1.size(); ++i)
2586 coeffs1[i] = (
std::abs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
2587 coeffs2[i] = (
std::abs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
2588 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
2610 quadPointsTypeDir1);
2612 quadPointsTypeDir1);
2620 basisKeyDir1, basisKeyDir2, quadGeom);
2624 basisKeyDir1, basisKeyDir2);
2628 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2629 for (
int i = 0; i < nelmts; ++i)
2631 CollExp.push_back(Exp);
2641 const int nq = Exp->GetTotPoints();
2642 const int nm = Exp->GetNcoeffs();
2649 Exp->GetCoords(xc, yc);
2651 for (
int i = 0; i < nq; ++i)
2653 phys1[i] = sin(xc[i]) * cos(yc[i]);
2654 phys2[i] = cos(xc[i]) * sin(yc[i]);
2656 for (
int i = 1; i < nelmts; ++i)
2662 for (
int i = 0; i < nelmts; ++i)
2665 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
2666 Exp->IProductWRTDerivBase(1, phys2 + i * nq, tmp1 = coeffs2 + i * nm);
2667 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2668 tmp = coeffs1 + i * nm, 1);
2673 double epsilon = 1.0e-8;
2674 for (
int i = 0; i < coeffs1.size(); ++i)
2676 coeffs1[i] = (
std::abs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
2677 coeffs2[i] = (
std::abs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
2678 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
2699 unsigned int numQuadPoints = 5;
2701 quadPointsTypeDir1);
2707 basisKeyDir1, basisKeyDir1, quadGeom);
2711 basisKeyDir1, basisKeyDir1);
2713 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2714 CollExp.push_back(Exp);
2723 const int nq = Exp->GetTotPoints();
2724 const int nm = Exp->GetNcoeffs();
2732 Exp->GetCoords(xc, yc);
2734 for (
int i = 0; i < nq; ++i)
2736 phys1[i] = sin(xc[i]) * cos(yc[i]);
2737 phys2[i] = cos(xc[i]) * sin(yc[i]);
2741 Exp->IProductWRTDerivBase(0, phys1, coeffs1);
2742 Exp->IProductWRTDerivBase(1, phys2, coeffs2);
2743 Vmath::Vadd(nm, coeffs1, 1, coeffs2, 1, coeffs1, 1);
2747 double epsilon = 1.0e-8;
2748 for (
int i = 0; i < coeffs1.size(); ++i)
2750 coeffs1[i] = (
std::abs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
2751 coeffs2[i] = (
std::abs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
2752 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
2774 quadPointsTypeDir1);
2776 quadPointsTypeDir1);
2784 basisKeyDir1, basisKeyDir2, quadGeom);
2788 basisKeyDir1, basisKeyDir2);
2792 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2793 for (
int i = 0; i < nelmts; ++i)
2795 CollExp.push_back(Exp);
2805 const int nq = Exp->GetTotPoints();
2806 const int nm = Exp->GetNcoeffs();
2813 Exp->GetCoords(xc, yc);
2815 for (
int i = 0; i < nq; ++i)
2817 phys1[i] = sin(xc[i]) * cos(yc[i]);
2818 phys2[i] = cos(xc[i]) * sin(yc[i]);
2820 for (
int i = 1; i < nelmts; ++i)
2826 for (
int i = 0; i < nelmts; ++i)
2829 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
2830 Exp->IProductWRTDerivBase(1, phys2 + i * nq, tmp1 = coeffs2 + i * nm);
2831 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2832 tmp = coeffs1 + i * nm, 1);
2837 double epsilon = 1.0e-8;
2838 for (
int i = 0; i < coeffs1.size(); ++i)
2840 coeffs1[i] = (
std::abs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
2841 coeffs2[i] = (
std::abs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
2842 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
2847 TestQuadIProductWRTDerivBase_SumFac_VariableP_MultiElmt_threedim)
2865 quadPointsTypeDir1);
2867 quadPointsTypeDir1);
2875 basisKeyDir1, basisKeyDir2, quadGeom);
2879 basisKeyDir1, basisKeyDir2);
2883 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2884 for (
int i = 0; i < nelmts; ++i)
2886 CollExp.push_back(Exp);
2896 const int nq = Exp->GetTotPoints();
2897 const int nm = Exp->GetNcoeffs();
2905 Exp->GetCoords(xc, yc, zc);
2907 for (
int i = 0; i < nq; ++i)
2909 phys1[i] = sin(xc[i]) * cos(yc[i]);
2910 phys2[i] = cos(xc[i]) * sin(yc[i]);
2911 phys2[i] = cos(xc[i]) * sin(zc[i]);
2913 for (
int i = 1; i < nelmts; ++i)
2920 for (
int i = 0; i < nelmts; ++i)
2923 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
2924 Exp->IProductWRTDerivBase(1, phys2 + i * nq, tmp1 = coeffs2 + i * nm);
2925 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2926 tmp = coeffs1 + i * nm, 1);
2927 Exp->IProductWRTDerivBase(2, phys3 + i * nq, tmp1 = coeffs2 + i * nm);
2928 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2929 tmp = coeffs1 + i * nm, 1);
2935 double epsilon = 1.0e-8;
2936 for (
int i = 0; i < coeffs1.size(); ++i)
2938 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
2939 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
2940 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
2961 unsigned int numQuadPoints = 6;
2962 unsigned int numModes = 5;
2964 quadPointsTypeDir1);
2970 basisKeyDir1, basisKeyDir1, quadGeom);
2974 basisKeyDir1, basisKeyDir1);
2978 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2979 for (
int i = 0; i < nelmts; ++i)
2981 CollExp.push_back(Exp);
2997 const int nm = Exp->GetNcoeffs();
3002 for (
int i = 0; i < nm; ++i)
3007 for (
int i = 1; i < nelmts; ++i)
3009 Vmath::Vcopy(nm, coeffsIn, 1, tmp = coeffsIn + i * nm, 1);
3015 for (
int i = 0; i < nelmts; ++i)
3018 Exp->GeneralMatrixOp(coeffsIn + i * nm, tmp = coeffsRef + i * nm, mkey);
3023 double epsilon = 1.0e-8;
3024 for (
int i = 0; i < coeffsRef.size(); ++i)
3026 coeffsRef[i] = (
std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
3027 coeffs[i] = (
std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
3028 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
3049 unsigned int numQuadPoints = 6;
3050 unsigned int numModes = 5;
3052 quadPointsTypeDir1);
3058 basisKeyDir1, basisKeyDir1, quadGeom);
3062 basisKeyDir1, basisKeyDir1);
3066 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
3067 for (
int i = 0; i < nelmts; ++i)
3069 CollExp.push_back(Exp);
3082 const int nm = Exp->GetNcoeffs();
3087 for (
int i = 0; i < nm; ++i)
3092 for (
int i = 1; i < nelmts; ++i)
3094 Vmath::Vcopy(nm, coeffsIn, 1, tmp = coeffsIn + i * nm, 1);
3100 for (
int i = 0; i < nelmts; ++i)
3103 Exp->GeneralMatrixOp(coeffsIn + i * nm, tmp = coeffsRef + i * nm, mkey);
3108 double epsilon = 1.0e-8;
3109 for (
int i = 0; i < coeffsRef.size(); ++i)
3111 coeffsRef[i] = (
std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
3112 coeffs[i] = (
std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
3113 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
3134 unsigned int numQuadPoints = 6;
3135 unsigned int numModes = 5;
3137 quadPointsTypeDir1);
3143 basisKeyDir1, basisKeyDir1, quadGeom);
3147 basisKeyDir1, basisKeyDir1);
3151 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
3152 for (
int i = 0; i < nelmts; ++i)
3154 CollExp.push_back(Exp);
3167 const int nm = Exp->GetNcoeffs();
3172 for (
int i = 0; i < nm; ++i)
3177 for (
int i = 1; i < nelmts; ++i)
3179 Vmath::Vcopy(nm, coeffsIn, 1, tmp = coeffsIn + i * nm, 1);
3185 for (
int i = 0; i < nelmts; ++i)
3188 Exp->GeneralMatrixOp(coeffsIn + i * nm, tmp = coeffsRef + i * nm, mkey);
3193 double epsilon = 1.0e-8;
3194 for (
int i = 0; i < coeffsRef.size(); ++i)
3196 coeffsRef[i] = (
std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
3197 coeffs[i] = (
std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
3198 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
3219 unsigned int numQuadPoints = 6;
3220 unsigned int numModes = 5;
3222 quadPointsTypeDir1);
3228 basisKeyDir1, basisKeyDir1, quadGeom);
3232 basisKeyDir1, basisKeyDir1);
3236 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
3237 for (
int i = 0; i < nelmts; ++i)
3239 CollExp.push_back(Exp);
3255 const int nm = Exp->GetNcoeffs();
3260 for (
int i = 0; i < nm; ++i)
3265 for (
int i = 1; i < nelmts; ++i)
3267 Vmath::Vcopy(nm, coeffsIn, 1, tmp = coeffsIn + i * nm, 1);
3273 for (
int i = 0; i < nelmts; ++i)
3276 Exp->GeneralMatrixOp(coeffsIn + i * nm, tmp = coeffsRef + i * nm, mkey);
3281 double epsilon = 1.0e-8;
3282 for (
int i = 0; i < coeffsRef.size(); ++i)
3284 coeffsRef[i] = (
std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
3285 coeffs[i] = (
std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
3286 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
3307 unsigned int numQuadPoints = 6;
3309 quadPointsTypeDir1);
3315 basisKeyDir1, basisKeyDir1, quadGeom);
3319 basisKeyDir1, basisKeyDir1);
3321 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
3322 CollExp.push_back(Exp);
3334 const int nq = Exp->GetTotPoints();
3339 Exp->GetCoords(xc, yc);
3341 for (
int i = 0; i < nq; ++i)
3343 phys[i] = pow(xc[i], 3) + pow(yc[i], 3);
3355 double epsilon = 1.0e-8;
3357 for (
int i = 0; i < nq1; ++i)
3359 NekDouble exact = pow(xc1[i], 3) + pow(yc1[i], 3);
3360 phys1[i] = (fabs(phys1[i]) < 1e-14) ? 0.0 : phys1[i];
3361 exact = (fabs(exact) < 1e-14) ? 0.0 : exact;
3362 BOOST_CHECK_CLOSE(phys1[i], exact, epsilon);
3383 unsigned int numQuadPoints = 6;
3385 quadPointsTypeDir1);
3391 basisKeyDir1, basisKeyDir1, quadGeom);
3395 basisKeyDir1, basisKeyDir1);
3397 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
3398 CollExp.push_back(Exp);
3410 const int nq = Exp->GetTotPoints();
3415 Exp->GetCoords(xc, yc);
3417 for (
int i = 0; i < nq; ++i)
3419 phys[i] = pow(xc[i], 3) + pow(yc[i], 3);
3431 double epsilon = 1.0e-8;
3433 for (
int i = 0; i < nq1; ++i)
3435 NekDouble exact = pow(xc1[i], 3) + pow(yc1[i], 3);
3436 phys1[i] = (fabs(phys1[i]) < 1e-14) ? 0.0 : phys1[i];
3437 exact = (fabs(exact) < 1e-14) ? 0.0 : exact;
3438 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.
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
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)