Skip to content

Commit

Permalink
Fix error in 3D quintic spline factor.
Browse files Browse the repository at this point in the history
Somehow this was set to 3/359 and not 1/120.  This is now fixed as per
many refernces including Violeau's book.
  • Loading branch information
prabhuramachandran committed Apr 18, 2020
1 parent dfd2d52 commit 4f73366
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pysph/base/kernels.py
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,7 @@ class QuinticSpline(object):
.. math::
\sigma_5 = \ & \frac{1}{120 h^1}, & \textrm{for dim=1}, \\
\sigma_5 = \ & \frac{7}{478\pi h^2}, \ & \textrm{for dim=2}, \\
\sigma_5 = \ & \frac{3}{359\pi h^3}, & \textrm{for dim=3}. \\
\sigma_5 = \ & \frac{1}{120\pi h^3}, & \textrm{for dim=3}. \\
"""

Expand All @@ -1077,7 +1077,7 @@ def __init__(self, dim=2):
elif dim == 2:
self.fac = M_1_PI * 7.0 / 478.0
elif dim == 3:
self.fac = M_1_PI * 3.0 / 359.0
self.fac = M_1_PI * 1.0 / 120.0

def get_deltap(self):
# The inflection points for the polynomial are obtained as
Expand Down
2 changes: 1 addition & 1 deletion pysph/base/tests/test_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ class TestQuinticSpline3D(TestGaussian3D):
kernel_factory = staticmethod(lambda: QuinticSpline(dim=3))

def test_simple(self):
self.check_kernel_at_origin(66.0 * 3.0 / (359.0 * np.pi))
self.check_kernel_at_origin(66.0 * 1.0 / (120.0 * np.pi))


###############################################################################
Expand Down

0 comments on commit 4f73366

Please sign in to comment.