From fd3fc91059228aa475bbae1581ab80a89f578176 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Tue, 23 Nov 2021 14:57:39 +0100 Subject: Switched to Legendre polynomials. --- stokes.hpp | 5 +++-- 1 file 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 f(Real t) const { -- cgit v1.2.3-54-g00ecf