[cig-commits] [commit] master: py: Fix bug in GLJ derivative calculation. (5bbd56d)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Mon Jan 12 13:11:37 PST 2015
Repository : https://github.com/geodynamics/specfem1d
On branch : master
Link : https://github.com/geodynamics/specfem1d/compare/9969ec4660bfbd56d30e7cea351276fec0318f59...067b9384a823b64c0f0fe1aff95de89c7d9d5397
>---------------------------------------------------------------
commit 5bbd56d9acd09a43c0ca2e320b96c7f2eb0a38a9
Author: Elliott Sales de Andrade <esalesde at physics.utoronto.ca>
Date: Mon Jan 12 15:19:02 2015 -0500
py: Fix bug in GLJ derivative calculation.
One element uses integer division, when it should be using floating
division. (This is why I think it's a good idea to use division from
Python 3.)
>---------------------------------------------------------------
5bbd56d9acd09a43c0ca2e320b96c7f2eb0a38a9
Python_version/gll.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Python_version/gll.py b/Python_version/gll.py
index c6bebfa..cad5b40 100644
--- a/Python_version/gll.py
+++ b/Python_version/gll.py
@@ -112,7 +112,7 @@ def glj_derivative(ksiGLJ):
elif 0 < i < N and j == N:
deriv[i,j] = 1/(1-ksiGLJ[i])*1/PbInterp(ksiGLJ[i])
elif i == N and j == 0:
- deriv[i,j] = (-1)**(N+1)*(N+1)/4
+ deriv[i,j] = (-1)**(N+1)*(N+1)/4.
elif i == N and 0 < j < N:
deriv[i,j] = -1/(1-ksiGLJ[j])*PbInterp(ksiGLJ[j])
elif i == N and j == N:
More information about the CIG-COMMITS
mailing list