Skip to content

Instantly share code, notes, and snippets.

View klkuhlm's full-sized avatar

Kris Kuhlman klkuhlm

View GitHub Profile
# already stripped out 2-letter words (too short by game rules)
# words originally sorted by length and then alphabetically
fh = open("wordlist.txt", "r")
words = [x.strip() for x in fh.readlines()]
fh.close()
sides = ["CSV", "EPO", "IFN", "RAD"] # all uppercase (like wordlist)
print(f" {sides[0]}")
print(f"{sides[3]} {sides[1]}")
print(f" {sides[2]}")
@klkuhlm
klkuhlm / test1d_convection.py
Created April 25, 2016 15:43
fipy test of convection terms
import fipy as fp
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
L = 1.0 # domain size
nx = 40 # discretization
dx = L/nx # h
from fipy import Grid1D, CellVariable, FaceVariable, TransientTerm, DiffusionTerm, ExponentialConvectionTerm, ImplicitSourceTerm, Viewer
import matplotlib.pyplot as plt
import numpy as np
L = 10.0
nx = 100
dx = L/nx
timeStep = dx/10.0
steps = 150
from fipy import CellVariable, FaceVariable, TransientTerm, DiffusionTerm, Viewer, Grid3D
from fipy.meshes.nonUniformGrid3D import NonUniformGrid3D
import numpy as np
import matplotlib.pyplot as plt
FT2M = 0.3048
uniformMesh = True
solveLinear = False
noViewer = False