Skip to content

Commit

Permalink
Fixed NumPy issue with float/integer numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
martijnende committed Jan 27, 2020
1 parent 48090d0 commit dc9f107
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/pyqdyn.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def __init__(self):
# Output control parameters
set_dict["V_TH"] = 1e-2 # Threshold velocity for seismic event
set_dict["NTOUT_OT"] = 1 # Temporal interval (number of time steps) for time series output
set_dict["NTOUT"] = 1 # Temporal interval (number of time steps) for snapshout output
set_dict["NTOUT"] = 1 # Temporal interval (number of time steps) for snapshot output
set_dict["NXOUT"] = 1 # Spatial interval (number of elements) for snapshot output
set_dict["OX_SEQ"] = 0 # Type of snapshot outputs (0: all snapshots in single file, 1: one file per snapshot)
set_dict["OX_DYN"] = 0 # Output specific snapshots of dynamic events defined by thresholds on peak slip velocity DYN_TH_ON and DYN_TH_OFF
Expand All @@ -196,7 +196,6 @@ def __init__(self):

set_dict["NPROC"] = 1 # Number of processors, default 1 = serial (no MPI)


self.set_dict = set_dict

pass
Expand Down
4 changes: 2 additions & 2 deletions test/singleasperity.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def render_RSF_mesh(set_dict):
Lasp *= Lc
L *= Lasp

N = np.power(2, np.ceil(np.log2(resolution*L/Lb)))
N = int(np.power(2, np.ceil(np.log2(resolution*L/Lb))))
x = np.linspace(-L/2, L/2, N, dtype=float)

a = b*(1 + cab_ratio*(1 - 2*np.exp(-(2*x/Lasp)**6)))
Expand All @@ -53,7 +53,7 @@ def render_RSF_mesh(set_dict):
V0 = V0 * V_pl / np.mean(V0)

result = {
"N": int(N),
"N": N,
"L": L,
"a": a,
"V0": V0,
Expand Down
4 changes: 2 additions & 2 deletions test/tserice.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def run_test(self):
p = self.p
set_dict = p.set_dict
t_yr = 3600 * 24 * 365.0
N = np.power(2, 11)
N = int(np.power(2, 11))

# Compute depth-dependent parameters

Expand Down Expand Up @@ -60,7 +60,7 @@ def run_test(self):
set_dict["FINITE"] = 3
set_dict["TMAX"] = 500*t_yr
set_dict["NTOUT"] = 1000
set_dict["NXOUT"] = np.power(2, 3)
set_dict["NXOUT"] = int(np.power(2, 3))
set_dict["V_PL"] = 35e-3 / t_yr
set_dict["MU"] = 3e10
set_dict["SIGMA"] = 1e8
Expand Down

0 comments on commit dc9f107

Please sign in to comment.