1644 if (dim == 0 || dim == 1)
1646 const ::QGauss<dim> quad(n_points_1D);
1648 this->quadrature_points = quad.get_points();
1649 this->weights = quad.get_weights();
1653 if (n_points_1D == 1)
1655 const double p = 1.0 / 3.0;
1656 this->quadrature_points.emplace_back(p, p);
1657 this->weights.emplace_back(0.5);
1659 else if (n_points_1D == 2)
1665 const double Q12 = 1.0 / 2.0;
1666 this->quadrature_points.emplace_back(0.17855872826361643,
1667 0.1550510257216822);
1668 this->quadrature_points.emplace_back(0.07503111022260812,
1669 0.6449489742783178);
1670 this->quadrature_points.emplace_back(0.6663902460147014,
1671 0.1550510257216822);
1672 this->quadrature_points.emplace_back(0.28001991549907407,
1673 0.6449489742783178);
1675 this->weights.emplace_back(0.31804138174397717 * Q12);
1676 this->weights.emplace_back(0.18195861825602283 * Q12);
1677 this->weights.emplace_back(0.31804138174397717 * Q12);
1678 this->weights.emplace_back(0.18195861825602283 * Q12);
1680 else if (n_points_1D == 3)
1683 const double p0 = 2.0 / 7.0 -
std::sqrt(15.0) / 21.0;
1684 const double p1 = 2.0 / 7.0 +
std::sqrt(15.0) / 21.0;
1685 const double p2 = 3.0 / 7.0 - 2.0 *
std::sqrt(15.0) / 21.0;
1686 const double p3 = 3.0 / 7.0 + 2.0 *
std::sqrt(15.0) / 21.0;
1687 this->quadrature_points.emplace_back(1.0 / 3.0, 1.0 / 3.0);
1688 this->quadrature_points.emplace_back(p3, p0);
1689 this->quadrature_points.emplace_back(p0, p3);
1690 this->quadrature_points.emplace_back(p0, p0);
1691 this->quadrature_points.emplace_back(p2, p1);
1692 this->quadrature_points.emplace_back(p1, p2);
1693 this->quadrature_points.emplace_back(p1, p1);
1695 const double q12 = 0.5;
1696 const double w0 = 9.0 / 40.0;
1697 const double w1 = 31.0 / 240.0 -
std::sqrt(15.0) / 1200.0;
1698 const double w2 = 31.0 / 240.0 +
std::sqrt(15.0) / 1200.0;
1699 this->weights.emplace_back(q12 * w0);
1700 this->weights.emplace_back(q12 * w1);
1701 this->weights.emplace_back(q12 * w1);
1702 this->weights.emplace_back(q12 * w1);
1703 this->weights.emplace_back(q12 * w2);
1704 this->weights.emplace_back(q12 * w2);
1705 this->weights.emplace_back(q12 * w2);
1707 else if (n_points_1D == 4)
1715 if (n_points_1D == 1)
1717 const double Q14 = 1.0 / 4.0;
1718 const double Q16 = 1.0 / 6.0;
1720 this->quadrature_points.emplace_back(Q14, Q14, Q14);
1721 this->weights.emplace_back(Q16);
1728 else if (n_points_1D == 2)
1730 const double Q16 = 1.0 / 6.0;
1731 this->weights.emplace_back(0.1223220027573451 * Q16);
1732 this->weights.emplace_back(0.1280664127107469 * Q16);
1733 this->weights.emplace_back(0.1325680271444452 * Q16);
1734 this->weights.emplace_back(0.1406244096604032 * Q16);
1735 this->weights.emplace_back(0.2244151669175574 * Q16);
1736 this->weights.emplace_back(0.2520039808095023 * Q16);
1738 this->quadrature_points.emplace_back(0.1620014916985245,
1740 0.01271836631368145);
1741 this->quadrature_points.emplace_back(0.01090521221118924,
1743 0.3621268299455338);
1744 this->quadrature_points.emplace_back(0.1901170024392839,
1745 0.01140332944455717,
1746 0.3586207204668839);
1747 this->quadrature_points.emplace_back(0.170816925164989,
1749 0.6384932999617267);
1750 this->quadrature_points.emplace_back(0.1586851632274406,
1752 0.1308471689520965);
1753 this->quadrature_points.emplace_back(0.5712260521491151,
1755 0.1403728057942107);
1759 else if (n_points_1D == 3)
1764 else if (n_points_1D == 4)
1771 AssertDimension(this->quadrature_points.size(), this->weights.size());
1772 Assert(this->quadrature_points.size() > 0,
1774 "QGaussSimplex is currently only implemented for "
1775 "n_points_1D = 1, 2, 3, and 4 while you are asking for "
1807 const unsigned int n_points_1D,
1808 const bool use_odd_order)
1820 std::array<double, dim + 1> centroid;
1821 std::fill(centroid.begin(), centroid.end(), 1.0 / (dim + 1.0));
1822 std::vector<std::vector<std::array<double, dim + 1>>> b_point_permutations;
1823 std::vector<double> b_weights;
1833 auto process_point_1 = [&](
const double a,
const double w) {
1834 const double b = 1.0 - dim * a;
1835 std::array<double, dim + 1> b_point;
1836 std::fill(b_point.begin(), b_point.begin() + dim, a);
1839 b_weights.push_back(w);
1840 b_point_permutations.push_back(all_permutations(b_point));
1845 auto process_point_2 = [&](
const double a,
const double w) {
1847 const double b = (1.0 - 2.0 * a) / 2.0;
1848 std::array<double, dim + 1> b_point;
1849 std::fill(b_point.begin(), b_point.begin() + dim - 1, a);
1850 b_point[dim - 1] = b;
1853 b_weights.push_back(w);
1854 b_point_permutations.push_back(all_permutations(b_point));
1860 auto process_point_3 = [&](
const double a,
const double b,
const double w) {
1861 const double c = 1.0 - (dim - 1.0) * a - b;
1862 std::array<double, dim + 1> b_point;
1863 std::fill(b_point.begin(), b_point.begin() + dim - 1, a);
1864 b_point[dim - 1] = b;
1867 b_weights.push_back(w);
1868 b_point_permutations.push_back(all_permutations(b_point));
1871 switch (n_points_1D)
1880 b_point_permutations.push_back({centroid});
1881 b_weights.push_back(1.0000000000000000e+00);
1886 process_point_1(1.6666666666666669e-01,
1887 3.3333333333333331e-01);
1894 b_point_permutations.push_back({centroid});
1895 b_weights.push_back(1.0000000000000000e+00);
1900 process_point_1(1.3819660112501050e-01,
1901 2.5000000000000000e-01);
1913 process_point_1(9.1576213509770743e-02, 1.0995174365532187e-01);
1914 process_point_1(4.4594849091596489e-01, 2.2338158967801147e-01);
1920 process_point_1(3.2816330251638171e-01,
1921 1.3621784253708741e-01);
1922 process_point_1(1.0804724989842859e-01,
1923 1.1378215746291261e-01);
1942 b_point_permutations.push_back({centroid});
1943 b_weights.push_back(2.2500000000000001e-01);
1944 process_point_1(1.0128650732345634e-01,
1945 1.2593918054482714e-01);
1946 process_point_1(4.7014206410511511e-01,
1947 1.3239415278850619e-01);
1952 process_point_1(6.3089014491502227e-02,
1953 5.0844906370206819e-02);
1954 process_point_1(2.4928674517091043e-01,
1955 1.1678627572637937e-01);
1956 process_point_3(5.3145049844816938e-02,
1957 3.1035245103378439e-01,
1958 8.2851075618373571e-02);
1965 process_point_1(3.1088591926330061e-01,
1966 1.1268792571801590e-01);
1967 process_point_1(9.2735250310891248e-02,
1968 7.3493043116361956e-02);
1969 process_point_2(4.5503704125649642e-02,
1970 4.2546020777081472e-02);
1975 process_point_1(4.0673958534611372e-02,
1976 1.0077211055320640e-02);
1977 process_point_1(3.2233789014227548e-01,
1978 5.5357181543654717e-02);
1979 process_point_1(2.1460287125915201e-01,
1980 3.9922750258167487e-02);
1981 process_point_3(6.3661001875017442e-02,
1982 6.0300566479164919e-01,
1983 4.8214285714285710e-02);
1997 process_point_1(3.3730648554587850e-02,
1998 1.6545050110792131e-02);
1999 process_point_1(4.7430969250471822e-01,
2000 7.7086646185986069e-02);
2001 process_point_1(2.4157738259540357e-01,
2002 1.2794417123015558e-01);
2003 process_point_3(4.7036644652595216e-02,
2004 1.9868331479735168e-01,
2005 5.5878732903199779e-02);
2010 b_point_permutations.push_back({centroid});
2011 b_weights.push_back(1.4431560767778717e-01);
2012 process_point_1(5.0547228317030957e-02,
2013 3.2458497623198079e-02);
2014 process_point_1(4.5929258829272313e-01,
2015 9.5091634267284619e-02);
2016 process_point_1(1.7056930775176021e-01,
2017 1.0321737053471824e-01);
2018 process_point_3(8.3947774099575878e-03,
2019 2.6311282963463811e-01,
2020 2.7230314174434993e-02);
2027 b_point_permutations.push_back({centroid});
2028 b_weights.push_back(9.5485289464130846e-02);
2029 process_point_1(3.1570114977820279e-01,
2030 4.2329581209967028e-02);
2031 process_point_2(5.0489822598396350e-02,
2032 3.1896927832857580e-02);
2033 process_point_3(1.8883383102600099e-01,
2034 5.7517163758699996e-01,
2035 3.7207130728334620e-02);
2036 process_point_3(2.1265472541483140e-02,
2037 8.1083024109854862e-01,
2038 8.1107708299033420e-03);
2043 process_point_1(1.0795272496221089e-01,
2044 2.6426650908408830e-02);
2045 process_point_1(1.8510948778258660e-01,
2046 5.2031747563738531e-02);
2047 process_point_1(4.2316543684767283e-02,
2048 7.5252561535401989e-03);
2049 process_point_1(3.1418170912403898e-01,
2050 4.1763782856934897e-02);
2051 process_point_2(4.3559132858383021e-01,
2052 3.6280930261308818e-02);
2053 process_point_3(2.1433930127130570e-02,
2054 7.1746406342630831e-01,
2055 7.1569028908444327e-03);
2056 process_point_3(2.0413933387602909e-01,
2057 5.8379737830214440e-01,
2058 1.5453486150960340e-02);
2072 b_point_permutations.push_back({centroid});
2073 b_weights.push_back(9.7135796282798836e-02);
2074 process_point_1(4.4729513394452691e-02,
2075 2.5577675658698031e-02);
2076 process_point_1(4.8968251919873762e-01,
2077 3.1334700227139071e-02);
2078 process_point_1(4.3708959149293664e-01,
2079 7.7827541004774278e-02);
2080 process_point_1(1.8820353561903275e-01,
2081 7.9647738927210249e-02);
2082 process_point_3(3.6838412054736258e-02,
2083 2.2196298916076568e-01,
2084 4.3283539377289376e-02);
2089 b_point_permutations.push_back({centroid});
2090 b_weights.push_back(8.1743329146285973e-02);
2091 process_point_1(3.2055373216943517e-02,
2092 1.3352968813149567e-02);
2093 process_point_1(1.4216110105656438e-01,
2094 4.5957963604744731e-02);
2095 process_point_3(2.8367665339938453e-02,
2096 1.6370173373718250e-01,
2097 2.5297757707288385e-02);
2098 process_point_3(2.9619889488729734e-02,
2099 3.6914678182781102e-01,
2100 3.4184648162959429e-02);
2101 process_point_3(1.4813288578382056e-01,
2102 3.2181299528883545e-01,
2103 6.3904906396424044e-02);
2110 b_point_permutations.push_back({centroid});
2111 b_weights.push_back(5.8010548912480253e-02);
2112 process_point_1(6.1981697552226933e-10,
2113 6.4319281759256394e-05);
2114 process_point_1(1.6077453539526160e-01,
2115 2.3173338462425461e-02);
2116 process_point_1(3.2227652182142102e-01,
2117 2.9562912335429289e-02);
2118 process_point_1(4.5108918345413578e-02,
2119 8.0639799796161822e-03);
2120 process_point_2(1.1229654600437609e-01,
2121 3.8134080103702457e-02);
2122 process_point_3(4.5887144875245922e-01,
2123 2.5545792330413102e-03,
2124 8.3844221982985519e-03);
2125 process_point_3(3.3775870685338598e-02,
2126 7.1835032644207453e-01,
2127 1.0234559352745330e-02);
2128 process_point_3(1.8364136980992790e-01,
2129 3.4415910578175279e-02,
2130 2.0524915967988139e-02);
2135 b_point_permutations.push_back({centroid});
2136 b_weights.push_back(4.7399773556020743e-02);
2137 process_point_1(3.1225006869518868e-01,
2138 2.6937059992268701e-02);
2139 process_point_1(1.1430965385734609e-01,
2140 9.8691597167933822e-03);
2141 process_point_3(4.1043073921896539e-01,
2142 1.6548602561961109e-01,
2143 1.1393881220195230e-02);
2144 process_point_3(6.1380088247906528e-03,
2145 9.4298876734520487e-01,
2146 3.6194434433925362e-04);
2147 process_point_3(1.2105018114558939e-01,
2148 4.7719037990428043e-01,
2149 2.5739731980456069e-02);
2150 process_point_3(3.2779468216442620e-02,
2151 5.9425626948000698e-01,
2152 1.0135871679755789e-02);
2153 process_point_3(3.2485281564823047e-02,
2154 8.0117728465834437e-01,
2155 6.5761472770359038e-03);
2156 process_point_3(1.7497934218393901e-01,
2157 6.2807184547536599e-01,
2158 1.2907035798861989e-02);
2171 b_point_permutations.push_back({centroid});
2172 b_weights.push_back(8.5761179732224219e-02);
2173 process_point_1(2.8485417614371900e-02, 1.0431870512894697e-02);
2174 process_point_1(4.9589190096589092e-01, 1.6606273054585369e-02);
2175 process_point_1(1.0263548271224643e-01, 3.8630759237019321e-02);
2176 process_point_1(4.3846592676435220e-01, 6.7316154079468296e-02);
2177 process_point_1(2.1021995670317828e-01, 7.0515684111716576e-02);
2178 process_point_3(7.3254276860644785e-03,
2179 1.4932478865208237e-01,
2180 1.0290289572953278e-02);
2181 process_point_3(4.6010500165429957e-02,
2182 2.8958112563770588e-01,
2183 4.0332476640500554e-02);
2188 process_point_1(2.4646363436335583e-02, 7.9316425099736389e-03);
2189 process_point_1(4.8820375094554153e-01, 2.4266838081452032e-02);
2190 process_point_1(1.0925782765935427e-01, 2.8486052068877544e-02);
2191 process_point_1(4.4011164865859309e-01, 4.9918334928060942e-02);
2192 process_point_1(2.7146250701492608e-01, 6.2541213195902765e-02);
2193 process_point_3(2.1382490256170616e-02,
2194 1.2727971723358933e-01,
2195 1.5083677576511438e-02);
2196 process_point_3(2.3034156355267121e-02,
2197 2.9165567973834094e-01,
2198 2.1783585038607559e-02);
2199 process_point_3(1.1629601967792658e-01,
2200 2.5545422863851736e-01,
2201 4.3227363659414209e-02);
2210 b_point_permutations.push_back({centroid});
2211 b_weights.push_back(6.7960036586831640e-02);
2212 process_point_1(2.1509681108843159e-02, 6.0523371035391717e-03);
2213 process_point_1(4.8907694645253935e-01, 2.3994401928894731e-02);
2214 process_point_1(4.2694141425980042e-01, 5.5601967530453329e-02);
2215 process_point_1(2.2137228629183292e-01, 5.8278485119199981e-02);
2216 process_point_3(5.1263891023823893e-03,
2217 2.7251581777342970e-01,
2218 9.5906810035432631e-03);
2219 process_point_3(2.4370186901093827e-02,
2220 1.1092204280346341e-01,
2221 1.4965401105165668e-02);
2222 process_point_3(8.7895483032197297e-02,
2223 1.6359740106785048e-01,
2224 2.4179039811593819e-02);
2225 process_point_3(6.8012243554206653e-02,
2226 3.0844176089211778e-01,
2227 3.4641276140848373e-02);
2232 process_point_1(1.9390961248701044e-02, 4.9234036024000819e-03);
2233 process_point_1(6.1799883090872587e-02, 1.4433699669776668e-02);
2234 process_point_1(4.8896391036217862e-01, 2.1883581369428889e-02);
2235 process_point_1(4.1764471934045394e-01, 3.2788353544125348e-02);
2236 process_point_1(1.7720553241254344e-01, 4.2162588736993016e-02);
2237 process_point_1(2.7347752830883865e-01, 5.1774104507291585e-02);
2238 process_point_3(1.2683309328720416e-03,
2239 1.1897449769695684e-01,
2240 5.0102288385006719e-03);
2241 process_point_3(1.4646950055654417e-02,
2242 2.9837288213625779e-01,
2243 1.4436308113533840e-02);
2244 process_point_3(5.7124757403647919e-02,
2245 1.7226668782135557e-01,
2246 2.4665753212563674e-02);
2247 process_point_3(9.2916249356971847e-02,
2248 3.3686145979634496e-01,
2249 3.8571510787060684e-02);
2257 for (
unsigned int permutation_n = 0; permutation_n < b_weights.size();
2260 for (
const std::array<double, dim + 1> &b_point :
2261 b_point_permutations[permutation_n])
2263 const double volume = (dim == 2 ? 1.0 / 2.0 : 1.0 / 6.0);
2264 this->weights.emplace_back(volume * b_weights[permutation_n]);
2266 for (
int d = 0; d < dim; ++d)
2267 c_point[d] = b_point[d];
2268 this->quadrature_points.emplace_back(c_point);