39#include <boost/test/tools/floating_point_comparison.hpp>
40#include <boost/test/unit_test.hpp>
67 unsigned int numSegPoints = 6;
75 basisKeyDir1, segGeom);
77 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
78 CollExp.push_back(Exp);
91 Exp->BwdTrans(coeffs, phys1);
94 double epsilon = 1.0e-8;
95 for (
int i = 0; i < phys1.size(); ++i)
97 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
114 unsigned int numSegPoints = 6;
122 basisKeyDir1, segGeom);
124 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
127 for (
int i = 0; i < nelmts; ++i)
129 CollExp.push_back(Exp);
143 for (
int i = 0; i < nelmts; ++i)
145 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
146 tmp = phys1 + i * Exp->GetTotPoints());
150 double epsilon = 1.0e-8;
151 for (
int i = 0; i < phys1.size(); ++i)
153 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
170 unsigned int numSegPoints = 6;
178 basisKeyDir1, segGeom);
180 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
181 CollExp.push_back(Exp);
194 Exp->BwdTrans(coeffs, phys1);
197 double epsilon = 1.0e-8;
198 for (
int i = 0; i < phys1.size(); ++i)
200 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
217 unsigned int numSegPoints = 6;
225 basisKeyDir1, segGeom);
227 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
230 for (
int i = 0; i < nelmts; ++i)
232 CollExp.push_back(Exp);
246 for (
int i = 0; i < nelmts; ++i)
248 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
249 tmp = phys1 + i * Exp->GetTotPoints());
253 double epsilon = 1.0e-8;
254 for (
int i = 0; i < phys1.size(); ++i)
256 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
273 unsigned int numSegPoints = 6;
281 basisKeyDir1, segGeom);
283 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
286 for (
int i = 0; i < nelmts; ++i)
288 CollExp.push_back(Exp);
302 for (
int i = 0; i < nelmts; ++i)
304 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
305 tmp = phys1 + i * Exp->GetTotPoints());
309 double epsilon = 1.0e-8;
310 for (
int i = 0; i < phys1.size(); ++i)
312 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
329 unsigned int numSegPoints = 6;
337 basisKeyDir1, segGeom);
339 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
342 for (
int i = 0; i < nelmts; ++i)
344 CollExp.push_back(Exp);
359 for (
int i = 0; i < nelmts; ++i)
361 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
362 tmp = phys1 + i * Exp->GetTotPoints());
366 double epsilon = 1.0e-8;
367 for (
int i = 0; i < phys1.size(); ++i)
369 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
393 basisKeyDir1, segGeom);
395 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
398 for (
int i = 0; i < nelmts; ++i)
400 CollExp.push_back(Exp);
410 const int nq = Exp->GetTotPoints();
411 const int nc = Exp->GetNcoeffs();
417 Exp->GetCoords(xc, yc);
419 for (
int i = 0; i < nq; ++i)
421 phys[i] = sin(xc[i]);
423 Exp->IProductWRTBase(phys, coeffs1);
425 for (
int i = 1; i < nelmts; ++i)
428 Exp->IProductWRTBase(phys + i * nq, tmp = coeffs1 + i * nc);
432 double epsilon = 1.0e-8;
433 for (
int i = 0; i < coeffs1.size(); ++i)
435 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
459 basisKeyDir1, segGeom);
461 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
464 for (
int i = 0; i < nelmts; ++i)
466 CollExp.push_back(Exp);
476 const int nq = Exp->GetTotPoints();
477 const int nc = Exp->GetNcoeffs();
483 Exp->GetCoords(xc, yc);
485 for (
int i = 0; i < nq; ++i)
487 phys[i] = sin(xc[i]);
489 Exp->IProductWRTBase(phys, coeffs1);
491 for (
int i = 1; i < nelmts; ++i)
494 Exp->IProductWRTBase(phys + i * nq, tmp = coeffs1 + i * nc);
498 double epsilon = 1.0e-8;
499 for (
int i = 0; i < coeffs1.size(); ++i)
501 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
525 basisKeyDir1, segGeom);
527 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
530 for (
int i = 0; i < nelmts; ++i)
532 CollExp.push_back(Exp);
542 const int nq = Exp->GetTotPoints();
543 const int nc = Exp->GetNcoeffs();
549 Exp->GetCoords(xc, yc);
551 for (
int i = 0; i < nq; ++i)
553 phys[i] = sin(xc[i]);
555 Exp->IProductWRTBase(phys, coeffs1);
557 for (
int i = 1; i < nelmts; ++i)
560 Exp->IProductWRTBase(phys + i * nq, tmp = coeffs1 + i * nc);
564 double epsilon = 1.0e-8;
565 for (
int i = 0; i < coeffs1.size(); ++i)
567 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
591 basisKeyDir1, segGeom);
593 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
596 for (
int i = 0; i < nelmts; ++i)
598 CollExp.push_back(Exp);
609 const int nq = Exp->GetTotPoints();
610 const int nc = Exp->GetNcoeffs();
616 Exp->GetCoords(xc, yc);
618 for (
int i = 0; i < nq; ++i)
620 phys[i] = sin(xc[i]);
622 Exp->IProductWRTBase(phys, coeffs1);
624 for (
int i = 1; i < nelmts; ++i)
627 Exp->IProductWRTBase(phys + i * nq, tmp = coeffs1 + i * nc);
631 double epsilon = 1.0e-8;
632 for (
int i = 0; i < coeffs1.size(); ++i)
634 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
658 basisKeyDir1, segGeom);
660 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
661 CollExp.push_back(Exp);
670 const int nq = Exp->GetTotPoints();
676 Exp->GetCoords(xc, yc);
678 for (
int i = 0; i < nq; ++i)
680 phys[i] = sin(xc[i]);
683 Exp->PhysDeriv(phys, diff1);
686 double epsilon = 1.0e-8;
687 for (
int i = 0; i < diff1.size(); ++i)
689 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
713 basisKeyDir1, segGeom);
717 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
718 for (
int i = 0; i < nelmts; ++i)
720 CollExp.push_back(Exp);
730 const int nq = Exp->GetTotPoints();
738 for (
int i = 0; i < nq; ++i)
740 phys[i] = sin(xc[i]);
742 Exp->PhysDeriv(phys, diff1);
744 for (
int i = 1; i < nelmts; ++i)
747 Exp->PhysDeriv(phys + i * nq, tmp = diff1 + i * nq);
752 double epsilon = 1.0e-8;
753 for (
int i = 0; i < diff1.size(); ++i)
755 diff1[i] = (fabs(diff1[i]) < 1e-14) ? 0.0 : diff1[i];
756 diff2[i] = (fabs(diff2[i]) < 1e-14) ? 0.0 : diff2[i];
757 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
781 basisKeyDir1, segGeom);
783 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
784 CollExp.push_back(Exp);
793 const int nq = Exp->GetTotPoints();
801 for (
int i = 0; i < nq; ++i)
803 phys[i] = sin(xc[i]);
806 Exp->PhysDeriv(phys, diff1);
809 double epsilon = 1.0e-8;
810 for (
int i = 0; i < diff1.size(); ++i)
812 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
836 basisKeyDir1, segGeom);
840 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
841 for (
int i = 0; i < nelmts; ++i)
843 CollExp.push_back(Exp);
853 const int nq = Exp->GetTotPoints();
861 for (
int i = 0; i < nq; ++i)
863 phys[i] = sin(xc[i]);
865 Exp->PhysDeriv(phys, diff1);
867 for (
int i = 1; i < nelmts; ++i)
870 Exp->PhysDeriv(phys + i * nq, tmp = diff1 + i * nq);
875 double epsilon = 1.0e-8;
876 for (
int i = 0; i < diff1.size(); ++i)
878 diff1[i] = (fabs(diff1[i]) < 1e-14) ? 0.0 : diff1[i];
879 diff2[i] = (fabs(diff2[i]) < 1e-14) ? 0.0 : diff2[i];
880 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
904 basisKeyDir1, segGeom);
908 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
909 for (
int i = 0; i < nelmts; ++i)
911 CollExp.push_back(Exp);
921 const int nq = Exp->GetTotPoints();
929 for (
int i = 0; i < nq; ++i)
931 phys[i] = sin(xc[i]);
933 Exp->PhysDeriv(phys, diff1);
935 for (
int i = 1; i < nelmts; ++i)
938 Exp->PhysDeriv(phys + i * nq, tmp = diff1 + i * nq);
943 double epsilon = 1.0e-8;
944 for (
int i = 0; i < diff1.size(); ++i)
946 diff1[i] = (fabs(diff1[i]) < 1e-14) ? 0.0 : diff1[i];
947 diff2[i] = (fabs(diff2[i]) < 1e-14) ? 0.0 : diff2[i];
948 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
972 basisKeyDir1, segGeom);
976 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
977 for (
int i = 0; i < nelmts; ++i)
979 CollExp.push_back(Exp);
990 const int nq = Exp->GetTotPoints();
998 for (
int i = 0; i < nq; ++i)
1000 phys[i] = sin(xc[i]);
1002 Exp->PhysDeriv(phys, diff1);
1004 for (
int i = 1; i < nelmts; ++i)
1007 Exp->PhysDeriv(phys + i * nq, tmp = diff1 + i * nq);
1012 double epsilon = 1.0e-8;
1013 for (
int i = 0; i < diff1.size(); ++i)
1015 diff1[i] = (fabs(diff1[i]) < 1e-14) ? 0.0 : diff1[i];
1016 diff2[i] = (fabs(diff2[i]) < 1e-14) ? 0.0 : diff2[i];
1017 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
1041 basisKeyDir1, segGeom);
1045 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1046 for (
int i = 0; i < nelmts; ++i)
1048 CollExp.push_back(Exp);
1059 const int nq = Exp->GetTotPoints();
1065 Exp->GetCoords(xc, yc);
1067 for (
int i = 0; i < nq; ++i)
1069 phys[i] = sin(xc[i]) * cos(yc[i]);
1071 Exp->PhysDeriv(phys, diff1, tmp = diff1 + nelmts * nq);
1073 for (
int i = 1; i < nelmts; ++i)
1076 Exp->PhysDeriv(phys + i * nq, tmp = diff1 + i * nq,
1077 tmp1 = diff1 + (nelmts + i) * nq);
1081 tmp = diff2 + nelmts * nq);
1083 double epsilon = 1.0e-8;
1084 for (
int i = 0; i < diff1.size(); ++i)
1086 diff1[i] = (fabs(diff1[i]) < 1e-14) ? 0.0 : diff1[i];
1087 diff2[i] = (fabs(diff2[i]) < 1e-14) ? 0.0 : diff2[i];
1088 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
1112 basisKeyDir1, segGeom);
1116 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1117 for (
int i = 0; i < nelmts; ++i)
1119 CollExp.push_back(Exp);
1130 const int nq = Exp->GetTotPoints();
1136 Exp->GetCoords(xc, yc, zc);
1138 for (
int i = 0; i < nq; ++i)
1140 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
1142 Exp->PhysDeriv(phys, diff1, tmp = diff1 + nelmts * nq,
1143 tmp1 = diff1 + 2 * nelmts * nq);
1145 for (
int i = 1; i < nelmts; ++i)
1148 Exp->PhysDeriv(phys + i * nq, tmp = diff1 + i * nq,
1149 tmp1 = diff1 + (nelmts + i) * nq,
1150 tmp2 = diff1 + (2 * nelmts + i) * nq);
1154 tmp = diff2 + nelmts * nq, tmp1 = diff2 + 2 * nelmts * nq);
1156 double epsilon = 1.0e-8;
1157 for (
int i = 0; i < diff1.size(); ++i)
1159 diff1[i] = (fabs(diff1[i]) < 1e-14) ? 0.0 : diff1[i];
1160 diff2[i] = (fabs(diff2[i]) < 1e-14) ? 0.0 : diff2[i];
1161 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
1178 unsigned int numSegPoints = 6;
1186 basisKeyDir1, segGeom);
1188 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1189 CollExp.push_back(Exp);
1198 const int nq = Exp->GetTotPoints();
1199 const int nm = Exp->GetNcoeffs();
1208 for (
int i = 0; i < nq; ++i)
1210 phys1[i] = sin(xc[i]);
1214 Exp->IProductWRTDerivBase(0, phys1, coeffs1);
1218 double epsilon = 1.0e-8;
1219 for (
int i = 0; i < coeffs1.size(); ++i)
1221 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
1222 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
1223 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1240 unsigned int numSegPoints = 6;
1248 basisKeyDir1, segGeom);
1250 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1253 for (
int i = 0; i < nelmts; ++i)
1255 CollExp.push_back(Exp);
1265 const int nq = Exp->GetTotPoints();
1266 const int nm = Exp->GetNcoeffs();
1274 for (
int i = 0; i < nq; ++i)
1276 phys1[i] = sin(xc[i]);
1278 Exp->IProductWRTDerivBase(0, phys1, coeffs1);
1280 for (
int i = 1; i < nelmts; ++i)
1285 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
1290 double epsilon = 1.0e-8;
1291 for (
int i = 0; i < coeffs1.size(); ++i)
1293 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
1294 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
1295 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1312 unsigned int numSegPoints = 6;
1320 basisKeyDir1, segGeom);
1322 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1323 CollExp.push_back(Exp);
1332 const int nq = Exp->GetTotPoints();
1333 const int nm = Exp->GetNcoeffs();
1342 for (
int i = 0; i < nq; ++i)
1344 phys1[i] = sin(xc[i]);
1348 Exp->IProductWRTDerivBase(0, phys1, coeffs1);
1352 double epsilon = 1.0e-8;
1353 for (
int i = 0; i < coeffs1.size(); ++i)
1355 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
1356 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
1357 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1374 unsigned int numSegPoints = 6;
1382 basisKeyDir1, segGeom);
1384 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1387 for (
int i = 0; i < nelmts; ++i)
1389 CollExp.push_back(Exp);
1399 const int nq = Exp->GetTotPoints();
1400 const int nm = Exp->GetNcoeffs();
1408 for (
int i = 0; i < nq; ++i)
1410 phys1[i] = sin(xc[i]);
1412 Exp->IProductWRTDerivBase(0, phys1, coeffs1);
1414 for (
int i = 1; i < nelmts; ++i)
1419 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
1424 double epsilon = 1.0e-8;
1425 for (
int i = 0; i < coeffs1.size(); ++i)
1427 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
1428 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
1429 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1446 unsigned int numSegPoints = 6;
1454 basisKeyDir1, segGeom);
1456 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1457 CollExp.push_back(Exp);
1466 const int nq = Exp->GetTotPoints();
1467 const int nm = Exp->GetNcoeffs();
1476 for (
int i = 0; i < nq; ++i)
1478 phys1[i] = sin(xc[i]);
1482 Exp->IProductWRTDerivBase(0, phys1, coeffs1);
1486 double epsilon = 1.0e-8;
1487 for (
int i = 0; i < coeffs1.size(); ++i)
1489 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
1490 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
1491 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1508 unsigned int numSegPoints = 6;
1516 basisKeyDir1, segGeom);
1518 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1521 for (
int i = 0; i < nelmts; ++i)
1523 CollExp.push_back(Exp);
1533 const int nq = Exp->GetTotPoints();
1534 const int nm = Exp->GetNcoeffs();
1542 for (
int i = 0; i < nq; ++i)
1544 phys1[i] = sin(xc[i]);
1546 Exp->IProductWRTDerivBase(0, phys1, coeffs1);
1548 for (
int i = 1; i < nelmts; ++i)
1553 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
1558 double epsilon = 1.0e-8;
1559 for (
int i = 0; i < coeffs1.size(); ++i)
1561 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
1562 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
1563 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1568 TestSegIProductWRTDerivBase_SumFac_UniformP_MultiElmt_CoordimTwo)
1581 unsigned int numSegPoints = 6;
1589 basisKeyDir1, segGeom);
1591 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1594 for (
int i = 0; i < nelmts; ++i)
1596 CollExp.push_back(Exp);
1606 const int nq = Exp->GetTotPoints();
1607 const int nm = Exp->GetNcoeffs();
1614 Exp->GetCoords(xc, yc);
1616 for (
int i = 0; i < nq; ++i)
1618 phys1[i] = sin(xc[i]);
1619 phys2[i] = cos(yc[i]);
1621 Exp->IProductWRTDerivBase(0, phys1, coeffs1);
1622 Exp->IProductWRTDerivBase(1, phys2, coeffs2);
1624 for (
int i = 1; i < nelmts; ++i)
1630 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
1631 Exp->IProductWRTDerivBase(1, phys2 + i * nq, tmp = coeffs2 + i * nm);
1633 Vmath::Vadd(nelmts * nm, coeffs1, 1, coeffs2, 1, coeffs1, 1);
1637 double epsilon = 1.0e-8;
1638 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);
1659 unsigned int numSegPoints = 6;
1667 basisKeyDir1, segGeom);
1669 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1672 for (
int i = 0; i < nelmts; ++i)
1674 CollExp.push_back(Exp);
1685 const int nq = Exp->GetTotPoints();
1686 const int nm = Exp->GetNcoeffs();
1694 for (
int i = 0; i < nq; ++i)
1696 phys1[i] = sin(xc[i]);
1698 Exp->IProductWRTDerivBase(0, phys1, coeffs1);
1700 for (
int i = 1; i < nelmts; ++i)
1705 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
1710 double epsilon = 1.0e-8;
1711 for (
int i = 0; i < coeffs1.size(); ++i)
1713 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
1714 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
1715 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1720 TestSegIProductWRTDerivBase_MatrixFree_UniformP_MultiElmt_CoordimTwo)
1733 unsigned int numSegPoints = 6;
1741 basisKeyDir1, segGeom);
1743 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1746 for (
int i = 0; i < nelmts; ++i)
1748 CollExp.push_back(Exp);
1759 const int nq = Exp->GetTotPoints();
1760 const int nm = Exp->GetNcoeffs();
1767 Exp->GetCoords(xc, yc);
1769 for (
int i = 0; i < nq; ++i)
1771 phys1[i] = sin(xc[i]);
1772 phys2[i] = cos(yc[i]);
1774 Exp->IProductWRTDerivBase(0, phys1, coeffs1);
1775 Exp->IProductWRTDerivBase(1, phys2, coeffs2);
1777 for (
int i = 1; i < nelmts; ++i)
1783 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
1784 Exp->IProductWRTDerivBase(1, phys2 + i * nq, tmp = coeffs2 + i * nm);
1786 Vmath::Vadd(nelmts * nm, coeffs1, 1, coeffs2, 1, coeffs1, 1);
1790 double epsilon = 1.0e-8;
1791 for (
int i = 0; i < coeffs1.size(); ++i)
1793 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
1794 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
1795 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1812 unsigned int numSegPoints = 6;
1820 basisKeyDir1, segGeom);
1822 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1823 CollExp.push_back(Exp);
1835 const int nq = Exp->GetTotPoints();
1840 Exp->GetCoords(xc, yc);
1842 for (
int i = 0; i < nq; ++i)
1844 phys[i] = pow(xc[i], 3) + pow(yc[i], 3);
1856 double epsilon = 1.0e-8;
1858 for (
int i = 0; i < nq1; ++i)
1860 NekDouble exact = pow(xc1[i], 3) + pow(yc1[i], 3);
1861 phys1[i] = (fabs(phys1[i]) < 1e-14) ? 0.0 : phys1[i];
1862 exact = (fabs(exact) < 1e-14) ? 0.0 : exact;
1863 BOOST_CHECK_CLOSE(phys1[i], exact, epsilon);
1880 unsigned int numSegPoints = 6;
1888 basisKeyDir1, segGeom);
1890 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1891 CollExp.push_back(Exp);
1903 const int nq = Exp->GetTotPoints();
1908 Exp->GetCoords(xc, yc);
1910 for (
int i = 0; i < nq; ++i)
1912 yc[i] = (fabs(yc[i]) < 1e-14) ? 0.0 : yc[i];
1913 phys[i] = pow(xc[i], 3) + pow(yc[i], 3);
1925 double epsilon = 1.0e-8;
1927 for (
int i = 0; i < nq1; ++i)
1929 xc1[i] = (fabs(xc1[i]) < 1e-14) ? 0.0 : xc1[i];
1930 yc1[i] = (fabs(yc1[i]) < 1e-14) ? 0.0 : yc1[i];
1931 NekDouble exact = pow(xc1[i], 3) + pow(yc1[i], 3);
1932 phys1[i] = (fabs(phys1[i]) < 1e-14) ? 0.0 : phys1[i];
1933 exact = (fabs(exact) < 1e-14) ? 0.0 : exact;
1934 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< SegExp > SegExpSharedPtr
SpatialDomains::SegGeomSharedPtr CreateSegGeom(unsigned int id, SpatialDomains::PointGeomSharedPtr v0, SpatialDomains::PointGeomSharedPtr v1, int coordim=1)
BOOST_AUTO_TEST_CASE(TestSegBwdTrans_StdMat_UniformP)
std::shared_ptr< SegGeom > SegGeomSharedPtr
std::shared_ptr< PointGeom > PointGeomSharedPtr
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)