Nektar++
Functions
Nektar::PyrCollectionTests Namespace Reference

Functions

SpatialDomains::SegGeomSharedPtr CreateSegGeom (unsigned int id, SpatialDomains::PointGeomSharedPtr v0, SpatialDomains::PointGeomSharedPtr v1)
 
SpatialDomains::PyrGeomSharedPtr CreatePyr (SpatialDomains::PointGeomSharedPtr v0, SpatialDomains::PointGeomSharedPtr v1, SpatialDomains::PointGeomSharedPtr v2, SpatialDomains::PointGeomSharedPtr v3, SpatialDomains::PointGeomSharedPtr v4)
 
 BOOST_AUTO_TEST_CASE (TestPyrBwdTrans_IterPerExp_UniformP_MultiElmt)
 
 BOOST_AUTO_TEST_CASE (TestPyrBwdTrans_StdMat_UniformP_MultiElmt)
 
 BOOST_AUTO_TEST_CASE (TestPyrBwdTrans_SumFac_UniformP_MultiElmt)
 
 BOOST_AUTO_TEST_CASE (TestPyrBwdTrans_IterPerExp_VariableP_MultiElmt)
 
 BOOST_AUTO_TEST_CASE (TestPyrBwdTrans_StdMat_VariableP_MultiElmt)
 
 BOOST_AUTO_TEST_CASE (TestPyrBwdTrans_SumFac_VariableP_MultiElmt)
 
 BOOST_AUTO_TEST_CASE (TestPyrPhysDeriv_IterPerExp_UniformP_MultiElmt)
 
 BOOST_AUTO_TEST_CASE (TestPyrPhysDeriv_StdMat_UniformP_MultiElmt)
 
 BOOST_AUTO_TEST_CASE (TestPyrPhysDeriv_SumFac_UniformP_MultiElmt)
 
 BOOST_AUTO_TEST_CASE (TestPyrPhysDeriv_IterPerExp_VariableP_MultiElmt)
 
 BOOST_AUTO_TEST_CASE (TestPyrPhysDeriv_SumFac_VariableP_MultiElmt)
 
 BOOST_AUTO_TEST_CASE (TestPyrPhysDeriv_MatrixFree_UniformP_MultiElmt)
 
 BOOST_AUTO_TEST_CASE (TestPyrIProductWRTBase_IterPerExp_UniformP_MultiElmt)
 
 BOOST_AUTO_TEST_CASE (TestPyrIProductWRTBase_StdMat_UniformP_MultiElmt)
 
 BOOST_AUTO_TEST_CASE (TestPyrIProductWRTBase_SumFac_UniformP_MultiElmt)
 
 BOOST_AUTO_TEST_CASE (TestPyrIProductWRTBase_IterPerExp_VariableP_MultiElmt)
 
 BOOST_AUTO_TEST_CASE (TestPyrIProductWRTBase_StdMat_VariableP_MultiElmt)
 
 BOOST_AUTO_TEST_CASE (TestPyrIProductWRTBase_SumFac_VariableP_MultiElmt)
 
 BOOST_AUTO_TEST_CASE (TestPyrIProductWRTBase_MatrixFree_UniformP_MultiElmt)
 
 BOOST_AUTO_TEST_CASE (TestPyrIProductWRTBase_MatrixFree_Deformed_MultiElmt)
 
 BOOST_AUTO_TEST_CASE (TestPyrIProductWRTDerivBase_IterPerExp_UniformP_MultiElmt)
 
 BOOST_AUTO_TEST_CASE (TestPyrIProductWRTDerivBase_StdMat_UniformP_MultiElmt)
 
 BOOST_AUTO_TEST_CASE (TestPyrIProductWRTDerivBase_SumFac_UniformP_MultiElmt)
 
 BOOST_AUTO_TEST_CASE (TestPyrIProductWRTDerivBase_IterPerExp_VariableP_MultiElmt)
 
 BOOST_AUTO_TEST_CASE (TestPyrIProductWRTDerivBase_MatrixFree_Deformed_MultiElmt)
 
 BOOST_AUTO_TEST_CASE (TestPyrIProductWRTDerivBase_MatrixFree_Deformed_MultiElmt_OverInt)
 
 BOOST_AUTO_TEST_CASE (TestPyrBwdTrans_MatrixFree_UniformP_MultiElmt)
 
 BOOST_AUTO_TEST_CASE (TestPyrBwdTrans_MatrixFree_UniformP_OverInt_MultiElmt)
 
 BOOST_AUTO_TEST_CASE (TestPyrIProductWRTDerivBase_StdMat_VariableP_MultiElmt)
 
 BOOST_AUTO_TEST_CASE (TestPyrIProductWRTDerivBase_SumFac_VariableP_MultiElmt)
 
 BOOST_AUTO_TEST_CASE (TestPyrHelmholtz_IterPerExp_UniformP_ConstVarDiff)
 
 BOOST_AUTO_TEST_CASE (TestPyrHelmholtz_MatrixFree_UniformP)
 
 BOOST_AUTO_TEST_CASE (TestPyrHelmholtz_MatrixFree_Deformed_overInt)
 
 BOOST_AUTO_TEST_CASE (TestPyrHelmholtz_MatrixFree_UniformP_ConstVarDiff)
 
 BOOST_AUTO_TEST_CASE (TestPyrPhysInterp1DScaled_NoCollection_UniformP_MultiElmt)
 
 BOOST_AUTO_TEST_CASE (TestPyrPhysInterp1DScaled_MatrixFree_UniformP_MultiElmt)
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/36]

Nektar::PyrCollectionTests::BOOST_AUTO_TEST_CASE ( TestPyrBwdTrans_IterPerExp_UniformP_MultiElmt  )

Definition at line 107 of file TestPyrCollection.cpp.

108{
110 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
112 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
114 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
116 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
118 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
119
120 SpatialDomains::PyrGeomSharedPtr pyrGeom = CreatePyr(v0, v1, v2, v3, v4);
121
122 Nektar::LibUtilities::PointsType PointsTypeDir1 =
124 const Nektar::LibUtilities::PointsKey PointsKeyDir1(5, PointsTypeDir1);
125 Nektar::LibUtilities::BasisType basisTypeDir1 =
127 const Nektar::LibUtilities::BasisKey basisKeyDir1(basisTypeDir1, 4,
128 PointsKeyDir1);
129
130 Nektar::LibUtilities::PointsType PointsTypeDir2 =
132 const Nektar::LibUtilities::PointsKey PointsKeyDir2(5, PointsTypeDir2);
133 Nektar::LibUtilities::BasisType basisTypeDir2 =
135 const Nektar::LibUtilities::BasisKey basisKeyDir2(basisTypeDir2, 4,
136 PointsKeyDir2);
137
138 Nektar::LibUtilities::PointsType PointsTypeDir3 =
139 Nektar::LibUtilities::eGaussRadauMAlpha2Beta0;
140 const Nektar::LibUtilities::PointsKey PointsKeyDir3(4, PointsTypeDir3);
141 Nektar::LibUtilities::BasisType basisTypeDir3 =
143 const Nektar::LibUtilities::BasisKey basisKeyDir3(basisTypeDir3, 4,
144 PointsKeyDir3);
145
148 basisKeyDir1, basisKeyDir2, basisKeyDir3, pyrGeom);
149
150 int nelmts = NELMTS;
151
152 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
153 for (int i = 0; i < nelmts; ++i)
154 {
155 CollExp.push_back(Exp);
156 }
157
159 Collections::CollectionOptimisation colOpt(dummySession, 3,
161 Collections::OperatorImpMap impTypes = colOpt.GetOperatorImpMap(Exp);
162 Collections::Collection c(CollExp, impTypes);
163 c.Initialise(Collections::eBwdTrans);
164
165 Array<OneD, NekDouble> coeffs(nelmts * Exp->GetNcoeffs(), 1.0), tmp;
166 Array<OneD, NekDouble> phys1(nelmts * Exp->GetTotPoints());
167 Array<OneD, NekDouble> phys2(nelmts * Exp->GetTotPoints());
168
169 for (int i = 0; i < nelmts; ++i)
170 {
171 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
172 tmp = phys1 + i * Exp->GetTotPoints());
173 }
174
175 LibUtilities::Timer timer;
176 timer.Start();
177 c.ApplyOperator(Collections::eBwdTrans, coeffs, phys2);
178 timer.Stop();
179 timer.AccumulateRegion("Pyr BwdTrans IterPerExp");
180
181 double epsilon = 1.0e-8;
182 for (int i = 0; i < phys1.size(); ++i)
183 {
184 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
185 }
186}
#define NELMTS
Describes the specification for a Basis.
Definition: Basis.h:45
Defines a specification for a set of points.
Definition: Points.h:50
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
std::map< OperatorType, ImplementationType > OperatorImpMap
Definition: Operator.h:131
std::shared_ptr< SessionReader > SessionReaderSharedPtr
@ eGaussLobattoLegendre
1D Gauss-Lobatto-Legendre quadrature points
Definition: PointsType.h:51
@ eModifiedPyr_C
Principle Modified Functions.
Definition: BasisType.h:53
@ eModified_A
Principle Modified Functions .
Definition: BasisType.h:48
std::shared_ptr< PyrExp > PyrExpSharedPtr
Definition: PyrExp.h:183
SpatialDomains::PyrGeomSharedPtr CreatePyr(SpatialDomains::PointGeomSharedPtr v0, SpatialDomains::PointGeomSharedPtr v1, SpatialDomains::PointGeomSharedPtr v2, SpatialDomains::PointGeomSharedPtr v3, SpatialDomains::PointGeomSharedPtr v4)
std::shared_ptr< PyrGeom > PyrGeomSharedPtr
Definition: PyrGeom.h:75
std::shared_ptr< PointGeom > PointGeomSharedPtr
Definition: Geometry.h:57

References Nektar::LibUtilities::Timer::AccumulateRegion(), Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::Collection::ApplyOperator(), CreatePyr(), Nektar::Collections::eBwdTrans, Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::Collections::eIterPerExp, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::Collections::CollectionOptimisation::GetOperatorImpMap(), Nektar::Collections::Collection::Initialise(), NELMTS, Nektar::LibUtilities::Timer::Start(), and Nektar::LibUtilities::Timer::Stop().

◆ BOOST_AUTO_TEST_CASE() [2/36]

Nektar::PyrCollectionTests::BOOST_AUTO_TEST_CASE ( TestPyrBwdTrans_IterPerExp_VariableP_MultiElmt  )

Definition at line 348 of file TestPyrCollection.cpp.

349{
351 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
353 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
355 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
357 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
359 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
360
361 SpatialDomains::PyrGeomSharedPtr pyrGeom = CreatePyr(v0, v1, v2, v3, v4);
362
363 Nektar::LibUtilities::PointsType PointsTypeDir1 =
365 const Nektar::LibUtilities::PointsKey PointsKeyDir1(5, PointsTypeDir1);
366 Nektar::LibUtilities::BasisType basisTypeDir1 =
368 const Nektar::LibUtilities::BasisKey basisKeyDir1(basisTypeDir1, 4,
369 PointsKeyDir1);
370
371 Nektar::LibUtilities::PointsType PointsTypeDir2 =
373 const Nektar::LibUtilities::PointsKey PointsKeyDir2(7, PointsTypeDir2);
374 Nektar::LibUtilities::BasisType basisTypeDir2 =
376 const Nektar::LibUtilities::BasisKey basisKeyDir2(basisTypeDir2, 6,
377 PointsKeyDir2);
378
379 Nektar::LibUtilities::PointsType PointsTypeDir3 =
380 Nektar::LibUtilities::eGaussRadauMAlpha2Beta0;
381 const Nektar::LibUtilities::PointsKey PointsKeyDir3(8, PointsTypeDir3);
382 Nektar::LibUtilities::BasisType basisTypeDir3 =
384 const Nektar::LibUtilities::BasisKey basisKeyDir3(basisTypeDir3, 8,
385 PointsKeyDir3);
386
389 basisKeyDir1, basisKeyDir2, basisKeyDir3, pyrGeom);
390 int nelmts = 10;
391
392 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
393 for (int i = 0; i < nelmts; ++i)
394 {
395 CollExp.push_back(Exp);
396 }
397
399 Collections::CollectionOptimisation colOpt(dummySession, 3,
401 Collections::OperatorImpMap impTypes = colOpt.GetOperatorImpMap(Exp);
402 Collections::Collection c(CollExp, impTypes);
403 c.Initialise(Collections::eBwdTrans);
404
405 Array<OneD, NekDouble> coeffs(nelmts * Exp->GetNcoeffs(), 1.0);
406 Array<OneD, NekDouble> phys1(nelmts * Exp->GetTotPoints(), 0.0);
407 Array<OneD, NekDouble> phys2(nelmts * Exp->GetTotPoints(), 0.0);
409
410 for (int i = 0; i < nelmts; ++i)
411 {
412 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
413 tmp = phys1 + i * Exp->GetTotPoints());
414 }
415 c.ApplyOperator(Collections::eBwdTrans, coeffs, phys2);
416
417 double epsilon = 1.0e-8;
418 for (int i = 0; i < phys1.size(); ++i)
419 {
420 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
421 }
422}

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::Collection::ApplyOperator(), CreatePyr(), Nektar::Collections::eBwdTrans, Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::Collections::eIterPerExp, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::Collections::CollectionOptimisation::GetOperatorImpMap(), and Nektar::Collections::Collection::Initialise().

◆ BOOST_AUTO_TEST_CASE() [3/36]

Nektar::PyrCollectionTests::BOOST_AUTO_TEST_CASE ( TestPyrBwdTrans_MatrixFree_UniformP_MultiElmt  )

Definition at line 2589 of file TestPyrCollection.cpp.

2590{
2592 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
2594 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
2596 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
2598 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
2600 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
2601
2602 SpatialDomains::PyrGeomSharedPtr pyrGeom = CreatePyr(v0, v1, v2, v3, v4);
2603
2604 unsigned int numQuadPoints = 5;
2605 unsigned int numModes = 4;
2606
2607 Nektar::LibUtilities::PointsType PointsTypeDir1 =
2609 const Nektar::LibUtilities::PointsKey PointsKeyDir1(numQuadPoints,
2610 PointsTypeDir1);
2611 Nektar::LibUtilities::BasisType basisTypeDir1 =
2613 const Nektar::LibUtilities::BasisKey basisKeyDir1(basisTypeDir1, numModes,
2614 PointsKeyDir1);
2615
2616 Nektar::LibUtilities::PointsType PointsTypeDir2 =
2618 const Nektar::LibUtilities::PointsKey PointsKeyDir2(numQuadPoints,
2619 PointsTypeDir2);
2620 Nektar::LibUtilities::BasisType basisTypeDir2 =
2622 const Nektar::LibUtilities::BasisKey basisKeyDir2(basisTypeDir2, numModes,
2623 PointsKeyDir2);
2624
2625 Nektar::LibUtilities::PointsType PointsTypeDir3 =
2626 Nektar::LibUtilities::eGaussRadauMAlpha2Beta0;
2627 const Nektar::LibUtilities::PointsKey PointsKeyDir3(numQuadPoints - 1,
2628 PointsTypeDir3);
2629 Nektar::LibUtilities::BasisType basisTypeDir3 =
2631 const Nektar::LibUtilities::BasisKey basisKeyDir3(basisTypeDir3, numModes,
2632 PointsKeyDir3);
2633
2636 basisKeyDir1, basisKeyDir2, basisKeyDir3, pyrGeom);
2637
2638 unsigned int nelmts = NELMTS;
2639
2640 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2641 for (unsigned int i = 0; i < nelmts; ++i)
2642 {
2643 CollExp.push_back(Exp);
2644 }
2645
2647 Collections::CollectionOptimisation colOpt(dummySession, 2,
2649 Collections::OperatorImpMap impTypes = colOpt.GetOperatorImpMap(Exp);
2650
2651 // ... only one op at the time ...
2653 Collections::Collection c(CollExp, impTypes);
2654 c.Initialise(Collections::eBwdTrans);
2655
2656 Array<OneD, NekDouble> coeffs(nelmts * Exp->GetNcoeffs(), 1.0);
2657 Array<OneD, NekDouble> physRef(nelmts * Exp->GetTotPoints(), 0.0);
2658 Array<OneD, NekDouble> phys(nelmts * Exp->GetTotPoints(), 0.0);
2660
2661 for (unsigned int i = 0; i < nelmts; ++i)
2662 {
2663 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
2664 tmp = physRef + i * Exp->GetTotPoints());
2665 }
2666 LibUtilities::Timer timer;
2667 timer.Start();
2668 c.ApplyOperator(Collections::eBwdTrans, coeffs, phys);
2669 timer.Stop();
2670 timer.AccumulateRegion("Pyr BwdTrans MatrixFree");
2671
2672 double epsilon = 1.0e-8;
2673 for (unsigned int i = 0; i < physRef.size(); ++i)
2674 {
2675 BOOST_CHECK_CLOSE(physRef[i], phys[i], epsilon);
2676 }
2677}

References Nektar::LibUtilities::Timer::AccumulateRegion(), Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::Collection::ApplyOperator(), CreatePyr(), Nektar::Collections::eBwdTrans, Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::Collections::eIterPerExp, Nektar::Collections::eMatrixFree, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::Collections::CollectionOptimisation::GetOperatorImpMap(), Nektar::Collections::Collection::Initialise(), NELMTS, Nektar::LibUtilities::Timer::Start(), and Nektar::LibUtilities::Timer::Stop().

◆ BOOST_AUTO_TEST_CASE() [4/36]

Nektar::PyrCollectionTests::BOOST_AUTO_TEST_CASE ( TestPyrBwdTrans_MatrixFree_UniformP_OverInt_MultiElmt  )

Definition at line 2679 of file TestPyrCollection.cpp.

2680{
2682 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
2684 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
2686 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
2688 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
2690 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
2691
2692 SpatialDomains::PyrGeomSharedPtr pyrGeom = CreatePyr(v0, v1, v2, v3, v4);
2693
2694 unsigned int numQuadPoints = 8;
2695 unsigned int numModes = 4;
2696
2697 Nektar::LibUtilities::PointsType PointsTypeDir1 =
2699 const Nektar::LibUtilities::PointsKey PointsKeyDir1(numQuadPoints,
2700 PointsTypeDir1);
2701 Nektar::LibUtilities::BasisType basisTypeDir1 =
2703 const Nektar::LibUtilities::BasisKey basisKeyDir1(basisTypeDir1, numModes,
2704 PointsKeyDir1);
2705
2706 Nektar::LibUtilities::PointsType PointsTypeDir2 =
2708 const Nektar::LibUtilities::PointsKey PointsKeyDir2(numQuadPoints,
2709 PointsTypeDir2);
2710 Nektar::LibUtilities::BasisType basisTypeDir2 =
2712 const Nektar::LibUtilities::BasisKey basisKeyDir2(basisTypeDir2, numModes,
2713 PointsKeyDir2);
2714
2715 Nektar::LibUtilities::PointsType PointsTypeDir3 =
2716 Nektar::LibUtilities::eGaussRadauMAlpha2Beta0;
2717 const Nektar::LibUtilities::PointsKey PointsKeyDir3(numQuadPoints - 1,
2718 PointsTypeDir3);
2719 Nektar::LibUtilities::BasisType basisTypeDir3 =
2721 const Nektar::LibUtilities::BasisKey basisKeyDir3(basisTypeDir3, numModes,
2722 PointsKeyDir3);
2723
2726 basisKeyDir1, basisKeyDir2, basisKeyDir3, pyrGeom);
2727
2728 unsigned int nelmts = 10;
2729
2730 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2731 for (unsigned int i = 0; i < nelmts; ++i)
2732 {
2733 CollExp.push_back(Exp);
2734 }
2735
2737 Collections::CollectionOptimisation colOpt(dummySession, 2,
2739 Collections::OperatorImpMap impTypes = colOpt.GetOperatorImpMap(Exp);
2740
2741 // ... only one op at the time ...
2743 Collections::Collection c(CollExp, impTypes);
2744 c.Initialise(Collections::eBwdTrans);
2745
2746 Array<OneD, NekDouble> coeffs(nelmts * Exp->GetNcoeffs(), 1.0);
2747 Array<OneD, NekDouble> physRef(nelmts * Exp->GetTotPoints(), 0.0);
2748 Array<OneD, NekDouble> phys(nelmts * Exp->GetTotPoints(), 0.0);
2750
2751 for (unsigned int i = 0; i < nelmts; ++i)
2752 {
2753 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
2754 tmp = physRef + i * Exp->GetTotPoints());
2755 }
2756 c.ApplyOperator(Collections::eBwdTrans, coeffs, phys);
2757
2758 double epsilon = 1.0e-8;
2759 for (unsigned int i = 0; i < physRef.size(); ++i)
2760 {
2761 BOOST_CHECK_CLOSE(physRef[i], phys[i], epsilon);
2762 }
2763}

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::Collection::ApplyOperator(), CreatePyr(), Nektar::Collections::eBwdTrans, Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::Collections::eIterPerExp, Nektar::Collections::eMatrixFree, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::Collections::CollectionOptimisation::GetOperatorImpMap(), and Nektar::Collections::Collection::Initialise().

