Skip to content

Instantly share code, notes, and snippets.

"""
Example which re-creates the OpenFOAM cavity tutorial case.
>>> import os
>>> case_dir = os.path.join(getfixture('tmpdir').strpath, 'cavity')
>>> main(case_dir)
Running blockMesh...
Running icoFoam...
>>> os.path.isdir(os.path.join(case_dir, '0.5'))
True
"""
Example which re-creates the OpenFOAM cavity tutorial case.
"""
import os
from PyFoam.Execution.BasicRunner import BasicRunner
from PyFoam.Basics.DataStructures import Dimension, Field
from cusfsim.case import Case, CaseFile, FileClass
"""
Example which re-creates the OpenFOAM cavity tutorial case.
FIXME: test that it runs(!)
>>> import os
>>> case_dir = os.path.join(getfixture('tmpdir').strpath, 'cavity')
>>> main(case_dir)
>>> os.path.isdir(os.path.join(case_dir, '0.5'))
True
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rjw57
rjw57 / timing.py
Last active November 3, 2015 20:50
Microbit games
import microbit
tolerance=500 # milliseconds
def game():
target_time = 3 + microbit.random(5)
microbit.display.scroll('Guess ' + str(target_time))
for n in '321':
microbit.display.print(n)
microbit.sleep(1000)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.