27TEST(FunctionalExpansionsTest, legendreSeriesOrthonormalEvaluation)
29 const unsigned int order = 15;
30 Real location = -0.90922108754014;
31 const std::array<Real, order> truth = {{0.50000000000000,
52 legendre.setLocation(Point(location));
53 auto & answer = legendre.getAllGeneration();
54 for (std::size_t i = 0; i < order; ++i)
56 EXPECT_NEAR(answer[i], truth[i], 1.e-12);
59TEST(FunctionalExpansionsTest, legendreSeriesSqrtMuEvaluation)
61 const unsigned int order = 15;
62 Real location = -0.90922108754014;
63 const std::array<Real, order> truth = {{0.50000000000000,
84 legendre.setLocation(Point(location));
85 auto & answer = legendre.getAllGeneration();
86 for (std::size_t i = 0; i < order; ++i)
88 EXPECT_NEAR(answer[i], truth[i] / std::sqrt(i + 0.5), 5.e-12);
91TEST(FunctionalExpansionsTest, legendreSeriesStandardEvaluation)
93 const unsigned int order = 15;
94 Real location = -0.90922108754014;
95 const std::array<Real, order> truth = {{0.50000000000000,
116 legendre.setLocation(Point(location));
117 auto & answer = legendre.getAllGeneration();
118 for (std::size_t i = 0; i < order; ++i)
119 EXPECT_NEAR(answer[i], truth[i] / (i + 0.5),
tol);
122TEST(FunctionalExpansionsTest, CartesianConstructor)
124 std::vector<MooseEnum> domains;
125 std::vector<std::size_t> orders;
126 std::vector<MooseEnum> series;
140 EXPECT_EQ(legendreTwo.
getNumberOfTerms(), (orders[0] + 1) * (orders[1] + 1));
143 orders = {{14, 21, 22}};
146 EXPECT_EQ(legendreThree.
getNumberOfTerms(), (orders[0] + 1) * (orders[1] + 1) * (orders[2] + 1));
149TEST(FunctionalExpansionsTest, Cartesian3D)
154 const std::vector<std::size_t> orders = {14, 21, 22};
162 const std::vector<Point> locations = {
163 Point(-0.14854612627465, 0.60364074055275, 0.76978431165674),
164 Point(0.93801805187856, 0.74175118177279, 0.74211345600994),
165 Point(0.35423736896098, -0.83921049062126, -0.02231845586669)};
166 const std::vector<Real> standard_truth = {1.32257143058688, 3.68047786932034, 0.17515811557416};
167 const std::vector<Real> orthogonal_truth = {
168 -2.33043696271172, 74.48747654183713, -14.48091828923379};
170 for (std::size_t i = 0; i < locations.size(); ++i)
179TEST(FunctionalExpansionsTest, functionalBasisInterfaceCartesian)
184 const std::vector<std::size_t> orders = {4, 5, 3};
192 const Point location(-0.38541903411291, 0.61369802505416, -0.04539307255549);
193 const Real truth = 0.26458908225718;
197 EXPECT_NEAR(interface.getExpansionSeriesSum(), truth,
tol);