◆ BOOST_AUTO_TEST_CASE() [5/36]

Nektar::PyrCollectionTests::BOOST_AUTO_TEST_CASE ( TestPyrBwdTrans_StdMat_UniformP_MultiElmt  )

Definition at line 188 of file TestPyrCollection.cpp.

189{
191 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
193 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
195 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
197 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
199 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
200
201 SpatialDomains::PyrGeomSharedPtr pyrGeom = CreatePyr(v0, v1, v2, v3, v4);
202
203 Nektar::LibUtilities::PointsType PointsTypeDir1 =
205 const Nektar::LibUtilities::PointsKey PointsKeyDir1(5, PointsTypeDir1);
206 Nektar::LibUtilities::BasisType basisTypeDir1 =
208 const Nektar::LibUtilities::BasisKey basisKeyDir1(basisTypeDir1, 4,
209 PointsKeyDir1);
210
211 Nektar::LibUtilities::PointsType PointsTypeDir2 =
213 const Nektar::LibUtilities::PointsKey PointsKeyDir2(5, PointsTypeDir2);
214 Nektar::LibUtilities::BasisType basisTypeDir2 =
216 const Nektar::LibUtilities::BasisKey basisKeyDir2(basisTypeDir2, 4,
217 PointsKeyDir2);
218
219 Nektar::LibUtilities::PointsType PointsTypeDir3 =
220 Nektar::LibUtilities::eGaussRadauMAlpha2Beta0;
221 const Nektar::LibUtilities::PointsKey PointsKeyDir3(5, PointsTypeDir3);
222 Nektar::LibUtilities::BasisType basisTypeDir3 =
224 const Nektar::LibUtilities::BasisKey basisKeyDir3(basisTypeDir3, 4,
225 PointsKeyDir3);
226
229 basisKeyDir1, basisKeyDir2, basisKeyDir3, pyrGeom);
230
231 int nelmts = 10;
232
233 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
234 for (int i = 0; i < nelmts; ++i)
235 {
236 CollExp.push_back(Exp);
237 }
238
240 Collections::CollectionOptimisation colOpt(dummySession, 3,
242 Collections::OperatorImpMap impTypes = colOpt.GetOperatorImpMap(Exp);
243 Collections::Collection c(CollExp, impTypes);
244 c.Initialise(Collections::eBwdTrans);
245
246 Array<OneD, NekDouble> coeffs(nelmts * Exp->GetNcoeffs(), 1.0);
247 Array<OneD, NekDouble> phys1(nelmts * Exp->GetTotPoints(), 0.0);
248 Array<OneD, NekDouble> phys2(nelmts * Exp->GetTotPoints(), 0.0);
250
251 for (int i = 0; i < nelmts; ++i)
252 {
253 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
254 tmp = phys1 + i * Exp->GetTotPoints());
255 }
256 c.ApplyOperator(Collections::eBwdTrans, coeffs, phys2);
257
258 double epsilon = 1.0e-8;
259 for (int i = 0; i < phys1.size(); ++i)
260 {
261 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
262 }
263}

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::Collection::ApplyOperator(), CreatePyr(), Nektar::Collections::eBwdTrans, Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::Collections::eStdMat, Nektar::Collections::CollectionOptimisation::GetOperatorImpMap(), and Nektar::Collections::Collection::Initialise().

◆ BOOST_AUTO_TEST_CASE() [6/36]

Nektar::PyrCollectionTests::BOOST_AUTO_TEST_CASE ( TestPyrBwdTrans_StdMat_VariableP_MultiElmt  )

Definition at line 424 of file TestPyrCollection.cpp.

425{
427 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
429 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
431 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
433 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
435 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
436
437 SpatialDomains::PyrGeomSharedPtr pyrGeom = CreatePyr(v0, v1, v2, v3, v4);
438
439 Nektar::LibUtilities::PointsType PointsTypeDir1 =
441 const Nektar::LibUtilities::PointsKey PointsKeyDir1(5, PointsTypeDir1);
442 Nektar::LibUtilities::BasisType basisTypeDir1 =
444 const Nektar::LibUtilities::BasisKey basisKeyDir1(basisTypeDir1, 4,
445 PointsKeyDir1);
446
447 Nektar::LibUtilities::PointsType PointsTypeDir2 =
449 const Nektar::LibUtilities::PointsKey PointsKeyDir2(7, PointsTypeDir2);
450 Nektar::LibUtilities::BasisType basisTypeDir2 =
452 const Nektar::LibUtilities::BasisKey basisKeyDir2(basisTypeDir2, 6,
453 PointsKeyDir2);
454
455 Nektar::LibUtilities::PointsType PointsTypeDir3 =
456 Nektar::LibUtilities::eGaussRadauMAlpha2Beta0;
457 const Nektar::LibUtilities::PointsKey PointsKeyDir3(8, PointsTypeDir3);
458 Nektar::LibUtilities::BasisType basisTypeDir3 =
460 const Nektar::LibUtilities::BasisKey basisKeyDir3(basisTypeDir3, 8,
461 PointsKeyDir3);
462
465 basisKeyDir1, basisKeyDir2, basisKeyDir3, pyrGeom);
466
467 int nelmts = 10;
468
469 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
470 for (int i = 0; i < nelmts; ++i)
471 {
472 CollExp.push_back(Exp);
473 }
474
476 Collections::CollectionOptimisation colOpt(dummySession, 3,
478 Collections::OperatorImpMap impTypes = colOpt.GetOperatorImpMap(Exp);
479 Collections::Collection c(CollExp, impTypes);
480 c.Initialise(Collections::eBwdTrans);
481
482 Array<OneD, NekDouble> coeffs(nelmts * Exp->GetNcoeffs(), 1.0);
483 Array<OneD, NekDouble> phys1(nelmts * Exp->GetTotPoints(), 0.0);
484 Array<OneD, NekDouble> phys2(nelmts * Exp->GetTotPoints(), 0.0);
486
487 for (int i = 0; i < nelmts; ++i)
488 {
489 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
490 tmp = phys1 + i * Exp->GetTotPoints());
491 }
492 c.ApplyOperator(Collections::eBwdTrans, coeffs, phys2);
493
494 double epsilon = 1.0e-8;
495 for (int i = 0; i < phys1.size(); ++i)
496 {
497 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
498 }
499}

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::Collection::ApplyOperator(), CreatePyr(), Nektar::Collections::eBwdTrans, Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::Collections::eStdMat, Nektar::Collections::CollectionOptimisation::GetOperatorImpMap(), and Nektar::Collections::Collection::Initialise().

◆ BOOST_AUTO_TEST_CASE() [7/36]

Nektar::PyrCollectionTests::BOOST_AUTO_TEST_CASE ( TestPyrBwdTrans_SumFac_UniformP_MultiElmt  )

Definition at line 265 of file TestPyrCollection.cpp.

266{
268 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
270 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
272 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
274 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
276 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
277
278 SpatialDomains::PyrGeomSharedPtr pyrGeom = CreatePyr(v0, v1, v2, v3, v4);
279
280 Nektar::LibUtilities::PointsType PointsTypeDir1 =
282 const Nektar::LibUtilities::PointsKey PointsKeyDir1(5, PointsTypeDir1);
283 Nektar::LibUtilities::BasisType basisTypeDir1 =
285 const Nektar::LibUtilities::BasisKey basisKeyDir1(basisTypeDir1, 4,
286 PointsKeyDir1);
287
288 Nektar::LibUtilities::PointsType PointsTypeDir2 =
290 const Nektar::LibUtilities::PointsKey PointsKeyDir2(5, PointsTypeDir2);
291 Nektar::LibUtilities::BasisType basisTypeDir2 =
293 const Nektar::LibUtilities::BasisKey basisKeyDir2(basisTypeDir2, 4,
294 PointsKeyDir2);
295
296 Nektar::LibUtilities::PointsType PointsTypeDir3 =
297 Nektar::LibUtilities::eGaussRadauMAlpha2Beta0;
298 const Nektar::LibUtilities::PointsKey PointsKeyDir3(5, PointsTypeDir3);
299 Nektar::LibUtilities::BasisType basisTypeDir3 =
301 const Nektar::LibUtilities::BasisKey basisKeyDir3(basisTypeDir3, 4,
302 PointsKeyDir3);
303
306 basisKeyDir1, basisKeyDir2, basisKeyDir3, pyrGeom);
307
308 int nelmts = NELMTS;
309
310 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
311 for (int i = 0; i < nelmts; ++i)
312 {
313 CollExp.push_back(Exp);
314 }
315
317 Collections::CollectionOptimisation colOpt(dummySession, 3,
321 Collections::Collection c(CollExp, impTypes);
322 c.Initialise(Collections::eBwdTrans);
323
324 Array<OneD, NekDouble> coeffs(nelmts * Exp->GetNcoeffs(), 1.0);
325 Array<OneD, NekDouble> phys1(nelmts * Exp->GetTotPoints(), 0.0);
326 Array<OneD, NekDouble> phys2(nelmts * Exp->GetTotPoints(), 0.0);
328
329 for (int i = 0; i < nelmts; ++i)
330 {
331 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
332 tmp = phys1 + i * Exp->GetTotPoints());
333 }
334
335 LibUtilities::Timer timer;
336 timer.Start();
337 c.ApplyOperator(Collections::eBwdTrans, coeffs, phys2);
338 timer.Stop();
339 timer.AccumulateRegion("Pyr BwdTrans SumFactor");
340
341 double epsilon = 1.0e-8;
342 for (int i = 0; i < phys1.size(); ++i)
343 {
344 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
345 }
346}

References Nektar::LibUtilities::Timer::AccumulateRegion(), Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::Collection::ApplyOperator(), CreatePyr(), Nektar::Collections::eBwdTrans, Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::Collections::eSumFac, Nektar::Collections::Collection::Initialise(), NELMTS, Nektar::LibUtilities::Timer::Start(), and Nektar::LibUtilities::Timer::Stop().

◆ BOOST_AUTO_TEST_CASE() [8/36]

Nektar::PyrCollectionTests::BOOST_AUTO_TEST_CASE ( TestPyrBwdTrans_SumFac_VariableP_MultiElmt  )

Definition at line 501 of file TestPyrCollection.cpp.

502{
504 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
506 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
508 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
510 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
512 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
513
514 SpatialDomains::PyrGeomSharedPtr pyrGeom = CreatePyr(v0, v1, v2, v3, v4);
515
516 Nektar::LibUtilities::PointsType PointsTypeDir1 =
518 const Nektar::LibUtilities::PointsKey PointsKeyDir1(5, PointsTypeDir1);
519 Nektar::LibUtilities::BasisType basisTypeDir1 =
521 const Nektar::LibUtilities::BasisKey basisKeyDir1(basisTypeDir1, 4,
522 PointsKeyDir1);
523
524 Nektar::LibUtilities::PointsType PointsTypeDir2 =
526 const Nektar::LibUtilities::PointsKey PointsKeyDir2(7, PointsTypeDir2);
527 Nektar::LibUtilities::BasisType basisTypeDir2 =
529 const Nektar::LibUtilities::BasisKey basisKeyDir2(basisTypeDir2, 6,
530 PointsKeyDir2);
531
532 Nektar::LibUtilities::PointsType PointsTypeDir3 =
534 const Nektar::LibUtilities::PointsKey PointsKeyDir3(8, PointsTypeDir3);
535 Nektar::LibUtilities::BasisType basisTypeDir3 =
537 const Nektar::LibUtilities::BasisKey basisKeyDir3(basisTypeDir3, 8,
538 PointsKeyDir3);
539
542 basisKeyDir1, basisKeyDir2, basisKeyDir3, pyrGeom);
543
544 int nelmts = 10;
545
546 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
547 for (int i = 0; i < nelmts; ++i)
548 {
549 CollExp.push_back(Exp);
550 }
551
553 Collections::CollectionOptimisation colOpt(dummySession, 3,
557 Collections::Collection c(CollExp, impTypes);
558 c.Initialise(Collections::eBwdTrans);
559
560 Array<OneD, NekDouble> coeffs(nelmts * Exp->GetNcoeffs(), 1.0);
561 Array<OneD, NekDouble> phys1(nelmts * Exp->GetTotPoints(), 0.0);
562 Array<OneD, NekDouble> phys2(nelmts * Exp->GetTotPoints(), 0.0);
564
565 for (int i = 0; i < nelmts; ++i)
566 {
567 Exp->BwdTrans(coeffs + i * Exp->GetNcoeffs(),
568 tmp = phys1 + i * Exp->GetTotPoints());
569 }
570 c.ApplyOperator(Collections::eBwdTrans, coeffs, phys2);
571
572 double epsilon = 1.0e-8;
573 for (int i = 0; i < phys1.size(); ++i)
574 {
575 BOOST_CHECK_CLOSE(phys1[i], phys2[i], epsilon);
576 }
577}

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::Collection::ApplyOperator(), CreatePyr(), Nektar::Collections::eBwdTrans, Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::Collections::eSumFac, and Nektar::Collections::Collection::Initialise().

◆ BOOST_AUTO_TEST_CASE() [9/36]

Nektar::PyrCollectionTests::BOOST_AUTO_TEST_CASE ( TestPyrHelmholtz_IterPerExp_UniformP_ConstVarDiff  )

Definition at line 2979 of file TestPyrCollection.cpp.

2980{
2982 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
2984 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
2986 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
2988 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
2990 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
2991
2992 SpatialDomains::PyrGeomSharedPtr pyrGeom = CreatePyr(v0, v1, v2, v3, v4);
2993
2994 unsigned int numQuadPoints = 5;
2995 unsigned int numModes = 4;
2996
2997 Nektar::LibUtilities::PointsType PointsTypeDir1 =
2999 const Nektar::LibUtilities::PointsKey PointsKeyDir1(numQuadPoints,
3000 PointsTypeDir1);
3001 Nektar::LibUtilities::BasisType basisTypeDir1 =
3003 const Nektar::LibUtilities::BasisKey basisKeyDir1(basisTypeDir1, numModes,
3004 PointsKeyDir1);
3005
3006 Nektar::LibUtilities::PointsType PointsTypeDir2 =
3008 const Nektar::LibUtilities::PointsKey PointsKeyDir2(numQuadPoints,
3009 PointsTypeDir2);
3010 Nektar::LibUtilities::BasisType basisTypeDir2 =
3012 const Nektar::LibUtilities::BasisKey basisKeyDir2(basisTypeDir2, numModes,
3013 PointsKeyDir2);
3014
3015 Nektar::LibUtilities::PointsType PointsTypeDir3 =
3016 Nektar::LibUtilities::eGaussRadauMAlpha2Beta0;
3017 const Nektar::LibUtilities::PointsKey PointsKeyDir3(numQuadPoints - 1,
3018 PointsTypeDir3);
3019 Nektar::LibUtilities::BasisType basisTypeDir3 =
3021 const Nektar::LibUtilities::BasisKey basisKeyDir3(basisTypeDir3, numModes,
3022 PointsKeyDir3);
3023
3026 basisKeyDir1, basisKeyDir2, basisKeyDir3, pyrGeom);
3027
3028 int nelmts = 10;
3029
3030 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
3031 for (int i = 0; i < nelmts; ++i)
3032 {
3033 CollExp.push_back(Exp);
3034 }
3035
3037 Collections::CollectionOptimisation colOpt(dummySession, 2,
3039 Collections::OperatorImpMap impTypes = colOpt.GetOperatorImpMap(Exp);
3040 Collections::Collection c(CollExp, impTypes);
3049
3050 c.Initialise(Collections::eHelmholtz, factors);
3051
3052 const int nm = Exp->GetNcoeffs();
3053 Array<OneD, NekDouble> coeffsIn(nelmts * nm);
3054 Array<OneD, NekDouble> coeffsRef(nelmts * nm);
3055 Array<OneD, NekDouble> coeffs(nelmts * nm), tmp;
3056
3057 for (int i = 0; i < nm; ++i)
3058 {
3059 coeffsIn[i] = 1.0;
3060 }
3061
3062 for (int i = 1; i < nelmts; ++i)
3063 {
3064 Vmath::Vcopy(nm, coeffsIn, 1, tmp = coeffsIn + i * nm, 1);
3065 }
3066
3067 StdRegions::StdMatrixKey mkey(StdRegions::eHelmholtz, Exp->DetShapeType(),
3068 *Exp, factors);
3069
3070 for (int i = 0; i < nelmts; ++i)
3071 {
3072 // Standard routines
3073 Exp->GeneralMatrixOp(coeffsIn + i * nm, tmp = coeffsRef + i * nm, mkey);
3074 }
3075
3076 c.ApplyOperator(Collections::eHelmholtz, coeffsIn, coeffs);
3077
3078 double epsilon = 1.0e-8;
3079 for (int i = 0; i < coeffsRef.size(); ++i)
3080 {
3081 coeffsRef[i] = (std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
3082 coeffs[i] = (std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
3083 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
3084 }
3085}
std::map< ConstFactorType, NekDouble > ConstFactorMap
Definition: StdRegions.hpp:430
StdRegions::ConstFactorMap factors
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.hpp:825
scalarT< T > abs(scalarT< T > in)
Definition: scalar.hpp:298

References tinysimd::abs(), Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::Collection::ApplyOperator(), CreatePyr(), Nektar::StdRegions::eFactorCoeffD00, Nektar::StdRegions::eFactorCoeffD01, Nektar::StdRegions::eFactorCoeffD02, Nektar::StdRegions::eFactorCoeffD11, Nektar::StdRegions::eFactorCoeffD12, Nektar::StdRegions::eFactorCoeffD22, Nektar::StdRegions::eFactorLambda, Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::Collections::eHelmholtz, Nektar::StdRegions::eHelmholtz, Nektar::Collections::eIterPerExp, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::VarcoeffHashingTest::factors, Nektar::Collections::CollectionOptimisation::GetOperatorImpMap(), Nektar::Collections::Collection::Initialise(), and Vmath::Vcopy().

◆ BOOST_AUTO_TEST_CASE() [10/36]

Nektar::PyrCollectionTests::BOOST_AUTO_TEST_CASE ( TestPyrHelmholtz_MatrixFree_Deformed_overInt  )

Definition at line 3189 of file TestPyrCollection.cpp.

3190{
3192 new SpatialDomains::PointGeom(3u, 0u, -1.5, -1.5, -1.5));
3194 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
3196 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
3198 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
3200 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
3201
3202 SpatialDomains::PyrGeomSharedPtr pyrGeom = CreatePyr(v0, v1, v2, v3, v4);
3203
3204 unsigned int numQuadPoints = 8;
3205 unsigned int numModes = 4;
3206
3207 Nektar::LibUtilities::PointsType PointsTypeDir1 =
3209 const Nektar::LibUtilities::PointsKey PointsKeyDir1(numQuadPoints,
3210 PointsTypeDir1);
3211 Nektar::LibUtilities::BasisType basisTypeDir1 =
3213 const Nektar::LibUtilities::BasisKey basisKeyDir1(basisTypeDir1, numModes,
3214 PointsKeyDir1);
3215
3216 Nektar::LibUtilities::PointsType PointsTypeDir2 =
3218 const Nektar::LibUtilities::PointsKey PointsKeyDir2(numQuadPoints,
3219 PointsTypeDir2);
3220 Nektar::LibUtilities::BasisType basisTypeDir2 =
3222 const Nektar::LibUtilities::BasisKey basisKeyDir2(basisTypeDir2, numModes,
3223 PointsKeyDir2);
3224
3225 Nektar::LibUtilities::PointsType PointsTypeDir3 =
3226 Nektar::LibUtilities::eGaussRadauMAlpha2Beta0;
3227 const Nektar::LibUtilities::PointsKey PointsKeyDir3(numQuadPoints - 1,
3228 PointsTypeDir3);
3229 Nektar::LibUtilities::BasisType basisTypeDir3 =
3231 const Nektar::LibUtilities::BasisKey basisKeyDir3(basisTypeDir3, numModes,
3232 PointsKeyDir3);
3233
3236 basisKeyDir1, basisKeyDir2, basisKeyDir3, pyrGeom);
3237
3238 int nelmts = 10;
3239
3240 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
3241 for (int i = 0; i < nelmts; ++i)
3242 {
3243 CollExp.push_back(Exp);
3244 }
3245
3247 Collections::CollectionOptimisation colOpt(dummySession, 2,
3249 Collections::OperatorImpMap impTypes = colOpt.GetOperatorImpMap(Exp);
3250 Collections::Collection c(CollExp, impTypes);
3253
3254 c.Initialise(Collections::eHelmholtz, factors);
3255
3256 const int nm = Exp->GetNcoeffs();
3257 Array<OneD, NekDouble> coeffsIn(nelmts * nm);
3258 Array<OneD, NekDouble> coeffsRef(nelmts * nm);
3259 Array<OneD, NekDouble> coeffs(nelmts * nm), tmp;
3260
3261 for (int i = 0; i < nm; ++i)
3262 {
3263 coeffsIn[i] = 1.0;
3264 }
3265
3266 for (int i = 1; i < nelmts; ++i)
3267 {
3268 Vmath::Vcopy(nm, coeffsIn, 1, tmp = coeffsIn + i * nm, 1);
3269 }
3270
3271 StdRegions::StdMatrixKey mkey(StdRegions::eHelmholtz, Exp->DetShapeType(),
3272 *Exp, factors);
3273
3274 for (int i = 0; i < nelmts; ++i)
3275 {
3276 // Standard routines
3277 Exp->GeneralMatrixOp(coeffsIn + i * nm, tmp = coeffsRef + i * nm, mkey);
3278 }
3279
3280 c.ApplyOperator(Collections::eHelmholtz, coeffsIn, coeffs);
3281
3282 double epsilon = 1.0e-8;
3283 for (int i = 0; i < coeffsRef.size(); ++i)
3284 {
3285 coeffsRef[i] = (std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
3286 coeffs[i] = (std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
3287 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
3288 }
3289}

References tinysimd::abs(), Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::Collection::ApplyOperator(), CreatePyr(), Nektar::StdRegions::eFactorLambda, Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::Collections::eHelmholtz, Nektar::StdRegions::eHelmholtz, Nektar::Collections::eMatrixFree, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::VarcoeffHashingTest::factors, Nektar::Collections::CollectionOptimisation::GetOperatorImpMap(), Nektar::Collections::Collection::Initialise(), and Vmath::Vcopy().

◆ BOOST_AUTO_TEST_CASE() [11/36]

Nektar::PyrCollectionTests::BOOST_AUTO_TEST_CASE ( TestPyrHelmholtz_MatrixFree_UniformP  )

Definition at line 3087 of file TestPyrCollection.cpp.

3088{
3090 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
3092 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
3094 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
3096 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
3098 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
3099
3100 SpatialDomains::PyrGeomSharedPtr pyrGeom = CreatePyr(v0, v1, v2, v3, v4);
3101
3102 unsigned int numQuadPoints = 5;
3103 unsigned int numModes = 4;
3104
3105 Nektar::LibUtilities::PointsType PointsTypeDir1 =
3107 const Nektar::LibUtilities::PointsKey PointsKeyDir1(numQuadPoints,
3108 PointsTypeDir1);
3109 Nektar::LibUtilities::BasisType basisTypeDir1 =
3111 const Nektar::LibUtilities::BasisKey basisKeyDir1(basisTypeDir1, numModes,
3112 PointsKeyDir1);
3113
3114 Nektar::LibUtilities::PointsType PointsTypeDir2 =
3116 const Nektar::LibUtilities::PointsKey PointsKeyDir2(numQuadPoints,
3117 PointsTypeDir2);
3118 Nektar::LibUtilities::BasisType basisTypeDir2 =
3120 const Nektar::LibUtilities::BasisKey basisKeyDir2(basisTypeDir2, numModes,
3121 PointsKeyDir2);
3122
3123 Nektar::LibUtilities::PointsType PointsTypeDir3 =
3124 Nektar::LibUtilities::eGaussRadauMAlpha2Beta0;
3125 const Nektar::LibUtilities::PointsKey PointsKeyDir3(numQuadPoints - 1,
3126 PointsTypeDir3);
3127 Nektar::LibUtilities::BasisType basisTypeDir3 =
3129 const Nektar::LibUtilities::BasisKey basisKeyDir3(basisTypeDir3, numModes,
3130 PointsKeyDir3);
3131
3134 basisKeyDir1, basisKeyDir2, basisKeyDir3, pyrGeom);
3135
3136 int nelmts = 10;
3137
3138 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
3139 for (int i = 0; i < nelmts; ++i)
3140 {
3141 CollExp.push_back(Exp);
3142 }
3143
3145 Collections::CollectionOptimisation colOpt(dummySession, 2,
3147 Collections::OperatorImpMap impTypes = colOpt.GetOperatorImpMap(Exp);
3148 Collections::Collection c(CollExp, impTypes);
3151
3152 c.Initialise(Collections::eHelmholtz, factors);
3153
3154 const int nm = Exp->GetNcoeffs();
3155 Array<OneD, NekDouble> coeffsIn(nelmts * nm);
3156 Array<OneD, NekDouble> coeffsRef(nelmts * nm);
3157 Array<OneD, NekDouble> coeffs(nelmts * nm), tmp;
3158
3159 for (int i = 0; i < nm; ++i)
3160 {
3161 coeffsIn[i] = 1.0;
3162 }
3163
3164 for (int i = 1; i < nelmts; ++i)
3165 {
3166 Vmath::Vcopy(nm, coeffsIn, 1, tmp = coeffsIn + i * nm, 1);
3167 }
3168
3169 StdRegions::StdMatrixKey mkey(StdRegions::eHelmholtz, Exp->DetShapeType(),
3170 *Exp, factors);
3171
3172 for (int i = 0; i < nelmts; ++i)
3173 {
3174 // Standard routines
3175 Exp->GeneralMatrixOp(coeffsIn + i * nm, tmp = coeffsRef + i * nm, mkey);
3176 }
3177
3178 c.ApplyOperator(Collections::eHelmholtz, coeffsIn, coeffs);
3179
3180 double epsilon = 1.0e-8;
3181 for (int i = 0; i < coeffsRef.size(); ++i)
3182 {
3183 coeffsRef[i] = (std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
3184 coeffs[i] = (std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
3185 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
3186 }
3187}

References tinysimd::abs(), Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::Collection::ApplyOperator(), CreatePyr(), Nektar::StdRegions::eFactorLambda, Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::Collections::eHelmholtz, Nektar::StdRegions::eHelmholtz, Nektar::Collections::eMatrixFree, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::VarcoeffHashingTest::factors, Nektar::Collections::CollectionOptimisation::GetOperatorImpMap(), Nektar::Collections::Collection::Initialise(), and Vmath::Vcopy().

◆ BOOST_AUTO_TEST_CASE() [12/36]

Nektar::PyrCollectionTests::BOOST_AUTO_TEST_CASE ( TestPyrHelmholtz_MatrixFree_UniformP_ConstVarDiff  )

Definition at line 3291 of file TestPyrCollection.cpp.

3292{
3294 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
3296 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
3298 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
3300 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
3302 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
3303
3304 SpatialDomains::PyrGeomSharedPtr pyrGeom = CreatePyr(v0, v1, v2, v3, v4);
3305
3306 unsigned int numQuadPoints = 5;
3307 unsigned int numModes = 4;
3308
3309 Nektar::LibUtilities::PointsType PointsTypeDir1 =
3311 const Nektar::LibUtilities::PointsKey PointsKeyDir1(numQuadPoints,
3312 PointsTypeDir1);
3313 Nektar::LibUtilities::BasisType basisTypeDir1 =
3315 const Nektar::LibUtilities::BasisKey basisKeyDir1(basisTypeDir1, numModes,
3316 PointsKeyDir1);
3317
3318 Nektar::LibUtilities::PointsType PointsTypeDir2 =
3320 const Nektar::LibUtilities::PointsKey PointsKeyDir2(numQuadPoints,
3321 PointsTypeDir2);
3322 Nektar::LibUtilities::BasisType basisTypeDir2 =
3324 const Nektar::LibUtilities::BasisKey basisKeyDir2(basisTypeDir2, numModes,
3325 PointsKeyDir2);
3326
3327 Nektar::LibUtilities::PointsType PointsTypeDir3 =
3328 Nektar::LibUtilities::eGaussRadauMAlpha2Beta0;
3329 const Nektar::LibUtilities::PointsKey PointsKeyDir3(numQuadPoints - 1,
3330 PointsTypeDir3);
3331 Nektar::LibUtilities::BasisType basisTypeDir3 =
3333 const Nektar::LibUtilities::BasisKey basisKeyDir3(basisTypeDir3, numModes,
3334 PointsKeyDir3);
3335
3338 basisKeyDir1, basisKeyDir2, basisKeyDir3, pyrGeom);
3339
3340 int nelmts = 10;
3341
3342 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
3343 for (int i = 0; i < nelmts; ++i)
3344 {
3345 CollExp.push_back(Exp);
3346 }
3347
3349 Collections::CollectionOptimisation colOpt(dummySession, 3,
3351 Collections::OperatorImpMap impTypes = colOpt.GetOperatorImpMap(Exp);
3352 Collections::Collection c(CollExp, impTypes);
3361
3362 c.Initialise(Collections::eHelmholtz, factors);
3363
3364 const int nm = Exp->GetNcoeffs();
3365 Array<OneD, NekDouble> coeffsIn(nelmts * nm);
3366 Array<OneD, NekDouble> coeffsRef(nelmts * nm);
3367 Array<OneD, NekDouble> coeffs(nelmts * nm), tmp;
3368
3369 for (int i = 0; i < nm; ++i)
3370 {
3371 coeffsIn[i] = 1.0;
3372 }
3373
3374 for (int i = 1; i < nelmts; ++i)
3375 {
3376 Vmath::Vcopy(nm, coeffsIn, 1, tmp = coeffsIn + i * nm, 1);
3377 }
3378
3379 StdRegions::StdMatrixKey mkey(StdRegions::eHelmholtz, Exp->DetShapeType(),
3380 *Exp, factors);
3381
3382 for (int i = 0; i < nelmts; ++i)
3383 {
3384 // Standard routines
3385 Exp->GeneralMatrixOp(coeffsIn + i * nm, tmp = coeffsRef + i * nm, mkey);
3386 }
3387
3388 c.ApplyOperator(Collections::eHelmholtz, coeffsIn, coeffs);
3389
3390 double epsilon = 1.0e-8;
3391 for (int i = 0; i < coeffsRef.size(); ++i)
3392 {
3393 coeffsRef[i] = (std::abs(coeffsRef[i]) < 1e-14) ? 0.0 : coeffsRef[i];
3394 coeffs[i] = (std::abs(coeffs[i]) < 1e-14) ? 0.0 : coeffs[i];
3395 BOOST_CHECK_CLOSE(coeffsRef[i], coeffs[i], epsilon);
3396 }
3397}

References tinysimd::abs(), Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::Collection::ApplyOperator(), CreatePyr(), Nektar::StdRegions::eFactorCoeffD00, Nektar::StdRegions::eFactorCoeffD01, Nektar::StdRegions::eFactorCoeffD02, Nektar::StdRegions::eFactorCoeffD11, Nektar::StdRegions::eFactorCoeffD12, Nektar::StdRegions::eFactorCoeffD22, Nektar::StdRegions::eFactorLambda, Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::Collections::eHelmholtz, Nektar::StdRegions::eHelmholtz, Nektar::Collections::eMatrixFree, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::VarcoeffHashingTest::factors, Nektar::Collections::CollectionOptimisation::GetOperatorImpMap(), Nektar::Collections::Collection::Initialise(), and Vmath::Vcopy().

◆ BOOST_AUTO_TEST_CASE() [13/36]

Nektar::PyrCollectionTests::BOOST_AUTO_TEST_CASE ( TestPyrIProductWRTBase_IterPerExp_UniformP_MultiElmt  )

Definition at line 1160 of file TestPyrCollection.cpp.

1161{
1163 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
1165 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
1167 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
1169 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
1171 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
1172
1173 SpatialDomains::PyrGeomSharedPtr pyrGeom = CreatePyr(v0, v1, v2, v3, v4);
1174
1175 Nektar::LibUtilities::PointsType PointsTypeDir1 =
1177 const Nektar::LibUtilities::PointsKey PointsKeyDir1(5, PointsTypeDir1);
1178 Nektar::LibUtilities::BasisType basisTypeDir1 =
1180 const Nektar::LibUtilities::BasisKey basisKeyDir1(basisTypeDir1, 4,
1181 PointsKeyDir1);
1182
1183 Nektar::LibUtilities::PointsType PointsTypeDir2 =
1185 const Nektar::LibUtilities::PointsKey PointsKeyDir2(5, PointsTypeDir2);
1186 Nektar::LibUtilities::BasisType basisTypeDir2 =
1188 const Nektar::LibUtilities::BasisKey basisKeyDir2(basisTypeDir2, 4,
1189 PointsKeyDir2);
1190
1191 Nektar::LibUtilities::PointsType PointsTypeDir3 =
1192 Nektar::LibUtilities::eGaussRadauMAlpha2Beta0;
1193 const Nektar::LibUtilities::PointsKey PointsKeyDir3(4, PointsTypeDir3);
1194 Nektar::LibUtilities::BasisType basisTypeDir3 =
1196 const Nektar::LibUtilities::BasisKey basisKeyDir3(basisTypeDir3, 4,
1197 PointsKeyDir3);
1198
1201 basisKeyDir1, basisKeyDir2, basisKeyDir3, pyrGeom);
1202
1203 int nelmts = NELMTS;
1204
1205 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1206 for (int i = 0; i < nelmts; ++i)
1207 {
1208 CollExp.push_back(Exp);
1209 }
1210
1212 Collections::CollectionOptimisation colOpt(dummySession, 3,
1214 Collections::OperatorImpMap impTypes = colOpt.GetOperatorImpMap(Exp);
1215 Collections::Collection c(CollExp, impTypes);
1216 c.Initialise(Collections::eIProductWRTBase);
1217
1218 const int nq = Exp->GetTotPoints();
1219 Array<OneD, NekDouble> phys(nelmts * nq, 0.0);
1220 Array<OneD, NekDouble> coeffs1(nelmts * Exp->GetNcoeffs(), 0.0);
1221 Array<OneD, NekDouble> coeffs2(nelmts * Exp->GetNcoeffs(), 0.0);
1223 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
1224
1225 Exp->GetCoords(xc, yc, zc);
1226
1227 for (int i = 0; i < nq; ++i)
1228 {
1229 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
1230 }
1231 Exp->IProductWRTBase(phys, coeffs1);
1232
1233 for (int i = 1; i < nelmts; ++i)
1234 {
1235 Vmath::Vcopy(nq, &phys[0], 1, &phys[i * nq], 1);
1236 Exp->IProductWRTBase(phys + i * nq,
1237 tmp = coeffs1 + i * Exp->GetNcoeffs());
1238 }
1239
1240 LibUtilities::Timer timer;
1241 timer.Start();
1242 c.ApplyOperator(Collections::eIProductWRTBase, phys, coeffs2);
1243 timer.Stop();
1244 timer.AccumulateRegion("Pyr IProdWRTB IterPerExp");
1245
1246 double epsilon = 1.0e-8;
1247 for (int i = 0; i < coeffs1.size(); ++i)
1248 {
1249 // clamp values below 1e-14 to zero
1250 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
1251 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
1252 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1253 }
1254}

References Nektar::LibUtilities::Timer::AccumulateRegion(), Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::Collection::ApplyOperator(), CreatePyr(), Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::Collections::eIProductWRTBase, Nektar::Collections::eIterPerExp, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::Collections::CollectionOptimisation::GetOperatorImpMap(), Nektar::Collections::Collection::Initialise(), NELMTS, Nektar::LibUtilities::Timer::Start(), Nektar::LibUtilities::Timer::Stop(), and Vmath::Vcopy().

◆ BOOST_AUTO_TEST_CASE() [14/36]

Nektar::PyrCollectionTests::BOOST_AUTO_TEST_CASE ( TestPyrIProductWRTBase_IterPerExp_VariableP_MultiElmt  )

Definition at line 1445 of file TestPyrCollection.cpp.

1446{
1448 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
1450 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
1452 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
1454 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
1456 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
1457
1458 SpatialDomains::PyrGeomSharedPtr pyrGeom = CreatePyr(v0, v1, v2, v3, v4);
1459
1460 Nektar::LibUtilities::PointsType PointsTypeDir1 =
1462 const Nektar::LibUtilities::PointsKey PointsKeyDir1(5, PointsTypeDir1);
1463 Nektar::LibUtilities::BasisType basisTypeDir1 =
1465 const Nektar::LibUtilities::BasisKey basisKeyDir1(basisTypeDir1, 4,
1466 PointsKeyDir1);
1467
1468 Nektar::LibUtilities::PointsType PointsTypeDir2 =
1470 const Nektar::LibUtilities::PointsKey PointsKeyDir2(7, PointsTypeDir2);
1471 Nektar::LibUtilities::BasisType basisTypeDir2 =
1473 const Nektar::LibUtilities::BasisKey basisKeyDir2(basisTypeDir2, 6,
1474 PointsKeyDir2);
1475
1476 Nektar::LibUtilities::PointsType PointsTypeDir3 =
1477 Nektar::LibUtilities::eGaussRadauMAlpha2Beta0;
1478 const Nektar::LibUtilities::PointsKey PointsKeyDir3(8, PointsTypeDir3);
1479 Nektar::LibUtilities::BasisType basisTypeDir3 =
1481 const Nektar::LibUtilities::BasisKey basisKeyDir3(basisTypeDir3, 8,
1482 PointsKeyDir3);
1483
1486 basisKeyDir1, basisKeyDir2, basisKeyDir3, pyrGeom);
1487
1488 int nelmts = 10;
1489
1490 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1491 for (int i = 0; i < nelmts; ++i)
1492 {
1493 CollExp.push_back(Exp);
1494 }
1495
1497 Collections::CollectionOptimisation colOpt(dummySession, 3,
1499 Collections::OperatorImpMap impTypes = colOpt.GetOperatorImpMap(Exp);
1500 Collections::Collection c(CollExp, impTypes);
1501 c.Initialise(Collections::eIProductWRTBase);
1502
1503 const int nq = Exp->GetTotPoints();
1504 Array<OneD, NekDouble> phys(nelmts * nq, 0.0);
1505 Array<OneD, NekDouble> coeffs1(nelmts * Exp->GetNcoeffs(), 0.0);
1506 Array<OneD, NekDouble> coeffs2(nelmts * Exp->GetNcoeffs(), 0.0);
1508 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
1509
1510 Exp->GetCoords(xc, yc, zc);
1511
1512 for (int i = 0; i < nq; ++i)
1513 {
1514 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
1515 }
1516 Exp->IProductWRTBase(phys, coeffs1);
1517
1518 for (int i = 1; i < nelmts; ++i)
1519 {
1520 Vmath::Vcopy(nq, &phys[0], 1, &phys[i * nq], 1);
1521 Exp->IProductWRTBase(phys + i * nq,
1522 tmp = coeffs1 + i * Exp->GetNcoeffs());
1523 }
1524
1525 c.ApplyOperator(Collections::eIProductWRTBase, phys, coeffs2);
1526
1527 double epsilon = 1.0e-8;
1528 for (int i = 0; i < coeffs1.size(); ++i)
1529 {
1530 // clamp values below 1e-14 to zero
1531 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
1532 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
1533 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1534 }
1535}

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::Collection::ApplyOperator(), CreatePyr(), Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::Collections::eIProductWRTBase, Nektar::Collections::eIterPerExp, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::Collections::CollectionOptimisation::GetOperatorImpMap(), Nektar::Collections::Collection::Initialise(), and Vmath::Vcopy().

◆ BOOST_AUTO_TEST_CASE() [15/36]

Nektar::PyrCollectionTests::BOOST_AUTO_TEST_CASE ( TestPyrIProductWRTBase_MatrixFree_Deformed_MultiElmt  )

Definition at line 1825 of file TestPyrCollection.cpp.

1826{
1828 new SpatialDomains::PointGeom(3u, 0u, -2.0, -3.0, -4.0));
1830 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
1832 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
1834 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
1836 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
1837
1838 SpatialDomains::PyrGeomSharedPtr pyrGeom = CreatePyr(v0, v1, v2, v3, v4);
1839
1840 unsigned int numQuadPoints = 5;
1841 unsigned int numModes = 4;
1842
1843 Nektar::LibUtilities::PointsType PointsTypeDir1 =
1845 const Nektar::LibUtilities::PointsKey PointsKeyDir1(numQuadPoints,
1846 PointsTypeDir1);
1847 Nektar::LibUtilities::BasisType basisTypeDir1 =
1849 const Nektar::LibUtilities::BasisKey basisKeyDir1(basisTypeDir1, numModes,
1850 PointsKeyDir1);
1851
1852 Nektar::LibUtilities::PointsType PointsTypeDir2 =
1854 const Nektar::LibUtilities::PointsKey PointsKeyDir2(numQuadPoints,
1855 PointsTypeDir2);
1856 Nektar::LibUtilities::BasisType basisTypeDir2 =
1858 const Nektar::LibUtilities::BasisKey basisKeyDir2(basisTypeDir2, numModes,
1859 PointsKeyDir2);
1860
1861 Nektar::LibUtilities::PointsType PointsTypeDir3 =
1862 Nektar::LibUtilities::eGaussRadauMAlpha2Beta0;
1863 const Nektar::LibUtilities::PointsKey PointsKeyDir3(numQuadPoints - 1,
1864 PointsTypeDir3);
1865 Nektar::LibUtilities::BasisType basisTypeDir3 =
1867 const Nektar::LibUtilities::BasisKey basisKeyDir3(basisTypeDir3, numModes,
1868 PointsKeyDir3);
1869
1872 basisKeyDir1, basisKeyDir2, basisKeyDir3, pyrGeom);
1873
1874 int nelmts = 5;
1875
1876 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1877 for (int i = 0; i < nelmts; ++i)
1878 {
1879 CollExp.push_back(Exp);
1880 }
1881
1883 Collections::CollectionOptimisation colOpt(dummySession, 2,
1886
1888 Collections::Collection c(CollExp, impTypes);
1889 c.Initialise(Collections::eIProductWRTBase);
1890
1891 const int nq = Exp->GetTotPoints();
1892 Array<OneD, NekDouble> phys(nelmts * nq, 0.0);
1893 Array<OneD, NekDouble> coeffs1(nelmts * Exp->GetNcoeffs(), 0.0);
1894 Array<OneD, NekDouble> coeffs2(nelmts * Exp->GetNcoeffs(), 0.0);
1896 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
1897
1898 Exp->GetCoords(xc, yc, zc);
1899
1900 for (int i = 0; i < nq; ++i)
1901 {
1902 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
1903 }
1904 Exp->IProductWRTBase(phys, coeffs1);
1905
1906 for (int i = 1; i < nelmts; ++i)
1907 {
1908 Vmath::Vcopy(nq, &phys[0], 1, &phys[i * nq], 1);
1909 Exp->IProductWRTBase(phys + i * nq,
1910 tmp = coeffs1 + i * Exp->GetNcoeffs());
1911 }
1912
1913 c.ApplyOperator(Collections::eIProductWRTBase, phys, coeffs2);
1914
1915 double epsilon = 1.0e-8;
1916 for (int i = 0; i < coeffs1.size(); ++i)
1917 {
1918 // clamp values below 1e-14 to zero
1919 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
1920 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
1921 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1922 }
1923}

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::Collection::ApplyOperator(), CreatePyr(), Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::Collections::eIProductWRTBase, Nektar::Collections::eIterPerExp, Nektar::Collections::eMatrixFree, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::Collections::Collection::Initialise(), and Vmath::Vcopy().

◆ BOOST_AUTO_TEST_CASE() [16/36]

Nektar::PyrCollectionTests::BOOST_AUTO_TEST_CASE ( TestPyrIProductWRTBase_MatrixFree_UniformP_MultiElmt  )

Definition at line 1722 of file TestPyrCollection.cpp.

1723{
1725 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
1727 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
1729 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
1731 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
1733 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
1734
1735 SpatialDomains::PyrGeomSharedPtr pyrGeom = CreatePyr(v0, v1, v2, v3, v4);
1736
1737 unsigned int numQuadPoints = 5;
1738 unsigned int numModes = 4;
1739
1740 Nektar::LibUtilities::PointsType PointsTypeDir1 =
1742 const Nektar::LibUtilities::PointsKey PointsKeyDir1(numQuadPoints,
1743 PointsTypeDir1);
1744 Nektar::LibUtilities::BasisType basisTypeDir1 =
1746 const Nektar::LibUtilities::BasisKey basisKeyDir1(basisTypeDir1, numModes,
1747 PointsKeyDir1);
1748
1749 Nektar::LibUtilities::PointsType PointsTypeDir2 =
1751 const Nektar::LibUtilities::PointsKey PointsKeyDir2(numQuadPoints,
1752 PointsTypeDir2);
1753 Nektar::LibUtilities::BasisType basisTypeDir2 =
1755 const Nektar::LibUtilities::BasisKey basisKeyDir2(basisTypeDir2, numModes,
1756 PointsKeyDir2);
1757
1758 Nektar::LibUtilities::PointsType PointsTypeDir3 =
1759 Nektar::LibUtilities::eGaussRadauMAlpha2Beta0;
1760 const Nektar::LibUtilities::PointsKey PointsKeyDir3(numQuadPoints - 1,
1761 PointsTypeDir3);
1762 Nektar::LibUtilities::BasisType basisTypeDir3 =
1764 const Nektar::LibUtilities::BasisKey basisKeyDir3(basisTypeDir3, numModes,
1765 PointsKeyDir3);
1766
1769 basisKeyDir1, basisKeyDir2, basisKeyDir3, pyrGeom);
1770
1771 int nelmts = NELMTS;
1772
1773 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1774 for (int i = 0; i < nelmts; ++i)
1775 {
1776 CollExp.push_back(Exp);
1777 }
1778
1780 Collections::CollectionOptimisation colOpt(dummySession, 2,
1784 Collections::Collection c(CollExp, impTypes);
1785 c.Initialise(Collections::eIProductWRTBase);
1786
1787 const int nq = Exp->GetTotPoints();
1788 Array<OneD, NekDouble> phys(nelmts * nq, 0.0);
1789 Array<OneD, NekDouble> coeffs1(nelmts * Exp->GetNcoeffs(), 0.0);
1790 Array<OneD, NekDouble> coeffs2(nelmts * Exp->GetNcoeffs(), 0.0);
1792 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
1793
1794 Exp->GetCoords(xc, yc, zc);
1795
1796 for (int i = 0; i < nq; ++i)
1797 {
1798 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
1799 }
1800 Exp->IProductWRTBase(phys, coeffs1);
1801
1802 for (int i = 1; i < nelmts; ++i)
1803 {
1804 Vmath::Vcopy(nq, &phys[0], 1, &phys[i * nq], 1);
1805 Exp->IProductWRTBase(phys + i * nq,
1806 tmp = coeffs1 + i * Exp->GetNcoeffs());
1807 }
1808
1809 LibUtilities::Timer timer;
1810 timer.Start();
1811 c.ApplyOperator(Collections::eIProductWRTBase, phys, coeffs2);
1812 timer.Stop();
1813 timer.AccumulateRegion("Pyr IProdWRTB MatrixFree");
1814
1815 double epsilon = 1.0e-8;
1816 for (int i = 0; i < coeffs1.size(); ++i)
1817 {
1818 // clamp values below 1e-14 to zero
1819 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
1820 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
1821 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1822 }
1823}

References Nektar::LibUtilities::Timer::AccumulateRegion(), Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::Collection::ApplyOperator(), CreatePyr(), Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::Collections::eIProductWRTBase, Nektar::Collections::eIterPerExp, Nektar::Collections::eMatrixFree, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::Collections::Collection::Initialise(), NELMTS, Nektar::LibUtilities::Timer::Start(), Nektar::LibUtilities::Timer::Stop(), and Vmath::Vcopy().

◆ BOOST_AUTO_TEST_CASE() [17/36]

Nektar::PyrCollectionTests::BOOST_AUTO_TEST_CASE ( TestPyrIProductWRTBase_StdMat_UniformP_MultiElmt  )

Definition at line 1256 of file TestPyrCollection.cpp.

1257{
1259 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
1261 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
1263 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
1265 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
1267 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
1268
1269 SpatialDomains::PyrGeomSharedPtr pyrGeom = CreatePyr(v0, v1, v2, v3, v4);
1270
1271 Nektar::LibUtilities::PointsType PointsTypeDir1 =
1273 const Nektar::LibUtilities::PointsKey PointsKeyDir1(5, PointsTypeDir1);
1274 Nektar::LibUtilities::BasisType basisTypeDir1 =
1276 const Nektar::LibUtilities::BasisKey basisKeyDir1(basisTypeDir1, 4,
1277 PointsKeyDir1);
1278
1279 Nektar::LibUtilities::PointsType PointsTypeDir2 =
1281 const Nektar::LibUtilities::PointsKey PointsKeyDir2(5, PointsTypeDir2);
1282 Nektar::LibUtilities::BasisType basisTypeDir2 =
1284 const Nektar::LibUtilities::BasisKey basisKeyDir2(basisTypeDir2, 4,
1285 PointsKeyDir2);
1286
1287 Nektar::LibUtilities::PointsType PointsTypeDir3 =
1288 Nektar::LibUtilities::eGaussRadauMAlpha2Beta0;
1289 const Nektar::LibUtilities::PointsKey PointsKeyDir3(4, PointsTypeDir3);
1290 Nektar::LibUtilities::BasisType basisTypeDir3 =
1292 const Nektar::LibUtilities::BasisKey basisKeyDir3(basisTypeDir3, 4,
1293 PointsKeyDir3);
1294
1297 basisKeyDir1, basisKeyDir2, basisKeyDir3, pyrGeom);
1298
1299 int nelmts = 10;
1300
1301 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1302 for (int i = 0; i < nelmts; ++i)
1303 {
1304 CollExp.push_back(Exp);
1305 }
1306
1308 Collections::CollectionOptimisation colOpt(dummySession, 3,
1310 Collections::OperatorImpMap impTypes = colOpt.GetOperatorImpMap(Exp);
1311 Collections::Collection c(CollExp, impTypes);
1312 c.Initialise(Collections::eIProductWRTBase);
1313
1314 const int nq = Exp->GetTotPoints();
1315 Array<OneD, NekDouble> phys(nelmts * nq, 0.0);
1316 Array<OneD, NekDouble> coeffs1(nelmts * Exp->GetNcoeffs(), 0.0);
1317 Array<OneD, NekDouble> coeffs2(nelmts * Exp->GetNcoeffs(), 0.0);
1319 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
1320
1321 Exp->GetCoords(xc, yc, zc);
1322
1323 for (int i = 0; i < nq; ++i)
1324 {
1325 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
1326 }
1327 Exp->IProductWRTBase(phys, coeffs1);
1328
1329 for (int i = 1; i < nelmts; ++i)
1330 {
1331 Vmath::Vcopy(nq, &phys[0], 1, &phys[i * nq], 1);
1332 Exp->IProductWRTBase(phys + i * nq,
1333 tmp = coeffs1 + i * Exp->GetNcoeffs());
1334 }
1335
1336 c.ApplyOperator(Collections::eIProductWRTBase, phys, coeffs2);
1337
1338 double epsilon = 1.0e-8;
1339 for (int i = 0; i < coeffs1.size(); ++i)
1340 {
1341 // clamp values below 1e-14 to zero
1342 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
1343 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
1344 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1345 }
1346}

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::Collection::ApplyOperator(), CreatePyr(), Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::Collections::eIProductWRTBase, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::Collections::eStdMat, Nektar::Collections::CollectionOptimisation::GetOperatorImpMap(), Nektar::Collections::Collection::Initialise(), and Vmath::Vcopy().

◆ BOOST_AUTO_TEST_CASE() [18/36]

Nektar::PyrCollectionTests::BOOST_AUTO_TEST_CASE ( TestPyrIProductWRTBase_StdMat_VariableP_MultiElmt  )

Definition at line 1537 of file TestPyrCollection.cpp.

1538{
1540 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
1542 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
1544 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
1546 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
1548 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
1549
1550 SpatialDomains::PyrGeomSharedPtr pyrGeom = CreatePyr(v0, v1, v2, v3, v4);
1551
1552 Nektar::LibUtilities::PointsType PointsTypeDir1 =
1554 const Nektar::LibUtilities::PointsKey PointsKeyDir1(5, PointsTypeDir1);
1555 Nektar::LibUtilities::BasisType basisTypeDir1 =
1557 const Nektar::LibUtilities::BasisKey basisKeyDir1(basisTypeDir1, 4,
1558 PointsKeyDir1);
1559
1560 Nektar::LibUtilities::PointsType PointsTypeDir2 =
1562 const Nektar::LibUtilities::PointsKey PointsKeyDir2(7, PointsTypeDir2);
1563 Nektar::LibUtilities::BasisType basisTypeDir2 =
1565 const Nektar::LibUtilities::BasisKey basisKeyDir2(basisTypeDir2, 6,
1566 PointsKeyDir2);
1567
1568 Nektar::LibUtilities::PointsType PointsTypeDir3 =
1569 Nektar::LibUtilities::eGaussRadauMAlpha2Beta0;
1570 const Nektar::LibUtilities::PointsKey PointsKeyDir3(8, PointsTypeDir3);
1571 Nektar::LibUtilities::BasisType basisTypeDir3 =
1573 const Nektar::LibUtilities::BasisKey basisKeyDir3(basisTypeDir3, 8,
1574 PointsKeyDir3);
1575
1578 basisKeyDir1, basisKeyDir2, basisKeyDir3, pyrGeom);
1579
1580 int nelmts = 10;
1581
1582 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1583 for (int i = 0; i < nelmts; ++i)
1584 {
1585 CollExp.push_back(Exp);
1586 }
1587
1589 Collections::CollectionOptimisation colOpt(dummySession, 3,
1591 Collections::OperatorImpMap impTypes = colOpt.GetOperatorImpMap(Exp);
1592 Collections::Collection c(CollExp, impTypes);
1593 c.Initialise(Collections::eIProductWRTBase);
1594
1595 const int nq = Exp->GetTotPoints();
1596 Array<OneD, NekDouble> phys(nelmts * nq, 0.0);
1597 Array<OneD, NekDouble> coeffs1(nelmts * Exp->GetNcoeffs(), 0.0);
1598 Array<OneD, NekDouble> coeffs2(nelmts * Exp->GetNcoeffs(), 0.0);
1600 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
1601
1602 Exp->GetCoords(xc, yc, zc);
1603
1604 for (int i = 0; i < nq; ++i)
1605 {
1606 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
1607 }
1608 Exp->IProductWRTBase(phys, coeffs1);
1609
1610 for (int i = 1; i < nelmts; ++i)
1611 {
1612 Vmath::Vcopy(nq, &phys[0], 1, &phys[i * nq], 1);
1613 Exp->IProductWRTBase(phys + i * nq,
1614 tmp = coeffs1 + i * Exp->GetNcoeffs());
1615 }
1616
1617 c.ApplyOperator(Collections::eIProductWRTBase, phys, coeffs2);
1618
1619 double epsilon = 1.0e-8;
1620 for (int i = 0; i < coeffs1.size(); ++i)
1621 {
1622 // clamp values below 1e-14 to zero
1623 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
1624 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
1625 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1626 }
1627}

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::Collection::ApplyOperator(), CreatePyr(), Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::Collections::eIProductWRTBase, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::Collections::eStdMat, Nektar::Collections::CollectionOptimisation::GetOperatorImpMap(), Nektar::Collections::Collection::Initialise(), and Vmath::Vcopy().

◆ BOOST_AUTO_TEST_CASE() [19/36]

Nektar::PyrCollectionTests::BOOST_AUTO_TEST_CASE ( TestPyrIProductWRTBase_SumFac_UniformP_MultiElmt  )

Definition at line 1348 of file TestPyrCollection.cpp.

1349{
1351 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
1353 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
1355 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
1357 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
1359 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
1360
1361 SpatialDomains::PyrGeomSharedPtr pyrGeom = CreatePyr(v0, v1, v2, v3, v4);
1362
1363 Nektar::LibUtilities::PointsType PointsTypeDir1 =
1365 const Nektar::LibUtilities::PointsKey PointsKeyDir1(5, PointsTypeDir1);
1366 Nektar::LibUtilities::BasisType basisTypeDir1 =
1368 const Nektar::LibUtilities::BasisKey basisKeyDir1(basisTypeDir1, 4,
1369 PointsKeyDir1);
1370
1371 Nektar::LibUtilities::PointsType PointsTypeDir2 =
1373 const Nektar::LibUtilities::PointsKey PointsKeyDir2(5, PointsTypeDir2);
1374 Nektar::LibUtilities::BasisType basisTypeDir2 =
1376 const Nektar::LibUtilities::BasisKey basisKeyDir2(basisTypeDir2, 4,
1377 PointsKeyDir2);
1378
1379 Nektar::LibUtilities::PointsType PointsTypeDir3 =
1380 Nektar::LibUtilities::eGaussRadauMAlpha2Beta0;
1381 const Nektar::LibUtilities::PointsKey PointsKeyDir3(4, PointsTypeDir3);
1382 Nektar::LibUtilities::BasisType basisTypeDir3 =
1384 const Nektar::LibUtilities::BasisKey basisKeyDir3(basisTypeDir3, 4,
1385 PointsKeyDir3);
1386
1389 basisKeyDir1, basisKeyDir2, basisKeyDir3, pyrGeom);
1390
1391 int nelmts = NELMTS;
1392
1393 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1394 for (int i = 0; i < nelmts; ++i)
1395 {
1396 CollExp.push_back(Exp);
1397 }
1398
1400 Collections::CollectionOptimisation colOpt(dummySession, 3,
1404 Collections::Collection c(CollExp, impTypes);
1405 c.Initialise(Collections::eIProductWRTBase);
1406
1407 const int nq = Exp->GetTotPoints();
1408 Array<OneD, NekDouble> phys(nelmts * nq, 0.0);
1409 Array<OneD, NekDouble> coeffs1(nelmts * Exp->GetNcoeffs(), 0.0);
1410 Array<OneD, NekDouble> coeffs2(nelmts * Exp->GetNcoeffs(), 0.0);
1412 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
1413
1414 Exp->GetCoords(xc, yc, zc);
1415
1416 for (int i = 0; i < nq; ++i)
1417 {
1418 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
1419 }
1420 Exp->IProductWRTBase(phys, coeffs1);
1421
1422 for (int i = 1; i < nelmts; ++i)
1423 {
1424 Vmath::Vcopy(nq, &phys[0], 1, &phys[i * nq], 1);
1425 Exp->IProductWRTBase(phys + i * nq,
1426 tmp = coeffs1 + i * Exp->GetNcoeffs());
1427 }
1428
1429 LibUtilities::Timer timer;
1430 timer.Start();
1431 c.ApplyOperator(Collections::eIProductWRTBase, phys, coeffs2);
1432 timer.Stop();
1433 timer.AccumulateRegion("Pyr IProdWRTB SumFactor");
1434
1435 double epsilon = 1.0e-8;
1436 for (int i = 0; i < coeffs1.size(); ++i)
1437 {
1438 // clamp values below 1e-14 to zero
1439 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
1440 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
1441 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1442 }
1443}

References Nektar::LibUtilities::Timer::AccumulateRegion(), Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::Collection::ApplyOperator(), CreatePyr(), Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::Collections::eIProductWRTBase, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::Collections::eSumFac, Nektar::Collections::Collection::Initialise(), NELMTS, Nektar::LibUtilities::Timer::Start(), Nektar::LibUtilities::Timer::Stop(), and Vmath::Vcopy().

◆ BOOST_AUTO_TEST_CASE() [20/36]

Nektar::PyrCollectionTests::BOOST_AUTO_TEST_CASE ( TestPyrIProductWRTBase_SumFac_VariableP_MultiElmt  )

Definition at line 1629 of file TestPyrCollection.cpp.

1630{
1632 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
1634 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
1636 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
1638 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
1640 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
1641
1642 SpatialDomains::PyrGeomSharedPtr pyrGeom = CreatePyr(v0, v1, v2, v3, v4);
1643
1644 Nektar::LibUtilities::PointsType PointsTypeDir1 =
1646 const Nektar::LibUtilities::PointsKey PointsKeyDir1(5, PointsTypeDir1);
1647 Nektar::LibUtilities::BasisType basisTypeDir1 =
1649 const Nektar::LibUtilities::BasisKey basisKeyDir1(basisTypeDir1, 4,
1650 PointsKeyDir1);
1651
1652 Nektar::LibUtilities::PointsType PointsTypeDir2 =
1654 const Nektar::LibUtilities::PointsKey PointsKeyDir2(7, PointsTypeDir2);
1655 Nektar::LibUtilities::BasisType basisTypeDir2 =
1657 const Nektar::LibUtilities::BasisKey basisKeyDir2(basisTypeDir2, 6,
1658 PointsKeyDir2);
1659
1660 Nektar::LibUtilities::PointsType PointsTypeDir3 =
1661 Nektar::LibUtilities::eGaussRadauMAlpha2Beta0;
1662 const Nektar::LibUtilities::PointsKey PointsKeyDir3(8, PointsTypeDir3);
1663 Nektar::LibUtilities::BasisType basisTypeDir3 =
1665 const Nektar::LibUtilities::BasisKey basisKeyDir3(basisTypeDir3, 8,
1666 PointsKeyDir3);
1667
1670 basisKeyDir1, basisKeyDir2, basisKeyDir3, pyrGeom);
1671
1672 int nelmts = 10;
1673
1674 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1675 for (int i = 0; i < nelmts; ++i)
1676 {
1677 CollExp.push_back(Exp);
1678 }
1679
1681 Collections::CollectionOptimisation colOpt(dummySession, 3,
1685 Collections::Collection c(CollExp, impTypes);
1686 c.Initialise(Collections::eIProductWRTBase);
1687
1688 const int nq = Exp->GetTotPoints();
1689 Array<OneD, NekDouble> phys(nelmts * nq, 0.0);
1690 Array<OneD, NekDouble> coeffs1(nelmts * Exp->GetNcoeffs(), 0.0);
1691 Array<OneD, NekDouble> coeffs2(nelmts * Exp->GetNcoeffs(), 0.0);
1693 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
1694
1695 Exp->GetCoords(xc, yc, zc);
1696
1697 for (int i = 0; i < nq; ++i)
1698 {
1699 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
1700 }
1701 Exp->IProductWRTBase(phys, coeffs1);
1702
1703 for (int i = 1; i < nelmts; ++i)
1704 {
1705 Vmath::Vcopy(nq, &phys[0], 1, &phys[i * nq], 1);
1706 Exp->IProductWRTBase(phys + i * nq,
1707 tmp = coeffs1 + i * Exp->GetNcoeffs());
1708 }
1709
1710 c.ApplyOperator(Collections::eIProductWRTBase, phys, coeffs2);
1711
1712 double epsilon = 1.0e-8;
1713 for (int i = 0; i < coeffs1.size(); ++i)
1714 {
1715 // clamp values below 1e-14 to zero
1716 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
1717 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
1718 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
1719 }
1720}

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::Collection::ApplyOperator(), CreatePyr(), Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::Collections::eIProductWRTBase, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::Collections::eSumFac, Nektar::Collections::Collection::Initialise(), and Vmath::Vcopy().

◆ BOOST_AUTO_TEST_CASE() [21/36]

Nektar::PyrCollectionTests::BOOST_AUTO_TEST_CASE ( TestPyrIProductWRTDerivBase_IterPerExp_UniformP_MultiElmt  )

Definition at line 1925 of file TestPyrCollection.cpp.

1926{
1928 new SpatialDomains::PointGeom(3u, 0u, -1.5, -1.5, -1.5));
1930 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
1932 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
1934 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
1936 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
1937
1938 SpatialDomains::PyrGeomSharedPtr pyrGeom = CreatePyr(v0, v1, v2, v3, v4);
1939
1940 Nektar::LibUtilities::PointsType PointsTypeDir1 =
1942 const Nektar::LibUtilities::PointsKey PointsKeyDir1(5, PointsTypeDir1);
1943 Nektar::LibUtilities::BasisType basisTypeDir1 =
1945 const Nektar::LibUtilities::BasisKey basisKeyDir1(basisTypeDir1, 4,
1946 PointsKeyDir1);
1947
1948 Nektar::LibUtilities::PointsType PointsTypeDir2 =
1950 const Nektar::LibUtilities::PointsKey PointsKeyDir2(5, PointsTypeDir2);
1951 Nektar::LibUtilities::BasisType basisTypeDir2 =
1953 const Nektar::LibUtilities::BasisKey basisKeyDir2(basisTypeDir2, 4,
1954 PointsKeyDir2);
1955
1956 Nektar::LibUtilities::PointsType PointsTypeDir3 =
1957 Nektar::LibUtilities::eGaussRadauMAlpha2Beta0;
1958 const Nektar::LibUtilities::PointsKey PointsKeyDir3(4, PointsTypeDir3);
1959 Nektar::LibUtilities::BasisType basisTypeDir3 =
1961 const Nektar::LibUtilities::BasisKey basisKeyDir3(basisTypeDir3, 4,
1962 PointsKeyDir3);
1963
1966 basisKeyDir1, basisKeyDir2, basisKeyDir3, pyrGeom);
1967
1968 int nelmts = NELMTS;
1969
1970 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1971 for (int i = 0; i < nelmts; ++i)
1972 {
1973 CollExp.push_back(Exp);
1974 }
1975
1977 Collections::CollectionOptimisation colOpt(dummySession, 3,
1979 Collections::OperatorImpMap impTypes = colOpt.GetOperatorImpMap(Exp);
1980 Collections::Collection c(CollExp, impTypes);
1982
1983 const int nq = Exp->GetTotPoints();
1984 const int nm = Exp->GetNcoeffs();
1985 Array<OneD, NekDouble> phys1(nelmts * nq), tmp;
1986 Array<OneD, NekDouble> phys2(nelmts * nq);
1987 Array<OneD, NekDouble> phys3(nelmts * nq);
1988 Array<OneD, NekDouble> coeffs1(nelmts * nm);
1989 Array<OneD, NekDouble> coeffs2(nelmts * nm);
1990
1991 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
1992
1993 Exp->GetCoords(xc, yc, zc);
1994
1995 for (int i = 0; i < nq; ++i)
1996 {
1997 phys1[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
1998 phys2[i] = cos(xc[i]) * sin(yc[i]) * cos(zc[i]);
1999 phys3[i] = cos(xc[i]) * sin(yc[i]) * sin(zc[i]);
2000 }
2001 for (int i = 1; i < nelmts; ++i)
2002 {
2003 Vmath::Vcopy(nq, phys1, 1, tmp = phys1 + i * nq, 1);
2004 Vmath::Vcopy(nq, phys2, 1, tmp = phys2 + i * nq, 1);
2005 Vmath::Vcopy(nq, phys3, 1, tmp = phys3 + i * nq, 1);
2006 }
2007
2008 // Standard routines
2009 for (int i = 0; i < nelmts; ++i)
2010 {
2011 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
2012 Exp->IProductWRTDerivBase(1, phys2 + i * nq, tmp = coeffs2 + i * nm);
2013 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2014 tmp = coeffs1 + i * nm, 1);
2015 Exp->IProductWRTDerivBase(2, phys3 + i * nq, tmp = coeffs2 + i * nm);
2016 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2017 tmp = coeffs1 + i * nm, 1);
2018 }
2019
2020 LibUtilities::Timer timer;
2021 timer.Start();
2022 c.ApplyOperator(Collections::eIProductWRTDerivBase, phys1, phys2, phys3,
2023 coeffs2);
2024 timer.Stop();
2025 timer.AccumulateRegion("Pyr IProdWRTDB IterPerExp");
2026
2027 double epsilon = 1.0e-8;
2028 for (int i = 0; i < coeffs1.size(); ++i)
2029 {
2030 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
2031 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
2032 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
2033 }
2034}
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
Definition: Vmath.hpp:180

References Nektar::LibUtilities::Timer::AccumulateRegion(), Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::Collection::ApplyOperator(), CreatePyr(), Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::Collections::eIProductWRTDerivBase, Nektar::Collections::eIterPerExp, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::Collections::CollectionOptimisation::GetOperatorImpMap(), Nektar::Collections::Collection::Initialise(), NELMTS, Nektar::LibUtilities::Timer::Start(), Nektar::LibUtilities::Timer::Stop(), Vmath::Vadd(), and Vmath::Vcopy().

◆ BOOST_AUTO_TEST_CASE() [22/36]

Nektar::PyrCollectionTests::BOOST_AUTO_TEST_CASE ( TestPyrIProductWRTDerivBase_IterPerExp_VariableP_MultiElmt  )

Definition at line 2254 of file TestPyrCollection.cpp.

2255{
2257 new SpatialDomains::PointGeom(3u, 0u, -1.5, -1.5, -1.5));
2259 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
2261 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
2263 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
2265 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
2266
2267 SpatialDomains::PyrGeomSharedPtr pyrGeom = CreatePyr(v0, v1, v2, v3, v4);
2268
2269 Nektar::LibUtilities::PointsType PointsTypeDir1 =
2271 const Nektar::LibUtilities::PointsKey PointsKeyDir1(5, PointsTypeDir1);
2272 Nektar::LibUtilities::BasisType basisTypeDir1 =
2274 const Nektar::LibUtilities::BasisKey basisKeyDir1(basisTypeDir1, 4,
2275 PointsKeyDir1);
2276
2277 Nektar::LibUtilities::PointsType PointsTypeDir2 =
2279 const Nektar::LibUtilities::PointsKey PointsKeyDir2(7, PointsTypeDir2);
2280 Nektar::LibUtilities::BasisType basisTypeDir2 =
2282 const Nektar::LibUtilities::BasisKey basisKeyDir2(basisTypeDir2, 6,
2283 PointsKeyDir2);
2284
2285 Nektar::LibUtilities::PointsType PointsTypeDir3 =
2286 Nektar::LibUtilities::eGaussRadauMAlpha2Beta0;
2287 const Nektar::LibUtilities::PointsKey PointsKeyDir3(8, PointsTypeDir3);
2288 Nektar::LibUtilities::BasisType basisTypeDir3 =
2290 const Nektar::LibUtilities::BasisKey basisKeyDir3(basisTypeDir3, 8,
2291 PointsKeyDir3);
2292
2295 basisKeyDir1, basisKeyDir2, basisKeyDir3, pyrGeom);
2296
2297 int nelmts = 10;
2298
2299 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2300 for (int i = 0; i < nelmts; ++i)
2301 {
2302 CollExp.push_back(Exp);
2303 }
2304
2306 Collections::CollectionOptimisation colOpt(dummySession, 3,
2308 Collections::OperatorImpMap impTypes = colOpt.GetOperatorImpMap(Exp);
2309 Collections::Collection c(CollExp, impTypes);
2311
2312 const int nq = Exp->GetTotPoints();
2313 const int nm = Exp->GetNcoeffs();
2314 Array<OneD, NekDouble> phys1(nelmts * nq), tmp;
2315 Array<OneD, NekDouble> phys2(nelmts * nq);
2316 Array<OneD, NekDouble> phys3(nelmts * nq);
2317 Array<OneD, NekDouble> coeffs1(nelmts * nm);
2318 Array<OneD, NekDouble> coeffs2(nelmts * nm);
2319
2320 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
2321
2322 Exp->GetCoords(xc, yc, zc);
2323
2324 for (int i = 0; i < nq; ++i)
2325 {
2326 phys1[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
2327 phys2[i] = cos(xc[i]) * sin(yc[i]) * cos(zc[i]);
2328 phys3[i] = cos(xc[i]) * sin(yc[i]) * sin(zc[i]);
2329 }
2330 for (int i = 1; i < nelmts; ++i)
2331 {
2332 Vmath::Vcopy(nq, phys1, 1, tmp = phys1 + i * nq, 1);
2333 Vmath::Vcopy(nq, phys2, 1, tmp = phys2 + i * nq, 1);
2334 Vmath::Vcopy(nq, phys3, 1, tmp = phys3 + i * nq, 1);
2335 }
2336
2337 // Standard routines
2338 for (int i = 0; i < nelmts; ++i)
2339 {
2340 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
2341 Exp->IProductWRTDerivBase(1, phys2 + i * nq, tmp = coeffs2 + i * nm);
2342 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2343 tmp = coeffs1 + i * nm, 1);
2344 Exp->IProductWRTDerivBase(2, phys3 + i * nq, tmp = coeffs2 + i * nm);
2345 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2346 tmp = coeffs1 + i * nm, 1);
2347 }
2348
2349 c.ApplyOperator(Collections::eIProductWRTDerivBase, phys1, phys2, phys3,
2350 coeffs2);
2351
2352 double epsilon = 1.0e-8;
2353 for (int i = 0; i < coeffs1.size(); ++i)
2354 {
2355 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
2356 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
2357 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
2358 }
2359}

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::Collection::ApplyOperator(), CreatePyr(), Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::Collections::eIProductWRTDerivBase, Nektar::Collections::eIterPerExp, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::Collections::CollectionOptimisation::GetOperatorImpMap(), Nektar::Collections::Collection::Initialise(), Vmath::Vadd(), and Vmath::Vcopy().

◆ BOOST_AUTO_TEST_CASE() [23/36]

Nektar::PyrCollectionTests::BOOST_AUTO_TEST_CASE ( TestPyrIProductWRTDerivBase_MatrixFree_Deformed_MultiElmt  )

Definition at line 2361 of file TestPyrCollection.cpp.

2362{
2364 new SpatialDomains::PointGeom(3u, 0u, -1.5, -1.5, -1.5));
2366 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
2368 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
2370 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
2372 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
2373
2374 SpatialDomains::PyrGeomSharedPtr pyrGeom = CreatePyr(v0, v1, v2, v3, v4);
2375
2376 unsigned int numQuadPoints = 5;
2377 unsigned int numModes = 4;
2378
2379 Nektar::LibUtilities::PointsType PointsTypeDir1 =
2381 const Nektar::LibUtilities::PointsKey PointsKeyDir1(numQuadPoints,
2382 PointsTypeDir1);
2383 Nektar::LibUtilities::BasisType basisTypeDir1 =
2385 const Nektar::LibUtilities::BasisKey basisKeyDir1(basisTypeDir1, numModes,
2386 PointsKeyDir1);
2387
2388 Nektar::LibUtilities::PointsType PointsTypeDir2 =
2390 const Nektar::LibUtilities::PointsKey PointsKeyDir2(numQuadPoints,
2391 PointsTypeDir2);
2392 Nektar::LibUtilities::BasisType basisTypeDir2 =
2394 const Nektar::LibUtilities::BasisKey basisKeyDir2(basisTypeDir2, numModes,
2395 PointsKeyDir2);
2396
2397 Nektar::LibUtilities::PointsType PointsTypeDir3 =
2398 Nektar::LibUtilities::eGaussRadauMAlpha2Beta0;
2399 const Nektar::LibUtilities::PointsKey PointsKeyDir3(numQuadPoints - 1,
2400 PointsTypeDir3);
2401 Nektar::LibUtilities::BasisType basisTypeDir3 =
2403 const Nektar::LibUtilities::BasisKey basisKeyDir3(basisTypeDir3, numModes,
2404 PointsKeyDir3);
2405
2408 basisKeyDir1, basisKeyDir2, basisKeyDir3, pyrGeom);
2409
2410 int nelmts = NELMTS;
2411
2412 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2413 for (int i = 0; i < nelmts; ++i)
2414 {
2415 CollExp.push_back(Exp);
2416 }
2417
2419 Collections::CollectionOptimisation colOpt(dummySession, 2,
2421 Collections::OperatorImpMap impTypes = colOpt.GetOperatorImpMap(Exp);
2422 Collections::Collection c(CollExp, impTypes);
2424
2425 const int nq = Exp->GetTotPoints();
2426 const int nm = Exp->GetNcoeffs();
2427 Array<OneD, NekDouble> phys1(nelmts * nq), tmp;
2428 Array<OneD, NekDouble> phys2(nelmts * nq);
2429 Array<OneD, NekDouble> phys3(nelmts * nq);
2430 Array<OneD, NekDouble> coeffs1(nelmts * nm);
2431 Array<OneD, NekDouble> coeffs2(nelmts * nm);
2432
2433 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
2434 Exp->GetCoords(xc, yc, zc);
2435
2436 for (int i = 0; i < nq; ++i)
2437 {
2438 phys1[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
2439 phys2[i] = cos(xc[i]) * sin(yc[i]) * cos(zc[i]);
2440 phys3[i] = cos(xc[i]) * sin(yc[i]) * sin(zc[i]);
2441 }
2442 for (int i = 1; i < nelmts; ++i)
2443 {
2444 Vmath::Vcopy(nq, phys1, 1, tmp = phys1 + i * nq, 1);
2445 Vmath::Vcopy(nq, phys2, 1, tmp = phys2 + i * nq, 1);
2446 Vmath::Vcopy(nq, phys3, 1, tmp = phys3 + i * nq, 1);
2447 }
2448
2449 // Standard routines
2450 for (int i = 0; i < nelmts; ++i)
2451 {
2452 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
2453 Exp->IProductWRTDerivBase(1, phys2 + i * nq, tmp = coeffs2 + i * nm);
2454 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2455 tmp = coeffs1 + i * nm, 1);
2456 Exp->IProductWRTDerivBase(2, phys3 + i * nq, tmp = coeffs2 + i * nm);
2457 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2458 tmp = coeffs1 + i * nm, 1);
2459 }
2460
2461 LibUtilities::Timer timer;
2462 timer.Start();
2463 c.ApplyOperator(Collections::eIProductWRTDerivBase, phys1, phys2, phys3,
2464 coeffs2);
2465 timer.Stop();
2466 timer.AccumulateRegion("Pyr IProdWRTDB MatrixFree");
2467
2468 double epsilon = 1.0e-8;
2469 for (int i = 0; i < coeffs1.size(); ++i)
2470 {
2471 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
2472 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
2473 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
2474 }
2475}

References Nektar::LibUtilities::Timer::AccumulateRegion(), Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::Collection::ApplyOperator(), CreatePyr(), Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::Collections::eIProductWRTDerivBase, Nektar::Collections::eMatrixFree, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::Collections::CollectionOptimisation::GetOperatorImpMap(), Nektar::Collections::Collection::Initialise(), NELMTS, Nektar::LibUtilities::Timer::Start(), Nektar::LibUtilities::Timer::Stop(), Vmath::Vadd(), and Vmath::Vcopy().

◆ BOOST_AUTO_TEST_CASE() [24/36]

Nektar::PyrCollectionTests::BOOST_AUTO_TEST_CASE ( TestPyrIProductWRTDerivBase_MatrixFree_Deformed_MultiElmt_OverInt  )

Definition at line 2476 of file TestPyrCollection.cpp.

2478{
2480 new SpatialDomains::PointGeom(3u, 0u, -1.5, -1.5, -1.5));
2482 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
2484 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
2486 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
2488 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
2489
2490 SpatialDomains::PyrGeomSharedPtr pyrGeom = CreatePyr(v0, v1, v2, v3, v4);
2491
2492 unsigned int numQuadPoints = 8;
2493 unsigned int numModes = 4;
2494
2495 Nektar::LibUtilities::PointsType PointsTypeDir1 =
2497 const Nektar::LibUtilities::PointsKey PointsKeyDir1(numQuadPoints,
2498 PointsTypeDir1);
2499 Nektar::LibUtilities::BasisType basisTypeDir1 =
2501 const Nektar::LibUtilities::BasisKey basisKeyDir1(basisTypeDir1, numModes,
2502 PointsKeyDir1);
2503
2504 Nektar::LibUtilities::PointsType PointsTypeDir2 =
2506 const Nektar::LibUtilities::PointsKey PointsKeyDir2(numQuadPoints,
2507 PointsTypeDir2);
2508 Nektar::LibUtilities::BasisType basisTypeDir2 =
2510 const Nektar::LibUtilities::BasisKey basisKeyDir2(basisTypeDir2, numModes,
2511 PointsKeyDir2);
2512
2513 Nektar::LibUtilities::PointsType PointsTypeDir3 =
2514 Nektar::LibUtilities::eGaussRadauMAlpha2Beta0;
2515 const Nektar::LibUtilities::PointsKey PointsKeyDir3(numQuadPoints - 1,
2516 PointsTypeDir3);
2517 Nektar::LibUtilities::BasisType basisTypeDir3 =
2519 const Nektar::LibUtilities::BasisKey basisKeyDir3(basisTypeDir3, numModes,
2520 PointsKeyDir3);
2521
2524 basisKeyDir1, basisKeyDir2, basisKeyDir3, pyrGeom);
2525
2526 int nelmts = 5;
2527
2528 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2529 for (int i = 0; i < nelmts; ++i)
2530 {
2531 CollExp.push_back(Exp);
2532 }
2533
2535 Collections::CollectionOptimisation colOpt(dummySession, 2,
2537 Collections::OperatorImpMap impTypes = colOpt.GetOperatorImpMap(Exp);
2538 Collections::Collection c(CollExp, impTypes);
2540
2541 const int nq = Exp->GetTotPoints();
2542 const int nm = Exp->GetNcoeffs();
2543 Array<OneD, NekDouble> phys1(nelmts * nq), tmp;
2544 Array<OneD, NekDouble> phys2(nelmts * nq);
2545 Array<OneD, NekDouble> phys3(nelmts * nq);
2546 Array<OneD, NekDouble> coeffs1(nelmts * nm);
2547 Array<OneD, NekDouble> coeffs2(nelmts * nm);
2548
2549 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
2550 Exp->GetCoords(xc, yc, zc);
2551
2552 for (int i = 0; i < nq; ++i)
2553 {
2554 phys1[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
2555 phys2[i] = cos(xc[i]) * sin(yc[i]) * cos(zc[i]);
2556 phys3[i] = cos(xc[i]) * sin(yc[i]) * sin(zc[i]);
2557 }
2558 for (int i = 1; i < nelmts; ++i)
2559 {
2560 Vmath::Vcopy(nq, phys1, 1, tmp = phys1 + i * nq, 1);
2561 Vmath::Vcopy(nq, phys2, 1, tmp = phys2 + i * nq, 1);
2562 Vmath::Vcopy(nq, phys3, 1, tmp = phys3 + i * nq, 1);
2563 }
2564
2565 // Standard routines
2566 for (int i = 0; i < nelmts; ++i)
2567 {
2568 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
2569 Exp->IProductWRTDerivBase(1, phys2 + i * nq, tmp = coeffs2 + i * nm);
2570 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2571 tmp = coeffs1 + i * nm, 1);
2572 Exp->IProductWRTDerivBase(2, phys3 + i * nq, tmp = coeffs2 + i * nm);
2573 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2574 tmp = coeffs1 + i * nm, 1);
2575 }
2576
2577 c.ApplyOperator(Collections::eIProductWRTDerivBase, phys1, phys2, phys3,
2578 coeffs2);
2579
2580 double epsilon = 1.0e-8;
2581 for (int i = 0; i < coeffs1.size(); ++i)
2582 {
2583 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
2584 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
2585 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
2586 }
2587}

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::Collection::ApplyOperator(), CreatePyr(), Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::Collections::eIProductWRTDerivBase, Nektar::Collections::eMatrixFree, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::Collections::CollectionOptimisation::GetOperatorImpMap(), Nektar::Collections::Collection::Initialise(), Vmath::Vadd(), and Vmath::Vcopy().

