diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2021-11-23 14:57:39 +0100 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2021-11-23 14:57:39 +0100 |
commit | fd3fc91059228aa475bbae1581ab80a89f578176 (patch) | |
tree | 4010484cac012592a55e9c823a2d5ef28f3bfdb1 | |
parent | 1b892fe2ac1c49d691f5358bf7342bdcf2399c68 (diff) | |
download | code-fd3fc91059228aa475bbae1581ab80a89f578176.tar.gz code-fd3fc91059228aa475bbae1581ab80a89f578176.tar.bz2 code-fd3fc91059228aa475bbae1581ab80a89f578176.zip |
Switched to Legendre polynomials.
-rw-r--r-- | stokes.hpp | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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 { |