Commit e15a66b8 authored by Nathan Coppin's avatar Nathan Coppin
Browse files

Update time_integration.py

parent 3193e0f6
Pipeline #9744 passed with stages
in 3 minutes and 53 seconds
...@@ -42,8 +42,8 @@ def _advance_particles(particles, f, dt, min_nsub,contact_tol,max_nsub=None,afte ...@@ -42,8 +42,8 @@ def _advance_particles(particles, f, dt, min_nsub,contact_tol,max_nsub=None,afte
vn = v + f*dt / particles.mass() vn = v + f*dt / particles.mass()
vmax = np.max(np.linalg.norm(vn,axis=1)) vmax = np.max(np.linalg.norm(vn,axis=1))
nsub = max(min_nsub, int(np.ceil((vmax * dt * 8)/min(particles.r())))) nsub = max(min_nsub, int(np.ceil((vmax * dt * 8)/min(particles.r()))))
if max_nsub is not None : #if max_nsub is not None :
nsub = min(max_nsub, nsub) # nsub = min(max_nsub, nsub)
else: else:
nsub = 1 nsub = 1
vmax = 0 vmax = 0
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment