Commits

J.S. Oishi  committed a270c18 Merge

merged.

  • Participants
  • Parent commits b45c61d, 38446ec

Comments (0)

Files changed (3)

File dedalus/data_objects/dealias_cy_2d.pyx

 import numpy as np
 cimport numpy as np
-
+cimport cython
 DTYPE1 = np.complex128
 ctypedef np.complex128_t DTYPE1_t
 
 DTYPE2 = np.float64
 ctypedef np.float64_t DTYPE2_t
-
+@cython.boundscheck(False)
 def dealias_23(np.ndarray[DTYPE1_t, ndim=2] data not None,
                np.ndarray[DTYPE2_t, ndim=2] kx not None,
                np.ndarray[DTYPE2_t, ndim=2] ky not None,
             for x in range(xmax):
                 if ((kx[y, x] >= 2 / 3. * knyquist[1]) or (kx[y, x] <= -2 / 3. * knyquist[1])) or \
                    ((ky[y, 0] >= 2 / 3. * knyquist[0]) or (ky[y, 0] <= -2 / 3. * knyquist[0])):
-                    data[y, x] = 0.
+                    data[y, x] = 0.

File dedalus/data_objects/setup.py

+from distutils.core import setup
+from distutils.extension import Extension
+from Cython.Distutils import build_ext
+import numpy as np
+
+setup(
+    cmdclass = {'build_ext': build_ext},
+    include_dirs = [np.get_include()],
+    ext_modules = [Extension("dealias_cy_2d", ["dealias_cy_2d.pyx"]),
+                   Extension("dealias_cy_3d", ["dealias_cy_3d.pyx"])]
+)

File dedalus/samples/test_mcwilliams.py

 from dedalus.mods import *
 
 shape = (450,450)
-RHS = Hydro(shape, FourierRepresentation)
+RHS = Hydro(shape, FourierRepresentation, visc_order=2)
 RHS.parameters['nu'] = 3.5e-7 # 100x mcwilliams
 data = RHS.create_fields(0.)
 
 turb(data['u']['x'],data['u']['y'],mcwilliams_spec,k0=23.)
-ti = RK2simplehypervisc4(RHS,CFL=0.4)
+ti = RK2simplevisc(RHS,CFL=0.4)
 ti.stop_time(1.) # set stoptime
 ti.stop_iter(100) # max iterations
 ti.stop_walltime(3600.) # stop after 10 hours