python3 print function
This commit is contained in:
parent
f369a16d4b
commit
990d01ce9d
1 changed files with 19 additions and 20 deletions
|
|
@ -75,7 +75,6 @@ class CompactScheme:
|
|||
else:
|
||||
for i in range(nz):
|
||||
xsrc[:] = src[i]
|
||||
print xsrc.shape
|
||||
dst[i] = compact.dfnonp(self.hx, xsrc, 1)
|
||||
|
||||
# return np.swapaxes(dst, 1, 2)
|
||||
|
|
@ -142,23 +141,23 @@ def read_old_data (fname):
|
|||
dummy = f1.read(dummy_len)
|
||||
#dummy = f1.read(4)
|
||||
|
||||
print t, nx, ny, nz
|
||||
print (t, nx, ny, nz)
|
||||
|
||||
#raw_field = f1.read(4+bSize*5+4)[4:-4]
|
||||
V = np.fromfile(f1, dtype=np.float64, count=(3*count)).reshape((3,nz,ny,nx))
|
||||
s = np.fromfile(f1, dtype=np.float64, count=(2*count)).reshape((nz,ny,nx,2))
|
||||
|
||||
print V.order
|
||||
print s.order
|
||||
print (V.order)
|
||||
print (s.order)
|
||||
|
||||
print V.shape
|
||||
print s.shape
|
||||
print (V.shape)
|
||||
print (s.shape)
|
||||
|
||||
V.order="F"
|
||||
s.order="F"
|
||||
|
||||
print V.shape
|
||||
print s.shape
|
||||
print (V.shape)
|
||||
print (s.shape)
|
||||
|
||||
u = V[0]
|
||||
v = V[1]
|
||||
|
|
@ -192,17 +191,17 @@ def read_data (fname):
|
|||
V = np.fromfile(f1, dtype=np.float64, count=(3*count)).reshape((3,nz,ny,nx))
|
||||
s = np.fromfile(f1, dtype=np.float64, count=(2*count)).reshape((2,nz,ny,nx))
|
||||
|
||||
print V.order
|
||||
print s.order
|
||||
print (V.order)
|
||||
print (s.order)
|
||||
|
||||
print V.shape
|
||||
print s.shape
|
||||
print (V.shape)
|
||||
print (s.shape)
|
||||
|
||||
V.order="F"
|
||||
s.order="F"
|
||||
|
||||
print V.shape
|
||||
print s.shape
|
||||
print (V.shape)
|
||||
print (s.shape)
|
||||
|
||||
u = V[0]
|
||||
v = V[1]
|
||||
|
|
@ -222,7 +221,7 @@ def validate_trigonometric():
|
|||
|
||||
pi8 = np.arccos(-1.)
|
||||
|
||||
print pi8
|
||||
print (pi8)
|
||||
|
||||
l_0 = 2.0
|
||||
hyp=l_0*pi8/ny
|
||||
|
|
@ -257,12 +256,12 @@ def validate_trigonometric():
|
|||
dydx[:] = cs.ddx(Y1)[:]
|
||||
|
||||
|
||||
print dydx.min(), dydx.max()
|
||||
print dydxtrue.min(), dydxtrue.max()
|
||||
print (dydx.min(), dydx.max())
|
||||
print (dydxtrue.min(), dydxtrue.max())
|
||||
|
||||
relerr = (dydx - dydxtrue) / dydxtrue
|
||||
|
||||
print np.nanmin(relerr), np.nanmax(relerr)
|
||||
print (np.nanmin(relerr), np.nanmax(relerr))
|
||||
|
||||
# cs.verify_nonp_coef()
|
||||
|
||||
|
|
@ -281,7 +280,7 @@ def test_dns_data():
|
|||
|
||||
y[:] = Y1[:]
|
||||
|
||||
print y.min(), y.max()
|
||||
print (y.min(), y.max())
|
||||
|
||||
dydx = np.memmap("dyr", dtype=np.float64, mode="w+", shape=cs.shape)
|
||||
|
||||
|
|
@ -289,7 +288,7 @@ def test_dns_data():
|
|||
|
||||
dydx.flush()
|
||||
|
||||
print dydx.min(), dydx.max()
|
||||
print (dydx.min(), dydx.max())
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue