53 std::vector<double> & values,
54 const unsigned int)
const
56 Assert(values.size() == points.size(),
59 for (
unsigned int i = 0; i < points.size(); ++i)
78 std::vector<double> & values,
79 const unsigned int)
const
81 Assert(values.size() == points.size(),
84 for (
unsigned int i = 0; i < points.size(); ++i)
114 const unsigned int)
const
116 Assert(gradients.size() == points.size(),
119 for (
unsigned int i = 0; i < points.size(); ++i)
140 std::vector<double> & values,
141 const unsigned int)
const
144 Assert(values.size() == points.size(),
147 for (
unsigned int i = 0; i < points.size(); ++i)
150 values[i] = p(0) * p(1);
162 Assert(values.size() == points.size(),
166 for (
unsigned int i = 0; i < points.size(); ++i)
169 values[i](0) = p(0) * p(1);
186 std::vector<double> & values,
187 const unsigned int)
const
190 Assert(values.size() == points.size(),
193 for (
unsigned int i = 0; i < points.size(); ++i)
216 const unsigned int)
const
219 Assert(gradients.size() == points.size(),
222 for (
unsigned int i = 0; i < points.size(); ++i)
224 gradients[i][0] = points[i](1);
225 gradients[i][1] = points[i](0);
237 Assert(gradients.size() == points.size(),
239 Assert(gradients[0].size() == 1,
242 for (
unsigned int i = 0; i < points.size(); ++i)
244 gradients[i][0][0] = points[i](1);
245 gradients[i][0][1] = points[i](0);
266 return 1. - p(0) * p(0) + offset;
268 return (1. - p(0) * p(0)) * (1. - p(1) * p(1)) + offset;
270 return (1. - p(0) * p(0)) * (1. - p(1) * p(1)) * (1. - p(2) * p(2)) +
281 std::vector<double> & values,
282 const unsigned int)
const
284 Assert(values.size() == points.size(),
287 for (
unsigned int i = 0; i < points.size(); ++i)
293 values[i] = 1. - p(0) * p(0) + offset;
296 values[i] = (1. - p(0) * p(0)) * (1. - p(1) * p(1)) + offset;
300 (1. - p(0) * p(0)) * (1. - p(1) * p(1)) * (1. - p(2) * p(2)) +
320 return -2. * ((1. - p(0) * p(0)) + (1. - p(1) * p(1)));
322 return -2. * ((1. - p(0) * p(0)) * (1. - p(1) * p(1)) +
323 (1. - p(1) * p(1)) * (1. - p(2) * p(2)) +
324 (1. - p(2) * p(2)) * (1. - p(0) * p(0)));
334 std::vector<double> & values,
335 const unsigned int)
const
337 Assert(values.size() == points.size(),
340 for (
unsigned int i = 0; i < points.size(); ++i)
349 values[i] = -2. * ((1. - p(0) * p(0)) + (1. - p(1) * p(1)));
352 values[i] = -2. * ((1. - p(0) * p(0)) * (1. - p(1) * p(1)) +
353 (1. - p(1) * p(1)) * (1. - p(2) * p(2)) +
354 (1. - p(2) * p(2)) * (1. - p(0) * p(0)));
370 result[0] = -2. * p(0);
373 result[0] = -2. * p(0) * (1. - p(1) * p(1));
374 result[1] = -2. * p(1) * (1. - p(0) * p(0));
377 result[0] = -2. * p(0) * (1. - p(1) * p(1)) * (1. - p(2) * p(2));
378 result[1] = -2. * p(1) * (1. - p(0) * p(0)) * (1. - p(2) * p(2));
379 result[2] = -2. * p(2) * (1. - p(0) * p(0)) * (1. - p(1) * p(1));
391 const unsigned int)
const
393 Assert(gradients.size() == points.size(),
396 for (
unsigned int i = 0; i < points.size(); ++i)
402 gradients[i][0] = -2. * p(0);
405 gradients[i][0] = -2. * p(0) * (1. - p(1) * p(1));
406 gradients[i][1] = -2. * p(1) * (1. - p(0) * p(0));
410 -2. * p(0) * (1. - p(1) * p(1)) * (1. - p(2) * p(2));
412 -2. * p(1) * (1. - p(0) * p(0)) * (1. - p(2) * p(2));
414 -2. * p(2) * (1. - p(0) * p(0)) * (1. - p(1) * p(1));
455 std::vector<double> & values,
456 const unsigned int)
const
458 Assert(values.size() == points.size(),
461 for (
unsigned int i = 0; i < points.size(); ++i)
462 values[i] =
value(points[i]);
472 Assert(values.size() == points.size(),
475 for (
unsigned int i = 0; i < points.size(); ++i)
477 const double v =
value(points[i]);
478 for (
unsigned int k = 0; k < values[i].size(); ++k)
511 std::vector<double> & values,
512 const unsigned int)
const
514 Assert(values.size() == points.size(),
517 for (
unsigned int i = 0; i < points.size(); ++i)
518 values[i] = laplacian(points[i]);
558 const unsigned int)
const
560 Assert(gradients.size() == points.size(),
563 for (
unsigned int i = 0; i < points.size(); ++i)
622 const double cococo = -pi2 * std::cos(
numbers::PI_2 * p(0)) *
635 result[0][0] = cococo;
636 result[1][1] = cococo;
637 result[2][2] = cococo;
639 result[0][1] = sisico;
640 result[0][2] = sicosi;
641 result[1][2] = cosisi;
655 const unsigned int)
const
657 Assert(hessians.size() == points.size(),
662 for (
unsigned int i = 0; i < points.size(); ++i)
676 hessians[i][0][0] = coco;
677 hessians[i][1][1] = coco;
679 hessians[i][0][1] = sisi;
684 const double cococo = -pi2 * std::cos(
numbers::PI_2 * p(0)) *
697 hessians[i][0][0] = cococo;
698 hessians[i][1][1] = cococo;
699 hessians[i][2][2] = cococo;
701 hessians[i][0][1] = sisico;
702 hessians[i][0][2] = sicosi;
703 hessians[i][1][2] = cosisi;
723 const unsigned int d)
const
726 const unsigned int d1 = (
d + 1) % dim;
727 const unsigned int d2 = (
d + 2) % dim;
783 std::vector<double> & values,
784 const unsigned int d)
const
786 Assert(values.size() == points.size(),
789 const unsigned int d1 = (
d + 1) % dim;
790 const unsigned int d2 = (
d + 2) % dim;
792 for (
unsigned int i = 0; i < points.size(); ++i)
822 Assert(values.size() == points.size(),
825 for (
unsigned int i = 0; i < points.size(); ++i)
860 const unsigned int d)
const
869 const unsigned int d)
const
872 const unsigned int d1 = (
d + 1) % dim;
873 const unsigned int d2 = (
d + 2) % dim;
910 const unsigned int d)
const
913 const unsigned int d1 = (
d + 1) % dim;
914 const unsigned int d2 = (
d + 2) % dim;
917 Assert(gradients.size() == points.size(),
919 for (
unsigned int i = 0; i < points.size(); ++i)
962 for (
unsigned int i = 0; i < points.size(); ++i)
976 gradients[i][0][0] = coco;
977 gradients[i][1][1] = coco;
978 gradients[i][0][1] = sisi;
979 gradients[i][1][0] = sisi;
984 const double cococo = -pi2 * std::cos(
numbers::PI_2 * p(0)) *
997 gradients[i][0][0] = cococo;
998 gradients[i][1][1] = cococo;
999 gradients[i][2][2] = cococo;
1000 gradients[i][0][1] = sisico;
1001 gradients[i][1][0] = sisico;
1002 gradients[i][0][2] = sicosi;
1003 gradients[i][2][0] = sicosi;
1004 gradients[i][1][2] = cosisi;
1005 gradients[i][2][1] = cosisi;
1024 return std::exp(p(0));
1026 return std::exp(p(0)) * std::exp(p(1));
1028 return std::exp(p(0)) * std::exp(p(1)) * std::exp(p(2));
1038 std::vector<double> & values,
1039 const unsigned int)
const
1041 Assert(values.size() == points.size(),
1044 for (
unsigned int i = 0; i < points.size(); ++i)
1050 values[i] = std::exp(p(0));
1053 values[i] = std::exp(p(0)) * std::exp(p(1));
1056 values[i] = std::exp(p(0)) * std::exp(p(1)) * std::exp(p(2));
1071 return std::exp(p(0));
1073 return 2 * std::exp(p(0)) * std::exp(p(1));
1075 return 3 * std::exp(p(0)) * std::exp(p(1)) * std::exp(p(2));
1085 std::vector<double> & values,
1086 const unsigned int)
const
1088 Assert(values.size() == points.size(),
1091 for (
unsigned int i = 0; i < points.size(); ++i)
1097 values[i] = std::exp(p(0));
1100 values[i] = 2 * std::exp(p(0)) * std::exp(p(1));
1103 values[i] = 3 * std::exp(p(0)) * std::exp(p(1)) * std::exp(p(2));
1119 result[0] = std::exp(p(0));
1122 result[0] = std::exp(p(0)) * std::exp(p(1));
1123 result[1] = result[0];
1126 result[0] = std::exp(p(0)) * std::exp(p(1)) * std::exp(p(2));
1127 result[1] = result[0];
1128 result[2] = result[0];
1140 const unsigned int)
const
1142 Assert(gradients.size() == points.size(),
1145 for (
unsigned int i = 0; i < points.size(); ++i)
1151 gradients[i][0] = std::exp(p(0));
1154 gradients[i][0] = std::exp(p(0)) * std::exp(p(1));
1155 gradients[i][1] = gradients[i][0];
1159 std::exp(p(0)) * std::exp(p(1)) * std::exp(p(2));
1160 gradients[i][1] = gradients[i][0];
1161 gradients[i][2] = gradients[i][0];
1178 if ((x >= 0) && (y >= 0))
1182 double r2 = x * x + y * y;
1184 return std::pow(r2, 1. / 3.) * std::sin(2. / 3. * phi);
1190 std::vector<double> & values,
1191 const unsigned int)
const
1193 Assert(values.size() == points.size(),
1196 for (
unsigned int i = 0; i < points.size(); ++i)
1198 double x = points[i](0);
1199 double y = points[i](1);
1201 if ((x >= 0) && (y >= 0))
1206 double r2 = x * x + y * y;
1208 values[i] = std::pow(r2, 1. / 3.) * std::sin(2. / 3. * phi);
1216 const std::vector<
Point<2>> &points,
1219 Assert(values.size() == points.size(),
1222 for (
unsigned int i = 0; i < points.size(); ++i)
1224 Assert(values[i].size() == 1,
1226 double x = points[i](0);
1227 double y = points[i](1);
1229 if ((x >= 0) && (y >= 0))
1234 double r2 = x * x + y * y;
1236 values[i](0) = std::pow(r2, 1. / 3.) * std::sin(2. / 3. * phi);
1251 std::vector<double> & values,
1252 const unsigned int)
const
1254 Assert(values.size() == points.size(),
1257 for (
unsigned int i = 0; i < points.size(); ++i)
1268 double r43 = std::pow(x * x + y * y, 2. / 3.);
1271 result[0] = 2. / 3. *
1272 (std::sin(2. / 3. * phi) * x + std::cos(2. / 3. * phi) * y) /
1274 result[1] = 2. / 3. *
1275 (std::sin(2. / 3. * phi) * y - std::cos(2. / 3. * phi) * x) /
1284 const unsigned int)
const
1286 Assert(gradients.size() == points.size(),
1289 for (
unsigned int i = 0; i < points.size(); ++i)
1295 double r43 = std::pow(x * x + y * y, 2. / 3.);
1299 (std::sin(2. / 3. * phi) * x + std::cos(2. / 3. * phi) * y) / r43;
1302 (std::sin(2. / 3. * phi) * y - std::cos(2. / 3. * phi) * x) / r43;
1309 const std::vector<
Point<2>> & points,
1310 std::vector<std::vector<
Tensor<1, 2>>> &gradients)
const
1312 Assert(gradients.size() == points.size(),
1315 for (
unsigned int i = 0; i < points.size(); ++i)
1317 Assert(gradients[i].size() == 1,
1323 double r43 = std::pow(x * x + y * y, 2. / 3.);
1325 gradients[i][0][0] =
1327 (std::sin(2. / 3. * phi) * x + std::cos(2. / 3. * phi) * y) / r43;
1328 gradients[i][0][1] =
1330 (std::sin(2. / 3. * phi) * y - std::cos(2. / 3. * phi) * x) / r43;
1346 const double x = p(0);
1347 const double y = p(1);
1349 const double r43 = std::pow(x * x + y * y, 2. / 3.);
1352 (std::sin(2. / 3. * phi) * p(
d) +
1353 (
d == 0 ? (std::cos(2. / 3. * phi) * y) :
1354 (-std::cos(2. / 3. * phi) * x))) /
1361 std::vector<double> & values,
1362 const unsigned int d)
const
1367 for (
unsigned int i = 0; i < points.size(); ++i)
1370 const double x = p(0);
1371 const double y = p(1);
1373 const double r43 = std::pow(x * x + y * y, 2. / 3.);
1375 values[i] = 2. / 3. *
1376 (std::sin(2. / 3. * phi) * p(
d) +
1377 (
d == 0 ? (std::cos(2. / 3. * phi) * y) :
1378 (-std::cos(2. / 3. * phi) * x))) /
1386 const std::vector<
Point<2>> &points,
1389 Assert(values.size() == points.size(),
1392 for (
unsigned int i = 0; i < points.size(); ++i)
1396 const double x = p(0);
1397 const double y = p(1);
1399 const double r43 = std::pow(x * x + y * y, 2. / 3.);
1403 (std::sin(2. / 3. * phi) * x + std::cos(2. / 3. * phi) * y) / r43;
1406 (std::sin(2. / 3. * phi) * y - std::cos(2. / 3. * phi) * x) / r43;
1413 const unsigned int)
const
1421 std::vector<double> & values,
1422 const unsigned int)
const
1424 Assert(values.size() == points.size(),
1427 for (
unsigned int i = 0; i < points.size(); ++i)
1435 const unsigned int )
const
1446 const unsigned int )
const
1465 const unsigned int)
const
1471 double r2 = x * x + y * y;
1473 return std::pow(r2, .25) * std::sin(.5 * phi);
1481 std::vector<double> & values,
1482 const unsigned int)
const
1484 Assert(values.size() == points.size(),
1487 for (
unsigned int i = 0; i < points.size(); ++i)
1489 double x = points[i](0);
1490 double y = points[i](1);
1493 double r2 = x * x + y * y;
1495 values[i] = std::pow(r2, .25) * std::sin(.5 * phi);
1506 Assert(values.size() == points.size(),
1509 for (
unsigned int i = 0; i < points.size(); ++i)
1511 Assert(values[i].size() == 1,
1514 double x = points[i](0);
1515 double y = points[i](1);
1518 double r2 = x * x + y * y;
1520 values[i](0) = std::pow(r2, .25) * std::sin(.5 * phi);
1528 const unsigned int)
const
1538 std::vector<double> & values,
1539 const unsigned int)
const
1541 Assert(values.size() == points.size(),
1544 for (
unsigned int i = 0; i < points.size(); ++i)
1552 const unsigned int)
const
1557 double r64 = std::pow(x * x + y * y, 3. / 4.);
1560 result[0] = 1. / 2. *
1561 (std::sin(1. / 2. * phi) * x + std::cos(1. / 2. * phi) * y) /
1563 result[1] = 1. / 2. *
1564 (std::sin(1. / 2. * phi) * y - std::cos(1. / 2. * phi) * x) /
1575 const unsigned int)
const
1577 Assert(gradients.size() == points.size(),
1580 for (
unsigned int i = 0; i < points.size(); ++i)
1586 double r64 = std::pow(x * x + y * y, 3. / 4.);
1590 (std::sin(1. / 2. * phi) * x + std::cos(1. / 2. * phi) * y) / r64;
1593 (std::sin(1. / 2. * phi) * y - std::cos(1. / 2. * phi) * x) / r64;
1594 for (
unsigned int d = 2;
d < dim; ++
d)
1595 gradients[i][
d] = 0.;
1605 Assert(gradients.size() == points.size(),
1608 for (
unsigned int i = 0; i < points.size(); ++i)
1610 Assert(gradients[i].size() == 1,
1617 double r64 = std::pow(x * x + y * y, 3. / 4.);
1619 gradients[i][0][0] =
1621 (std::sin(1. / 2. * phi) * x + std::cos(1. / 2. * phi) * y) / r64;
1622 gradients[i][0][1] =
1624 (std::sin(1. / 2. * phi) * y - std::cos(1. / 2. * phi) * x) / r64;
1625 for (
unsigned int d = 2;
d < dim; ++
d)
1626 gradients[i][0][
d] = 0.;
1635 const unsigned int)
const
1641 double r2 = x * x + y * y;
1643 return std::pow(r2, .125) * std::sin(.25 * phi);
1649 std::vector<double> & values,
1650 const unsigned int)
const
1652 Assert(values.size() == points.size(),
1655 for (
unsigned int i = 0; i < points.size(); ++i)
1657 double x = points[i](0);
1658 double y = points[i](1);
1661 double r2 = x * x + y * y;
1663 values[i] = std::pow(r2, .125) * std::sin(.25 * phi);
1670 const std::vector<
Point<2>> &points,
1673 Assert(values.size() == points.size(),
1676 for (
unsigned int i = 0; i < points.size(); ++i)
1678 Assert(values[i].size() == 1,
1681 double x = points[i](0);
1682 double y = points[i](1);
1685 double r2 = x * x + y * y;
1687 values[i](0) = std::pow(r2, .125) * std::sin(.25 * phi);
1694 const unsigned int)
const
1702 const std::vector<
Point<2>> &points,
1703 std::vector<double> & values,
1704 const unsigned int)
const
1706 Assert(values.size() == points.size(),
1709 for (
unsigned int i = 0; i < points.size(); ++i)
1716 const unsigned int)
const
1721 double r78 = std::pow(x * x + y * y, 7. / 8.);
1725 result[0] = 1. / 4. *
1726 (std::sin(1. / 4. * phi) * x + std::cos(1. / 4. * phi) * y) /
1728 result[1] = 1. / 4. *
1729 (std::sin(1. / 4. * phi) * y - std::cos(1. / 4. * phi) * x) /
1737 const std::vector<
Point<2>> &points,
1739 const unsigned int)
const
1741 Assert(gradients.size() == points.size(),
1744 for (
unsigned int i = 0; i < points.size(); ++i)
1750 double r78 = std::pow(x * x + y * y, 7. / 8.);
1754 (std::sin(1. / 4. * phi) * x + std::cos(1. / 4. * phi) * y) / r78;
1757 (std::sin(1. / 4. * phi) * y - std::cos(1. / 4. * phi) * x) / r78;
1764 const std::vector<
Point<2>> & points,
1765 std::vector<std::vector<
Tensor<1, 2>>> &gradients)
const
1767 Assert(gradients.size() == points.size(),
1770 for (
unsigned int i = 0; i < points.size(); ++i)
1772 Assert(gradients[i].size() == 1,
1779 double r78 = std::pow(x * x + y * y, 7. / 8.);
1781 gradients[i][0][0] =
1783 (std::sin(1. / 4. * phi) * x + std::cos(1. / 4. * phi) * y) / r78;
1784 gradients[i][0][1] =
1786 (std::sin(1. / 4. * phi) * y - std::cos(1. / 4. * phi) * x) / r78;
1794 const double steepness)
1795 : direction(direction)
1796 , steepness(steepness)
1819 double x = steepness * (-cosine * p(0) + sine * p(1));
1828 std::vector<double> & values,
1829 const unsigned int)
const
1831 Assert(values.size() == p.size(),
1834 for (
unsigned int i = 0; i < p.size(); ++i)
1836 double x = steepness * (-cosine * p[i](0) + sine * p[i](1));
1846 double x = steepness * (-cosine * p(0) + sine * p(1));
1847 double r = 1 + x * x;
1848 return 2 * steepness * steepness * x / (r * r);
1855 std::vector<double> & values,
1856 const unsigned int)
const
1858 Assert(values.size() == p.size(),
1861 double f = 2 * steepness * steepness;
1863 for (
unsigned int i = 0; i < p.size(); ++i)
1865 double x = steepness * (-cosine * p[i](0) + sine * p[i](1));
1866 double r = 1 + x * x;
1867 values[i] = f * x / (r * r);
1877 double x = steepness * (-cosine * p(0) + sine * p(1));
1878 double r = -steepness * (1 + x * x);
1880 erg[0] = cosine * r;
1891 const unsigned int)
const
1893 Assert(gradients.size() == p.size(),
1896 for (
unsigned int i = 0; i < p.size(); ++i)
1898 double x = steepness * (cosine * p[i](0) + sine * p[i](1));
1899 double r = -steepness * (1 + x * x);
1900 gradients[i][0] = cosine * r;
1901 gradients[i][1] = sine * r;
1913 return sizeof(*this);
1925 , fourier_coefficients(fourier_coefficients)
1933 const unsigned int component)
const
1937 return std::cos(fourier_coefficients * p);
1945 const unsigned int component)
const
1949 return -fourier_coefficients * std::sin(fourier_coefficients * p);
1957 const unsigned int component)
const
1961 return (fourier_coefficients * fourier_coefficients) *
1962 (-std::cos(fourier_coefficients * p));
1975 , fourier_coefficients(fourier_coefficients)
1983 const unsigned int component)
const
1987 return std::sin(fourier_coefficients * p);
1995 const unsigned int component)
const
1999 return fourier_coefficients * std::cos(fourier_coefficients * p);
2007 const unsigned int component)
const
2011 return (fourier_coefficients * fourier_coefficients) *
2012 (-std::sin(fourier_coefficients * p));
2023 const std::vector<
Point<dim>> &fourier_coefficients,
2024 const std::vector<double> & weights)
2026 , fourier_coefficients(fourier_coefficients)
2039 const unsigned int component)
const
2044 const unsigned int n = weights.size();
2046 for (
unsigned int s = 0; s < n; ++s)
2047 sum += weights[s] * std::sin(fourier_coefficients[s] * p);
2057 const unsigned int component)
const
2062 const unsigned int n = weights.size();
2064 for (
unsigned int s = 0; s < n; ++s)
2065 sum += fourier_coefficients[s] * std::cos(fourier_coefficients[s] * p);
2075 const unsigned int component)
const
2080 const unsigned int n = weights.size();
2082 for (
unsigned int s = 0; s < n; ++s)
2083 sum -= (fourier_coefficients[s] * fourier_coefficients[s]) *
2084 std::sin(fourier_coefficients[s] * p);
2097 const std::vector<
Point<dim>> &fourier_coefficients,
2098 const std::vector<double> & weights)
2100 , fourier_coefficients(fourier_coefficients)
2113 const unsigned int component)
const
2118 const unsigned int n = weights.size();
2120 for (
unsigned int s = 0; s < n; ++s)
2121 sum += weights[s] * std::cos(fourier_coefficients[s] * p);
2131 const unsigned int component)
const
2136 const unsigned int n = weights.size();
2138 for (
unsigned int s = 0; s < n; ++s)
2139 sum -= fourier_coefficients[s] * std::sin(fourier_coefficients[s] * p);
2149 const unsigned int component)
const
2154 const unsigned int n = weights.size();
2156 for (
unsigned int s = 0; s < n; ++s)
2157 sum -= (fourier_coefficients[s] * fourier_coefficients[s]) *
2158 std::cos(fourier_coefficients[s] * p);
2173 , exponents(exponents)
2186 for (
unsigned int s = 0; s < dim; ++s)
2190 ExcMessage(
"Exponentiation of a negative base number with "
2191 "a real exponent can't be performed."));
2192 prod *= std::pow(p[s], exponents[s]);
2206 for (
unsigned int i = 0; i < values.
size(); ++i)
2215 const unsigned int component)
const
2221 for (
unsigned int d = 0;
d < dim; ++
d)
2224 for (
unsigned int s = 0; s < dim; ++s)
2226 if ((s ==
d) && (exponents[s] == 0) && (p[s] == 0))
2236 "Exponentiation of a negative base number with "
2237 "a real exponent can't be performed."));
2239 (s ==
d ? exponents[s] * std::pow(p[s], exponents[s] - 1) :
2240 std::pow(p[s], exponents[s]));
2254 std::vector<double> & values,
2255 const unsigned int component)
const
2257 Assert(values.size() == points.size(),
2260 for (
unsigned int i = 0; i < points.size(); ++i)
2267 const double wave_number,
2270 , wave_number(wave_number)
2289 std::vector<double> & values,
2290 const unsigned int)
const
2294 for (
unsigned int k = 0; k < points.size(); ++k)
2296 const double r = points[k].distance(
center);
2308 const double co = (r == 0.) ? 0. : (p(0) -
center(0)) / r;
2309 const double si = (r == 0.) ? 0. : (p(1) -
center(1)) / r;
2317 result[0] = wave_number * co * dJn;
2318 result[1] = wave_number * si * dJn;
2328 const unsigned int)
const
2332 for (
unsigned int k = 0; k < points.size(); ++k)
2336 const double co = (r == 0.) ? 0. : (p(0) -
center(0)) / r;
2337 const double si = (r == 0.) ? 0. : (p(1) -
center(1)) / r;
2345 result[0] = wave_number * co * dJn;
2346 result[1] = wave_number * si * dJn;
2362 return ((1 - xi[0]) * data_values[ix[0]] +
2363 xi[0] * data_values[ix[0] + 1]);
2371 return (((1 - p_unit[0]) * data_values[ix[0]][ix[1]] +
2372 p_unit[0] * data_values[ix[0] + 1][ix[1]]) *
2374 ((1 - p_unit[0]) * data_values[ix[0]][ix[1] + 1] +
2375 p_unit[0] * data_values[ix[0] + 1][ix[1] + 1]) *
2384 return ((((1 - p_unit[0]) * data_values[ix[0]][ix[1]][ix[2]] +
2385 p_unit[0] * data_values[ix[0] + 1][ix[1]][ix[2]]) *
2387 ((1 - p_unit[0]) * data_values[ix[0]][ix[1] + 1][ix[2]] +
2388 p_unit[0] * data_values[ix[0] + 1][ix[1] + 1][ix[2]]) *
2391 (((1 - p_unit[0]) * data_values[ix[0]][ix[1]][ix[2] + 1] +
2392 p_unit[0] * data_values[ix[0] + 1][ix[1]][ix[2] + 1]) *
2394 ((1 - p_unit[0]) * data_values[ix[0]][ix[1] + 1][ix[2] + 1] +
2395 p_unit[0] * data_values[ix[0] + 1][ix[1] + 1][ix[2] + 1]) *
2413 grad[0] = (data_values[ix[0] + 1] - data_values[ix[0]]) /
dx[0];
2425 double u00 = data_values[ix[0]][ix[1]],
2426 u01 = data_values[ix[0] + 1][ix[1]],
2427 u10 = data_values[ix[0]][ix[1] + 1],
2428 u11 = data_values[ix[0] + 1][ix[1] + 1];
2431 ((1 - p_unit[1]) * (u01 - u00) + p_unit[1] * (u11 - u10)) /
dx[0];
2433 ((1 - p_unit[0]) * (u10 - u00) + p_unit[0] * (u11 - u01)) /
dx[1];
2445 double u000 = data_values[ix[0]][ix[1]][ix[2]],
2446 u001 = data_values[ix[0] + 1][ix[1]][ix[2]],
2447 u010 = data_values[ix[0]][ix[1] + 1][ix[2]],
2448 u100 = data_values[ix[0]][ix[1]][ix[2] + 1],
2449 u011 = data_values[ix[0] + 1][ix[1] + 1][ix[2]],
2450 u101 = data_values[ix[0] + 1][ix[1]][ix[2] + 1],
2451 u110 = data_values[ix[0]][ix[1] + 1][ix[2] + 1],
2452 u111 = data_values[ix[0] + 1][ix[1] + 1][ix[2] + 1];
2456 ((1 - p_unit[1]) * (u001 - u000) + p_unit[1] * (u011 - u010)) +
2458 ((1 - p_unit[1]) * (u101 - u100) + p_unit[1] * (u111 - u110))) /
2462 ((1 - p_unit[0]) * (u010 - u000) + p_unit[0] * (u011 - u001)) +
2464 ((1 - p_unit[0]) * (u110 - u100) + p_unit[0] * (u111 - u101))) /
2468 ((1 - p_unit[0]) * (u100 - u000) + p_unit[0] * (u101 - u001)) +
2470 ((1 - p_unit[0]) * (u110 - u010) + p_unit[0] * (u111 - u011))) /
2479 const std::array<std::vector<double>, dim> &coordinate_values,
2481 : coordinate_values(coordinate_values)
2482 , data_values(data_values)
2484 for (
unsigned int d = 0;
d < dim; ++
d)
2489 "Coordinate arrays must have at least two coordinate values!"));
2494 "Coordinate arrays must be sorted in strictly ascending order."));
2498 "Data and coordinate tables do not have the same size."));
2514 for (
unsigned int d = 0;
d < dim; ++
d)
2519 coordinate_values[
d].
end(),
2521 coordinate_values[
d].begin());
2530 if (ix[
d] == coordinate_values[
d].size())
2531 ix[
d] = coordinate_values[
d].size() - 2;
2545 const unsigned int component)
const
2551 "This is a scalar function object, the component can only be zero."));
2560 for (
unsigned int d = 0;
d < dim; ++
d)
2562 (coordinate_values[
d][ix[
d] + 1] -
2563 coordinate_values[
d][ix[
d]]),
2576 const unsigned int component)
const
2582 "This is a scalar function object, the component can only be zero."));
2588 for (
unsigned int d = 0;
d < dim; ++
d)
2589 dx[
d] = coordinate_values[
d][ix[
d] + 1] - coordinate_values[
d][ix[
d]];
2592 for (
unsigned int d = 0;
d < dim; ++
d)
2597 return gradient_interpolate(data_values, ix, p_unit,
dx);
2604 const std::array<std::pair<double, double>, dim> &interval_endpoints,
2605 const std::array<unsigned int, dim> & n_subintervals,
2607 : interval_endpoints(interval_endpoints)
2608 , n_subintervals(n_subintervals)
2609 , data_values(data_values)
2611 for (
unsigned int d = 0;
d < dim; ++
d)
2614 ExcMessage(
"There needs to be at least one subinterval in each "
2615 "coordinate direction."));
2617 ExcMessage(
"The interval in each coordinate direction needs "
2618 "to have positive size"));
2620 ExcMessage(
"The data table does not have the correct size."));
2628 const unsigned int component)
const
2634 "This is a scalar function object, the component can only be zero."));
2639 for (
unsigned int d = 0;
d < dim; ++
d)
2641 const double delta_x =
2642 ((interval_endpoints[
d].second - interval_endpoints[
d].first) /
2644 if (p[
d] <= interval_endpoints[
d].
first)
2646 else if (p[
d] >= interval_endpoints[
d].
second - delta_x)
2647 ix[
d] = n_subintervals[
d] - 1;
2649 ix[
d] =
static_cast<unsigned int>(
2650 (p[
d] - interval_endpoints[
d].first) / delta_x);
2657 for (
unsigned int d = 0;
d < dim; ++
d)
2659 const double delta_x =
2660 ((interval_endpoints[
d].second - interval_endpoints[
d].first) /
2677 const unsigned int component)
const
2683 "This is a scalar function object, the component can only be zero."));
2688 for (
unsigned int d = 0;
d < dim; ++
d)
2690 const double delta_x = ((this->interval_endpoints[
d].second -
2691 this->interval_endpoints[
d].first) /
2692 this->n_subintervals[
d]);
2693 if (p[
d] <= this->interval_endpoints[
d].
first)
2695 else if (p[
d] >= this->interval_endpoints[
d].
second - delta_x)
2696 ix[
d] = this->n_subintervals[
d] - 1;
2698 ix[
d] =
static_cast<unsigned int>(
2699 (p[
d] - this->interval_endpoints[
d].first) / delta_x);
2707 for (
unsigned int d = 0;
d < dim; ++
d)
2709 delta_x[
d] = ((this->interval_endpoints[
d].second -
2710 this->interval_endpoints[
d].first) /
2711 this->n_subintervals[
d]);
2714 ix[
d] * delta_x[
d]) /
2720 return gradient_interpolate(this->data_values, ix, p_unit, delta_x);
2731 const std::vector<double> &coefficients)
2733 , exponents(exponents)
2734 , coefficients(coefficients)
2747 const unsigned int component)
const
2753 for (
unsigned int monom = 0; monom < exponents.n_rows(); ++monom)
2756 for (
unsigned int s = 0; s < dim; ++s)
2760 ExcMessage(
"Exponentiation of a negative base number with "
2761 "a real exponent can't be performed."));
2762 prod *= std::pow(p[s], exponents[monom][s]);
2764 sum += coefficients[monom] * prod;
2774 std::vector<double> & values,
2775 const unsigned int component)
const
2777 Assert(values.size() == points.size(),
2780 for (
unsigned int i = 0; i < points.size(); ++i)
2789 const unsigned int component)
const
2796 for (
unsigned int d = 0;
d < dim; ++
d)
2800 for (
unsigned int monom = 0; monom < exponents.n_rows(); ++monom)
2803 for (
unsigned int s = 0; s < dim; ++s)
2805 if ((s ==
d) && (exponents[monom][s] == 0) && (p[s] == 0))
2814 exponents[monom][s],
2816 "Exponentiation of a negative base number with "
2817 "a real exponent can't be performed."));
2819 (s ==
d ? exponents[monom][s] *
2820 std::pow(p[s], exponents[monom][s] - 1) :
2821 std::pow(p[s], exponents[monom][s]));
2824 sum += coefficients[monom] * prod;