◆ BOOST_AUTO_TEST_CASE() [25/36]

Nektar::PyrCollectionTests::BOOST_AUTO_TEST_CASE ( TestPyrIProductWRTDerivBase_StdMat_UniformP_MultiElmt  )

Definition at line 2036 of file TestPyrCollection.cpp.

2037{
2039 new SpatialDomains::PointGeom(3u, 0u, -1.5, -1.5, -1.5));
2041 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
2043 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
2045 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
2047 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
2048
2049 SpatialDomains::PyrGeomSharedPtr pyrGeom = CreatePyr(v0, v1, v2, v3, v4);
2050
2051 Nektar::LibUtilities::PointsType PointsTypeDir1 =
2053 const Nektar::LibUtilities::PointsKey PointsKeyDir1(5, PointsTypeDir1);
2054 Nektar::LibUtilities::BasisType basisTypeDir1 =
2056 const Nektar::LibUtilities::BasisKey basisKeyDir1(basisTypeDir1, 4,
2057 PointsKeyDir1);
2058
2059 Nektar::LibUtilities::PointsType PointsTypeDir2 =
2061 const Nektar::LibUtilities::PointsKey PointsKeyDir2(5, PointsTypeDir2);
2062 Nektar::LibUtilities::BasisType basisTypeDir2 =
2064 const Nektar::LibUtilities::BasisKey basisKeyDir2(basisTypeDir2, 4,
2065 PointsKeyDir2);
2066
2067 Nektar::LibUtilities::PointsType PointsTypeDir3 =
2068 Nektar::LibUtilities::eGaussRadauMAlpha2Beta0;
2069 const Nektar::LibUtilities::PointsKey PointsKeyDir3(4, PointsTypeDir3);
2070 Nektar::LibUtilities::BasisType basisTypeDir3 =
2072 const Nektar::LibUtilities::BasisKey basisKeyDir3(basisTypeDir3, 4,
2073 PointsKeyDir3);
2074
2077 basisKeyDir1, basisKeyDir2, basisKeyDir3, pyrGeom);
2078
2079 int nelmts = 10;
2080
2081 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2082 for (int i = 0; i < nelmts; ++i)
2083 {
2084 CollExp.push_back(Exp);
2085 }
2086
2088 Collections::CollectionOptimisation colOpt(dummySession, 3,
2090 Collections::OperatorImpMap impTypes = colOpt.GetOperatorImpMap(Exp);
2091 Collections::Collection c(CollExp, impTypes);
2093
2094 const int nq = Exp->GetTotPoints();
2095 const int nm = Exp->GetNcoeffs();
2096 Array<OneD, NekDouble> phys1(nelmts * nq), tmp;
2097 Array<OneD, NekDouble> phys2(nelmts * nq);
2098 Array<OneD, NekDouble> phys3(nelmts * nq);
2099 Array<OneD, NekDouble> coeffs1(nelmts * nm);
2100 Array<OneD, NekDouble> coeffs2(nelmts * nm);
2101
2102 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
2103
2104 Exp->GetCoords(xc, yc, zc);
2105
2106 for (int i = 0; i < nq; ++i)
2107 {
2108 phys1[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
2109 phys2[i] = cos(xc[i]) * sin(yc[i]) * cos(zc[i]);
2110 phys3[i] = cos(xc[i]) * sin(yc[i]) * sin(zc[i]);
2111 }
2112 for (int i = 1; i < nelmts; ++i)
2113 {
2114 Vmath::Vcopy(nq, phys1, 1, tmp = phys1 + i * nq, 1);
2115 Vmath::Vcopy(nq, phys2, 1, tmp = phys2 + i * nq, 1);
2116 Vmath::Vcopy(nq, phys3, 1, tmp = phys3 + i * nq, 1);
2117 }
2118
2119 // Standard routines
2120 for (int i = 0; i < nelmts; ++i)
2121 {
2122 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
2123 Exp->IProductWRTDerivBase(1, phys2 + i * nq, tmp = coeffs2 + i * nm);
2124 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2125 tmp = coeffs1 + i * nm, 1);
2126 Exp->IProductWRTDerivBase(2, phys3 + i * nq, tmp = coeffs2 + i * nm);
2127 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2128 tmp = coeffs1 + i * nm, 1);
2129 }
2130
2131 c.ApplyOperator(Collections::eIProductWRTDerivBase, phys1, phys2, phys3,
2132 coeffs2);
2133
2134 double epsilon = 1.0e-8;
2135 for (int i = 0; i < coeffs1.size(); ++i)
2136 {
2137 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
2138 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
2139 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
2140 }
2141}

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::Collection::ApplyOperator(), CreatePyr(), Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::Collections::eIProductWRTDerivBase, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::Collections::eStdMat, Nektar::Collections::CollectionOptimisation::GetOperatorImpMap(), Nektar::Collections::Collection::Initialise(), Vmath::Vadd(), and Vmath::Vcopy().

◆ BOOST_AUTO_TEST_CASE() [26/36]

Nektar::PyrCollectionTests::BOOST_AUTO_TEST_CASE ( TestPyrIProductWRTDerivBase_StdMat_VariableP_MultiElmt  )

Definition at line 2765 of file TestPyrCollection.cpp.

2766{
2768 new SpatialDomains::PointGeom(3u, 0u, -1.5, -1.5, -1.5));
2770 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
2772 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
2774 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
2776 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
2777
2778 SpatialDomains::PyrGeomSharedPtr pyrGeom = CreatePyr(v0, v1, v2, v3, v4);
2779
2780 Nektar::LibUtilities::PointsType PointsTypeDir1 =
2782 const Nektar::LibUtilities::PointsKey PointsKeyDir1(5, PointsTypeDir1);
2783 Nektar::LibUtilities::BasisType basisTypeDir1 =
2785 const Nektar::LibUtilities::BasisKey basisKeyDir1(basisTypeDir1, 4,
2786 PointsKeyDir1);
2787
2788 Nektar::LibUtilities::PointsType PointsTypeDir2 =
2790 const Nektar::LibUtilities::PointsKey PointsKeyDir2(7, PointsTypeDir2);
2791 Nektar::LibUtilities::BasisType basisTypeDir2 =
2793 const Nektar::LibUtilities::BasisKey basisKeyDir2(basisTypeDir2, 6,
2794 PointsKeyDir2);
2795
2796 Nektar::LibUtilities::PointsType PointsTypeDir3 =
2797 Nektar::LibUtilities::eGaussRadauMAlpha2Beta0;
2798 const Nektar::LibUtilities::PointsKey PointsKeyDir3(8, PointsTypeDir3);
2799 Nektar::LibUtilities::BasisType basisTypeDir3 =
2801 const Nektar::LibUtilities::BasisKey basisKeyDir3(basisTypeDir3, 8,
2802 PointsKeyDir3);
2803
2806 basisKeyDir1, basisKeyDir2, basisKeyDir3, pyrGeom);
2807
2808 int nelmts = 10;
2809
2810 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2811 for (int i = 0; i < nelmts; ++i)
2812 {
2813 CollExp.push_back(Exp);
2814 }
2815
2817 Collections::CollectionOptimisation colOpt(dummySession, 3,
2819 Collections::OperatorImpMap impTypes = colOpt.GetOperatorImpMap(Exp);
2820 Collections::Collection c(CollExp, impTypes);
2822
2823 const int nq = Exp->GetTotPoints();
2824 const int nm = Exp->GetNcoeffs();
2825 Array<OneD, NekDouble> phys1(nelmts * nq), tmp;
2826 Array<OneD, NekDouble> phys2(nelmts * nq);
2827 Array<OneD, NekDouble> phys3(nelmts * nq);
2828 Array<OneD, NekDouble> coeffs1(nelmts * nm);
2829 Array<OneD, NekDouble> coeffs2(nelmts * nm);
2830
2831 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
2832
2833 Exp->GetCoords(xc, yc, zc);
2834
2835 for (int i = 0; i < nq; ++i)
2836 {
2837 phys1[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
2838 phys2[i] = cos(xc[i]) * sin(yc[i]) * cos(zc[i]);
2839 phys3[i] = cos(xc[i]) * sin(yc[i]) * sin(zc[i]);
2840 }
2841 for (int i = 1; i < nelmts; ++i)
2842 {
2843 Vmath::Vcopy(nq, phys1, 1, tmp = phys1 + i * nq, 1);
2844 Vmath::Vcopy(nq, phys2, 1, tmp = phys2 + i * nq, 1);
2845 Vmath::Vcopy(nq, phys3, 1, tmp = phys3 + i * nq, 1);
2846 }
2847
2848 // Standard routines
2849 for (int i = 0; i < nelmts; ++i)
2850 {
2851 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
2852 Exp->IProductWRTDerivBase(1, phys2 + i * nq, tmp = coeffs2 + i * nm);
2853 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2854 tmp = coeffs1 + i * nm, 1);
2855 Exp->IProductWRTDerivBase(2, phys3 + i * nq, tmp = coeffs2 + i * nm);
2856 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2857 tmp = coeffs1 + i * nm, 1);
2858 }
2859
2860 c.ApplyOperator(Collections::eIProductWRTDerivBase, phys1, phys2, phys3,
2861 coeffs2);
2862
2863 double epsilon = 1.0e-8;
2864 for (int i = 0; i < coeffs1.size(); ++i)
2865 {
2866 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
2867 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
2868 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
2869 }
2870}

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::Collection::ApplyOperator(), CreatePyr(), Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::Collections::eIProductWRTDerivBase, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::Collections::eStdMat, Nektar::Collections::CollectionOptimisation::GetOperatorImpMap(), Nektar::Collections::Collection::Initialise(), Vmath::Vadd(), and Vmath::Vcopy().

◆ BOOST_AUTO_TEST_CASE() [27/36]

Nektar::PyrCollectionTests::BOOST_AUTO_TEST_CASE ( TestPyrIProductWRTDerivBase_SumFac_UniformP_MultiElmt  )

Definition at line 2143 of file TestPyrCollection.cpp.

2144{
2146 new SpatialDomains::PointGeom(3u, 0u, -1.5, -1.5, -1.5));
2148 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
2150 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
2152 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
2154 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
2155
2156 SpatialDomains::PyrGeomSharedPtr pyrGeom = CreatePyr(v0, v1, v2, v3, v4);
2157
2158 Nektar::LibUtilities::PointsType PointsTypeDir1 =
2160 const Nektar::LibUtilities::PointsKey PointsKeyDir1(5, PointsTypeDir1);
2161 Nektar::LibUtilities::BasisType basisTypeDir1 =
2163 const Nektar::LibUtilities::BasisKey basisKeyDir1(basisTypeDir1, 4,
2164 PointsKeyDir1);
2165
2166 Nektar::LibUtilities::PointsType PointsTypeDir2 =
2168 const Nektar::LibUtilities::PointsKey PointsKeyDir2(5, PointsTypeDir2);
2169 Nektar::LibUtilities::BasisType basisTypeDir2 =
2171 const Nektar::LibUtilities::BasisKey basisKeyDir2(basisTypeDir2, 4,
2172 PointsKeyDir2);
2173
2174 Nektar::LibUtilities::PointsType PointsTypeDir3 =
2175 Nektar::LibUtilities::eGaussRadauMAlpha2Beta0;
2176 const Nektar::LibUtilities::PointsKey PointsKeyDir3(4, PointsTypeDir3);
2177 Nektar::LibUtilities::BasisType basisTypeDir3 =
2179 const Nektar::LibUtilities::BasisKey basisKeyDir3(basisTypeDir3, 4,
2180 PointsKeyDir3);
2181
2184 basisKeyDir1, basisKeyDir2, basisKeyDir3, pyrGeom);
2185
2186 int nelmts = NELMTS;
2187
2188 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2189 for (int i = 0; i < nelmts; ++i)
2190 {
2191 CollExp.push_back(Exp);
2192 }
2193
2195 Collections::CollectionOptimisation colOpt(dummySession, 3,
2197 Collections::OperatorImpMap impTypes = colOpt.GetOperatorImpMap(Exp);
2198 Collections::Collection c(CollExp, impTypes);
2200
2201 const int nq = Exp->GetTotPoints();
2202 const int nm = Exp->GetNcoeffs();
2203 Array<OneD, NekDouble> phys1(nelmts * nq), tmp;
2204 Array<OneD, NekDouble> phys2(nelmts * nq);
2205 Array<OneD, NekDouble> phys3(nelmts * nq);
2206 Array<OneD, NekDouble> coeffs1(nelmts * nm);
2207 Array<OneD, NekDouble> coeffs2(nelmts * nm);
2208
2209 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
2210
2211 Exp->GetCoords(xc, yc, zc);
2212
2213 for (int i = 0; i < nq; ++i)
2214 {
2215 phys1[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
2216 phys2[i] = cos(xc[i]) * sin(yc[i]) * cos(zc[i]);
2217 phys3[i] = cos(xc[i]) * sin(yc[i]) * sin(zc[i]);
2218 }
2219 for (int i = 1; i < nelmts; ++i)
2220 {
2221 Vmath::Vcopy(nq, phys1, 1, tmp = phys1 + i * nq, 1);
2222 Vmath::Vcopy(nq, phys2, 1, tmp = phys2 + i * nq, 1);
2223 Vmath::Vcopy(nq, phys3, 1, tmp = phys3 + i * nq, 1);
2224 }
2225
2226 // Standard routines
2227 for (int i = 0; i < nelmts; ++i)
2228 {
2229 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
2230 Exp->IProductWRTDerivBase(1, phys2 + i * nq, tmp = coeffs2 + i * nm);
2231 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2232 tmp = coeffs1 + i * nm, 1);
2233 Exp->IProductWRTDerivBase(2, phys3 + i * nq, tmp = coeffs2 + i * nm);
2234 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2235 tmp = coeffs1 + i * nm, 1);
2236 }
2237
2238 LibUtilities::Timer timer;
2239 timer.Start();
2240 c.ApplyOperator(Collections::eIProductWRTDerivBase, phys1, phys2, phys3,
2241 coeffs2);
2242 timer.Stop();
2243 timer.AccumulateRegion("Pyr IProdWRTDB SumFactor");
2244
2245 double epsilon = 1.0e-8;
2246 for (int i = 0; i < coeffs1.size(); ++i)
2247 {
2248 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
2249 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
2250 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
2251 }
2252}

References Nektar::LibUtilities::Timer::AccumulateRegion(), Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::Collection::ApplyOperator(), CreatePyr(), Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::Collections::eIProductWRTDerivBase, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::Collections::eSumFac, Nektar::Collections::CollectionOptimisation::GetOperatorImpMap(), Nektar::Collections::Collection::Initialise(), NELMTS, Nektar::LibUtilities::Timer::Start(), Nektar::LibUtilities::Timer::Stop(), Vmath::Vadd(), and Vmath::Vcopy().

◆ BOOST_AUTO_TEST_CASE() [28/36]

Nektar::PyrCollectionTests::BOOST_AUTO_TEST_CASE ( TestPyrIProductWRTDerivBase_SumFac_VariableP_MultiElmt  )

Definition at line 2872 of file TestPyrCollection.cpp.

