48 std::array<SpatialDomains::PointGeom *, 2> vertices = {v0, v1};
55 std::array<SpatialDomains::PointGeom *, 8> v,
56 std::array<SpatialDomains::SegGeomUniquePtr, 12> &segVec,
57 std::array<SpatialDomains::QuadGeomUniquePtr, 6> &faceVec)
59 std::array<std::array<int, 2>, 12> edgeVerts = {{{{0, 1}},
71 std::array<std::array<int, 4>, 6> faceEdges = {{{{0, 1, 2, 3}},
79 for (
int i = 0; i < 12; ++i)
81 segVec[i] =
CreateSegGeom(i, v[edgeVerts[i][0]], v[edgeVerts[i][1]]);
85 std::array<SpatialDomains::QuadGeom *, 6> faces;
86 for (
int i = 0; i < 6; ++i)
88 std::array<SpatialDomains::SegGeom *, 4> face;
89 for (
int j = 0; j < 4; ++j)
91 face[j] = segVec[faceEdges[i][j]].get();
95 faces[i] = faceVec[i].get();
122 std::array<SpatialDomains::PointGeom *, 8> v = {
123 v0.get(), v1.get(), v2.get(), v3.get(),
124 v4.get(), v5.get(), v6.get(), v7.get()};
125 std::array<SpatialDomains::SegGeomUniquePtr, 12> segVec;
126 std::array<SpatialDomains::QuadGeomUniquePtr, 6> faceVec;
133 unsigned int numQuadPoints = 6;
141 basisKeyDir1, basisKeyDir1, basisKeyDir1, hexGeom.get());
143 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
144 CollExp.push_back(Exp);
154 for (
int i = 0; i < coeffs.size(); ++i)
161 Exp->BwdTrans(coeffs, phys1);
164 double epsilon = 1.0e-8;
165 for (
int i = 0; i < phys1.size(); ++i)
167 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
190 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
191 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
193 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
194 v6.get(), v7.get(), segVec, faceVec);
215 basisKeyDir1, basisKeyDir2, basisKeyDir3, hexGeom.get());
217 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
218 CollExp.push_back(Exp);
228 for (
int i = 0; i < coeffs.size(); ++i)
232 Array<OneD, NekDouble> phys1(Exp->GetTotPoints());
233 Array<OneD, NekDouble> phys2(Exp->GetTotPoints());
235 Exp->BwdTrans(coeffs, phys1);
238 double epsilon = 1.0e-8;
239 for (
int i = 0; i < phys1.size(); ++i)
241 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
248 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
250 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
252 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
254 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
256 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
258 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
260 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
262 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
264 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
265 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
267 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
268 v6.get(), v7.get(), segVec, faceVec);
274 unsigned int numQuadPoints = 6;
282 basisKeyDir1, basisKeyDir1, basisKeyDir1, hexGeom.get());
284 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
285 CollExp.push_back(Exp);
288 Collections::CollectionOptimisation colOpt(dummySession, 3,
291 Collections::Collection c(CollExp, impTypes);
294 Array<OneD, NekDouble> coeffs(Exp->GetNcoeffs(), 1.0), tmp;
295 for (
int i = 0; i < coeffs.size(); ++i)
299 Array<OneD, NekDouble> phys1(Exp->GetTotPoints());
300 Array<OneD, NekDouble> phys2(Exp->GetTotPoints());
302 Exp->BwdTrans(coeffs, phys1);
305 double epsilon = 1.0e-8;
306 for (
int i = 0; i < phys1.size(); ++i)
308 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
315 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
317 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
319 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
321 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
323 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
325 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
327 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
329 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
331 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
332 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
334 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
335 v6.get(), v7.get(), segVec, faceVec);
341 unsigned int numQuadPoints = 6;
353 basisKeyDir1, basisKeyDir2, basisKeyDir3, hexGeom.get());
355 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
356 CollExp.push_back(Exp);
359 Collections::CollectionOptimisation colOpt(dummySession, 3,
362 Collections::Collection c(CollExp, impTypes);
365 Array<OneD, NekDouble> coeffs(Exp->GetNcoeffs(), 1.0), tmp;
366 for (
int i = 0; i < coeffs.size(); ++i)
370 Array<OneD, NekDouble> phys1(Exp->GetTotPoints());
371 Array<OneD, NekDouble> phys2(Exp->GetTotPoints());
373 Exp->BwdTrans(coeffs, phys1);
377 double epsilon = 1.0e-8;
378 for (
int i = 0; i < phys1.size(); ++i)
380 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
387 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
389 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
391 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
393 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
395 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
397 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
399 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
401 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
403 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
404 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
406 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
407 v6.get(), v7.get(), segVec, faceVec);
413 unsigned int numQuadPoints = 6;
425 basisKeyDir1, basisKeyDir2, basisKeyDir3, hexGeom.get());
429 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
430 for (
int i = 0; i < nelmts; ++i)
432 CollExp.push_back(Exp);
436 Collections::CollectionOptimisation colOpt(dummySession, 3,
439 Collections::Collection c(CollExp, impTypes);
442 Array<OneD, NekDouble> coeffs(nelmts * Exp->GetNcoeffs(), 1.0), tmp;
443 for (
int i = 0; i < coeffs.size(); ++i)
447 Array<OneD, NekDouble> phys1(nelmts * Exp->GetTotPoints());
448 Array<OneD, NekDouble> phys2(nelmts * Exp->GetTotPoints());
450 for (
int i = 0; i < nelmts; ++i)
452 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
453 tmp = phys1 + i * Exp->GetTotPoints());
458 double epsilon = 1.0e-8;
459 for (
int i = 0; i < phys1.size(); ++i)
461 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
468 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
470 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
472 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
474 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
476 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
478 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
480 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
482 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
484 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
485 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
487 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
488 v6.get(), v7.get(), segVec, faceVec);
494 unsigned int numQuadPoints = 6;
506 basisKeyDir1, basisKeyDir2, basisKeyDir3, hexGeom.get());
508 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
509 CollExp.push_back(Exp);
512 Collections::CollectionOptimisation colOpt(dummySession, 3,
515 Collections::Collection c(CollExp, impTypes);
518 Array<OneD, NekDouble> coeffs(Exp->GetNcoeffs(), 1.0), tmp;
519 for (
int i = 0; i < coeffs.size(); ++i)
523 Array<OneD, NekDouble> phys1(Exp->GetTotPoints());
524 Array<OneD, NekDouble> phys2(Exp->GetTotPoints());
526 Exp->BwdTrans(coeffs, phys1);
530 double epsilon = 1.0e-8;
531 for (
int i = 0; i < phys1.size(); ++i)
533 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
540 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
542 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
544 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
546 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
548 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
550 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
552 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
554 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
556 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
557 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
559 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
560 v6.get(), v7.get(), segVec, faceVec);
566 unsigned int numQuadPoints = 6;
574 basisKeyDir1, basisKeyDir1, basisKeyDir1, hexGeom.get());
578 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
579 for (
int i = 0; i < nelmts; ++i)
581 CollExp.push_back(Exp);
585 Collections::CollectionOptimisation colOpt(dummySession, 3,
588 Collections::Collection c(CollExp, impTypes);
591 Array<OneD, NekDouble> coeffs(nelmts * Exp->GetNcoeffs(), 1.0), tmp;
592 for (
int i = 0; i < coeffs.size(); ++i)
596 Array<OneD, NekDouble> phys1(nelmts * Exp->GetTotPoints());
597 Array<OneD, NekDouble> phys2(nelmts * Exp->GetTotPoints());
599 for (
int i = 0; i < nelmts; ++i)
601 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
602 tmp = phys1 + i * Exp->GetTotPoints());
606 double epsilon = 1.0e-8;
607 for (
int i = 0; i < phys1.size(); ++i)
609 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
616 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
618 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
620 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
622 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
624 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
626 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
628 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
630 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
632 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
633 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
635 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
636 v6.get(), v7.get(), segVec, faceVec);
642 unsigned int numQuadPoints = 6;
650 basisKeyDir1, basisKeyDir1, basisKeyDir1, hexGeom.get());
654 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
655 for (
int i = 0; i < nelmts; ++i)
657 CollExp.push_back(Exp);
661 Collections::CollectionOptimisation colOpt(dummySession, 3,
664 Collections::Collection c(CollExp, impTypes);
667 Array<OneD, NekDouble> coeffs(nelmts * Exp->GetNcoeffs(), 1.0), tmp;
668 for (
int i = 0; i < coeffs.size(); ++i)
672 Array<OneD, NekDouble> phys1(nelmts * Exp->GetTotPoints());
673 Array<OneD, NekDouble> phys2(nelmts * Exp->GetTotPoints());
675 for (
int i = 0; i < nelmts; ++i)
677 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
678 tmp = phys1 + i * Exp->GetTotPoints());
682 double epsilon = 1.0e-8;
683 for (
int i = 0; i < phys1.size(); ++i)
685 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
692 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
694 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
696 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
698 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
700 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
702 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
704 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
706 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
708 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
709 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
711 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
712 v6.get(), v7.get(), segVec, faceVec);
733 basisKeyDir1, basisKeyDir2, basisKeyDir3, hexGeom.get());
737 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
738 for (
int i = 0; i < nelmts; ++i)
740 CollExp.push_back(Exp);
744 Collections::CollectionOptimisation colOpt(dummySession, 3,
747 Collections::Collection c(CollExp, impTypes);
750 Array<OneD, NekDouble> coeffs(nelmts * Exp->GetNcoeffs(), 1.0), tmp;
751 for (
int i = 0; i < coeffs.size(); ++i)
755 Array<OneD, NekDouble> phys1(nelmts * Exp->GetTotPoints());
756 Array<OneD, NekDouble> phys2(nelmts * Exp->GetTotPoints());
758 for (
int i = 0; i < nelmts; ++i)
760 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
761 tmp = phys1 + i * Exp->GetTotPoints());
765 double epsilon = 1.0e-8;
766 for (
int i = 0; i < phys1.size(); ++i)
768 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
775 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
777 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
779 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
781 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
783 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
785 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
787 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
789 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
791 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
792 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
794 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
795 v6.get(), v7.get(), segVec, faceVec);
816 basisKeyDir1, basisKeyDir2, basisKeyDir3, hexGeom.get());
820 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
821 for (
int i = 0; i < nelmts; ++i)
823 CollExp.push_back(Exp);
827 Collections::CollectionOptimisation colOpt(dummySession, 3,
830 Collections::Collection c(CollExp, impTypes);
833 Array<OneD, NekDouble> coeffs(nelmts * Exp->GetNcoeffs(), 1.0), tmp;
834 for (
int i = 0; i < coeffs.size(); ++i)
838 Array<OneD, NekDouble> phys1(nelmts * Exp->GetTotPoints());
839 Array<OneD, NekDouble> phys2(nelmts * Exp->GetTotPoints());
841 for (
int i = 0; i < nelmts; ++i)
843 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
844 tmp = phys1 + i * Exp->GetTotPoints());
848 double epsilon = 1.0e-8;
849 for (
int i = 0; i < phys1.size(); ++i)
851 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
858 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
860 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
862 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
864 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
866 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
868 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
870 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
872 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
874 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
875 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
877 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
878 v6.get(), v7.get(), segVec, faceVec);
884 unsigned int numQuadPoints = 6;
885 unsigned int numModes = 4;
893 basisKeyDir1, basisKeyDir1, basisKeyDir1, hexGeom.get());
895 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
896 CollExp.push_back(Exp);
899 Collections::CollectionOptimisation colOpt(dummySession, 3,
902 Collections::Collection c(CollExp, impTypes);
905 Array<OneD, NekDouble> coeffs(Exp->GetNcoeffs(), 1.0), tmp;
906 for (
int i = 0; i < coeffs.size(); ++i)
910 Array<OneD, NekDouble> physRef(Exp->GetTotPoints());
911 Array<OneD, NekDouble> phys(Exp->GetTotPoints());
913 Exp->BwdTrans(coeffs, physRef);
916 double epsilon = 1.0e-8;
917 for (
int i = 0; i < physRef.size(); ++i)
919 BOOST_CHECK_CLOSE(physRef[i], phys[i], epsilon);
926 new SpatialDomains::PointGeom(3u, 0u, -1.5, -1.5, -1.5));
928 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
930 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
932 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
934 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
936 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
938 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
940 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
942 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
943 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
945 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
946 v6.get(), v7.get(), segVec, faceVec);
952 unsigned int numQuadPoints = 6;
960 basisKeyDir1, basisKeyDir1, basisKeyDir1, hexGeom.get());
962 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
963 CollExp.push_back(Exp);
966 Collections::CollectionOptimisation colOpt(dummySession, 3,
969 Collections::Collection c(CollExp, impTypes);
972 const int nq = Exp->GetTotPoints();
973 Array<OneD, NekDouble> phys(nq);
974 Array<OneD, NekDouble> coeffs1(Exp->GetNcoeffs());
975 Array<OneD, NekDouble> coeffs2(Exp->GetNcoeffs());
977 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
979 Exp->GetCoords(xc, yc, zc);
981 for (
int i = 0; i < nq; ++i)
983 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
986 Exp->IProductWRTBase(phys, coeffs1);
989 double epsilon = 1.0e-8;
990 for (
int i = 0; i < coeffs1.size(); ++i)
992 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
999 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
1001 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
1003 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
1005 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
1007 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
1009 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
1011 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
1013 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
1015 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
1016 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
1018 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
1019 v6.get(), v7.get(), segVec, faceVec);
1025 unsigned int numQuadPoints = 5;
1026 unsigned int numModes = 4;
1028 quadPointsTypeDir1);
1034 basisKeyDir1, basisKeyDir1, basisKeyDir1, hexGeom.get());
1036 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
1037 CollExp.push_back(Exp);
1040 Collections::CollectionOptimisation colOpt(dummySession, 3,
1043 Collections::Collection c(CollExp, impTypes);
1046 const int nq = Exp->GetTotPoints();
1047 Array<OneD, NekDouble> phys(nq);
1048 Array<OneD, NekDouble> coeffsRef(Exp->GetNcoeffs());
1049 Array<OneD, NekDouble> coeffs(Exp->GetNcoeffs());
1051 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
1053 Exp->GetCoords(xc, yc, zc);
1055 for (
int i = 0; i < nq; ++i)
1057 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
1060 Exp->IProductWRTBase(phys, coeffsRef);
1063 double epsilon = 1.0e-8;
1064 for (
int i = 0; i < coeffsRef.size(); ++i)
1066 coeffsRef[i] = (std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
1067 coeffs[i] = (std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
1068 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
1075 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
1077 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
1079 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
1081 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
1083 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
1085 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
1087 new SpatialDomains::PointGeom(3u, 6u, 2.0, 3.0, 4.0));
1089 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
1091 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
1092 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
1094 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
1095 v6.get(), v7.get(), segVec, faceVec);
1101 unsigned int numQuadPoints = 5;
1102 unsigned int numModes = 4;
1104 quadPointsTypeDir1);
1110 basisKeyDir1, basisKeyDir1, basisKeyDir1, hexGeom.get());
1112 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
1113 CollExp.push_back(Exp);
1116 Collections::CollectionOptimisation colOpt(dummySession, 3,
1119 Collections::Collection c(CollExp, impTypes);
1122 const int nq = Exp->GetTotPoints();
1123 Array<OneD, NekDouble> phys(nq);
1124 Array<OneD, NekDouble> coeffsRef(Exp->GetNcoeffs());
1125 Array<OneD, NekDouble> coeffs(Exp->GetNcoeffs());
1127 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
1129 Exp->GetCoords(xc, yc, zc);
1131 for (
int i = 0; i < nq; ++i)
1133 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
1136 Exp->IProductWRTBase(phys, coeffsRef);
1139 double epsilon = 1.0e-8;
1140 for (
int i = 0; i < coeffsRef.size(); ++i)
1142 coeffsRef[i] = (std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
1143 coeffs[i] = (std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
1144 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
1149 TestHexIProductWRTBase_MatrixFree_UniformP_Deformed_OverInt)
1152 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
1154 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
1156 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
1158 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
1160 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
1162 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
1164 new SpatialDomains::PointGeom(3u, 6u, 2.0, 3.0, 4.0));
1166 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
1168 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
1169 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
1171 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
1172 v6.get(), v7.get(), segVec, faceVec);
1178 unsigned int numQuadPoints = 8;
1179 unsigned int numModes = 4;
1181 quadPointsTypeDir1);
1187 basisKeyDir1, basisKeyDir1, basisKeyDir1, hexGeom.get());
1189 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
1190 CollExp.push_back(Exp);
1193 Collections::CollectionOptimisation colOpt(dummySession, 3,
1196 Collections::Collection c(CollExp, impTypes);
1199 const int nq = Exp->GetTotPoints();
1200 Array<OneD, NekDouble> phys(nq);
1201 Array<OneD, NekDouble> coeffsRef(Exp->GetNcoeffs());
1202 Array<OneD, NekDouble> coeffs(Exp->GetNcoeffs());
1204 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
1206 Exp->GetCoords(xc, yc, zc);
1208 for (
int i = 0; i < nq; ++i)
1210 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
1213 Exp->IProductWRTBase(phys, coeffsRef);
1216 double epsilon = 1.0e-8;
1217 for (
int i = 0; i < coeffsRef.size(); ++i)
1219 coeffsRef[i] = (std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
1220 coeffs[i] = (std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
1221 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
1228 new SpatialDomains::PointGeom(3u, 0u, -1.5, -1.5, -1.5));
1230 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
1232 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
1234 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
1236 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
1238 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
1240 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
1242 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
1244 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
1245 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
1247 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
1248 v6.get(), v7.get(), segVec, faceVec);
1255 quadPointsTypeDir1);
1257 quadPointsTypeDir1);
1259 quadPointsTypeDir1);
1269 basisKeyDir1, basisKeyDir2, basisKeyDir3, hexGeom.get());
1271 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
1272 CollExp.push_back(Exp);
1275 Collections::CollectionOptimisation colOpt(dummySession, 3,
1278 Collections::Collection c(CollExp, impTypes);
1281 const int nq = Exp->GetTotPoints();
1282 Array<OneD, NekDouble> phys(nq);
1283 Array<OneD, NekDouble> coeffs1(Exp->GetNcoeffs());
1284 Array<OneD, NekDouble> coeffs2(Exp->GetNcoeffs());
1286 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
1288 Exp->GetCoords(xc, yc, zc);
1290 for (
int i = 0; i < nq; ++i)
1292 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
1295 Exp->IProductWRTBase(phys, coeffs1);
1299 double epsilon = 1.0e-8;
1300 for (
int i = 0; i < coeffs1.size(); ++i)
1302 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1309 new SpatialDomains::PointGeom(3u, 0u, -1.5, -1.5, -1.5));
1311 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
1313 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
1315 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
1317 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
1319 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
1321 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
1323 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
1325 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
1326 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
1328 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
1329 v6.get(), v7.get(), segVec, faceVec);
1336 quadPointsTypeDir1);
1338 quadPointsTypeDir1);
1340 quadPointsTypeDir1);
1350 basisKeyDir1, basisKeyDir2, basisKeyDir3, hexGeom.get());
1352 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
1353 CollExp.push_back(Exp);
1356 Collections::CollectionOptimisation colOpt(dummySession, 3,
1359 Collections::Collection c(CollExp, impTypes);
1362 const int nq = Exp->GetTotPoints();
1363 Array<OneD, NekDouble> phys(nq);
1364 Array<OneD, NekDouble> coeffs1(Exp->GetNcoeffs());
1365 Array<OneD, NekDouble> coeffs2(Exp->GetNcoeffs());
1367 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
1369 Exp->GetCoords(xc, yc, zc);
1371 for (
int i = 0; i < nq; ++i)
1373 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
1376 Exp->IProductWRTBase(phys, coeffs1);
1380 double epsilon = 1.0e-8;
1381 for (
int i = 0; i < coeffs1.size(); ++i)
1383 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1390 new SpatialDomains::PointGeom(3u, 0u, -1.5, -1.5, -1.5));
1392 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
1394 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
1396 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
1398 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
1400 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
1402 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
1404 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
1406 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
1407 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
1409 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
1410 v6.get(), v7.get(), segVec, faceVec);
1417 quadPointsTypeDir1);
1419 quadPointsTypeDir1);
1421 quadPointsTypeDir1);
1431 basisKeyDir1, basisKeyDir2, basisKeyDir3, hexGeom.get());
1433 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
1434 CollExp.push_back(Exp);
1437 Collections::CollectionOptimisation colOpt(dummySession, 3,
1440 Collections::Collection c(CollExp, impTypes);
1443 const int nq = Exp->GetTotPoints();
1444 Array<OneD, NekDouble> phys(nq);
1445 Array<OneD, NekDouble> coeffs1(Exp->GetNcoeffs());
1446 Array<OneD, NekDouble> coeffs2(Exp->GetNcoeffs());
1448 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
1450 Exp->GetCoords(xc, yc, zc);
1452 for (
int i = 0; i < nq; ++i)
1454 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
1457 Exp->IProductWRTBase(phys, coeffs1);
1460 double epsilon = 1.0e-8;
1461 for (
int i = 0; i < coeffs1.size(); ++i)
1463 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1470 new SpatialDomains::PointGeom(3u, 0u, -1.5, -1.5, -1.5));
1472 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
1474 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
1476 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
1478 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
1480 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
1482 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
1484 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
1486 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
1487 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
1489 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
1490 v6.get(), v7.get(), segVec, faceVec);
1497 quadPointsTypeDir1);
1499 quadPointsTypeDir1);
1501 quadPointsTypeDir1);
1511 basisKeyDir1, basisKeyDir2, basisKeyDir3, hexGeom.get());
1513 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
1514 CollExp.push_back(Exp);
1517 Collections::CollectionOptimisation colOpt(dummySession, 3,
1520 Collections::Collection c(CollExp, impTypes);
1523 const int nq = Exp->GetTotPoints();
1524 Array<OneD, NekDouble> phys(nq);
1525 Array<OneD, NekDouble> coeffs1(Exp->GetNcoeffs());
1526 Array<OneD, NekDouble> coeffs2(Exp->GetNcoeffs());
1528 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
1530 Exp->GetCoords(xc, yc, zc);
1532 for (
int i = 0; i < nq; ++i)
1534 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
1537 Exp->IProductWRTBase(phys, coeffs1);
1540 double epsilon = 1.0e-8;
1541 for (
int i = 0; i < coeffs1.size(); ++i)
1543 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1550 new SpatialDomains::PointGeom(3u, 0u, -1.5, -1.5, -1.5));
1552 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
1554 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
1556 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
1558 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
1560 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
1562 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
1564 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
1566 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
1567 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
1569 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
1570 v6.get(), v7.get(), segVec, faceVec);
1577 quadPointsTypeDir1);
1579 quadPointsTypeDir1);
1581 quadPointsTypeDir1);
1591 basisKeyDir1, basisKeyDir2, basisKeyDir3, hexGeom.get());
1593 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
1594 CollExp.push_back(Exp);
1597 Collections::CollectionOptimisation colOpt(dummySession, 3,
1600 Collections::Collection c(CollExp, impTypes);
1603 const int nq = Exp->GetTotPoints();
1604 Array<OneD, NekDouble> phys(nq);
1605 Array<OneD, NekDouble> coeffs1(Exp->GetNcoeffs());
1606 Array<OneD, NekDouble> coeffs2(Exp->GetNcoeffs());
1608 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
1610 Exp->GetCoords(xc, yc, zc);
1612 for (
int i = 0; i < nq; ++i)
1614 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
1617 Exp->IProductWRTBase(phys, coeffs1);
1620 double epsilon = 1.0e-8;
1621 for (
int i = 0; i < coeffs1.size(); ++i)
1623 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1630 new SpatialDomains::PointGeom(3u, 0u, -1.5, -1.5, -1.5));
1632 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
1634 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
1636 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
1638 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
1640 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
1642 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
1644 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
1646 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
1647 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
1649 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
1650 v6.get(), v7.get(), segVec, faceVec);
1657 quadPointsTypeDir1);
1659 quadPointsTypeDir1);
1661 quadPointsTypeDir1);
1671 basisKeyDir1, basisKeyDir2, basisKeyDir3, hexGeom.get());
1675 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
1676 for (
int i = 0; i < nelmts; ++i)
1678 CollExp.push_back(Exp);
1682 Collections::CollectionOptimisation colOpt(dummySession, 3,
1685 Collections::Collection c(CollExp, impTypes);
1688 const int nq = Exp->GetTotPoints();
1689 Array<OneD, NekDouble> phys(nelmts * nq), tmp;
1690 Array<OneD, NekDouble> coeffs1(nelmts * Exp->GetNcoeffs());
1691 Array<OneD, NekDouble> coeffs2(nelmts * Exp->GetNcoeffs());
1693 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
1695 Exp->GetCoords(xc, yc, zc);
1697 for (
int i = 0; i < nq; ++i)
1699 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
1701 Exp->IProductWRTBase(phys, coeffs1);
1703 for (
int i = 1; i < nelmts; ++i)
1706 Exp->IProductWRTBase(phys + i * nq,
1707 tmp = coeffs1 + i * Exp->GetNcoeffs());
1712 double epsilon = 1.0e-8;
1713 for (
int i = 0; i < coeffs1.size(); ++i)
1715 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1722 new SpatialDomains::PointGeom(3u, 0u, -1.5, -1.5, -1.5));
1724 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
1726 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
1728 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
1730 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
1732 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
1734 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
1736 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
1738 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
1739 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
1741 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
1742 v6.get(), v7.get(), segVec, faceVec);
1749 quadPointsTypeDir1);
1751 quadPointsTypeDir1);
1753 quadPointsTypeDir1);
1763 basisKeyDir1, basisKeyDir2, basisKeyDir3, hexGeom.get());
1767 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
1768 for (
int i = 0; i < nelmts; ++i)
1770 CollExp.push_back(Exp);
1774 Collections::CollectionOptimisation colOpt(dummySession, 3,
1777 Collections::Collection c(CollExp, impTypes);
1780 const int nq = Exp->GetTotPoints();
1781 Array<OneD, NekDouble> phys(nelmts * nq), tmp;
1782 Array<OneD, NekDouble> coeffs1(nelmts * Exp->GetNcoeffs());
1783 Array<OneD, NekDouble> coeffs2(nelmts * Exp->GetNcoeffs());
1785 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
1787 Exp->GetCoords(xc, yc, zc);
1789 for (
int i = 0; i < nq; ++i)
1791 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
1793 Exp->IProductWRTBase(phys, coeffs1);
1795 for (
int i = 1; i < nelmts; ++i)
1798 Exp->IProductWRTBase(phys + i * nq,
1799 tmp = coeffs1 + i * Exp->GetNcoeffs());
1804 double epsilon = 1.0e-8;
1805 for (
int i = 0; i < coeffs1.size(); ++i)
1807 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1814 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
1816 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
1818 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
1820 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
1822 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
1824 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
1826 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
1828 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
1830 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
1831 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
1833 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
1834 v6.get(), v7.get(), segVec, faceVec);
1840 unsigned int numQuadPoints = 6;
1842 quadPointsTypeDir1);
1848 basisKeyDir1, basisKeyDir1, basisKeyDir1, hexGeom.get());
1850 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
1851 CollExp.push_back(Exp);
1854 Collections::CollectionOptimisation colOpt(dummySession, 3,
1857 Collections::Collection c(CollExp, impTypes);
1860 const int nq = Exp->GetTotPoints();
1861 Array<OneD, NekDouble> phys(nq);
1862 Array<OneD, NekDouble> coeffs1(Exp->GetNcoeffs());
1863 Array<OneD, NekDouble> coeffs2(Exp->GetNcoeffs());
1865 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
1867 Exp->GetCoords(xc, yc, zc);
1869 for (
int i = 0; i < nq; ++i)
1871 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
1874 Exp->IProductWRTBase(phys, coeffs1);
1877 double epsilon = 1.0e-6;
1878 for (
int i = 0; i < coeffs1.size(); ++i)
1881 coeffs1[i] = (std::abs(coeffs1[i]) < 1e-16) ? 0.0 : coeffs1[i];
1882 coeffs2[i] = (std::abs(coeffs2[i]) < 1e-16) ? 0.0 : coeffs2[i];
1883 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1890 new SpatialDomains::PointGeom(3u, 0u, -1.5, -1.5, -1.5));
1892 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
1894 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
1896 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
1898 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
1900 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
1902 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
1904 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
1906 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
1907 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
1909 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
1910 v6.get(), v7.get(), segVec, faceVec);
1917 quadPointsTypeDir1);
1919 quadPointsTypeDir1);
1921 quadPointsTypeDir1);
1931 basisKeyDir1, basisKeyDir2, basisKeyDir3, hexGeom.get());
1933 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
1934 CollExp.push_back(Exp);
1937 Collections::CollectionOptimisation colOpt(dummySession, 3,
1940 Collections::Collection c(CollExp, impTypes);
1943 const int nq = Exp->GetTotPoints();
1944 Array<OneD, NekDouble> phys(nq);
1945 Array<OneD, NekDouble> coeffs1(Exp->GetNcoeffs());
1946 Array<OneD, NekDouble> coeffs2(Exp->GetNcoeffs());
1948 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
1950 Exp->GetCoords(xc, yc, zc);
1952 for (
int i = 0; i < nq; ++i)
1954 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
1957 Exp->IProductWRTBase(phys, coeffs1);
1960 double epsilon = 1.0e-6;
1961 for (
int i = 0; i < coeffs1.size(); ++i)
1964 coeffs1[i] = (std::abs(coeffs1[i]) < 1e-16) ? 0.0 : coeffs1[i];
1965 coeffs2[i] = (std::abs(coeffs2[i]) < 1e-16) ? 0.0 : coeffs2[i];
1966 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1973 new SpatialDomains::PointGeom(3u, 0u, -1.5, -1.5, -1.5));
1975 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
1977 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
1979 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
1981 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
1983 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
1985 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
1987 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
1989 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
1990 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
1992 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
1993 v6.get(), v7.get(), segVec, faceVec);
2000 quadPointsTypeDir1);
2006 basisKeyDir1, basisKeyDir1, basisKeyDir1, hexGeom.get());
2010 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
2011 for (
int i = 0; i < nelmts; ++i)
2013 CollExp.push_back(Exp);
2017 Collections::CollectionOptimisation colOpt(dummySession, 3,
2020 Collections::Collection c(CollExp, impTypes);
2023 const int nq = Exp->GetTotPoints();
2024 Array<OneD, NekDouble> phys(nelmts * nq), tmp;
2025 Array<OneD, NekDouble> coeffs1(nelmts * Exp->GetNcoeffs());
2026 Array<OneD, NekDouble> coeffs2(nelmts * Exp->GetNcoeffs());
2028 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
2030 Exp->GetCoords(xc, yc, zc);
2032 for (
int i = 0; i < nq; ++i)
2034 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
2036 Exp->IProductWRTBase(phys, coeffs1);
2038 for (
int i = 1; i < nelmts; ++i)
2041 Exp->IProductWRTBase(phys + i * nq,
2042 tmp = coeffs1 + i * Exp->GetNcoeffs());
2046 double epsilon = 1.0e-6;
2047 for (
int i = 0; i < coeffs1.size(); ++i)
2050 coeffs1[i] = (std::abs(coeffs1[i]) < 1e-16) ? 0.0 : coeffs1[i];
2051 coeffs2[i] = (std::abs(coeffs2[i]) < 1e-16) ? 0.0 : coeffs2[i];
2052 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
2059 new SpatialDomains::PointGeom(3u, 0u, -1.5, -1.5, -1.5));
2061 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
2063 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
2065 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
2067 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
2069 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
2071 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
2073 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
2075 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
2076 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
2078 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
2079 v6.get(), v7.get(), segVec, faceVec);
2086 quadPointsTypeDir1);
2088 quadPointsTypeDir1);
2090 quadPointsTypeDir1);
2100 basisKeyDir1, basisKeyDir2, basisKeyDir3, hexGeom.get());
2104 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
2105 for (
int i = 0; i < nelmts; ++i)
2107 CollExp.push_back(Exp);
2111 Collections::CollectionOptimisation colOpt(dummySession, 3,
2114 Collections::Collection c(CollExp, impTypes);
2117 const int nq = Exp->GetTotPoints();
2118 Array<OneD, NekDouble> phys(nelmts * nq), tmp;
2119 Array<OneD, NekDouble> coeffs1(nelmts * Exp->GetNcoeffs());
2120 Array<OneD, NekDouble> coeffs2(nelmts * Exp->GetNcoeffs());
2122 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
2124 Exp->GetCoords(xc, yc, zc);
2126 for (
int i = 0; i < nq; ++i)
2128 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
2130 Exp->IProductWRTBase(phys, coeffs1);
2132 for (
int i = 1; i < nelmts; ++i)
2135 Exp->IProductWRTBase(phys + i * nq,
2136 tmp = coeffs1 + i * Exp->GetNcoeffs());
2140 double epsilon = 1.0e-4;
2141 for (
int i = 0; i < coeffs1.size(); ++i)
2144 coeffs1[i] = (std::abs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
2145 coeffs2[i] = (std::abs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
2146 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
2151 TestHexIProductWRTBase_SumFac_VariableP_MultiElmt_CollDir02)
2154 new SpatialDomains::PointGeom(3u, 0u, -1.5, -1.5, -1.5));
2156 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
2158 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
2160 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
2162 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
2164 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
2166 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
2168 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
2170 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
2171 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
2173 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
2174 v6.get(), v7.get(), segVec, faceVec);
2181 quadPointsTypeDir1);
2183 quadPointsTypeDir1);
2185 quadPointsTypeDir1);
2195 basisKeyDir1, basisKeyDir2, basisKeyDir3, hexGeom.get());
2199 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
2200 for (
int i = 0; i < nelmts; ++i)
2202 CollExp.push_back(Exp);
2206 Collections::CollectionOptimisation colOpt(dummySession, 3,
2209 Collections::Collection c(CollExp, impTypes);
2212 const int nq = Exp->GetTotPoints();
2213 Array<OneD, NekDouble> phys(nelmts * nq), tmp;
2214 Array<OneD, NekDouble> coeffs1(nelmts * Exp->GetNcoeffs());
2215 Array<OneD, NekDouble> coeffs2(nelmts * Exp->GetNcoeffs());
2217 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
2219 Exp->GetCoords(xc, yc, zc);
2221 for (
int i = 0; i < nq; ++i)
2223 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
2225 Exp->IProductWRTBase(phys, coeffs1);
2227 for (
int i = 1; i < nelmts; ++i)
2230 Exp->IProductWRTBase(phys + i * nq,
2231 tmp = coeffs1 + i * Exp->GetNcoeffs());
2235 double epsilon = 1.0e-4;
2236 for (
int i = 0; i < coeffs1.size(); ++i)
2239 coeffs1[i] = (std::abs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
2240 coeffs2[i] = (std::abs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
2241 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
2246 TestHexIProductWRTBase_SumFac_VariableP_MultiElmt_CollDir12)
2249 new SpatialDomains::PointGeom(3u, 0u, -1.5, -1.5, -1.5));
2251 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
2253 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
2255 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
2257 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
2259 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
2261 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
2263 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
2265 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
2266 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
2268 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
2269 v6.get(), v7.get(), segVec, faceVec);
2276 quadPointsTypeDir1);
2278 quadPointsTypeDir1);
2280 quadPointsTypeDir1);
2290 basisKeyDir1, basisKeyDir2, basisKeyDir3, hexGeom.get());
2294 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
2295 for (
int i = 0; i < nelmts; ++i)
2297 CollExp.push_back(Exp);
2301 Collections::CollectionOptimisation colOpt(dummySession, 3,
2304 Collections::Collection c(CollExp, impTypes);
2307 const int nq = Exp->GetTotPoints();
2308 Array<OneD, NekDouble> phys(nelmts * nq), tmp;
2309 Array<OneD, NekDouble> coeffs1(nelmts * Exp->GetNcoeffs());
2310 Array<OneD, NekDouble> coeffs2(nelmts * Exp->GetNcoeffs());
2312 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
2314 Exp->GetCoords(xc, yc, zc);
2316 for (
int i = 0; i < nq; ++i)
2318 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
2320 Exp->IProductWRTBase(phys, coeffs1);
2322 for (
int i = 1; i < nelmts; ++i)
2325 Exp->IProductWRTBase(phys + i * nq,
2326 tmp = coeffs1 + i * Exp->GetNcoeffs());
2330 double epsilon = 1.0e-4;
2331 for (
int i = 0; i < coeffs1.size(); ++i)
2334 coeffs1[i] = (std::abs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
2335 coeffs2[i] = (std::abs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
2336 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
2343 new SpatialDomains::PointGeom(3u, 0u, -1.5, -1.5, -1.5));
2345 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
2347 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
2349 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
2351 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
2353 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
2355 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
2357 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
2359 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
2360 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
2362 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
2363 v6.get(), v7.get(), segVec, faceVec);
2369 unsigned int numQuadPoints = 6;
2371 quadPointsTypeDir1);
2377 basisKeyDir1, basisKeyDir1, basisKeyDir1, hexGeom.get());
2379 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
2380 CollExp.push_back(Exp);
2383 Collections::CollectionOptimisation colOpt(dummySession, 3,
2386 Collections::Collection c(CollExp, impTypes);
2389 const int nq = Exp->GetTotPoints();
2390 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
2391 Array<OneD, NekDouble> phys(nq), tmp, tmp1, tmp2;
2392 Array<OneD, NekDouble> diff1(3 * nq);
2393 Array<OneD, NekDouble> diff2(3 * nq);
2395 Exp->GetCoords(xc, yc, zc);
2397 for (
int i = 0; i < nq; ++i)
2399 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
2402 Exp->PhysDeriv(phys, diff1, tmp = diff1 + nq, tmp1 = diff1 + 2 * nq);
2404 tmp2 = diff2 + 2 * nq);
2406 double epsilon = 1.0e-8;
2407 for (
int i = 0; i < diff1.size(); ++i)
2409 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
2416 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
2418 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
2420 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
2422 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
2424 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
2426 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
2428 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
2430 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
2432 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
2433 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
2435 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
2436 v6.get(), v7.get(), segVec, faceVec);
2442 unsigned int numQuadPoints = 6;
2443 unsigned int numModes = 2;
2445 quadPointsTypeDir1);
2451 basisKeyDir1, basisKeyDir1, basisKeyDir1, hexGeom.get());
2453 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
2454 CollExp.push_back(Exp);
2457 Collections::CollectionOptimisation colOpt(dummySession, 2,
2460 Collections::Collection c(CollExp, impTypes);
2463 const int nq = Exp->GetTotPoints();
2464 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
2465 Array<OneD, NekDouble> phys(nq), tmp, tmp1, tmp2;
2466 Array<OneD, NekDouble> diffRef(3 * nq);
2467 Array<OneD, NekDouble> diff(3 * nq);
2469 Exp->GetCoords(xc, yc, zc);
2471 for (
int i = 0; i < nq; ++i)
2473 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
2476 Exp->PhysDeriv(phys, diffRef, tmp = diffRef + nq, tmp1 = diffRef + 2 * nq);
2478 tmp2 = diff + 2 * nq);
2480 double epsilon = 1.0e-8;
2481 for (
int i = 0; i < diffRef.size(); ++i)
2483 diffRef[i] = (std::abs(diffRef[i]) < 1e-14) ? 0.0 : diffRef[i];
2484 diff[i] = (std::abs(diff[i]) < 1e-14) ? 0.0 : diff[i];
2485 BOOST_CHECK_CLOSE(diffRef[i], diff[i], epsilon);
2492 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
2494 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
2496 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
2498 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
2500 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
2502 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
2504 new SpatialDomains::PointGeom(3u, 6u, 2.0, 3.0, 4.0));
2506 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
2508 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
2509 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
2511 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
2512 v6.get(), v7.get(), segVec, faceVec);
2518 unsigned int numQuadPoints = 5;
2519 unsigned int numModes = 2;
2521 quadPointsTypeDir1);
2527 basisKeyDir1, basisKeyDir1, basisKeyDir1, hexGeom.get());
2529 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
2530 CollExp.push_back(Exp);
2533 Collections::CollectionOptimisation colOpt(dummySession, 2,
2536 Collections::Collection c(CollExp, impTypes);
2539 const int nq = Exp->GetTotPoints();
2540 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
2541 Array<OneD, NekDouble> phys(nq), tmp, tmp1, tmp2;
2542 Array<OneD, NekDouble> diffRef(3 * nq);
2543 Array<OneD, NekDouble> diff(3 * nq);
2545 Exp->GetCoords(xc, yc, zc);
2547 for (
int i = 0; i < nq; ++i)
2549 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
2552 Exp->PhysDeriv(phys, diffRef, tmp = diffRef + nq, tmp1 = diffRef + 2 * nq);
2554 tmp2 = diff + 2 * nq);
2556 double epsilon = 1.0e-8;
2557 for (
int i = 0; i < diffRef.size(); ++i)
2559 diffRef[i] = (std::abs(diffRef[i]) < 1e-14) ? 0.0 : diffRef[i];
2560 diff[i] = (std::abs(diff[i]) < 1e-14) ? 0.0 : diff[i];
2561 BOOST_CHECK_CLOSE(diffRef[i], diff[i], epsilon);
2568 new SpatialDomains::PointGeom(3u, 0u, -1.5, -1.5, -1.5));
2570 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
2572 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
2574 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
2576 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
2578 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
2580 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
2582 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
2584 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
2585 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
2587 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
2588 v6.get(), v7.get(), segVec, faceVec);
2595 quadPointsTypeDir1);
2597 quadPointsTypeDir1);
2599 quadPointsTypeDir1);
2609 basisKeyDir1, basisKeyDir2, basisKeyDir3, hexGeom.get());
2613 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
2614 for (
int i = 0; i < nelmts; ++i)
2616 CollExp.push_back(Exp);
2620 Collections::CollectionOptimisation colOpt(dummySession, 3,
2623 Collections::Collection c(CollExp, impTypes);
2626 const int nq = Exp->GetTotPoints();
2627 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
2628 Array<OneD, NekDouble> phys(nelmts * nq), tmp, tmp1, tmp2;
2629 Array<OneD, NekDouble> diff1(3 * nelmts * nq);
2630 Array<OneD, NekDouble> diff2(3 * nelmts * nq);
2632 Exp->GetCoords(xc, yc, zc);
2634 for (
int i = 0; i < nq; ++i)
2636 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
2638 Exp->PhysDeriv(phys, tmp = diff1, tmp1 = diff1 + (nelmts)*nq,
2639 tmp2 = diff1 + (2 * nelmts) * nq);
2640 for (
int i = 1; i < nelmts; ++i)
2643 Exp->PhysDeriv(phys, tmp = diff1 + i * nq,
2644 tmp1 = diff1 + (nelmts + i) * nq,
2645 tmp2 = diff1 + (2 * nelmts + i) * nq);
2649 tmp = diff2 + nelmts * nq, tmp2 = diff2 + 2 * nelmts * nq);
2651 double epsilon = 1.0e-8;
2652 for (
int i = 0; i < diff1.size(); ++i)
2654 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
2661 new SpatialDomains::PointGeom(3u, 0u, -1.5, -1.5, -1.5));
2663 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
2665 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
2667 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
2669 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
2671 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
2673 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
2675 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
2677 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
2678 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
2680 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
2681 v6.get(), v7.get(), segVec, faceVec);
2688 quadPointsTypeDir1);
2690 quadPointsTypeDir1);
2692 quadPointsTypeDir1);
2702 basisKeyDir1, basisKeyDir2, basisKeyDir3, hexGeom.get());
2706 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
2707 for (
int i = 0; i < nelmts; ++i)
2709 CollExp.push_back(Exp);
2713 Collections::CollectionOptimisation colOpt(dummySession, 3,
2716 Collections::Collection c(CollExp, impTypes);
2719 const int nq = Exp->GetTotPoints();
2720 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
2721 Array<OneD, NekDouble> phys(nelmts * nq), tmp, tmp1, tmp2;
2722 Array<OneD, NekDouble> diff1(3 * nelmts * nq);
2723 Array<OneD, NekDouble> diff2(3 * nelmts * nq);
2725 Exp->GetCoords(xc, yc, zc);
2727 for (
int i = 0; i < nq; ++i)
2729 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
2731 Exp->PhysDeriv(phys, tmp = diff1, tmp1 = diff1 + (nelmts)*nq,
2732 tmp2 = diff1 + (2 * nelmts) * nq);
2734 for (
int i = 1; i < nelmts; ++i)
2737 Exp->PhysDeriv(phys, tmp = diff1 + i * nq,
2738 tmp1 = diff1 + (nelmts + i) * nq,
2739 tmp2 = diff1 + (2 * nelmts + i) * nq);
2743 tmp = diff2 + nelmts * nq, tmp2 = diff2 + 2 * nelmts * nq);
2745 double epsilon = 1.0e-8;
2746 for (
int i = 0; i < diff1.size(); ++i)
2748 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
2755 new SpatialDomains::PointGeom(3u, 0u, -1.5, -1.5, -1.5));
2757 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
2759 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
2761 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
2763 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
2765 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
2767 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
2769 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
2771 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
2772 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
2774 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
2775 v6.get(), v7.get(), segVec, faceVec);
2781 unsigned int numQuadPoints = 4;
2783 quadPointsTypeDir1);
2789 basisKeyDir1, basisKeyDir1, basisKeyDir1, hexGeom.get());
2791 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
2792 CollExp.push_back(Exp);
2795 Collections::CollectionOptimisation colOpt(dummySession, 3,
2798 Collections::Collection c(CollExp, impTypes);
2801 const int nq = Exp->GetTotPoints();
2802 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
2803 Array<OneD, NekDouble> phys(nq), tmp, tmp1, tmp2;
2804 Array<OneD, NekDouble> diff1(3 * nq);
2805 Array<OneD, NekDouble> diff2(3 * nq);
2807 Exp->GetCoords(xc, yc, zc);
2809 for (
int i = 0; i < nq; ++i)
2811 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
2814 Exp->PhysDeriv(phys, diff1, tmp = diff1 + nq, tmp1 = diff1 + 2 * nq);
2816 tmp2 = diff2 + 2 * nq);
2818 double epsilon = 1.0e-8;
2819 for (
int i = 0; i < diff1.size(); ++i)
2821 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
2828 new SpatialDomains::PointGeom(3u, 0u, -1.5, -1.5, -1.5));
2830 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
2832 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
2834 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
2836 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
2838 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
2840 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
2842 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
2844 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
2845 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
2847 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
2848 v6.get(), v7.get(), segVec, faceVec);
2855 quadPointsTypeDir1);
2857 quadPointsTypeDir1);
2859 quadPointsTypeDir1);
2869 basisKeyDir1, basisKeyDir2, basisKeyDir3, hexGeom.get());
2873 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
2874 for (
int i = 0; i < nelmts; ++i)
2876 CollExp.push_back(Exp);
2880 Collections::CollectionOptimisation colOpt(dummySession, 3,
2883 Collections::Collection c(CollExp, impTypes);
2886 const int nq = Exp->GetTotPoints();
2887 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
2888 Array<OneD, NekDouble> phys(nelmts * nq), tmp, tmp1, tmp2;
2889 Array<OneD, NekDouble> diff1(3 * nelmts * nq);
2890 Array<OneD, NekDouble> diff2(3 * nelmts * nq);
2892 Exp->GetCoords(xc, yc, zc);
2894 for (
int i = 0; i < nq; ++i)
2896 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
2898 Exp->PhysDeriv(phys, tmp = diff1, tmp1 = diff1 + (nelmts)*nq,
2899 tmp2 = diff1 + (2 * nelmts) * nq);
2900 for (
int i = 1; i < nelmts; ++i)
2903 Exp->PhysDeriv(phys, tmp = diff1 + i * nq,
2904 tmp1 = diff1 + (nelmts + i) * nq,
2905 tmp2 = diff1 + (2 * nelmts + i) * nq);
2909 tmp = diff2 + nelmts * nq, tmp2 = diff2 + 2 * nelmts * nq);
2911 double epsilon = 1.0e-8;
2912 for (
int i = 0; i < diff1.size(); ++i)
2914 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
2921 new SpatialDomains::PointGeom(3u, 0u, -1.5, -1.5, -1.5));
2923 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
2925 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
2927 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
2929 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
2931 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
2933 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
2935 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
2937 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
2938 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
2940 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
2941 v6.get(), v7.get(), segVec, faceVec);
2947 unsigned int numQuadPoints = 6;
2949 quadPointsTypeDir1);
2955 basisKeyDir1, basisKeyDir1, basisKeyDir1, hexGeom.get());
2957 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
2958 CollExp.push_back(Exp);
2961 Collections::CollectionOptimisation colOpt(dummySession, 3,
2964 Collections::Collection c(CollExp, impTypes);
2967 const int nq = Exp->GetTotPoints();
2968 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
2969 Array<OneD, NekDouble> phys(nq), tmp, tmp1, tmp2;
2970 Array<OneD, NekDouble> diff1(3 * nq);
2971 Array<OneD, NekDouble> diff2(3 * nq);
2973 Exp->GetCoords(xc, yc, zc);
2975 for (
int i = 0; i < nq; ++i)
2977 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
2980 Exp->PhysDeriv(phys, diff1, tmp = diff1 + nq, tmp1 = diff1 + 2 * nq);
2982 tmp2 = diff2 + 2 * nq);
2984 double epsilon = 1.0e-8;
2985 for (
int i = 0; i < diff1.size(); ++i)
2987 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
2994 new SpatialDomains::PointGeom(3u, 0u, -1.5, -1.5, -1.5));
2996 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
2998 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
3000 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
3002 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
3004 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
3006 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
3008 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
3010 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
3011 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
3013 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
3014 v6.get(), v7.get(), segVec, faceVec);
3021 quadPointsTypeDir1);
3023 quadPointsTypeDir1);
3025 quadPointsTypeDir1);
3035 basisKeyDir1, basisKeyDir2, basisKeyDir3, hexGeom.get());
3039 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
3040 for (
int i = 0; i < nelmts; ++i)
3042 CollExp.push_back(Exp);
3046 Collections::CollectionOptimisation colOpt(dummySession, 3,
3049 Collections::Collection c(CollExp, impTypes);
3052 const int nq = Exp->GetTotPoints();
3053 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
3054 Array<OneD, NekDouble> phys(nelmts * nq), tmp, tmp1, tmp2;
3055 Array<OneD, NekDouble> diff1(3 * nelmts * nq);
3056 Array<OneD, NekDouble> diff2(3 * nelmts * nq);
3058 Exp->GetCoords(xc, yc, zc);
3060 for (
int i = 0; i < nq; ++i)
3062 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
3064 Exp->PhysDeriv(phys, tmp = diff1, tmp1 = diff1 + (nelmts)*nq,
3065 tmp2 = diff1 + (2 * nelmts) * nq);
3066 for (
int i = 1; i < nelmts; ++i)
3069 Exp->PhysDeriv(phys, tmp = diff1 + i * nq,
3070 tmp1 = diff1 + (nelmts + i) * nq,
3071 tmp2 = diff1 + (2 * nelmts + i) * nq);
3075 tmp = diff2 + nelmts * nq, tmp2 = diff2 + 2 * nelmts * nq);
3077 double epsilon = 1.0e-8;
3078 for (
int i = 0; i < diff1.size(); ++i)
3080 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
3087 new SpatialDomains::PointGeom(3u, 0u, -1.5, -1.5, -1.5));
3089 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
3091 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
3093 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
3095 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
3097 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
3099 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
3101 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
3103 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
3104 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
3106 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
3107 v6.get(), v7.get(), segVec, faceVec);
3113 unsigned int numQuadPoints = 6;
3115 quadPointsTypeDir1);
3121 basisKeyDir1, basisKeyDir1, basisKeyDir1, hexGeom.get());
3123 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
3124 CollExp.push_back(Exp);
3127 Collections::CollectionOptimisation colOpt(dummySession, 3,
3130 Collections::Collection c(CollExp, impTypes);
3133 const int nq = Exp->GetTotPoints();
3134 const int nm = Exp->GetNcoeffs();
3135 Array<OneD, NekDouble> phys1(nq, 0.0);
3136 Array<OneD, NekDouble> phys2(nq, 0.0);
3137 Array<OneD, NekDouble> phys3(nq, 0.0);
3138 Array<OneD, NekDouble> coeffs1(nm, 0.0);
3139 Array<OneD, NekDouble> coeffs2(nm, 0.0);
3141 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
3143 Exp->GetCoords(xc, yc, zc);
3145 for (
int i = 0; i < nq; ++i)
3147 phys1[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
3148 phys2[i] = cos(xc[i]) * sin(yc[i]) * cos(zc[i]);
3149 phys2[i] = cos(xc[i]) * sin(yc[i]) * sin(zc[i]);
3153 Exp->IProductWRTDerivBase(0, phys1, coeffs1);
3154 Exp->IProductWRTDerivBase(1, phys2, coeffs2);
3155 Vmath::Vadd(nm, coeffs1, 1, coeffs2, 1, coeffs1, 1);
3156 Exp->IProductWRTDerivBase(2, phys3, coeffs2);
3157 Vmath::Vadd(nm, coeffs1, 1, coeffs2, 1, coeffs1, 1);
3162 double epsilon = 1.0e-8;
3163 for (
int i = 0; i < nm; ++i)
3165 coeffs1[i] = (std::abs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
3166 coeffs2[i] = (std::abs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
3167 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
3174 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
3176 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
3178 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
3180 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
3182 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
3184 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
3186 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
3188 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
3190 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
3191 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
3193 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
3194 v6.get(), v7.get(), segVec, faceVec);
3200 unsigned int numQuadPoints = 5;
3201 unsigned int numModes = 4;
3203 quadPointsTypeDir1);
3209 basisKeyDir1, basisKeyDir1, basisKeyDir1, hexGeom.get());
3211 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
3212 CollExp.push_back(Exp);
3215 Collections::CollectionOptimisation colOpt(dummySession, 2,
3218 Collections::Collection c(CollExp, impTypes);
3221 const int nq = Exp->GetTotPoints();
3222 const int nm = Exp->GetNcoeffs();
3223 Array<OneD, NekDouble> phys1(nq, 0.0);
3224 Array<OneD, NekDouble> phys2(nq, 0.0);
3225 Array<OneD, NekDouble> phys3(nq, 0.0);
3226 Array<OneD, NekDouble> coeffsRef(nm, 0.0);
3227 Array<OneD, NekDouble> coeffs(nm, 0.0);
3229 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
3231 Exp->GetCoords(xc, yc, zc);
3233 for (
int i = 0; i < nq; ++i)
3235 phys1[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
3236 phys2[i] = cos(xc[i]) * sin(yc[i]) * cos(zc[i]);
3237 phys2[i] = cos(xc[i]) * sin(yc[i]) * sin(zc[i]);
3241 Exp->IProductWRTDerivBase(0, phys1, coeffsRef);
3242 Exp->IProductWRTDerivBase(1, phys2, coeffs);
3243 Vmath::Vadd(nm, coeffsRef, 1, coeffs, 1, coeffsRef, 1);
3244 Exp->IProductWRTDerivBase(2, phys3, coeffs);
3245 Vmath::Vadd(nm, coeffsRef, 1, coeffs, 1, coeffsRef, 1);
3250 double epsilon = 1.0e-8;
3251 for (
int i = 0; i < nm; ++i)
3253 coeffsRef[i] = (std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
3254 coeffs[i] = (std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
3255 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
3262 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
3264 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
3266 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
3268 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
3270 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
3272 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
3274 new SpatialDomains::PointGeom(3u, 6u, 2.0, 3.0, 4.0));
3276 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
3278 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
3279 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
3281 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
3282 v6.get(), v7.get(), segVec, faceVec);
3288 unsigned int numQuadPoints = 5;
3289 unsigned int numModes = 4;
3291 quadPointsTypeDir1);
3297 basisKeyDir1, basisKeyDir1, basisKeyDir1, hexGeom.get());
3299 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
3300 CollExp.push_back(Exp);
3303 Collections::CollectionOptimisation colOpt(dummySession, 2,
3306 Collections::Collection c(CollExp, impTypes);
3309 const int nq = Exp->GetTotPoints();
3310 const int nm = Exp->GetNcoeffs();
3311 Array<OneD, NekDouble> phys1(nq, 0.0);
3312 Array<OneD, NekDouble> phys2(nq, 0.0);
3313 Array<OneD, NekDouble> phys3(nq, 0.0);
3314 Array<OneD, NekDouble> coeffsRef(nm, 0.0);
3315 Array<OneD, NekDouble> coeffs(nm, 0.0);
3317 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
3319 Exp->GetCoords(xc, yc, zc);
3321 for (
int i = 0; i < nq; ++i)
3323 phys1[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
3324 phys2[i] = cos(xc[i]) * sin(yc[i]) * cos(zc[i]);
3325 phys2[i] = cos(xc[i]) * sin(yc[i]) * sin(zc[i]);
3329 Exp->IProductWRTDerivBase(0, phys1, coeffsRef);
3330 Exp->IProductWRTDerivBase(1, phys2, coeffs);
3331 Vmath::Vadd(nm, coeffsRef, 1, coeffs, 1, coeffsRef, 1);
3332 Exp->IProductWRTDerivBase(2, phys3, coeffs);
3333 Vmath::Vadd(nm, coeffsRef, 1, coeffs, 1, coeffsRef, 1);
3338 double epsilon = 1.0e-8;
3339 for (
int i = 0; i < nm; ++i)
3341 coeffsRef[i] = (std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
3342 coeffs[i] = (std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
3343 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
3348 TestHexIProductWRTDerivBase_MatrixFree_UniformP_Deformed_OverInt)
3351 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
3353 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
3355 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
3357 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
3359 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
3361 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
3363 new SpatialDomains::PointGeom(3u, 6u, 2.0, 3.0, 4.0));
3365 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
3367 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
3368 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
3370 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
3371 v6.get(), v7.get(), segVec, faceVec);
3377 unsigned int numQuadPoints = 8;
3378 unsigned int numModes = 4;
3380 quadPointsTypeDir1);
3386 basisKeyDir1, basisKeyDir1, basisKeyDir1, hexGeom.get());
3388 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
3389 CollExp.push_back(Exp);
3392 Collections::CollectionOptimisation colOpt(dummySession, 2,
3395 Collections::Collection c(CollExp, impTypes);
3398 const int nq = Exp->GetTotPoints();
3399 const int nm = Exp->GetNcoeffs();
3400 Array<OneD, NekDouble> phys1(nq, 0.0);
3401 Array<OneD, NekDouble> phys2(nq, 0.0);
3402 Array<OneD, NekDouble> phys3(nq, 0.0);
3403 Array<OneD, NekDouble> coeffsRef(nm, 0.0);
3404 Array<OneD, NekDouble> coeffs(nm, 0.0);
3406 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
3408 Exp->GetCoords(xc, yc, zc);
3410 for (
int i = 0; i < nq; ++i)
3412 phys1[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
3413 phys2[i] = cos(xc[i]) * sin(yc[i]) * cos(zc[i]);
3414 phys2[i] = cos(xc[i]) * sin(yc[i]) * sin(zc[i]);
3418 Exp->IProductWRTDerivBase(0, phys1, coeffsRef);
3419 Exp->IProductWRTDerivBase(1, phys2, coeffs);
3420 Vmath::Vadd(nm, coeffsRef, 1, coeffs, 1, coeffsRef, 1);
3421 Exp->IProductWRTDerivBase(2, phys3, coeffs);
3422 Vmath::Vadd(nm, coeffsRef, 1, coeffs, 1, coeffsRef, 1);
3427 double epsilon = 1.0e-8;
3428 for (
int i = 0; i < nm; ++i)
3430 coeffsRef[i] = (std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
3431 coeffs[i] = (std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
3432 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
3439 new SpatialDomains::PointGeom(3u, 0u, -1.5, -1.5, -1.5));
3441 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
3443 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
3445 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
3447 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
3449 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
3451 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
3453 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
3455 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
3456 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
3458 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
3459 v6.get(), v7.get(), segVec, faceVec);
3466 quadPointsTypeDir1);
3468 quadPointsTypeDir1);
3470 quadPointsTypeDir1);
3480 basisKeyDir1, basisKeyDir2, basisKeyDir3, hexGeom.get());
3484 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
3485 for (
int i = 0; i < nelmts; ++i)
3487 CollExp.push_back(Exp);
3491 Collections::CollectionOptimisation colOpt(dummySession, 3,
3494 Collections::Collection c(CollExp, impTypes);
3497 const int nq = Exp->GetTotPoints();
3498 const int nm = Exp->GetNcoeffs();
3499 Array<OneD, NekDouble> phys1(nelmts * nq, 0.0);
3500 Array<OneD, NekDouble> phys2(nelmts * nq, 0.0);
3501 Array<OneD, NekDouble> phys3(nelmts * nq, 0.0);
3502 Array<OneD, NekDouble> coeffs1(nelmts * nm, 0.0);
3503 Array<OneD, NekDouble> coeffs2(nelmts * nm, 0.0);
3504 Array<OneD, NekDouble> tmp;
3506 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
3508 Exp->GetCoords(xc, yc, zc);
3510 for (
int i = 0; i < nq; ++i)
3512 phys1[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
3513 phys2[i] = cos(xc[i]) * sin(yc[i]) * cos(zc[i]);
3514 phys2[i] = cos(xc[i]) * sin(yc[i]) * sin(zc[i]);
3517 for (
int i = 1; i < nelmts; ++i)
3525 for (
int i = 0; i < nelmts; ++i)
3528 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
3529 Exp->IProductWRTDerivBase(1, phys2 + i * nq, tmp = coeffs2 + i * nm);
3530 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
3531 tmp = coeffs1 + i * nm, 1);
3532 Exp->IProductWRTDerivBase(2, phys3 + i * nq, tmp = coeffs2 + i * nm);
3533 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
3534 tmp = coeffs1 + i * nm, 1);
3540 double epsilon = 1.0e-6;
3541 for (
int i = 0; i < coeffs1.size(); ++i)
3543 coeffs1[i] = (std::abs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
3544 coeffs2[i] = (std::abs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
3545 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
3552 new SpatialDomains::PointGeom(3u, 0u, -1.5, -1.5, -1.5));
3554 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
3556 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
3558 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
3560 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
3562 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
3564 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
3566 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
3568 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
3569 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
3571 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
3572 v6.get(), v7.get(), segVec, faceVec);
3578 unsigned int numQuadPoints = 6;
3580 quadPointsTypeDir1);
3586 basisKeyDir1, basisKeyDir1, basisKeyDir1, hexGeom.get());
3588 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
3589 CollExp.push_back(Exp);
3592 Collections::CollectionOptimisation colOpt(dummySession, 3,
3595 Collections::Collection c(CollExp, impTypes);
3598 const int nq = Exp->GetTotPoints();
3599 const int nm = Exp->GetNcoeffs();
3600 Array<OneD, NekDouble> phys1(nq, 0.0);
3601 Array<OneD, NekDouble> phys2(nq, 0.0);
3602 Array<OneD, NekDouble> phys3(nq, 0.0);
3603 Array<OneD, NekDouble> coeffs1(nm, 0.0);
3604 Array<OneD, NekDouble> coeffs2(nm, 0.0);
3606 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
3608 Exp->GetCoords(xc, yc, zc);
3610 for (
int i = 0; i < nq; ++i)
3612 phys1[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
3613 phys2[i] = cos(xc[i]) * sin(yc[i]) * cos(zc[i]);
3614 phys2[i] = cos(xc[i]) * sin(yc[i]) * sin(zc[i]);
3618 Exp->IProductWRTDerivBase(0, phys1, coeffs1);
3619 Exp->IProductWRTDerivBase(1, phys2, coeffs2);
3620 Vmath::Vadd(nm, coeffs1, 1, coeffs2, 1, coeffs1, 1);
3621 Exp->IProductWRTDerivBase(2, phys3, coeffs2);
3622 Vmath::Vadd(nm, coeffs1, 1, coeffs2, 1, coeffs1, 1);
3627 double epsilon = 1.0e-8;
3628 for (
int i = 0; i < coeffs1.size(); ++i)
3630 coeffs1[i] = (std::abs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
3631 coeffs2[i] = (std::abs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
3632 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
3639 new SpatialDomains::PointGeom(3u, 0u, -1.5, -1.5, -1.5));
3641 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
3643 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
3645 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
3647 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
3649 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
3651 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
3653 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
3655 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
3656 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
3658 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
3659 v6.get(), v7.get(), segVec, faceVec);
3666 quadPointsTypeDir1);
3668 quadPointsTypeDir1);
3670 quadPointsTypeDir1);
3680 basisKeyDir1, basisKeyDir2, basisKeyDir3, hexGeom.get());
3684 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
3685 for (
int i = 0; i < nelmts; ++i)
3687 CollExp.push_back(Exp);
3691 Collections::CollectionOptimisation colOpt(dummySession, 3,
3694 Collections::Collection c(CollExp, impTypes);
3697 const int nq = Exp->GetTotPoints();
3698 const int nm = Exp->GetNcoeffs();
3699 Array<OneD, NekDouble> phys1(nelmts * nq, 0.0);
3700 Array<OneD, NekDouble> phys2(nelmts * nq, 0.0);
3701 Array<OneD, NekDouble> phys3(nelmts * nq, 0.0);
3702 Array<OneD, NekDouble> coeffs1(nelmts * nm, 0.0);
3703 Array<OneD, NekDouble> coeffs2(nelmts * nm, 0.0);
3704 Array<OneD, NekDouble> tmp;
3706 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
3708 Exp->GetCoords(xc, yc, zc);
3710 for (
int i = 0; i < nq; ++i)
3712 phys1[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
3713 phys2[i] = cos(xc[i]) * sin(yc[i]) * cos(zc[i]);
3714 phys2[i] = cos(xc[i]) * sin(yc[i]) * sin(zc[i]);
3717 for (
int i = 1; i < nelmts; ++i)
3725 for (
int i = 0; i < nelmts; ++i)
3728 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
3729 Exp->IProductWRTDerivBase(1, phys2 + i * nq, tmp = coeffs2 + i * nm);
3730 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
3731 tmp = coeffs1 + i * nm, 1);
3732 Exp->IProductWRTDerivBase(2, phys3 + i * nq, tmp = coeffs2 + i * nm);
3733 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
3734 tmp = coeffs1 + i * nm, 1);
3740 double epsilon = 1.0e-8;
3741 for (
int i = 0; i < coeffs1.size(); ++i)
3743 coeffs1[i] = (std::abs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
3744 coeffs2[i] = (std::abs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
3745 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
3750 TestHexIProductWRTDerivBase_NoCollection_VariableP_MultiElmt)
3753 new SpatialDomains::PointGeom(3u, 0u, -1.5, -1.5, -1.5));
3755 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
3757 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
3759 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
3761 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
3763 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
3765 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
3767 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
3769 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
3770 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
3772 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
3773 v6.get(), v7.get(), segVec, faceVec);
3780 quadPointsTypeDir1);
3782 quadPointsTypeDir1);
3784 quadPointsTypeDir1);
3794 basisKeyDir1, basisKeyDir2, basisKeyDir3, hexGeom.get());
3798 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
3799 for (
int i = 0; i < nelmts; ++i)
3801 CollExp.push_back(Exp);
3805 Collections::CollectionOptimisation colOpt(dummySession, 3,
3808 Collections::Collection c(CollExp, impTypes);
3811 const int nq = Exp->GetTotPoints();
3812 const int nm = Exp->GetNcoeffs();
3813 Array<OneD, NekDouble> phys1(nelmts * nq, 0.0);
3814 Array<OneD, NekDouble> phys2(nelmts * nq, 0.0);
3815 Array<OneD, NekDouble> phys3(nelmts * nq, 0.0);
3816 Array<OneD, NekDouble> coeffs1(nelmts * nm, 0.0);
3817 Array<OneD, NekDouble> coeffs2(nelmts * nm, 0.0);
3818 Array<OneD, NekDouble> tmp;
3819 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
3821 Exp->GetCoords(xc, yc, zc);
3823 for (
int i = 0; i < nq; ++i)
3825 phys1[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
3826 phys2[i] = cos(xc[i]) * sin(yc[i]) * cos(zc[i]);
3827 phys2[i] = cos(xc[i]) * sin(yc[i]) * sin(zc[i]);
3830 for (
int i = 1; i < nelmts; ++i)
3838 for (
int i = 0; i < nelmts; ++i)
3841 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
3842 Exp->IProductWRTDerivBase(1, phys2 + i * nq, tmp = coeffs2 + i * nm);
3843 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
3844 tmp = coeffs1 + i * nm, 1);
3845 Exp->IProductWRTDerivBase(2, phys3 + i * nq, tmp = coeffs2 + i * nm);
3846 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
3847 tmp = coeffs1 + i * nm, 1);
3853 double epsilon = 1.0e-6;
3854 for (
int i = 0; i < coeffs1.size(); ++i)
3856 coeffs1[i] = (std::abs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
3857 coeffs2[i] = (std::abs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
3858 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
3865 new SpatialDomains::PointGeom(3u, 0u, -1.5, -1.5, -1.5));
3867 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
3869 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
3871 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
3873 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
3875 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
3877 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
3879 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
3881 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
3882 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
3884 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
3885 v6.get(), v7.get(), segVec, faceVec);
3891 unsigned int numQuadPoints = 6;
3893 quadPointsTypeDir1);
3899 basisKeyDir1, basisKeyDir1, basisKeyDir1, hexGeom.get());
3901 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
3902 CollExp.push_back(Exp);
3905 Collections::CollectionOptimisation colOpt(dummySession, 3,
3908 Collections::Collection c(CollExp, impTypes);
3911 const int nq = Exp->GetTotPoints();
3912 const int nm = Exp->GetNcoeffs();
3913 Array<OneD, NekDouble> phys1(nq, 0.0);
3914 Array<OneD, NekDouble> phys2(nq, 0.0);
3915 Array<OneD, NekDouble> phys3(nq, 0.0);
3916 Array<OneD, NekDouble> coeffs1(nm, 0.0);
3917 Array<OneD, NekDouble> coeffs2(nm, 0.0);
3919 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
3921 Exp->GetCoords(xc, yc, zc);
3923 for (
int i = 0; i < nq; ++i)
3925 phys1[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
3926 phys2[i] = cos(xc[i]) * sin(yc[i]) * cos(zc[i]);
3927 phys2[i] = cos(xc[i]) * sin(yc[i]) * sin(zc[i]);
3931 Exp->IProductWRTDerivBase(0, phys1, coeffs1);
3932 Exp->IProductWRTDerivBase(1, phys2, coeffs2);
3933 Vmath::Vadd(nm, coeffs1, 1, coeffs2, 1, coeffs1, 1);
3934 Exp->IProductWRTDerivBase(2, phys3, coeffs2);
3935 Vmath::Vadd(nm, coeffs1, 1, coeffs2, 1, coeffs1, 1);
3940 double epsilon = 1.0e-8;
3941 for (
int i = 0; i < coeffs1.size(); ++i)
3943 coeffs1[i] = (std::abs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
3944 coeffs2[i] = (std::abs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
3945 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
3952 new SpatialDomains::PointGeom(3u, 0u, -1.5, -1.5, -1.5));
3954 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
3956 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
3958 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
3960 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
3962 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
3964 new SpatialDomains::PointGeom(3u, 6u, 1.0, 1.0, 1.0));
3966 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
3968 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
3969 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
3971 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
3972 v6.get(), v7.get(), segVec, faceVec);
3979 quadPointsTypeDir1);
3981 quadPointsTypeDir1);
3983 quadPointsTypeDir1);
3993 basisKeyDir1, basisKeyDir2, basisKeyDir3, hexGeom.get());
3997 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
3998 for (
int i = 0; i < nelmts; ++i)
4000 CollExp.push_back(Exp);
4004 Collections::CollectionOptimisation colOpt(dummySession, 3,
4007 Collections::Collection c(CollExp, impTypes);
4010 const int nq = Exp->GetTotPoints();
4011 const int nm = Exp->GetNcoeffs();
4012 Array<OneD, NekDouble> phys1(nelmts * nq, 0.0);
4013 Array<OneD, NekDouble> phys2(nelmts * nq, 0.0);
4014 Array<OneD, NekDouble> phys3(nelmts * nq, 0.0);
4015 Array<OneD, NekDouble> coeffs1(nelmts * nm, 0.0);
4016 Array<OneD, NekDouble> coeffs2(nelmts * nm, 0.0);
4017 Array<OneD, NekDouble> tmp;
4019 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
4021 Exp->GetCoords(xc, yc, zc);
4023 for (
int i = 0; i < nq; ++i)
4025 phys1[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
4026 phys2[i] = cos(xc[i]) * sin(yc[i]) * cos(zc[i]);
4027 phys2[i] = cos(xc[i]) * sin(yc[i]) * sin(zc[i]);
4030 for (
int i = 1; i < nelmts; ++i)
4038 for (
int i = 0; i < nelmts; ++i)
4040 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
4041 Exp->IProductWRTDerivBase(1, phys2 + i * nq, tmp = coeffs2 + i * nm);
4042 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
4043 tmp = coeffs1 + i * nm, 1);
4044 Exp->IProductWRTDerivBase(2, phys3 + i * nq, tmp = coeffs2 + i * nm);
4045 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
4046 tmp = coeffs1 + i * nm, 1);
4052 double epsilon = 1.0e-8;
4053 for (
int i = 0; i < coeffs1.size(); ++i)
4055 coeffs1[i] = (std::abs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
4056 coeffs2[i] = (std::abs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
4057 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
4064 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
4066 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
4068 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
4070 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
4072 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
4074 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
4076 new SpatialDomains::PointGeom(3u, 6u, 2.0, 3.0, 4.0));
4078 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
4080 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
4081 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
4083 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
4084 v6.get(), v7.get(), segVec, faceVec);
4090 unsigned int numQuadPoints = 5;
4091 unsigned int numModes = 4;
4094 quadPointsTypeDir1);
4100 basisKeyDir1, basisKeyDir1, basisKeyDir1, hexGeom.get());
4104 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
4105 for (
int i = 0; i < nelmts; ++i)
4107 CollExp.push_back(Exp);
4111 Collections::CollectionOptimisation colOpt(dummySession, 2,
4114 Collections::Collection c(CollExp, impTypes);
4120 const int nm = Exp->GetNcoeffs();
4121 Array<OneD, NekDouble> coeffsIn(nelmts * nm);
4122 Array<OneD, NekDouble> coeffsRef(nelmts * nm);
4123 Array<OneD, NekDouble> coeffs(nelmts * nm), tmp;
4125 for (
int i = 0; i < coeffsIn.size(); ++i)
4127 coeffsIn[i] = i + 1.0;
4133 for (
int i = 0; i < nelmts; ++i)
4136 Exp->GeneralMatrixOp(coeffsIn + i * nm, tmp = coeffsRef + i * nm, mkey);
4141 double epsilon = 1.0e-8;
4142 for (
int i = 0; i < coeffsRef.size(); ++i)
4144 coeffsRef[i] = (std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
4145 coeffs[i] = (std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
4146 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
4153 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
4155 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
4157 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
4159 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
4161 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
4163 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
4165 new SpatialDomains::PointGeom(3u, 6u, 2.0, 3.0, 4.0));
4167 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
4169 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
4170 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
4172 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
4173 v6.get(), v7.get(), segVec, faceVec);
4179 unsigned int numQuadPoints = 5;
4180 unsigned int numModes = 4;
4183 quadPointsTypeDir1);
4189 basisKeyDir1, basisKeyDir1, basisKeyDir1, hexGeom.get());
4193 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
4194 for (
int i = 0; i < nelmts; ++i)
4196 CollExp.push_back(Exp);
4200 Collections::CollectionOptimisation colOpt(dummySession, 2,
4203 Collections::Collection c(CollExp, impTypes);
4209 const int nm = Exp->GetNcoeffs();
4210 Array<OneD, NekDouble> coeffsIn(nelmts * nm);
4211 Array<OneD, NekDouble> coeffsRef(nelmts * nm);
4212 Array<OneD, NekDouble> coeffs(nelmts * nm), tmp;
4214 for (
int i = 0; i < coeffsIn.size(); ++i)
4216 coeffsIn[i] = i + 1.0;
4222 for (
int i = 0; i < nelmts; ++i)
4225 Exp->GeneralMatrixOp(coeffsIn + i * nm, tmp = coeffsRef + i * nm, mkey);
4230 double epsilon = 1.0e-8;
4231 for (
int i = 0; i < coeffsRef.size(); ++i)
4233 coeffsRef[i] = (std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
4234 coeffs[i] = (std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
4235 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
4242 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
4244 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
4246 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
4248 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
4250 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
4252 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
4254 new SpatialDomains::PointGeom(3u, 6u, 2.0, 3.0, 4.0));
4256 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
4258 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
4259 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
4261 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
4262 v6.get(), v7.get(), segVec, faceVec);
4268 unsigned int numQuadPoints = 5;
4269 unsigned int numModes = 4;
4272 quadPointsTypeDir1);
4278 basisKeyDir1, basisKeyDir1, basisKeyDir1, hexGeom.get());
4282 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
4283 for (
int i = 0; i < nelmts; ++i)
4285 CollExp.push_back(Exp);
4289 Collections::CollectionOptimisation colOpt(dummySession, 2,
4292 Collections::Collection c(CollExp, impTypes);
4304 const int nm = Exp->GetNcoeffs();
4305 Array<OneD, NekDouble> coeffsIn(nelmts * nm);
4306 Array<OneD, NekDouble> coeffsRef(nelmts * nm);
4307 Array<OneD, NekDouble> coeffs(nelmts * nm), tmp;
4309 for (
int i = 0; i < coeffsIn.size(); ++i)
4311 coeffsIn[i] = i + 1.0;
4317 for (
int i = 0; i < nelmts; ++i)
4320 Exp->GeneralMatrixOp(coeffsIn + i * nm, tmp = coeffsRef + i * nm, mkey);
4325 double epsilon = 1.0e-8;
4326 for (
int i = 0; i < coeffsRef.size(); ++i)
4328 coeffsRef[i] = (std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
4329 coeffs[i] = (std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
4330 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
4337 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
4339 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
4341 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
4343 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
4345 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
4347 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
4349 new SpatialDomains::PointGeom(3u, 6u, 2.0, 3.0, 4.0));
4351 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
4353 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
4354 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
4356 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
4357 v6.get(), v7.get(), segVec, faceVec);
4363 unsigned int numQuadPoints = 5;
4364 unsigned int numModes = 4;
4367 quadPointsTypeDir1);
4373 basisKeyDir1, basisKeyDir1, basisKeyDir1, hexGeom.get());
4377 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
4378 for (
int i = 0; i < nelmts; ++i)
4380 CollExp.push_back(Exp);
4384 Collections::CollectionOptimisation colOpt(dummySession, 2,
4387 Collections::Collection c(CollExp, impTypes);
4393 const int nm = Exp->GetNcoeffs();
4394 Array<OneD, NekDouble> coeffsIn(nelmts * nm);
4395 Array<OneD, NekDouble> coeffsRef(nelmts * nm);
4396 Array<OneD, NekDouble> coeffs(nelmts * nm), tmp;
4398 for (
int i = 0; i < coeffsIn.size(); ++i)
4400 coeffsIn[i] = i + 1.0;
4406 for (
int i = 0; i < nelmts; ++i)
4409 Exp->GeneralMatrixOp(coeffsIn + i * nm, tmp = coeffsRef + i * nm, mkey);
4414 double epsilon = 1.0e-8;
4415 for (
int i = 0; i < coeffsRef.size(); ++i)
4417 coeffsRef[i] = (std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
4418 coeffs[i] = (std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
4419 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
4426 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
4428 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
4430 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
4432 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
4434 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
4436 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
4438 new SpatialDomains::PointGeom(3u, 6u, 2.0, 3.0, 4.0));
4440 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
4442 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
4443 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
4445 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
4446 v6.get(), v7.get(), segVec, faceVec);
4452 unsigned int numQuadPoints = 8;
4453 unsigned int numModes = 4;
4456 quadPointsTypeDir1);
4462 basisKeyDir1, basisKeyDir1, basisKeyDir1, hexGeom.get());
4466 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
4467 for (
int i = 0; i < nelmts; ++i)
4469 CollExp.push_back(Exp);
4473 Collections::CollectionOptimisation colOpt(dummySession, 2,
4476 Collections::Collection c(CollExp, impTypes);
4482 const int nm = Exp->GetNcoeffs();
4483 Array<OneD, NekDouble> coeffsIn(nelmts * nm);
4484 Array<OneD, NekDouble> coeffsRef(nelmts * nm);
4485 Array<OneD, NekDouble> coeffs(nelmts * nm), tmp;
4487 for (
int i = 0; i < coeffsIn.size(); ++i)
4489 coeffsIn[i] = i + 1.0;
4495 for (
int i = 0; i < nelmts; ++i)
4498 Exp->GeneralMatrixOp(coeffsIn + i * nm, tmp = coeffsRef + i * nm, mkey);
4503 double epsilon = 1.0e-8;
4504 for (
int i = 0; i < coeffsRef.size(); ++i)
4506 coeffsRef[i] = (std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
4507 coeffs[i] = (std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
4508 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
4515 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
4517 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
4519 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
4521 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
4523 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
4525 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
4527 new SpatialDomains::PointGeom(3u, 6u, 2.0, 3.0, 4.0));
4529 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
4531 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
4532 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
4534 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(),
4535 v6.get(), v7.get(), segVec, faceVec);
4541 unsigned int numQuadPoints = 5;
4542 unsigned int numModes = 4;
4545 quadPointsTypeDir1);
4551 basisKeyDir1, basisKeyDir1, basisKeyDir1, hexGeom.get());
4555 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
4556 for (
int i = 0; i < nelmts; ++i)
4558 CollExp.push_back(Exp);
4562 Collections::CollectionOptimisation colOpt(dummySession, 2,
4565 Collections::Collection c(CollExp, impTypes);
4577 const int nm = Exp->GetNcoeffs();
4578 Array<OneD, NekDouble> coeffsIn(nelmts * nm);
4579 Array<OneD, NekDouble> coeffsRef(nelmts * nm);
4580 Array<OneD, NekDouble> coeffs(nelmts * nm), tmp;
4582 for (
int i = 0; i < coeffsIn.size(); ++i)
4584 coeffsIn[i] = i + 1.0;
4590 for (
int i = 0; i < nelmts; ++i)
4593 Exp->GeneralMatrixOp(coeffsIn + i * nm, tmp = coeffsRef + i * nm, mkey);
4598 double epsilon = 1.0e-8;
4599 for (
int i = 0; i < coeffsRef.size(); ++i)
4601 coeffsRef[i] = (std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
4602 coeffs[i] = (std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
4603 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
4610 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
4612 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
4614 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
4616 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
4618 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
4620 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
4622 new SpatialDomains::PointGeom(3u, 6u, 2.0, 3.0, 4.0));
4624 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
4626 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
4627 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
4629 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(), v6.get(), v7.get(), segVec, faceVec);
4635 unsigned int numQuadPoints = 5;
4636 unsigned int numModes = 4;
4639 quadPointsTypeDir1);
4645 basisKeyDir1, basisKeyDir1, basisKeyDir1, hexGeom.get());
4647 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
4648 CollExp.push_back(Exp);
4651 Collections::CollectionOptimisation colOpt(dummySession, 3,
4654 Collections::Collection c(CollExp, impTypes);
4660 const int nq = Exp->GetTotPoints();
4662 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
4663 Array<OneD, NekDouble> phys(nq), tmp;
4665 Exp->GetCoords(xc, yc, zc);
4667 for (
int i = 0; i < nq; ++i)
4669 phys[i] = pow(xc[i], 3) + pow(yc[i], 3) + pow(zc[i], 3);
4673 Array<OneD, NekDouble> xc1(nq1);
4674 Array<OneD, NekDouble> yc1(nq1);
4675 Array<OneD, NekDouble> zc1(nq1);
4676 Array<OneD, NekDouble> phys1(nq1);
4683 double epsilon = 1.0e-8;
4685 for (
int i = 0; i < nq1; ++i)
4687 NekDouble exact = pow(xc1[i], 3) + pow(yc1[i], 3) + pow(zc1[i], 3);
4688 phys1[i] = (fabs(phys1[i]) < 1e-14) ? 0.0 : phys1[i];
4689 exact = (fabs(exact) < 1e-14) ? 0.0 : exact;
4690 BOOST_CHECK_CLOSE(phys1[i], exact, epsilon);
4697 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
4699 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
4701 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
4703 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
4705 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
4707 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
4709 new SpatialDomains::PointGeom(3u, 6u, 2.0, 3.0, 4.0));
4711 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
4713 std::vector<SpatialDomains::SegGeomUniquePtr> segVec;
4714 std::vector<SpatialDomains::QuadGeomUniquePtr> faceVec;
4716 CreateHex(v0.get(), v1.get(), v2.get(), v3.get(), v4.get(), v5.get(), v6.get(), v7.get(), segVec, faceVec);
4722 unsigned int numQuadPoints = 5;
4723 unsigned int numModes = 4;
4726 quadPointsTypeDir1);
4732 basisKeyDir1, basisKeyDir1, basisKeyDir1, hexGeom.get());
4734 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
4735 CollExp.push_back(Exp);
4738 Collections::CollectionOptimisation colOpt(dummySession, 3,
4741 Collections::Collection c(CollExp, impTypes);
4747 const int nq = Exp->GetTotPoints();
4749 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
4750 Array<OneD, NekDouble> phys(nq), tmp;
4752 Exp->GetCoords(xc, yc, zc);
4754 for (
int i = 0; i < nq; ++i)
4756 phys[i] = pow(xc[i], 3) + pow(yc[i], 3) + pow(zc[i], 3);
4760 Array<OneD, NekDouble> xc1(nq1);
4761 Array<OneD, NekDouble> yc1(nq1);
4762 Array<OneD, NekDouble> zc1(nq1);
4763 Array<OneD, NekDouble> phys1(nq1);
4770 double epsilon = 1.0e-8;
4772 for (
int i = 0; i < nq1; ++i)
4774 NekDouble exact = pow(xc1[i], 3) + pow(yc1[i], 3) + pow(zc1[i], 3);
4775 phys1[i] = (fabs(phys1[i]) < 1e-14) ? 0.0 : phys1[i];
4776 exact = (fabs(exact) < 1e-14) ? 0.0 : exact;
4777 BOOST_CHECK_CLOSE(phys1[i], exact, epsilon);
4782 TestHexLinearAdvectionDiffusionReaction_NoCollection_UniformP)
4785 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
4787 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
4789 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
4791 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
4793 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
4795 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
4797 new SpatialDomains::PointGeom(3u, 6u, 2.0, 3.0, 4.0));
4799 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
4801 std::array<SpatialDomains::PointGeom *, 8> v = {
4802 v0.get(), v1.get(), v2.get(), v3.get(),
4803 v4.get(), v5.get(), v6.get(), v7.get()};
4804 std::array<SpatialDomains::SegGeomUniquePtr, 12> segVec;
4805 std::array<SpatialDomains::QuadGeomUniquePtr, 6> faceVec;
4812 unsigned int numQuadPoints = 5;
4813 unsigned int numModes = 4;
4816 quadPointsTypeDir1);
4822 basisKeyDir1, basisKeyDir1, basisKeyDir1, hexGeom.get());
4826 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
4827 for (
int i = 0; i < nelmts; ++i)
4829 CollExp.push_back(Exp);
4833 Collections::CollectionOptimisation colOpt(dummySession, 2,
4836 Collections::Collection c(CollExp, impTypes);
4843 int npoints = Exp->GetTotPoints() * nelmts;
4848 for (
int i = 0; i < Exp->GetShapeDimension(); i++)
4850 varcoeffs[varcoefftypes[i]] = Array<OneD, NekDouble>(npoints, 1.0);
4855 const int nm = Exp->GetNcoeffs();
4856 Array<OneD, NekDouble> coeffsIn(nelmts * nm);
4857 Array<OneD, NekDouble> coeffsRef(nelmts * nm);
4858 Array<OneD, NekDouble> coeffs(nelmts * nm), tmp;
4860 for (
int i = 0; i < coeffsIn.size(); ++i)
4862 coeffsIn[i] = i + 1.0;
4866 Exp->DetShapeType(), *Exp, factors,
4869 for (
int i = 0; i < nelmts; ++i)
4872 Exp->GeneralMatrixOp(coeffsIn + i * nm, tmp = coeffsRef + i * nm, mkey);
4878 double epsilon = 1.0e-8;
4879 for (
int i = 0; i < coeffsRef.size(); ++i)
4881 coeffsRef[i] = (std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
4882 coeffs[i] = (std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
4883 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
4888 TestHexLinearAdvectionDiffusionReaction_IterPerExp_UniformP)
4891 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
4893 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
4895 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
4897 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
4899 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
4901 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
4903 new SpatialDomains::PointGeom(3u, 6u, 2.0, 3.0, 4.0));
4905 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
4907 std::array<SpatialDomains::PointGeom *, 8> v = {
4908 v0.get(), v1.get(), v2.get(), v3.get(),
4909 v4.get(), v5.get(), v6.get(), v7.get()};
4910 std::array<SpatialDomains::SegGeomUniquePtr, 12> segVec;
4911 std::array<SpatialDomains::QuadGeomUniquePtr, 6> faceVec;
4918 unsigned int numQuadPoints = 5;
4919 unsigned int numModes = 4;
4922 quadPointsTypeDir1);
4928 basisKeyDir1, basisKeyDir1, basisKeyDir1, hexGeom.get());
4932 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
4933 for (
int i = 0; i < nelmts; ++i)
4935 CollExp.push_back(Exp);
4939 Collections::CollectionOptimisation colOpt(dummySession, 2,
4942 Collections::Collection c(CollExp, impTypes);
4949 int npoints = Exp->GetTotPoints() * nelmts;
4954 for (
int i = 0; i < Exp->GetShapeDimension(); i++)
4956 varcoeffs[varcoefftypes[i]] = Array<OneD, NekDouble>(npoints, 1.0);
4961 const int nm = Exp->GetNcoeffs();
4962 Array<OneD, NekDouble> coeffsIn(nelmts * nm);
4963 Array<OneD, NekDouble> coeffsRef(nelmts * nm);
4964 Array<OneD, NekDouble> coeffs(nelmts * nm), tmp;
4966 for (
int i = 0; i < coeffsIn.size(); ++i)
4968 coeffsIn[i] = i + 1.0;
4972 Exp->DetShapeType(), *Exp, factors,
4975 for (
int i = 0; i < nelmts; ++i)
4978 Exp->GeneralMatrixOp(coeffsIn + i * nm, tmp = coeffsRef + i * nm, mkey);
4984 double epsilon = 1.0e-8;
4985 for (
int i = 0; i < coeffsRef.size(); ++i)
4987 coeffsRef[i] = (std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
4988 coeffs[i] = (std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
4989 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
4994 TestHexLinearAdvectionDiffusionReaction_MatrixFree_UniformP)
4997 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
4999 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
5001 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
5003 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
5005 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
5007 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
5009 new SpatialDomains::PointGeom(3u, 6u, 2.0, 3.0, 4.0));
5011 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
5013 std::array<SpatialDomains::PointGeom *, 8> v = {
5014 v0.get(), v1.get(), v2.get(), v3.get(),
5015 v4.get(), v5.get(), v6.get(), v7.get()};
5016 std::array<SpatialDomains::SegGeomUniquePtr, 12> segVec;
5017 std::array<SpatialDomains::QuadGeomUniquePtr, 6> faceVec;
5024 unsigned int numQuadPoints = 5;
5025 unsigned int numModes = 4;
5028 quadPointsTypeDir1);
5034 basisKeyDir1, basisKeyDir1, basisKeyDir1, hexGeom.get());
5038 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
5039 for (
int i = 0; i < nelmts; ++i)
5041 CollExp.push_back(Exp);
5045 Collections::CollectionOptimisation colOpt(dummySession, 2,
5048 Collections::Collection c(CollExp, impTypes);
5055 int npoints = Exp->GetTotPoints() * nelmts;
5060 for (
int i = 0; i < Exp->GetShapeDimension(); i++)
5062 varcoeffs[varcoefftypes[i]] = Array<OneD, NekDouble>(npoints, 1.0);
5067 const int nm = Exp->GetNcoeffs();
5068 Array<OneD, NekDouble> coeffsIn(nelmts * nm);
5069 Array<OneD, NekDouble> coeffsRef(nelmts * nm);
5070 Array<OneD, NekDouble> coeffs(nelmts * nm), tmp;
5072 for (
int i = 0; i < coeffsIn.size(); ++i)
5074 coeffsIn[i] = i + 1.0;
5078 Exp->DetShapeType(), *Exp, factors,
5081 for (
int i = 0; i < nelmts; ++i)
5084 Exp->GeneralMatrixOp(coeffsIn + i * nm, tmp = coeffsRef + i * nm, mkey);
5090 double epsilon = 1.0e-8;
5091 for (
int i = 0; i < coeffsRef.size(); ++i)
5093 coeffsRef[i] = (std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
5094 coeffs[i] = (std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
5095 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
5100 TestHexLinearAdvectionDiffusionReaction_MatrixFree_UniformP_Deformed_OverInt)
5103 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
5105 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
5107 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
5109 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
5111 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
5113 new SpatialDomains::PointGeom(3u, 5u, 1.0, -1.0, 1.0));
5115 new SpatialDomains::PointGeom(3u, 6u, 2.0, 3.0, 4.0));
5117 new SpatialDomains::PointGeom(3u, 7u, -1.0, 1.0, 1.0));
5119 std::array<SpatialDomains::PointGeom *, 8> v = {
5120 v0.get(), v1.get(), v2.get(), v3.get(),
5121 v4.get(), v5.get(), v6.get(), v7.get()};
5122 std::array<SpatialDomains::SegGeomUniquePtr, 12> segVec;
5123 std::array<SpatialDomains::QuadGeomUniquePtr, 6> faceVec;
5130 unsigned int numQuadPoints = 8;
5131 unsigned int numModes = 4;
5134 quadPointsTypeDir1);
5140 basisKeyDir1, basisKeyDir1, basisKeyDir1, hexGeom.get());
5144 std::vector<LocalRegions::ExpansionSharedPtr> CollExp;
5145 for (
int i = 0; i < nelmts; ++i)
5147 CollExp.push_back(Exp);
5151 Collections::CollectionOptimisation colOpt(dummySession, 2,
5154 Collections::Collection c(CollExp, impTypes);
5161 int npoints = Exp->GetTotPoints() * nelmts;
5166 for (
int i = 0; i < Exp->GetShapeDimension(); i++)
5168 varcoeffs[varcoefftypes[i]] = Array<OneD, NekDouble>(npoints, 1.0);
5173 const int nm = Exp->GetNcoeffs();
5174 Array<OneD, NekDouble> coeffsIn(nelmts * nm);
5175 Array<OneD, NekDouble> coeffsRef(nelmts * nm);
5176 Array<OneD, NekDouble> coeffs(nelmts * nm), tmp;
5178 for (
int i = 0; i < coeffsIn.size(); ++i)
5180 coeffsIn[i] = i + 1.0;
5184 Exp->DetShapeType(), *Exp, factors,
5187 for (
int i = 0; i < nelmts; ++i)
5190 Exp->GeneralMatrixOp(coeffsIn + i * nm, tmp = coeffsRef + i * nm, mkey);
5196 double epsilon = 1.0e-8;
5197 for (
int i = 0; i < coeffsRef.size(); ++i)
5199 coeffsRef[i] = (std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
5200 coeffs[i] = (std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
5201 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);