Skip to content

Instantly share code, notes, and snippets.

View wd15's full-sized avatar

Daniel Wheeler wd15

View GitHub Profile
{
"metadata": {
"name": "extremefill2D"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@wd15
wd15 / gist:7030819
Created October 17, 2013 19:29
Upwind face variable for Karim Khayrat
{
"metadata": {
"name": "upwind"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@wd15
wd15 / gist:8043375
Last active December 31, 2015 20:58
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@wd15
wd15 / gist:8717979
Created January 30, 2014 20:23
Python file with short test case for FiPy in parallel
import time
import fipy as fp
import numpy as np
np.random.seed(1)
L = 1.
N = 30
m = fp.GmshGrid3D(nx=N, ny=N, nz=N, dx=L / N, dy=L / N, dz=L / N)
v = fp.CellVariable(mesh=m)
v0 = np.random.random(m.numberOfCells)
#!/usr/bin/env python
import fipy as fp
import sys
from subprocess import Popen, PIPE
mshFile = 'tmsh3d.msh'
if fp.parallelComm.procID == 0:
dimensions = 3
geoFile = 'tmsh3d.geo'
@wd15
wd15 / gist:9944023
Created April 2, 2014 21:55
Demo Pandas for time stepping with hdf
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@wd15
wd15 / leveler-modified.py
Created April 10, 2014 16:50
FiPy leveler.py modified for more time steps
#!/usr/bin/env python
##
# ###################################################################
# FiPy - Python-based finite volume PDE solver
#
# FILE: "leveler.py"
#
# Author: Jonathan Guyer <guyer@nist.gov>
# Author: Daniel Wheeler <daniel.wheeler@nist.gov>
@wd15
wd15 / elasticity.py
Last active August 29, 2015 14:01
Linear elastic example for SfePy with periodic boundary conditions and varying material properties
#!/usr/bin/env python
from optparse import OptionParser
import numpy as nm
import sys
sys.path.append('.')
from sfepy.base.base import IndexedStruct
@wd15
wd15 / elastic.py
Created May 21, 2014 14:14
Sfepy code to seed the MKS, this is currently broken
#!/usr/bin/env python
from optparse import OptionParser
import numpy as nm
import sys
sys.path.append('.')
from sfepy.base.base import IndexedStruct
@wd15
wd15 / convection.py
Created August 5, 2014 16:12
Code related to FiPy mailing list question: http://article.gmane.org/gmane.comp.python.fipy/3551
import matplotlib.pyplot as plt
from matplotlib import colors
from numpy.random import normal
from matplotlib.mlab import bivariate_normal
from fipy import *
from fipy import numerix
import numpy as np
fig = plt.figure
ax1 = plt.subplot((111))