2873{
2875 new SpatialDomains::PointGeom(3u, 0u, -1.5, -1.5, -1.5));
2877 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
2879 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
2881 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
2883 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
2884
2885 SpatialDomains::PyrGeomSharedPtr pyrGeom = CreatePyr(v0, v1, v2, v3, v4);
2886
2887 Nektar::LibUtilities::PointsType PointsTypeDir1 =
2889 const Nektar::LibUtilities::PointsKey PointsKeyDir1(5, PointsTypeDir1);
2890 Nektar::LibUtilities::BasisType basisTypeDir1 =
2892 const Nektar::LibUtilities::BasisKey basisKeyDir1(basisTypeDir1, 4,
2893 PointsKeyDir1);
2894
2895 Nektar::LibUtilities::PointsType PointsTypeDir2 =
2897 const Nektar::LibUtilities::PointsKey PointsKeyDir2(7, PointsTypeDir2);
2898 Nektar::LibUtilities::BasisType basisTypeDir2 =
2900 const Nektar::LibUtilities::BasisKey basisKeyDir2(basisTypeDir2, 6,
2901 PointsKeyDir2);
2902
2903 Nektar::LibUtilities::PointsType PointsTypeDir3 =
2904 Nektar::LibUtilities::eGaussRadauMAlpha2Beta0;
2905 const Nektar::LibUtilities::PointsKey PointsKeyDir3(8, PointsTypeDir3);
2906 Nektar::LibUtilities::BasisType basisTypeDir3 =
2908 const Nektar::LibUtilities::BasisKey basisKeyDir3(basisTypeDir3, 8,
2909 PointsKeyDir3);
2910
2913 basisKeyDir1, basisKeyDir2, basisKeyDir3, pyrGeom);
2914
2915 int nelmts = 10;
2916
2917 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
2918 for (int i = 0; i < nelmts; ++i)
2919 {
2920 CollExp.push_back(Exp);
2921 }
2922
2924 Collections::CollectionOptimisation colOpt(dummySession, 3,
2926 Collections::OperatorImpMap impTypes = colOpt.GetOperatorImpMap(Exp);
2927 Collections::Collection c(CollExp, impTypes);
2929
2930 const int nq = Exp->GetTotPoints();
2931 const int nm = Exp->GetNcoeffs();
2932 Array<OneD, NekDouble> phys1(nelmts * nq), tmp;
2933 Array<OneD, NekDouble> phys2(nelmts * nq);
2934 Array<OneD, NekDouble> phys3(nelmts * nq);
2935 Array<OneD, NekDouble> coeffs1(nelmts * nm);
2936 Array<OneD, NekDouble> coeffs2(nelmts * nm);
2937
2938 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
2939
2940 Exp->GetCoords(xc, yc, zc);
2941
2942 for (int i = 0; i < nq; ++i)
2943 {
2944 phys1[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
2945 phys2[i] = cos(xc[i]) * sin(yc[i]) * cos(zc[i]);
2946 phys3[i] = cos(xc[i]) * sin(yc[i]) * sin(zc[i]);
2947 }
2948 for (int i = 1; i < nelmts; ++i)
2949 {
2950 Vmath::Vcopy(nq, phys1, 1, tmp = phys1 + i * nq, 1);
2951 Vmath::Vcopy(nq, phys2, 1, tmp = phys2 + i * nq, 1);
2952 Vmath::Vcopy(nq, phys3, 1, tmp = phys3 + i * nq, 1);
2953 }
2954
2955 // Standard routines
2956 for (int i = 0; i < nelmts; ++i)
2957 {
2958 Exp->IProductWRTDerivBase(0, phys1 + i * nq, tmp = coeffs1 + i * nm);
2959 Exp->IProductWRTDerivBase(1, phys2 + i * nq, tmp = coeffs2 + i * nm);
2960 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2961 tmp = coeffs1 + i * nm, 1);
2962 Exp->IProductWRTDerivBase(2, phys3 + i * nq, tmp = coeffs2 + i * nm);
2963 Vmath::Vadd(nm, coeffs1 + i * nm, 1, coeffs2 + i * nm, 1,
2964 tmp = coeffs1 + i * nm, 1);
2965 }
2966
2967 c.ApplyOperator(Collections::eIProductWRTDerivBase, phys1, phys2, phys3,
2968 coeffs2);
2969
2970 double epsilon = 1.0e-8;
2971 for (int i = 0; i < coeffs1.size(); ++i)
2972 {
2973 coeffs1[i] = (fabs(coeffs1[i]) < 1e-14) ? 0.0 : coeffs1[i];
2974 coeffs2[i] = (fabs(coeffs2[i]) < 1e-14) ? 0.0 : coeffs2[i];
2975 BOOST_CHECK_CLOSE(coeffs1[i], coeffs2[i], epsilon);
2976 }
2977}

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::Collection::ApplyOperator(), CreatePyr(), Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::Collections::eIProductWRTDerivBase, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::Collections::eSumFac, Nektar::Collections::CollectionOptimisation::GetOperatorImpMap(), Nektar::Collections::Collection::Initialise(), Vmath::Vadd(), and Vmath::Vcopy().

◆ BOOST_AUTO_TEST_CASE() [29/36]

Nektar::PyrCollectionTests::BOOST_AUTO_TEST_CASE ( TestPyrPhysDeriv_IterPerExp_UniformP_MultiElmt  )

Definition at line 579 of file TestPyrCollection.cpp.

580{
582 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
584 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
586 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
588 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
590 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
591
592 SpatialDomains::PyrGeomSharedPtr pyrGeom = CreatePyr(v0, v1, v2, v3, v4);
593
594 Nektar::LibUtilities::PointsType PointsTypeDir1 =
596 const Nektar::LibUtilities::PointsKey PointsKeyDir1(5, PointsTypeDir1);
597 Nektar::LibUtilities::BasisType basisTypeDir1 =
599 const Nektar::LibUtilities::BasisKey basisKeyDir1(basisTypeDir1, 4,
600 PointsKeyDir1);
601
602 Nektar::LibUtilities::PointsType PointsTypeDir2 =
604 const Nektar::LibUtilities::PointsKey PointsKeyDir2(5, PointsTypeDir2);
605 Nektar::LibUtilities::BasisType basisTypeDir2 =
607 const Nektar::LibUtilities::BasisKey basisKeyDir2(basisTypeDir2, 4,
608 PointsKeyDir2);
609
610 Nektar::LibUtilities::PointsType PointsTypeDir3 =
611 Nektar::LibUtilities::eGaussRadauMAlpha2Beta0;
612 const Nektar::LibUtilities::PointsKey PointsKeyDir3(4, PointsTypeDir3);
613 Nektar::LibUtilities::BasisType basisTypeDir3 =
615 const Nektar::LibUtilities::BasisKey basisKeyDir3(basisTypeDir3, 4,
616 PointsKeyDir3);
617
620 basisKeyDir1, basisKeyDir2, basisKeyDir3, pyrGeom);
621 int nelmts = NELMTS;
622
623 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
624 for (int i = 0; i < nelmts; ++i)
625 {
626 CollExp.push_back(Exp);
627 }
628
630 Collections::CollectionOptimisation colOpt(dummySession, 3,
632 Collections::OperatorImpMap impTypes = colOpt.GetOperatorImpMap(Exp);
633 Collections::Collection c(CollExp, impTypes);
634 c.Initialise(Collections::ePhysDeriv);
635
636 const int nq = Exp->GetTotPoints();
637 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
638 Array<OneD, NekDouble> phys(nelmts * nq), tmp, tmp1, tmp2;
639 Array<OneD, NekDouble> diff1(3 * nelmts * nq);
640 Array<OneD, NekDouble> diff2(3 * nelmts * nq);
641
642 Exp->GetCoords(xc, yc, zc);
643
644 for (int i = 0; i < nq; ++i)
645 {
646 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
647 }
648 Exp->PhysDeriv(phys, diff1, tmp1 = diff1 + (nelmts)*nq,
649 tmp2 = diff1 + (2 * nelmts) * nq);
650
651 for (int i = 1; i < nelmts; ++i)
652 {
653 Vmath::Vcopy(nq, phys, 1, tmp = phys + i * nq, 1);
654 Exp->PhysDeriv(phys, tmp = diff1 + i * nq,
655 tmp1 = diff1 + (nelmts + i) * nq,
656 tmp2 = diff1 + (2 * nelmts + i) * nq);
657 }
658
659 LibUtilities::Timer timer;
660 timer.Start();
661 c.ApplyOperator(Collections::ePhysDeriv, phys, diff2,
662 tmp = diff2 + nelmts * nq, tmp2 = diff2 + 2 * nelmts * nq);
663 timer.Stop();
664 timer.AccumulateRegion("Pyr PhysDeriv IterPerExp");
665
666 double epsilon = 1.0e-8;
667 for (int i = 0; i < diff1.size(); ++i)
668 {
669 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
670 }
671}

References Nektar::LibUtilities::Timer::AccumulateRegion(), Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::Collection::ApplyOperator(), CreatePyr(), Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::Collections::eIterPerExp, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::Collections::ePhysDeriv, Nektar::Collections::CollectionOptimisation::GetOperatorImpMap(), Nektar::Collections::Collection::Initialise(), NELMTS, Nektar::LibUtilities::Timer::Start(), Nektar::LibUtilities::Timer::Stop(), and Vmath::Vcopy().

◆ BOOST_AUTO_TEST_CASE() [30/36]

Nektar::PyrCollectionTests::BOOST_AUTO_TEST_CASE ( TestPyrPhysDeriv_IterPerExp_VariableP_MultiElmt  )

Definition at line 865 of file TestPyrCollection.cpp.

866{
868 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
870 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
872 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
874 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
876 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
877
878 SpatialDomains::PyrGeomSharedPtr pyrGeom = CreatePyr(v0, v1, v2, v3, v4);
879
880 Nektar::LibUtilities::PointsType PointsTypeDir1 =
882 const Nektar::LibUtilities::PointsKey PointsKeyDir1(5, PointsTypeDir1);
883 Nektar::LibUtilities::BasisType basisTypeDir1 =
885 const Nektar::LibUtilities::BasisKey basisKeyDir1(basisTypeDir1, 4,
886 PointsKeyDir1);
887
888 Nektar::LibUtilities::PointsType PointsTypeDir2 =
890 const Nektar::LibUtilities::PointsKey PointsKeyDir2(7, PointsTypeDir2);
891 Nektar::LibUtilities::BasisType basisTypeDir2 =
893 const Nektar::LibUtilities::BasisKey basisKeyDir2(basisTypeDir2, 6,
894 PointsKeyDir2);
895
896 Nektar::LibUtilities::PointsType PointsTypeDir3 =
897 Nektar::LibUtilities::eGaussRadauMAlpha2Beta0;
898 const Nektar::LibUtilities::PointsKey PointsKeyDir3(8, PointsTypeDir3);
899 Nektar::LibUtilities::BasisType basisTypeDir3 =
901 const Nektar::LibUtilities::BasisKey basisKeyDir3(basisTypeDir3, 8,
902 PointsKeyDir3);
903
906 basisKeyDir1, basisKeyDir2, basisKeyDir3, pyrGeom);
907
908 int nelmts = 10;
909
910 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
911 for (int i = 0; i < nelmts; ++i)
912 {
913 CollExp.push_back(Exp);
914 }
915
917 Collections::CollectionOptimisation colOpt(dummySession, 3,
919 Collections::OperatorImpMap impTypes = colOpt.GetOperatorImpMap(Exp);
920 Collections::Collection c(CollExp, impTypes);
921 c.Initialise(Collections::ePhysDeriv);
922
923 const int nq = Exp->GetTotPoints();
924 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
925 Array<OneD, NekDouble> phys(nelmts * nq), tmp, tmp1, tmp2;
926 Array<OneD, NekDouble> diff1(3 * nelmts * nq);
927 Array<OneD, NekDouble> diff2(3 * nelmts * nq);
928
929 Exp->GetCoords(xc, yc, zc);
930
931 for (int i = 0; i < nq; ++i)
932 {
933 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
934 }
935 Exp->PhysDeriv(phys, diff1, tmp1 = diff1 + (nelmts)*nq,
936 tmp2 = diff1 + (2 * nelmts) * nq);
937
938 for (int i = 1; i < nelmts; ++i)
939 {
940 Vmath::Vcopy(nq, phys, 1, tmp = phys + i * nq, 1);
941 Exp->PhysDeriv(phys, tmp = diff1 + i * nq,
942 tmp1 = diff1 + (nelmts + i) * nq,
943 tmp2 = diff1 + (2 * nelmts + i) * nq);
944 }
945
946 c.ApplyOperator(Collections::ePhysDeriv, phys, diff2,
947 tmp = diff2 + nelmts * nq, tmp2 = diff2 + 2 * nelmts * nq);
948
949 double epsilon = 1.0e-8;
950 for (int i = 0; i < diff1.size(); ++i)
951 {
952 // clamp values below 1e-14 to zero
953 diff1[i] = (fabs(diff1[i]) < 1e-14) ? 0.0 : diff1[i];
954 diff2[i] = (fabs(diff2[i]) < 1e-14) ? 0.0 : diff2[i];
955 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
956 }
957}

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::Collection::ApplyOperator(), CreatePyr(), Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::Collections::eIterPerExp, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::Collections::ePhysDeriv, Nektar::Collections::CollectionOptimisation::GetOperatorImpMap(), Nektar::Collections::Collection::Initialise(), and Vmath::Vcopy().

◆ BOOST_AUTO_TEST_CASE() [31/36]

Nektar::PyrCollectionTests::BOOST_AUTO_TEST_CASE ( TestPyrPhysDeriv_MatrixFree_UniformP_MultiElmt  )

Definition at line 1054 of file TestPyrCollection.cpp.

1055{
1057 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
1059 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
1061 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
1063 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
1065 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
1066
1067 SpatialDomains::PyrGeomSharedPtr pyrGeom = CreatePyr(v0, v1, v2, v3, v4);
1068
1069 unsigned int numQuadPoints = 5;
1070 unsigned int numModes = 2;
1071
1072 Nektar::LibUtilities::PointsType PointsTypeDir1 =
1074 const Nektar::LibUtilities::PointsKey PointsKeyDir1(numQuadPoints,
1075 PointsTypeDir1);
1076 Nektar::LibUtilities::BasisType basisTypeDir1 =
1078 const Nektar::LibUtilities::BasisKey basisKeyDir1(basisTypeDir1, numModes,
1079 PointsKeyDir1);
1080
1081 Nektar::LibUtilities::PointsType PointsTypeDir2 =
1083 const Nektar::LibUtilities::PointsKey PointsKeyDir2(numQuadPoints,
1084 PointsTypeDir2);
1085 Nektar::LibUtilities::BasisType basisTypeDir2 =
1087 const Nektar::LibUtilities::BasisKey basisKeyDir2(basisTypeDir2, numModes,
1088 PointsKeyDir2);
1089
1090 Nektar::LibUtilities::PointsType PointsTypeDir3 =
1091 Nektar::LibUtilities::eGaussRadauMAlpha2Beta0;
1092 const Nektar::LibUtilities::PointsKey PointsKeyDir3(numQuadPoints - 1,
1093 PointsTypeDir3);
1094 Nektar::LibUtilities::BasisType basisTypeDir3 =
1096 const Nektar::LibUtilities::BasisKey basisKeyDir3(basisTypeDir3, numModes,
1097 PointsKeyDir3);
1098
1101 basisKeyDir1, basisKeyDir2, basisKeyDir3, pyrGeom);
1102
1103 int nelmts = NELMTS;
1104
1105 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1106 for (int i = 0; i < nelmts; ++i)
1107 {
1108 CollExp.push_back(Exp);
1109 }
1110
1112 Collections::CollectionOptimisation colOpt(dummySession, 2,
1114 Collections::OperatorImpMap impTypes = colOpt.GetOperatorImpMap(Exp);
1115
1117 Collections::Collection c(CollExp, impTypes);
1118 c.Initialise(Collections::ePhysDeriv);
1119
1120 const int nq = Exp->GetTotPoints();
1121 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
1122 Array<OneD, NekDouble> phys(nelmts * nq), tmp, tmp1, tmp2;
1123 Array<OneD, NekDouble> diff1(3 * nelmts * nq);
1124 Array<OneD, NekDouble> diff2(3 * nelmts * nq);
1125
1126 Exp->GetCoords(xc, yc, zc);
1127
1128 for (int i = 0; i < nq; ++i)
1129 {
1130 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
1131 }
1132 Exp->PhysDeriv(phys, diff1, tmp1 = diff1 + (nelmts)*nq,
1133 tmp2 = diff1 + (2 * nelmts) * nq);
1134
1135 for (int i = 1; i < nelmts; ++i)
1136 {
1137 Vmath::Vcopy(nq, phys, 1, tmp = phys + i * nq, 1);
1138 Exp->PhysDeriv(phys, tmp = diff1 + i * nq,
1139 tmp1 = diff1 + (nelmts + i) * nq,
1140 tmp2 = diff1 + (2 * nelmts + i) * nq);
1141 }
1142
1143 LibUtilities::Timer timer;
1144 timer.Start();
1145 c.ApplyOperator(Collections::ePhysDeriv, phys, diff2,
1146 tmp = diff2 + nelmts * nq, tmp2 = diff2 + 2 * nelmts * nq);
1147 timer.Stop();
1148 timer.AccumulateRegion("Pyr PhysDeriv MatrixFree");
1149
1150 double epsilon = 1.0e-8;
1151 for (int i = 0; i < diff1.size(); ++i)
1152 {
1153 // clamp values below 1e-14 to zero
1154 diff1[i] = (fabs(diff1[i]) < 1e-14) ? 0.0 : diff1[i];
1155 diff2[i] = (fabs(diff2[i]) < 1e-14) ? 0.0 : diff2[i];
1156 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
1157 }
1158}

References Nektar::LibUtilities::Timer::AccumulateRegion(), Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::Collection::ApplyOperator(), CreatePyr(), Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::Collections::eIterPerExp, Nektar::Collections::eMatrixFree, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::Collections::ePhysDeriv, Nektar::Collections::CollectionOptimisation::GetOperatorImpMap(), Nektar::Collections::Collection::Initialise(), NELMTS, Nektar::LibUtilities::Timer::Start(), Nektar::LibUtilities::Timer::Stop(), and Vmath::Vcopy().

◆ BOOST_AUTO_TEST_CASE() [32/36]

Nektar::PyrCollectionTests::BOOST_AUTO_TEST_CASE ( TestPyrPhysDeriv_StdMat_UniformP_MultiElmt  )

Definition at line 673 of file TestPyrCollection.cpp.

674{
676 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
678 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
680 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
682 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
684 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
685
686 SpatialDomains::PyrGeomSharedPtr pyrGeom = CreatePyr(v0, v1, v2, v3, v4);
687
688 Nektar::LibUtilities::PointsType PointsTypeDir1 =
690 const Nektar::LibUtilities::PointsKey PointsKeyDir1(5, PointsTypeDir1);
691 Nektar::LibUtilities::BasisType basisTypeDir1 =
693 const Nektar::LibUtilities::BasisKey basisKeyDir1(basisTypeDir1, 4,
694 PointsKeyDir1);
695
696 Nektar::LibUtilities::PointsType PointsTypeDir2 =
698 const Nektar::LibUtilities::PointsKey PointsKeyDir2(5, PointsTypeDir2);
699 Nektar::LibUtilities::BasisType basisTypeDir2 =
701 const Nektar::LibUtilities::BasisKey basisKeyDir2(basisTypeDir2, 4,
702 PointsKeyDir2);
703
704 Nektar::LibUtilities::PointsType PointsTypeDir3 =
705 Nektar::LibUtilities::eGaussRadauMAlpha2Beta0;
706 const Nektar::LibUtilities::PointsKey PointsKeyDir3(4, PointsTypeDir3);
707 Nektar::LibUtilities::BasisType basisTypeDir3 =
709 const Nektar::LibUtilities::BasisKey basisKeyDir3(basisTypeDir3, 4,
710 PointsKeyDir3);
711
714 basisKeyDir1, basisKeyDir2, basisKeyDir3, pyrGeom);
715
716 int nelmts = 10;
717
718 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
719 for (int i = 0; i < nelmts; ++i)
720 {
721 CollExp.push_back(Exp);
722 }
723
725 Collections::CollectionOptimisation colOpt(dummySession, 3,
727 Collections::OperatorImpMap impTypes = colOpt.GetOperatorImpMap(Exp);
728 Collections::Collection c(CollExp, impTypes);
729 c.Initialise(Collections::ePhysDeriv);
730
731 const int nq = Exp->GetTotPoints();
732 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
733 Array<OneD, NekDouble> phys(nelmts * nq), tmp, tmp1, tmp2;
734 Array<OneD, NekDouble> diff1(3 * nelmts * nq);
735 Array<OneD, NekDouble> diff2(3 * nelmts * nq);
736
737 Exp->GetCoords(xc, yc, zc);
738
739 for (int i = 0; i < nq; ++i)
740 {
741 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
742 }
743 Exp->PhysDeriv(phys, diff1, tmp1 = diff1 + (nelmts)*nq,
744 tmp2 = diff1 + (2 * nelmts) * nq);
745
746 for (int i = 1; i < nelmts; ++i)
747 {
748 Vmath::Vcopy(nq, phys, 1, tmp = phys + i * nq, 1);
749 Exp->PhysDeriv(phys, tmp = diff1 + i * nq,
750 tmp1 = diff1 + (nelmts + i) * nq,
751 tmp2 = diff1 + (2 * nelmts + i) * nq);
752 }
753
754 c.ApplyOperator(Collections::ePhysDeriv, phys, diff2,
755 tmp = diff2 + nelmts * nq, tmp2 = diff2 + 2 * nelmts * nq);
756
757 double epsilon = 1.0e-8;
758 for (int i = 0; i < diff1.size(); ++i)
759 {
760 // clamp values below 1e-14 to zero
761 diff1[i] = (fabs(diff1[i]) < 1e-14) ? 0.0 : diff1[i];
762 diff2[i] = (fabs(diff2[i]) < 1e-14) ? 0.0 : diff2[i];
763 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
764 }
765}

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::Collection::ApplyOperator(), CreatePyr(), Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::Collections::ePhysDeriv, Nektar::Collections::eStdMat, Nektar::Collections::CollectionOptimisation::GetOperatorImpMap(), Nektar::Collections::Collection::Initialise(), and Vmath::Vcopy().

◆ BOOST_AUTO_TEST_CASE() [33/36]

Nektar::PyrCollectionTests::BOOST_AUTO_TEST_CASE ( TestPyrPhysDeriv_SumFac_UniformP_MultiElmt  )

