1. Matthew Turk
  2. dedalus

Commits

kburns  committed b77cf9b Merge

merge

  • Participants
  • Parent commits 01ee338, a270c18
  • Branches default

Comments (0)

Files changed (4)

File dedalus/data_objects/dealias_cy_2d.pyx

View file
 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/fourier_data.py

View file
             self.k['x'][self.k['x'] >= self.kny[-1]] -= 2 * self.kny[-1]
             
 class ParallelFourierRepresentation(FourierRepresentation):
-    def __init__(self, sd, shape, length, dtype='complex128', method='numpy',
+    def __init__(self, sd, shape, length, dtype='complex128', method='fftw',
                  dealiasing='2/3'):
         """
         Inputs:

File dedalus/data_objects/setup.py

View file
+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

View file
 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