Skip to content

Instantly share code, notes, and snippets.

View fnauman's full-sized avatar

Farrukh Nauman fnauman

View GitHub Profile
@fnauman
fnauman / readvtk_snoopy.py
Created February 29, 2020 05:03
Reads vtk binary data for 3D MHD runs from SNOOPY
# Reads output vtk files from the spectral code, SNOOPY
# Currently only for 3D MHD runs
# Output data is by default float 32 binary
# Big endian vs Little endian: depends on the machine
# <f4 means read as np.float32 type little endian byter order
# >f4 means read as np.float32 type big endian byter order
import numpy as np
@fnauman
fnauman / tgmhd_shenfun.py
Last active March 11, 2019 07:43
mhd with shenfun
from mpi4py import MPI
import numpy as np
from shenfun import *
nu = 0.000625
eta = 0.01
end_time = 0.1
dt = 0.01 # no adaptive time stepping
comm = MPI.COMM_WORLD
N = (2**5, 2**5, 2**5) # 32^3
python -m pytest .
============================= test session starts ==============================
platform linux -- Python 3.6.7, pytest-4.1.1, py-1.7.0, pluggy-0.8.1
rootdir: /home/fnauman/python3/shenfun, inifile:
collected 3563 items
test_curl.py .... [ 0%]
test_demos.py F [ 0%]
test_forms.py ........................... [ 0%]