This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.