39#include <boost/test/tools/floating_point_comparison.hpp>
40#include <boost/test/unit_test.hpp>
44namespace SegCollectionTests
69 unsigned int numSegPoints = 6;
77 basisKeyDir1, segGeom);
79 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
80 CollExp.push_back(Exp);
93 Exp->BwdTrans(coeffs, phys1);
96 double epsilon = 1.0e-8;
97 for (
int i = 0; i < phys1.size(); ++i)
99 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
116 unsigned int numSegPoints = 6;
124 basisKeyDir1, segGeom);
126 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
129 for (
int i = 0; i < nelmts; ++i)
131 CollExp.push_back(Exp);
145 for (
int i = 0; i < nelmts; ++i)
147 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
148 tmp = phys1 + i * Exp->GetTotPoints());
152 double epsilon = 1.0e-8;
153 for (
int i = 0; i < phys1.size(); ++i)
155 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
172 unsigned int numSegPoints = 6;
180 basisKeyDir1, segGeom);
182 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
183 CollExp.push_back(Exp);
196 Exp->BwdTrans(coeffs, phys1);
199 double epsilon = 1.0e-8;
200 for (
int i = 0; i < phys1.size(); ++i)
202 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
219 unsigned int numSegPoints = 6;
227 basisKeyDir1, segGeom);
229 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
232 for (
int i = 0; i < nelmts; ++i)
234 CollExp.push_back(Exp);
248 for (
int i = 0; i < nelmts; ++i)
250 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
251 tmp = phys1 + i * Exp->GetTotPoints());
255 double epsilon = 1.0e-8;
256 for (
int i = 0; i < phys1.size(); ++i)
258 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
275 unsigned int numSegPoints = 6;
283 basisKeyDir1, segGeom);
285 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
288 for (
int i = 0; i < nelmts; ++i)
290 CollExp.push_back(Exp);
304 for (
int i = 0; i < nelmts; ++i)
306 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
307 tmp = phys1 + i * Exp->GetTotPoints());
311 double epsilon = 1.0e-8;
312 for (
int i = 0; i < phys1.size(); ++i)
314 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
331 unsigned int numSegPoints = 6;
339 basisKeyDir1, segGeom);
341 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
344 for (
int i = 0; i < nelmts; ++i)
346 CollExp.push_back(Exp);
361 for (
int i = 0; i < nelmts; ++i)
363 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
364 tmp = phys1 + i * Exp->GetTotPoints());
368 double epsilon = 1.0e-8;
369 for (
int i = 0; i < phys1.size(); ++i)
371 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
395 basisKeyDir1, segGeom);
397 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
400 for (
int i = 0; i < nelmts; ++i)
402 CollExp.push_back(Exp);
412 const int nq = Exp->GetTotPoints();
413 const int nc = Exp->GetNcoeffs();
419 Exp->GetCoords(xc, yc);
421 for (
int i = 0; i < nq; ++i)
423 phys[i] = sin(xc[i]);
425 Exp->IProductWRTBase(phys, coeffs1);
427 for (
int i = 1; i < nelmts; ++i)
430 Exp->IProductWRTBase(phys + i * nq, tmp = coeffs1 + i * nc);
434 double epsilon = 1.0e-8;
435 for (
int i = 0; i < coeffs1.size(); ++i)
437 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
461 basisKeyDir1, segGeom);
463 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
466 for (
int i = 0; i < nelmts; ++i)
468 CollExp.push_back(Exp);
478 const int nq = Exp->GetTotPoints();
479 const int nc = Exp->GetNcoeffs();
485 Exp->GetCoords(xc, yc);
487 for (
int i = 0; i < nq; ++i)
489 phys[i] = sin(xc[i]);
491 Exp->IProductWRTBase(phys, coeffs1);
493 for (
int i = 1; i < nelmts; ++i)
496 Exp->IProductWRTBase(phys + i * nq, tmp = coeffs1 + i * nc);
500 double epsilon = 1.0e-8;
501 for (
int i = 0; i < coeffs1.size(); ++i)
503 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
527 basisKeyDir1, segGeom);
529 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
532 for (
int i = 0; i < nelmts; ++i)
534 CollExp.push_back(Exp);
544 const int nq = Exp->GetTotPoints();
545 const int nc = Exp->GetNcoeffs();
551 Exp->GetCoords(xc, yc);
553 for (
int i = 0; i < nq; ++i)
555 phys[i] = sin(xc[i]);
557 Exp->IProductWRTBase(phys, coeffs1);
559 for (
int i = 1; i < nelmts; ++i)
562 Exp->IProductWRTBase(phys + i * nq, tmp = coeffs1 + i * nc);
566 double epsilon = 1.0e-8;
567 for (
int i = 0; i < coeffs1.size(); ++i)
569 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
593 basisKeyDir1, segGeom);
595 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
598 for (
int i = 0; i < nelmts; ++i)
600 CollExp.push_back(Exp);
611 const int nq = Exp->GetTotPoints();
612 const int nc = Exp->GetNcoeffs();
618 Exp->GetCoords(xc, yc);
620 for (
int i = 0; i < nq; ++i)
622 phys[i] = sin(xc[i]);
624 Exp->IProductWRTBase(phys, coeffs1);
626 for (
int i = 1; i < nelmts; ++i)
629 Exp->IProductWRTBase(phys + i * nq, tmp = coeffs1 + i * nc);
633 double epsilon = 1.0e-8;
634 for (
int i = 0; i < coeffs1.size(); ++i)
636 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
660 basisKeyDir1, segGeom);
662 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
663 CollExp.push_back(Exp);
672 const int nq = Exp->GetTotPoints();
678 Exp->GetCoords(xc, yc);
680 for (
int i = 0; i < nq; ++i)
682 phys[i] = sin(xc[i]);
685 Exp->PhysDeriv(phys, diff1);
688 double epsilon = 1.0e-8;
689 for (
int i = 0; i < diff1.size(); ++i)
691 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
715 basisKeyDir1, segGeom);
719 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
720 for (
int i = 0; i < nelmts; ++i)
722 CollExp.push_back(Exp);
732 const int nq = Exp->GetTotPoints();
740 for (
int i = 0; i < nq; ++i)
742 phys[i] = sin(xc[i]);
744 Exp->PhysDeriv(phys, diff1);
746 for (
int i = 1; i < nelmts; ++i)
749 Exp->PhysDeriv(phys + i * nq, tmp = diff1 + i * nq);
754 double epsilon = 1.0e-8;
755 for (
int i = 0; i < diff1.size(); ++i)
757 diff1[i] = (fabs(diff1[i]) < 1e-14) ? 0.0 : diff1[i];
758 diff2[i] = (fabs(diff2[i]) < 1e-14) ? 0.0 : diff2[i];
759 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
783 basisKeyDir1, segGeom);
785 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
786 CollExp.push_back(Exp);
795 const int nq = Exp->GetTotPoints();
803 for (
int i = 0; i < nq; ++i)
805 phys[i] = sin(xc[i]);
808 Exp->PhysDeriv(phys, diff1);
811 double epsilon = 1.0e-8;
812 for (
int i = 0; i < diff1.size(); ++i)
814 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
838 basisKeyDir1, segGeom);
842 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
843 for (
int i = 0; i < nelmts; ++i)
845 CollExp.push_back(Exp);
855 const int nq = Exp->GetTotPoints();
863 for (
int i = 0; i < nq; ++i)
865 phys[i] = sin(xc[i]);
867 Exp->PhysDeriv(phys, diff1);
869 for (
int i = 1; i < nelmts; ++i)
872 Exp->PhysDeriv(phys + i * nq, tmp = diff1 + i * nq);
877 double epsilon = 1.0e-8;
878 for (
int i = 0; i < diff1.size(); ++i)
880 diff1[i] = (fabs(diff1[i]) < 1e-14) ? 0.0 : diff1[i];
881 diff2[i] = (fabs(diff2[i]) < 1e-14) ? 0.0 : diff2[i];
882 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
906 basisKeyDir1, segGeom);
910 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
911 for (
int i = 0; i < nelmts; ++i)
913 CollExp.push_back(Exp);
923 const int nq = Exp->GetTotPoints();
931 for (
int i = 0; i < nq; ++i)
933 phys[i] = sin(xc[i]);
935 Exp->PhysDeriv(phys, diff1);
937 for (
int i = 1; i < nelmts; ++i)
940 Exp->PhysDeriv(phys + i * nq, tmp = diff1 + i * nq);
945 double epsilon = 1.0e-8;
946 for (
int i = 0; i < diff1.size(); ++i)
948 diff1[i] = (fabs(diff1[i]) < 1e-14) ? 0.0 : diff1[i];
949 diff2[i] = (fabs(diff2[i]) < 1e-14) ? 0.0 : diff2[i];
950 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
974 basisKeyDir1, segGeom);
978 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
979 for (
int i = 0; i < nelmts; ++i)
981 CollExp.push_back(Exp);
992 const int nq = Exp->GetTotPoints();
1000 for (
int i = 0; i < nq; ++i)
1002 phys[i] = sin(xc[i]);
1004 Exp->PhysDeriv(phys, diff1);
1006 for (
int i = 1; i < nelmts; ++i)
1009 Exp->PhysDeriv(phys + i * nq, tmp = diff1 + i * nq);
1014 double epsilon = 1.0e-8;
1015 for (
int i = 0; i < diff1.size(); ++i)
1017 diff1[i] = (fabs(diff1[i]) < 1e-14) ? 0.0 : diff1[i];
1018 diff2[i] = (fabs(diff2[i]) < 1e-14) ? 0.0 : diff2[i];
1019 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
1043 basisKeyDir1, segGeom);
1047 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1048 for (
int i = 0; i < nelmts; ++i)
1050 CollExp.push_back(Exp);
1061 const int nq = Exp->GetTotPoints();
1067 Exp->GetCoords(xc, yc);
1069 for (
int i = 0; i < nq; ++i)
1071 phys[i] = sin(xc[i]) * cos(yc[i]);
1073 Exp->PhysDeriv(phys, diff1, tmp = diff1 + nelmts * nq);
1075 for (
int i = 1; i < nelmts; ++i)
1078 Exp->PhysDeriv(phys + i * nq, tmp = diff1 + i * nq,
1079 tmp1 = diff1 + (nelmts + i) * nq);
1083 tmp = diff2 + nelmts * nq);
1085 double epsilon = 1.0e-8;
1086 for (
int i = 0; i < diff1.size(); ++i)
1088 diff1[i] = (fabs(diff1[i]) < 1e-14) ? 0.0 : diff1[i];
1089 diff2[i] = (fabs(diff2[i]) < 1e-14) ? 0.0 : diff2[i];
1090 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
1114 basisKeyDir1, segGeom);
1118 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1119 for (
int i = 0; i < nelmts; ++i)
1121 CollExp.push_back(Exp);
1132 const int nq = Exp->GetTotPoints();
1138 Exp->GetCoords(xc, yc, zc);
1140 for (
int i = 0; i < nq; ++i)
1142 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
1144 Exp->PhysDeriv(phys, diff1, tmp = diff1 + nelmts * nq,
1145 tmp1 = diff1 + 2 * nelmts * nq);
1147 for (
int i = 1; i < nelmts; ++i)
1150 Exp->PhysDeriv(phys + i * nq, tmp = diff1 + i * nq,
1151 tmp1 = diff1 + (nelmts + i) * nq,
1152 tmp2 = diff1 + (2 * nelmts + i) * nq);
1156 tmp = diff2 + nelmts * nq, tmp1 = diff2 + 2 * nelmts * nq);
1158 double epsilon = 1.0e-8;
1159 for (
int i = 0; i < diff1.size(); ++i)
1161 diff1[i] = (fabs(diff1[i]) < 1e-14) ? 0.0 : diff1[i];
1162 diff2[i] = (fabs(diff2[i]) < 1e-14) ? 0.0 : diff2[i];
1163 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
1180 unsigned int numSegPoints = 6;
1188 basisKeyDir1, segGeom);
1190 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1191 CollExp.push_back(Exp);
1200 const int nq = Exp->GetTotPoints();
1201 const int nm = Exp->GetNcoeffs();
1210 for (
int i = 0; i < nq; ++i)
1212 phys1[i] = sin(xc[i]);
1216 Exp->IProductWRTDerivBase(0, phys1, coeffs1);
1220 double epsilon = 1.0e-8;
1221 for (
int i = 0; i < coeffs1.size(); ++i)
1223 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
1224 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
1225 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1242 unsigned int numSegPoints = 6;
1250 basisKeyDir1, segGeom);
1252 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1255 for (
int i = 0; i < nelmts; ++i)
1257 CollExp.push_back(Exp);
1267 const int nq = Exp->GetTotPoints();
1268 const int nm = Exp->GetNcoeffs();
1276 for (
int i = 0; i < nq; ++i)
1278 phys1[i] = sin(xc[i]);
1280 Exp->IProductWRTDerivBase(0, phys1, coeffs1);
1282 for (
int i = 1; i < nelmts; ++i)
1287 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
1292 double epsilon = 1.0e-8;
1293 for (
int i = 0; i < coeffs1.size(); ++i)
1295 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
1296 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
1297 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1314 unsigned int numSegPoints = 6;
1322 basisKeyDir1, segGeom);
1324 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1325 CollExp.push_back(Exp);
1334 const int nq = Exp->GetTotPoints();
1335 const int nm = Exp->GetNcoeffs();
1344 for (
int i = 0; i < nq; ++i)
1346 phys1[i] = sin(xc[i]);
1350 Exp->IProductWRTDerivBase(0, phys1, coeffs1);
1354 double epsilon = 1.0e-8;
1355 for (
int i = 0; i < coeffs1.size(); ++i)
1357 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
1358 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
1359 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1376 unsigned int numSegPoints = 6;
1384 basisKeyDir1, segGeom);
1386 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1389 for (
int i = 0; i < nelmts; ++i)
1391 CollExp.push_back(Exp);
1401 const int nq = Exp->GetTotPoints();
1402 const int nm = Exp->GetNcoeffs();
1410 for (
int i = 0; i < nq; ++i)
1412 phys1[i] = sin(xc[i]);
1414 Exp->IProductWRTDerivBase(0, phys1, coeffs1);
1416 for (
int i = 1; i < nelmts; ++i)
1421 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
1426 double epsilon = 1.0e-8;
1427 for (
int i = 0; i < coeffs1.size(); ++i)
1429 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
1430 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
1431 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1448 unsigned int numSegPoints = 6;
1456 basisKeyDir1, segGeom);
1458 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1459 CollExp.push_back(Exp);
1468 const int nq = Exp->GetTotPoints();
1469 const int nm = Exp->GetNcoeffs();
1478 for (
int i = 0; i < nq; ++i)
1480 phys1[i] = sin(xc[i]);
1484 Exp->IProductWRTDerivBase(0, phys1, coeffs1);
1488 double epsilon = 1.0e-8;
1489 for (
int i = 0; i < coeffs1.size(); ++i)
1491 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
1492 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
1493 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1510 unsigned int numSegPoints = 6;
1518 basisKeyDir1, segGeom);
1520 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1523 for (
int i = 0; i < nelmts; ++i)
1525 CollExp.push_back(Exp);
1535 const int nq = Exp->GetTotPoints();
1536 const int nm = Exp->GetNcoeffs();
1544 for (
int i = 0; i < nq; ++i)
1546 phys1[i] = sin(xc[i]);
1548 Exp->IProductWRTDerivBase(0, phys1, coeffs1);
1550 for (
int i = 1; i < nelmts; ++i)
1555 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
1560 double epsilon = 1.0e-8;
1561 for (
int i = 0; i < coeffs1.size(); ++i)
1563 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
1564 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
1565 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1570 TestSegIProductWRTDerivBase_SumFac_UniformP_MultiElmt_CoordimTwo)
1583 unsigned int numSegPoints = 6;
1591 basisKeyDir1, segGeom);
1593 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1596 for (
int i = 0; i < nelmts; ++i)
1598 CollExp.push_back(Exp);
1608 const int nq = Exp->GetTotPoints();
1609 const int nm = Exp->GetNcoeffs();
1616 Exp->GetCoords(xc, yc);
1618 for (
int i = 0; i < nq; ++i)
1620 phys1[i] = sin(xc[i]);
1621 phys2[i] = cos(yc[i]);
1623 Exp->IProductWRTDerivBase(0, phys1, coeffs1);
1624 Exp->IProductWRTDerivBase(1, phys2, coeffs2);
1626 for (
int i = 1; i < nelmts; ++i)
1632 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
1633 Exp->IProductWRTDerivBase(1, phys2 + i * nq, tmp = coeffs2 + i * nm);
1635 Vmath::Vadd(nelmts * nm, coeffs1, 1, coeffs2, 1, coeffs1, 1);
1639 double epsilon = 1.0e-8;
1640 for (
int i = 0; i < coeffs1.size(); ++i)
1642 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
1643 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
1644 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1661 unsigned int numSegPoints = 6;
1669 basisKeyDir1, segGeom);
1671 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1674 for (
int i = 0; i < nelmts; ++i)
1676 CollExp.push_back(Exp);
1687 const int nq = Exp->GetTotPoints();
1688 const int nm = Exp->GetNcoeffs();
1696 for (
int i = 0; i < nq; ++i)
1698 phys1[i] = sin(xc[i]);
1700 Exp->IProductWRTDerivBase(0, phys1, coeffs1);
1702 for (
int i = 1; i < nelmts; ++i)
1707 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
1712 double epsilon = 1.0e-8;
1713 for (
int i = 0; i < coeffs1.size(); ++i)
1715 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
1716 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
1717 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1722 TestSegIProductWRTDerivBase_MatrixFree_UniformP_MultiElmt_CoordimTwo)
1735 unsigned int numSegPoints = 6;
1743 basisKeyDir1, segGeom);
1745 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1748 for (
int i = 0; i < nelmts; ++i)
1750 CollExp.push_back(Exp);
1761 const int nq = Exp->GetTotPoints();
1762 const int nm = Exp->GetNcoeffs();
1769 Exp->GetCoords(xc, yc);
1771 for (
int i = 0; i < nq; ++i)
1773 phys1[i] = sin(xc[i]);
1774 phys2[i] = cos(yc[i]);
1776 Exp->IProductWRTDerivBase(0, phys1, coeffs1);
1777 Exp->IProductWRTDerivBase(1, phys2, coeffs2);
1779 for (
int i = 1; i < nelmts; ++i)
1785 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
1786 Exp->IProductWRTDerivBase(1, phys2 + i * nq, tmp = coeffs2 + i * nm);
1788 Vmath::Vadd(nelmts * nm, coeffs1, 1, coeffs2, 1, coeffs1, 1);
1792 double epsilon = 1.0e-8;
1793 for (
int i = 0; i < coeffs1.size(); ++i)
1795 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
1796 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
1797 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[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< 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
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)