This file contains 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
#!/usr/bin/python | |
from numpy import * | |
import sys | |
def forward22(uvec,vvec,xvec,tval,f,i): | |
return f(uvec[i+1],vvec[i+1],xvec[i+1],tval)-f(uvec[i],vvec[i],xvec[i],tval) | |
def backward22(uvec,vvec,xvec,tval,f,i): | |
return f(uvec[i],vvec[i],xvec[i],tval)-f(uvec[i-1],vvec[i-1],xvec[i-1],tval) | |
def mac22bf(uvec,vvec,dt,dx,fu,fv,gu,gv,xvec,t): | |
# predict: Backward! (needs numerical BC treatment at j=N) |
This file contains 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
# scenario: want to make this json data structure from a shell script (and store it in a variable): | |
# | |
# "menuitem": [ | |
# {"value": "New", "onclick": "CreateNewDoc()"}, | |
# {"value": "Open", "onclick": "OpenDoc()"}, | |
# {"value": "Close", "onclick": "CloseDoc()"} | |
# ] | |