Fixed multigpu for euler

This commit is contained in:
André R. Brodtkorb
2018-11-29 14:33:13 +01:00
parent b03afc3d81
commit f9f0f20df8
7 changed files with 463 additions and 637 deletions

View File

@@ -185,7 +185,7 @@ def genKelvinHelmholtz(nx, ny, gamma, roughness=0.125):
dy = 1.0 / ny
def genSmoothRandom(nx, n):
assert (n <= nx), "Number of generated points nx must be larger than n"
n = max(1, min(n, nx))
if n == nx:
return np.random.random(nx)-0.5
@@ -195,7 +195,17 @@ def genKelvinHelmholtz(nx, ny, gamma, roughness=0.125):
#Control points and interpolator
xp = np.linspace(0.0, 1.0, n)
yp = np.random.random(n) - 0.5
f = interp1d(xp, yp, kind='cubic')
if (n == 1):
kind = 'nearest'
elif (n == 2):
kind = 'linear'
elif (n == 3):
kind = 'quadratic'
else:
kind = 'cubic'
f = interp1d(xp, yp, kind=kind)
#Interpolation points
x = np.linspace(0.0, 1.0, nx)