From 6b2c4966678fb368fc325325af339a7263b39b00 Mon Sep 17 00:00:00 2001 From: anand43 Date: Fri, 10 Nov 2023 11:49:44 -0500 Subject: [PATCH] Changed normalisation to 4pi to be consistent everywhere --- src/swiftest/swiftest_sph.f90 | 4 ++-- swiftest/sph_harmonics.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/swiftest/swiftest_sph.f90 b/src/swiftest/swiftest_sph.f90 index b70d9e69b..cda7d617f 100644 --- a/src/swiftest/swiftest_sph.f90 +++ b/src/swiftest/swiftest_sph.f90 @@ -64,9 +64,9 @@ module subroutine swiftest_sph_g_acc_one(GMcb, r_0, phi, theta, rh, c_lm, g_sph, fac2 = 2 * t0 * (t1 - (2.0_DP - (14.0_DP * t2 / 3.0_DP)) * t3) if(cos(theta) > epsilon(0.0_DP)) then - call PLegendreA_d1(p, p_deriv, l_max, cos(theta)) ! Unnormalized Associated Legendre Polynomials and the 1st Derivative + call PlmBar_d1(p, p_deriv, l_max, cos(theta)) ! Unnormalized Associated Legendre Polynomials and the 1st Derivative else - call PLegendreA_d1(p, p_deriv, l_max, 0.0_DP) + call PlmBar_d1(p, p_deriv, l_max, 0.0_DP) end if do l = 1, l_max ! skipping the l = 0 term; It is the spherical body term diff --git a/swiftest/sph_harmonics.py b/swiftest/sph_harmonics.py index e5a1d9b71..79f0abf03 100644 --- a/swiftest/sph_harmonics.py +++ b/swiftest/sph_harmonics.py @@ -72,7 +72,7 @@ def clm_from_ellipsoid(mass, density, a, b = None, c = None, lmax = 6, ref_radiu # get gravity coefficients clm_class = pysh.SHGravCoeffs.from_shape(shape_SH, rho = density, gm = Gmass) # 4pi normalization - clm = clm_class.to_array(normalization = 'ortho') # Change to orthonormal normalization + clm = clm_class.to_array(normalization = '4pi') # export as array with 4pi normalization # Return reference radius EQUALS the radius of the Central Body print(f'Ensure that the Central Body radius equals the reference radius.') @@ -123,7 +123,7 @@ def clm_from_relief(mass, density, grid, lmax = 6, ref_radius = True): # get coefficients clm_class = pysh.SHGravcoeffs.from_shape(shape_SH, rho = density, gm = Gmass) # 4pi normalization - clm = clm_class.to_array(normalization = 'ortho') # change to orthogonal normalization + clm = clm_class.to_array(normalization = '4pi') # export as array with 4pi normalization # Return reference radius EQUALS the radius of the Central Body