summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2021-11-23 14:57:39 +0100
committerJaron Kent-Dobias <jaron@kent-dobias.com>2021-11-23 14:57:39 +0100
commitfd3fc91059228aa475bbae1581ab80a89f578176 (patch)
tree4010484cac012592a55e9c823a2d5ef28f3bfdb1
parent1b892fe2ac1c49d691f5358bf7342bdcf2399c68 (diff)
downloadcode-fd3fc91059228aa475bbae1581ab80a89f578176.tar.gz
code-fd3fc91059228aa475bbae1581ab80a89f578176.tar.bz2
code-fd3fc91059228aa475bbae1581ab80a89f578176.zip
Switched to Legendre polynomials.
-rw-r--r--stokes.hpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/stokes.hpp b/stokes.hpp
index 60a3f55..b511b0d 100644
--- a/stokes.hpp
+++ b/stokes.hpp
@@ -28,11 +28,12 @@ public:
}
Real gCoeff(unsigned i, Real t) const {
- return (1 - t) * t * pow(t, i);
+ return (1 - t) * t * std::legendre(i, 2 * t - 1);
}
Real dgCoeff(unsigned i, Real t) const {
- return (i + 1) * (1 - t) * pow(t, i) - pow(t, i + 1);
+ Real x = 2 * t - 1;
+ return ((i - 1) * x * std::legendre(i, x) - (i + 1) * std::legendre(i + 1, x)) / 2.0;
}
Vector<Scalar> f(Real t) const {