Definition at line 767 of file TestPyrCollection.cpp.

768{
770 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
772 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
774 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
776 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
778 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
779
780 SpatialDomains::PyrGeomSharedPtr pyrGeom = CreatePyr(v0, v1, v2, v3, v4);
781
782 Nektar::LibUtilities::PointsType PointsTypeDir1 =
784 const Nektar::LibUtilities::PointsKey PointsKeyDir1(5, PointsTypeDir1);
785 Nektar::LibUtilities::BasisType basisTypeDir1 =
787 const Nektar::LibUtilities::BasisKey basisKeyDir1(basisTypeDir1, 4,
788 PointsKeyDir1);
789
790 Nektar::LibUtilities::PointsType PointsTypeDir2 =
792 const Nektar::LibUtilities::PointsKey PointsKeyDir2(5, PointsTypeDir2);
793 Nektar::LibUtilities::BasisType basisTypeDir2 =
795 const Nektar::LibUtilities::BasisKey basisKeyDir2(basisTypeDir2, 4,
796 PointsKeyDir2);
797
798 Nektar::LibUtilities::PointsType PointsTypeDir3 =
799 Nektar::LibUtilities::eGaussRadauMAlpha2Beta0;
800 const Nektar::LibUtilities::PointsKey PointsKeyDir3(4, PointsTypeDir3);
801 Nektar::LibUtilities::BasisType basisTypeDir3 =
803 const Nektar::LibUtilities::BasisKey basisKeyDir3(basisTypeDir3, 4,
804 PointsKeyDir3);
805
808 basisKeyDir1, basisKeyDir2, basisKeyDir3, pyrGeom);
809 int nelmts = NELMTS;
810
811 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
812 for (int i = 0; i < nelmts; ++i)
813 {
814 CollExp.push_back(Exp);
815 }
816
818 Collections::CollectionOptimisation colOpt(dummySession, 3,
822 Collections::Collection c(CollExp, impTypes);
823 c.Initialise(Collections::ePhysDeriv);
824
825 const int nq = Exp->GetTotPoints();
826 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
827 Array<OneD, NekDouble> phys(nelmts * nq), tmp, tmp1, tmp2;
828 Array<OneD, NekDouble> diff1(3 * nelmts * nq);
829 Array<OneD, NekDouble> diff2(3 * nelmts * nq);
830
831 Exp->GetCoords(xc, yc, zc);
832
833 for (int i = 0; i < nq; ++i)
834 {
835 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
836 }
837 Exp->PhysDeriv(phys, diff1, tmp1 = diff1 + (nelmts)*nq,
838 tmp2 = diff1 + (2 * nelmts) * nq);
839
840 for (int i = 1; i < nelmts; ++i)
841 {
842 Vmath::Vcopy(nq, phys, 1, tmp = phys + i * nq, 1);
843 Exp->PhysDeriv(phys, tmp = diff1 + i * nq,
844 tmp1 = diff1 + (nelmts + i) * nq,
845 tmp2 = diff1 + (2 * nelmts + i) * nq);
846 }
847
848 LibUtilities::Timer timer;
849 timer.Start();
850 c.ApplyOperator(Collections::ePhysDeriv, phys, diff2,
851 tmp = diff2 + nelmts * nq, tmp2 = diff2 + 2 * nelmts * nq);
852 timer.Stop();
853 timer.AccumulateRegion("Pyr PhysDeriv SumFactor");
854
855 double epsilon = 1.0e-8;
856 for (int i = 0; i < diff1.size(); ++i)
857 {
858 // clamp values below 1e-14 to zero
859 diff1[i] = (fabs(diff1[i]) < 1e-14) ? 0.0 : diff1[i];
860 diff2[i] = (fabs(diff2[i]) < 1e-14) ? 0.0 : diff2[i];
861 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
862 }
863}

References Nektar::LibUtilities::Timer::AccumulateRegion(), Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::Collection::ApplyOperator(), CreatePyr(), Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::Collections::ePhysDeriv, Nektar::Collections::eSumFac, Nektar::Collections::Collection::Initialise(), NELMTS, Nektar::LibUtilities::Timer::Start(), Nektar::LibUtilities::Timer::Stop(), and Vmath::Vcopy().

◆ BOOST_AUTO_TEST_CASE() [34/36]

Nektar::PyrCollectionTests::BOOST_AUTO_TEST_CASE ( TestPyrPhysDeriv_SumFac_VariableP_MultiElmt  )

Definition at line 959 of file TestPyrCollection.cpp.

960{
962 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
964 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
966 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
968 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
970 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
971
972 SpatialDomains::PyrGeomSharedPtr pyrGeom = CreatePyr(v0, v1, v2, v3, v4);
973
974 Nektar::LibUtilities::PointsType PointsTypeDir1 =
976 const Nektar::LibUtilities::PointsKey PointsKeyDir1(5, PointsTypeDir1);
977 Nektar::LibUtilities::BasisType basisTypeDir1 =
979 const Nektar::LibUtilities::BasisKey basisKeyDir1(basisTypeDir1, 4,
980 PointsKeyDir1);
981
982 Nektar::LibUtilities::PointsType PointsTypeDir2 =
984 const Nektar::LibUtilities::PointsKey PointsKeyDir2(7, PointsTypeDir2);
985 Nektar::LibUtilities::BasisType basisTypeDir2 =
987 const Nektar::LibUtilities::BasisKey basisKeyDir2(basisTypeDir2, 6,
988 PointsKeyDir2);
989
990 Nektar::LibUtilities::PointsType PointsTypeDir3 =
991 Nektar::LibUtilities::eGaussRadauMAlpha2Beta0;
992 const Nektar::LibUtilities::PointsKey PointsKeyDir3(8, PointsTypeDir3);
993 Nektar::LibUtilities::BasisType basisTypeDir3 =
995 const Nektar::LibUtilities::BasisKey basisKeyDir3(basisTypeDir3, 8,
996 PointsKeyDir3);
997
1000 basisKeyDir1, basisKeyDir2, basisKeyDir3, pyrGeom);
1001
1002 int nelmts = 10;
1003
1004 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
1005 for (int i = 0; i < nelmts; ++i)
1006 {
1007 CollExp.push_back(Exp);
1008 }
1009
1011 Collections::CollectionOptimisation colOpt(dummySession, 3,
1015
1016 Collections::Collection c(CollExp, impTypes);
1017 c.Initialise(Collections::ePhysDeriv);
1018
1019 const int nq = Exp->GetTotPoints();
1020 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
1021 Array<OneD, NekDouble> phys(nelmts * nq), tmp, tmp1, tmp2;
1022 Array<OneD, NekDouble> diff1(3 * nelmts * nq);
1023 Array<OneD, NekDouble> diff2(3 * nelmts * nq);
1024
1025 Exp->GetCoords(xc, yc, zc);
1026
1027 for (int i = 0; i < nq; ++i)
1028 {
1029 phys[i] = sin(xc[i]) * cos(yc[i]) * sin(zc[i]);
1030 }
1031 Exp->PhysDeriv(phys, tmp = diff1, tmp1 = diff1 + (nelmts)*nq,
1032 tmp2 = diff1 + (2 * nelmts) * nq);
1033 for (int i = 1; i < nelmts; ++i)
1034 {
1035 Vmath::Vcopy(nq, phys, 1, tmp = phys + i * nq, 1);
1036 Exp->PhysDeriv(phys, tmp = diff1 + i * nq,
1037 tmp1 = diff1 + (nelmts + i) * nq,
1038 tmp2 = diff1 + (2 * nelmts + i) * nq);
1039 }
1040
1041 c.ApplyOperator(Collections::ePhysDeriv, phys, diff2,
1042 tmp = diff2 + nelmts * nq, tmp2 = diff2 + 2 * nelmts * nq);
1043
1044 double epsilon = 1.0e-8;
1045 for (int i = 0; i < diff1.size(); ++i)
1046 {
1047 // clamp values below 1e-14 to zero
1048 diff1[i] = (fabs(diff1[i]) < 1e-14) ? 0.0 : diff1[i];
1049 diff2[i] = (fabs(diff2[i]) < 1e-14) ? 0.0 : diff2[i];
1050 BOOST_CHECK_CLOSE(diff1[i], diff2[i], epsilon);
1051 }
1052}

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::Collection::ApplyOperator(), CreatePyr(), Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::Collections::ePhysDeriv, Nektar::Collections::eSumFac, Nektar::Collections::Collection::Initialise(), and Vmath::Vcopy().

◆ BOOST_AUTO_TEST_CASE() [35/36]

Nektar::PyrCollectionTests::BOOST_AUTO_TEST_CASE ( TestPyrPhysInterp1DScaled_MatrixFree_UniformP_MultiElmt  )

Definition at line 3491 of file TestPyrCollection.cpp.

3492{
3494 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
3496 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
3498 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
3500 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
3502 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
3503
3504 SpatialDomains::PyrGeomSharedPtr pyrGeom = CreatePyr(v0, v1, v2, v3, v4);
3505
3506 Nektar::LibUtilities::PointsType PointsTypeDir1 =
3508 const Nektar::LibUtilities::PointsKey PointsKeyDir1(5, PointsTypeDir1);
3509 Nektar::LibUtilities::BasisType basisTypeDir1 =
3511 const Nektar::LibUtilities::BasisKey basisKeyDir1(basisTypeDir1, 4,
3512 PointsKeyDir1);
3513
3514 Nektar::LibUtilities::PointsType PointsTypeDir2 =
3516 const Nektar::LibUtilities::PointsKey PointsKeyDir2(5, PointsTypeDir2);
3517 Nektar::LibUtilities::BasisType basisTypeDir2 =
3519 const Nektar::LibUtilities::BasisKey basisKeyDir2(basisTypeDir2, 4,
3520 PointsKeyDir2);
3521
3522 Nektar::LibUtilities::PointsType PointsTypeDir3 =
3523 Nektar::LibUtilities::eGaussRadauMAlpha2Beta0;
3524 const Nektar::LibUtilities::PointsKey PointsKeyDir3(4, PointsTypeDir3);
3525 Nektar::LibUtilities::BasisType basisTypeDir3 =
3527 const Nektar::LibUtilities::BasisKey basisKeyDir3(basisTypeDir3, 4,
3528 PointsKeyDir3);
3529
3532 basisKeyDir1, basisKeyDir2, basisKeyDir3, pyrGeom);
3533
3534 int nelmts = 1;
3535
3536 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
3537 for (int i = 0; i < nelmts; ++i)
3538 {
3539 CollExp.push_back(Exp);
3540 }
3541
3543 Collections::CollectionOptimisation colOpt(dummySession, 3,
3545 Collections::OperatorImpMap impTypes = colOpt.GetOperatorImpMap(Exp);
3546 Collections::Collection c(CollExp, impTypes);
3550
3551 const int nq = Exp->GetTotPoints();
3552 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
3553 Array<OneD, NekDouble> phys(nq);
3554
3555 Exp->GetCoords(xc, yc, zc);
3556
3557 for (int i = 0; i < nq; ++i)
3558 {
3559 phys[i] = pow(xc[i], 3) + pow(yc[i], 3) + pow(zc[i], 3);
3560 }
3561
3562 const int nq1 = c.GetOutputSize(Collections::ePhysInterp1DScaled);
3563 Array<OneD, NekDouble> xc1(nq1);
3564 Array<OneD, NekDouble> yc1(nq1);
3565 Array<OneD, NekDouble> zc1(nq1);
3566 Array<OneD, NekDouble> phys1(nq1);
3567
3568 c.ApplyOperator(Collections::ePhysInterp1DScaled, xc, xc1);
3569 c.ApplyOperator(Collections::ePhysInterp1DScaled, yc, yc1);
3570 c.ApplyOperator(Collections::ePhysInterp1DScaled, zc, zc1);
3571 c.ApplyOperator(Collections::ePhysInterp1DScaled, phys, phys1);
3572
3573 double epsilon = 2.0e-8;
3574 for (int i = 0; i < nq1; ++i)
3575 {
3576 NekDouble exact = pow(xc1[i], 3) + pow(yc1[i], 3) + pow(zc1[i], 3);
3577 phys1[i] = (fabs(phys1[i]) < 1e-14) ? 0.0 : phys1[i];
3578 exact = (fabs(exact) < 1e-14) ? 0.0 : exact;
3579 BOOST_CHECK_CLOSE(phys1[i], exact, epsilon);
3580 }
3581}
double NekDouble

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::Collection::ApplyOperator(), CreatePyr(), Nektar::StdRegions::eFactorConst, Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::Collections::eMatrixFree, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::Collections::ePhysInterp1DScaled, Nektar::VarcoeffHashingTest::factors, Nektar::Collections::CollectionOptimisation::GetOperatorImpMap(), Nektar::Collections::Collection::GetOutputSize(), and Nektar::Collections::Collection::Initialise().

◆ BOOST_AUTO_TEST_CASE() [36/36]

Nektar::PyrCollectionTests::BOOST_AUTO_TEST_CASE ( TestPyrPhysInterp1DScaled_NoCollection_UniformP_MultiElmt  )

Definition at line 3399 of file TestPyrCollection.cpp.

3400{
3402 new SpatialDomains::PointGeom(3u, 0u, -1.0, -1.0, -1.0));
3404 new SpatialDomains::PointGeom(3u, 1u, 1.0, -1.0, -1.0));
3406 new SpatialDomains::PointGeom(3u, 2u, 1.0, 1.0, -1.0));
3408 new SpatialDomains::PointGeom(3u, 3u, -1.0, 1.0, -1.0));
3410 new SpatialDomains::PointGeom(3u, 4u, -1.0, -1.0, 1.0));
3411
3412 SpatialDomains::PyrGeomSharedPtr pyrGeom = CreatePyr(v0, v1, v2, v3, v4);
3413
3414 Nektar::LibUtilities::PointsType PointsTypeDir1 =
3416 const Nektar::LibUtilities::PointsKey PointsKeyDir1(5, PointsTypeDir1);
3417 Nektar::LibUtilities::BasisType basisTypeDir1 =
3419 const Nektar::LibUtilities::BasisKey basisKeyDir1(basisTypeDir1, 4,
3420 PointsKeyDir1);
3421
3422 Nektar::LibUtilities::PointsType PointsTypeDir2 =
3424 const Nektar::LibUtilities::PointsKey PointsKeyDir2(5, PointsTypeDir2);
3425 Nektar::LibUtilities::BasisType basisTypeDir2 =
3427 const Nektar::LibUtilities::BasisKey basisKeyDir2(basisTypeDir2, 4,
3428 PointsKeyDir2);
3429
3430 Nektar::LibUtilities::PointsType PointsTypeDir3 =
3431 Nektar::LibUtilities::eGaussRadauMAlpha2Beta0;
3432 const Nektar::LibUtilities::PointsKey PointsKeyDir3(4, PointsTypeDir3);
3433 Nektar::LibUtilities::BasisType basisTypeDir3 =
3435 const Nektar::LibUtilities::BasisKey basisKeyDir3(basisTypeDir3, 4,
3436 PointsKeyDir3);
3437
3440 basisKeyDir1, basisKeyDir2, basisKeyDir3, pyrGeom);
3441
3442 int nelmts = 1;
3443
3444 std::vector<StdRegions::StdExpansionSharedPtr> CollExp;
3445 for (int i = 0; i < nelmts; ++i)
3446 {
3447 CollExp.push_back(Exp);
3448 }
3449
3451 Collections::CollectionOptimisation colOpt(dummySession, 3,
3453 Collections::OperatorImpMap impTypes = colOpt.GetOperatorImpMap(Exp);
3454 Collections::Collection c(CollExp, impTypes);
3458
3459 const int nq = Exp->GetTotPoints();
3460 Array<OneD, NekDouble> xc(nq), yc(nq), zc(nq);
3461 Array<OneD, NekDouble> phys(nq);
3462
3463 Exp->GetCoords(xc, yc, zc);
3464
3465 for (int i = 0; i < nq; ++i)
3466 {
3467 phys[i] = pow(xc[i], 3) + pow(yc[i], 3) + pow(zc[i], 3);
3468 }
3469
3470 const int nq1 = c.GetOutputSize(Collections::ePhysInterp1DScaled);
3471 Array<OneD, NekDouble> xc1(nq1);
3472 Array<OneD, NekDouble> yc1(nq1);
3473 Array<OneD, NekDouble> zc1(nq1);
3474 Array<OneD, NekDouble> phys1(nq1);
3475
3476 c.ApplyOperator(Collections::ePhysInterp1DScaled, xc, xc1);
3477 c.ApplyOperator(Collections::ePhysInterp1DScaled, yc, yc1);
3478 c.ApplyOperator(Collections::ePhysInterp1DScaled, zc, zc1);
3479 c.ApplyOperator(Collections::ePhysInterp1DScaled, phys, phys1);
3480
3481 double epsilon = 2.0e-8;
3482 for (int i = 0; i < nq1; ++i)
3483 {
3484 NekDouble exact = pow(xc1[i], 3) + pow(yc1[i], 3) + pow(zc1[i], 3);
3485 phys1[i] = (fabs(phys1[i]) < 1e-14) ? 0.0 : phys1[i];
3486 exact = (fabs(exact) < 1e-14) ? 0.0 : exact;
3487 BOOST_CHECK_CLOSE(phys1[i], exact, epsilon);
3488 }
3489}

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::Collection::ApplyOperator(), CreatePyr(), Nektar::StdRegions::eFactorConst, Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModifiedPyr_C, Nektar::Collections::eNoCollection, Nektar::Collections::ePhysInterp1DScaled, Nektar::VarcoeffHashingTest::factors, Nektar::Collections::CollectionOptimisation::GetOperatorImpMap(), Nektar::Collections::Collection::GetOutputSize(), and Nektar::Collections::Collection::Initialise().

◆ CreatePyr()

Definition at line 58 of file TestPyrCollection.cpp.

64{
73
75 edgesF0[Nektar::SpatialDomains::QuadGeom::kNedges] = {e0, e1, e2, e3};
76
78 edgesF1[Nektar::SpatialDomains::TriGeom::kNedges] = {e0, e4, e5};
79
81 edgesF2[Nektar::SpatialDomains::TriGeom::kNedges] = {e1, e6, e5};
82
84 edgesF3[Nektar::SpatialDomains::TriGeom::kNedges] = {e2, e6, e7};
85
87 edgesF4[Nektar::SpatialDomains::TriGeom::kNedges] = {e3, e4, e7};
88
90 new SpatialDomains::QuadGeom(0, edgesF0));
92 new SpatialDomains::TriGeom(1, edgesF1));
94 new SpatialDomains::TriGeom(2, edgesF2));
96 new SpatialDomains::TriGeom(3, edgesF3));
98 new SpatialDomains::TriGeom(4, edgesF4));
99
100 Nektar::SpatialDomains::Geometry2DSharedPtr faces[] = {face0, face1, face2,
101 face3, face4};
103 new SpatialDomains::PyrGeom(0, faces));
104 return pyrGeom;
105}
static const int kNedges
Definition: QuadGeom.h:74
static const int kNedges
Get the orientation of face1.
Definition: TriGeom.h:70
SpatialDomains::SegGeomSharedPtr CreateSegGeom(unsigned int id, SpatialDomains::PointGeomSharedPtr v0, SpatialDomains::PointGeomSharedPtr v1)
std::shared_ptr< QuadGeom > QuadGeomSharedPtr
Definition: HexGeom.h:45
std::shared_ptr< SegGeom > SegGeomSharedPtr
Definition: Geometry2D.h:59
std::shared_ptr< Geometry2D > Geometry2DSharedPtr
Definition: Geometry.h:62
std::shared_ptr< TriGeom > TriGeomSharedPtr
Definition: TriGeom.h:56

References CreateSegGeom(), Nektar::SpatialDomains::QuadGeom::kNedges, and Nektar::SpatialDomains::TriGeom::kNedges.

Referenced by BOOST_AUTO_TEST_CASE().

◆ CreateSegGeom()

SpatialDomains::SegGeomSharedPtr Nektar::PyrCollectionTests::CreateSegGeom ( unsigned int  id,
SpatialDomains::PointGeomSharedPtr  v0,
SpatialDomains::PointGeomSharedPtr  v1 
)

Definition at line 48 of file TestPyrCollection.cpp.

51{
52 SpatialDomains::PointGeomSharedPtr vertices[] = {v0, v1};
54 new SpatialDomains::SegGeom(id, 3, vertices));
55 return result;
56}

Referenced by CreatePyr().